text: #include <FWCore/Utilities/interface/ESInputTag.h>
  
  #include <memory>
  
  // user include files
  #include "FWCore/Framework/interface/ModuleFactory.h"
  #include "FWCore/Framework/interface/ESProducer.h"
  
  #include "FWCore/Framework/interface/ESHandle.h"
  
  #include "NavigationSchoolFactory.h"
  #include "RecoTracker/Record/interface/NavigationSchoolRecord.h"
  
  //
  // class decleration
  //
  
  class dso_hidden NavigationSchoolESProducer final : public edm::ESProducer {
  public:
    NavigationSchoolESProducer(const edm::ParameterSet&);
  
    typedef std::unique_ptr<NavigationSchool> ReturnType;
  
    virtual ReturnType produce(const NavigationSchoolRecord&);
  
    static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
  
  private:
    // ----------member data ---------------------------
    edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_;
    edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> geometricSearchTrackerToken_;
    const std::string navigationSchoolName_;
  };
  
  //
  //
  // constructors and destructor
  //
  NavigationSchoolESProducer::NavigationSchoolESProducer(const edm::ParameterSet& iConfig)
      : navigationSchoolName_(iConfig.getParameter<std::string>("ComponentName")) {
    //the following line is needed to tell the framework what
    // data is being produced
  
    setWhatProduced(this, navigationSchoolName_)
        .setConsumes(magFieldToken_, edm::ESInputTag("", iConfig.getParameter<std::string>("SimpleMagneticField")))
        .setConsumes(geometricSearchTrackerToken_);
  
    //now do what ever other initialization is needed
  }
  
  //
  // member functions
  //
  
  // ------------ method called to produce the data  ------------
  NavigationSchoolESProducer::ReturnType NavigationSchoolESProducer::produce(const NavigationSchoolRecord& iRecord) {
    using namespace edm::es;
  
    //get the geometricsearch tracker geometry
    return ReturnType(NavigationSchoolFactory::get()->create(
        navigationSchoolName_, &iRecord.get(geometricSearchTrackerToken_), &iRecord.get(magFieldToken_)));
  }
  
  void NavigationSchoolESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
    edm::ParameterSetDescription desc;
    desc.add<std::string>("ComponentName");
    desc.add<std::string>("SimpleMagneticField", "");
    descriptions.addDefault(desc);
  }
  
  #include "FWCore/PluginManager/interface/ModuleDef.h"
  #include "FWCore/Framework/interface/MakerMacros.h"
  DEFINE_FWK_EVENTSETUP_MODULE(NavigationSchoolESProducer);
  