#include <RecoTracker/TrackProducer/plugins/GsfTrackProducer.h>
Public Member Functions | |
GsfTrackProducer (const edm::ParameterSet &iConfig) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
TrackProducerAlgorithm < reco::GsfTrack > | theAlgo |
Definition at line 12 of file GsfTrackProducer.h.
GsfTrackProducer::GsfTrackProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 16 of file GsfTrackProducer.cc.
References TrackProducerBase< reco::GsfTrack >::alias_, edm::ParameterSet::getParameter(), TrackProducerBase< reco::GsfTrack >::setAlias(), TrackProducerBase< reco::GsfTrack >::setConf(), and TrackProducerBase< reco::GsfTrack >::setSrc().
00016 : 00017 GsfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"), 00018 iConfig.getParameter<bool>("useHitsSplitting")), 00019 theAlgo(iConfig) 00020 { 00021 setConf(iConfig); 00022 setSrc( iConfig.getParameter<edm::InputTag>( "src" ), iConfig.getParameter<edm::InputTag>( "beamSpot" )); 00023 setAlias( iConfig.getParameter<std::string>( "@module_label" ) ); 00024 // string a = alias_; 00025 // a.erase(a.size()-6,a.size()); 00026 //register your products 00027 produces<reco::GsfTrackCollection>().setBranchAlias( alias_ + "GsfTracks" ); 00028 produces<reco::TrackExtraCollection>().setBranchAlias( alias_ + "TrackExtras" ); 00029 produces<reco::GsfTrackExtraCollection>().setBranchAlias( alias_ + "GsfTrackExtras" ); 00030 produces<TrackingRecHitCollection>().setBranchAlias( alias_ + "RecHits" ); 00031 produces<std::vector<Trajectory> >() ; 00032 00033 }
void GsfTrackProducer::produce | ( | edm::Event & | theEvent, | |
const edm::EventSetup & | setup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 36 of file GsfTrackProducer.cc.
References e, TrackProducerBase< reco::GsfTrack >::getFromES(), TrackProducerBase< reco::GsfTrack >::getFromEvt(), edm::Event::id(), LogDebug, edm::ESHandle< T >::product(), GsfTrackProducerBase::putInEvt(), TrackProducerAlgorithm< T >::runWithCandidate(), and theAlgo.
00037 { 00038 edm::LogInfo("GsfTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n"; 00039 // 00040 // create empty output collections 00041 // 00042 std::auto_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection); 00043 std::auto_ptr<reco::GsfTrackCollection> outputTColl(new reco::GsfTrackCollection); 00044 std::auto_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection); 00045 std::auto_ptr<reco::GsfTrackExtraCollection> outputGsfTEColl(new reco::GsfTrackExtraCollection); 00046 std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>); 00047 // 00048 //declare and get stuff to be retrieved from ES 00049 // 00050 edm::ESHandle<TrackerGeometry> theG; 00051 edm::ESHandle<MagneticField> theMF; 00052 edm::ESHandle<TrajectoryFitter> theFitter; 00053 edm::ESHandle<Propagator> thePropagator; 00054 edm::ESHandle<TransientTrackingRecHitBuilder> theBuilder; 00055 getFromES(setup,theG,theMF,theFitter,thePropagator,theBuilder); 00056 00057 // 00058 //declare and get TrackColection to be retrieved from the event 00059 // 00060 AlgoProductCollection algoResults; 00061 reco::BeamSpot bs; 00062 try{ 00063 edm::Handle<TrackCandidateCollection> theTCCollection; 00064 getFromEvt(theEvent,theTCCollection,bs); 00065 00066 // 00067 //run the algorithm 00068 // 00069 LogDebug("GsfTrackProducer") << "run the algorithm" << "\n"; 00070 theAlgo.runWithCandidate(theG.product(), theMF.product(), *theTCCollection, 00071 theFitter.product(), thePropagator.product(), theBuilder.product(), bs, algoResults); 00072 } catch (cms::Exception &e){ edm::LogInfo("GsfTrackProducer") << "cms::Exception caught!!!" << "\n" << e << "\n"; throw; } 00073 // 00074 //put everything in the event 00075 putInEvt(theEvent, outputRHColl, outputTColl, outputTEColl, outputGsfTEColl, 00076 outputTrajectoryColl, algoResults, bs); 00077 LogDebug("GsfTrackProducer") << "end" << "\n"; 00078 }