#include <MTFTrackProducer.h>
Public Types | |
typedef std::vector< Trajectory > | TrajectoryCollection |
Public Member Functions | |
MTFTrackProducer (const edm::ParameterSet &iConfig) | |
Constructor. | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Implementation of produce method. | |
Private Member Functions | |
void | getFromEvt (edm::Event &, edm::Handle< TrajectoryCollection > &, reco::BeamSpot &) |
Private Attributes | |
MTFTrackProducerAlgorithm | theAlgo |
Definition at line 8 of file MTFTrackProducer.h.
typedef std::vector<Trajectory> MTFTrackProducer::TrajectoryCollection |
Definition at line 10 of file MTFTrackProducer.h.
MTFTrackProducer::MTFTrackProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Constructor.
Definition at line 18 of file MTFTrackProducer.cc.
References TrackProducerBase< reco::Track >::alias_, edm::ParameterSet::getParameter(), TrackProducerBase< reco::Track >::setAlias(), TrackProducerBase< reco::Track >::setConf(), and TrackProducerBase< reco::Track >::setSrc().
: KfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"),false), theAlgo(iConfig) { setConf(iConfig); setSrc( iConfig.getParameter<edm::InputTag>( "src" ), iConfig.getParameter<edm::InputTag>( "beamSpot" )); setAlias( iConfig.getParameter<std::string>( "@module_label" ) ); //register your products produces<reco::TrackCollection>().setBranchAlias( alias_ + "Tracks" ); produces<reco::TrackExtraCollection>().setBranchAlias( alias_ + "TrackExtras" ); produces<TrackingRecHitCollection>().setBranchAlias( alias_ + "RecHits" ); produces<std::vector<Trajectory> >() ; produces<TrajTrackAssociationCollection>(); }
void MTFTrackProducer::getFromEvt | ( | edm::Event & | theEvent, |
edm::Handle< TrajectoryCollection > & | theTrajectoryCollection, | ||
reco::BeamSpot & | bs | ||
) | [private] |
Definition at line 87 of file MTFTrackProducer.cc.
References TrackProducerBase< reco::Track >::bsSrc_, edm::Event::getByLabel(), TrackProducerBase< reco::Track >::getConf(), edm::ParameterSet::getParameter(), and TrackProducerBase< reco::Track >::src_.
Referenced by produce().
{ edm::InputTag src_=getConf().getParameter<edm::InputTag>( "src" ); theEvent.getByLabel(src_,theTrajectoryCollection ); //get the BeamSpot edm::Handle<reco::BeamSpot> recoBeamSpotHandle; theEvent.getByLabel(bsSrc_,recoBeamSpotHandle); bs = *recoBeamSpotHandle; }
void MTFTrackProducer::produce | ( | edm::Event & | theEvent, |
const edm::EventSetup & | setup | ||
) | [virtual] |
Implementation of produce method.
Implements edm::EDProducer.
Definition at line 34 of file MTFTrackProducer.cc.
References edm::EventSetup::get(), TrackProducerBase< reco::Track >::getConf(), TrackProducerBase< reco::Track >::getFromES(), getFromEvt(), edm::ParameterSet::getParameter(), edm::EventBase::id(), LogDebug, edm::ESHandle< T >::product(), KfTrackProducerBase::putInEvt(), MTFTrackProducerAlgorithm::runWithCandidate(), and theAlgo.
{ edm::LogInfo("MTFTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n"; // // create empty output collections // std::auto_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection); std::auto_ptr<reco::TrackCollection> outputTColl(new reco::TrackCollection); std::auto_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection); std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>); // //declare and get stuff to be retrieved from ES // edm::ESHandle<TrackerGeometry> theG; edm::ESHandle<MagneticField> theMF; edm::ESHandle<TrajectoryFitter> theFitter; edm::ESHandle<Propagator> thePropagator; edm::ESHandle<MeasurementTracker> theMeasTk; edm::ESHandle<TransientTrackingRecHitBuilder> theBuilder; getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder); //get additional es_modules needed by the MTF edm::ESHandle<MultiTrackFilterHitCollector> measurementCollectorHandle; edm::ESHandle<SiTrackerMultiRecHitUpdatorMTF> updatorHandle; std::string measurementCollectorName = getConf().getParameter<std::string>("MeasurementCollector"); setup.get<MultiRecHitRecord>().get(measurementCollectorName, measurementCollectorHandle); std::string updatorName = getConf().getParameter<std::string>("UpdatorName"); setup.get<MultiRecHitRecord>().get(updatorName, updatorHandle); AlgoProductCollection algoResults; edm::Handle<std::vector<Trajectory> > theTrajectoryCollection; reco::BeamSpot bs; getFromEvt(theEvent,theTrajectoryCollection,bs); measurementCollectorHandle->updateEvent(theEvent); // //run the algorithm // theAlgo.runWithCandidate(theG.product(), theMF.product(), *theTrajectoryCollection, theFitter.product(), theBuilder.product(), measurementCollectorHandle.product(), updatorHandle.product(),bs,algoResults); // //put everything in the event putInEvt(theEvent, thePropagator.product(), theMeasTk.product(), outputRHColl, outputTColl, outputTEColl, outputTrajectoryColl, algoResults); LogDebug("MTFTrackProducer") << "end" << "\n"; }
Definition at line 18 of file MTFTrackProducer.h.
Referenced by produce().