CMS 3D CMS Logo

TrackAssociatorEDProducer Class Reference

Inheritance diagram for TrackAssociatorEDProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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


Detailed Description

Definition at line 33 of file TrackAssociatorEDProducer.cc.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 59 of file TrackAssociatorEDProducer.cc.

00059                                                       {
00060  
00061 }


Member Function Documentation

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::endJob ( void   )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 107 of file TrackAssociatorEDProducer.cc.

00107                                   {
00108 }

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 }


Member Data Documentation

std::string TrackAssociatorEDProducer::associator [private]

Definition at line 46 of file TrackAssociatorEDProducer.cc.

Referenced by beginJob().

edm::InputTag TrackAssociatorEDProducer::label_tp [private]

Definition at line 45 of file TrackAssociatorEDProducer.cc.

Referenced by produce().

edm::InputTag TrackAssociatorEDProducer::label_tr [private]

Definition at line 44 of file TrackAssociatorEDProducer.cc.

Referenced by produce().

edm::ESHandle<TrackAssociatorBase> TrackAssociatorEDProducer::theAssociator [private]

Definition at line 43 of file TrackAssociatorEDProducer.cc.

Referenced by beginJob(), and produce().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:33:58 2009 for CMSSW by  doxygen 1.5.4