CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.cc

Go to the documentation of this file.
00001 #include "RecoTracker/TkNavigation/plugins/NavigationSchoolESProducer.h"
00002 
00003 
00004 //
00005 //
00006 // constructors and destructor
00007 //
00008 NavigationSchoolESProducer::NavigationSchoolESProducer(const edm::ParameterSet& iConfig)
00009 {
00010   theNavigationPSet = iConfig;
00011   theNavigationSchoolName = theNavigationPSet.getParameter<std::string>("ComponentName");
00012   //the following line is needed to tell the framework what
00013   // data is being produced
00014   setWhatProduced(this, theNavigationSchoolName);
00015   
00016   //now do what ever other initialization is needed
00017 }
00018 
00019 
00020 NavigationSchoolESProducer::~NavigationSchoolESProducer()
00021 {
00022  
00023    // do anything here that needs to be done at desctruction time
00024    // (e.g. close files, deallocate resources etc.)
00025 
00026 }
00027 
00028 
00029 //
00030 // member functions
00031 //
00032 
00033 // ------------ method called to produce the data  ------------
00034 NavigationSchoolESProducer::ReturnType
00035 NavigationSchoolESProducer::produce(const NavigationSchoolRecord& iRecord)
00036 {
00037    using namespace edm::es;
00038 
00039    // get the field
00040    edm::ESHandle<MagneticField>                field;
00041    iRecord.getRecord<IdealMagneticFieldRecord>().get(field);
00042 
00043    //get the geometricsearch tracker geometry
00044    edm::ESHandle<GeometricSearchTracker>         geometricSearchTracker;
00045    iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
00046    
00047    theNavigationSchool.reset(NavigationSchoolFactory::get()->create(theNavigationSchoolName,
00048                                                                     geometricSearchTracker.product(),
00049                                                                     field.product()));
00050    return theNavigationSchool ;
00051 }