Public Member Functions | |
TrackAssociatorEDProducer (const edm::ParameterSet &) | |
~TrackAssociatorEDProducer () | |
Private Member Functions | |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
std::string | associator |
edm::InputTag | label_tp |
edm::InputTag | label_tr |
edm::ESHandle < TrackAssociatorBase > | theAssociator |
Definition at line 33 of file TrackAssociatorEDProducer.cc.
TrackAssociatorEDProducer::TrackAssociatorEDProducer | ( | const edm::ParameterSet & | pset | ) | [explicit] |
Definition at line 49 of file TrackAssociatorEDProducer.cc.
00049 : 00050 label_tr(pset.getParameter< edm::InputTag >("label_tr")), 00051 label_tp(pset.getParameter< edm::InputTag >("label_tp")), 00052 associator(pset.getParameter< std::string >("associator")) 00053 { 00054 produces<reco::SimToRecoCollection>(); 00055 produces<reco::RecoToSimCollection>(); 00056 }
TrackAssociatorEDProducer::~TrackAssociatorEDProducer | ( | ) |
void TrackAssociatorEDProducer::beginJob | ( | const edm::EventSetup & | setup | ) | [private, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 98 of file TrackAssociatorEDProducer.cc.
References associator, edm::EventSetup::get(), and theAssociator.
00098 { 00099 // Get associator from eventsetup 00100 00101 setup.get<TrackAssociatorRecord>().get(associator,theAssociator); 00102 00103 }
void TrackAssociatorEDProducer::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 70 of file TrackAssociatorEDProducer.cc.
References edm::Event::getByLabel(), label_tp, label_tr, LogTrace, edm::Event::put(), and theAssociator.
00070 { 00071 using namespace edm; 00072 00073 Handle<TrackingParticleCollection> TPCollection ; 00074 iEvent.getByLabel(label_tp, TPCollection); 00075 00076 Handle<edm::View<reco::Track> > trackCollection; 00077 iEvent.getByLabel (label_tr, trackCollection ); 00078 00079 //associate tracks 00080 LogTrace("TrackValidator") << "Calling associateRecoToSim method" << "\n"; 00081 reco::RecoToSimCollection recSimColl=theAssociator->associateRecoToSim(trackCollection, 00082 TPCollection, 00083 &iEvent); 00084 LogTrace("TrackValidator") << "Calling associateSimToReco method" << "\n"; 00085 reco::SimToRecoCollection simRecColl=theAssociator->associateSimToReco(trackCollection, 00086 TPCollection, 00087 &iEvent); 00088 00089 std::auto_ptr<reco::RecoToSimCollection> rts(new reco::RecoToSimCollection(recSimColl)); 00090 std::auto_ptr<reco::SimToRecoCollection> str(new reco::SimToRecoCollection(simRecColl)); 00091 00092 iEvent.put(rts); 00093 iEvent.put(str); 00094 }
std::string TrackAssociatorEDProducer::associator [private] |
Definition at line 43 of file TrackAssociatorEDProducer.cc.
Referenced by beginJob(), and produce().