CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
MTFTrackProducer Class Reference

#include <MTFTrackProducer.h>

Inheritance diagram for MTFTrackProducer:
KfTrackProducerBase edm::EDProducer TrackProducerBase< reco::Track > edm::ProducerBase edm::ProductRegistryHelper

Public Types

typedef std::vector< TrajectoryTrajectoryCollection
 
- Public Types inherited from TrackProducerBase< reco::Track >
typedef std::pair< Trajectory
*, std::pair< reco::Track
*, PropagationDirection > > 
AlgoProduct
 
typedef std::vector< AlgoProductAlgoProductCollection
 
typedef std::vector< reco::TrackTrackCollection
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

 MTFTrackProducer (const edm::ParameterSet &iConfig)
 Constructor. More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 Implementation of produce method. More...
 
- Public Member Functions inherited from KfTrackProducerBase
 KfTrackProducerBase (bool trajectoryInEvent, bool split)
 Constructor. More...
 
virtual void putInEvt (edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::auto_ptr< TrackingRecHitCollection > &, std::auto_ptr< reco::TrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &)
 Put produced collections in the event. More...
 
- Public Member Functions inherited from TrackProducerBase< reco::Track >
const edm::ParameterSetgetConf () const
 
virtual void getFromES (const edm::EventSetup &, edm::ESHandle< TrackerGeometry > &, edm::ESHandle< MagneticField > &, edm::ESHandle< TrajectoryFitter > &, edm::ESHandle< Propagator > &, edm::ESHandle< MeasurementTracker > &, edm::ESHandle< TransientTrackingRecHitBuilder > &)
 Get needed services from the Event Setup. More...
 
virtual void getFromEvt (edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
 Get TrackCandidateCollection from the Event (needed by TrackProducer) More...
 
virtual void getFromEvt (edm::Event &, edm::Handle< TrackCollection > &, reco::BeamSpot &)
 Get TrackCollection from the Event (needed by TrackRefitter) More...
 
void setAlias (std::string alias)
 set the aliases of produced collections More...
 
void setClusterRemovalInfo (const edm::InputTag &clusterRemovalInfo)
 Sets the information on cluster removal, and turns it on. More...
 
void setConf (edm::ParameterSet conf)
 Set parameter set. More...
 
void setSecondHitPattern (Trajectory *traj, reco::Track &track, const Propagator *prop, const MeasurementTracker *measTk)
 
void setSrc (edm::InputTag src, edm::InputTag bsSrc)
 set label of source collection More...
 
 TrackProducerBase (bool trajectoryInEvent=false)
 Constructor. More...
 
virtual ~TrackProducerBase ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

void getFromEvt (edm::Event &, edm::Handle< TrajectoryCollection > &, reco::BeamSpot &)
 

Private Attributes

MTFTrackProducerAlgorithm theAlgo
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 
- Protected Attributes inherited from TrackProducerBase< reco::Track >
std::string alias_
 
edm::InputTag bsSrc_
 
edm::InputTag clusterRemovalInfo_
 
bool rekeyClusterRefs_
 
edm::OrphanHandle
< TrackCollection
rTracks_
 
edm::ESHandle< NavigationSchooltheSchool
 
bool trajectoryInEvent_
 

Detailed Description

Definition at line 8 of file MTFTrackProducer.h.

Member Typedef Documentation

Definition at line 10 of file MTFTrackProducer.h.

Constructor & Destructor Documentation

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

18  :
19  KfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"),false),
20  theAlgo(iConfig)
21 {
22  setConf(iConfig);
23  setSrc( iConfig.getParameter<edm::InputTag>( "src" ), iConfig.getParameter<edm::InputTag>( "beamSpot" ));
24  setAlias( iConfig.getParameter<std::string>( "@module_label" ) );
25  //register your products
26  produces<reco::TrackCollection>().setBranchAlias( alias_ + "Tracks" );
27  produces<reco::TrackExtraCollection>().setBranchAlias( alias_ + "TrackExtras" );
28  produces<TrackingRecHitCollection>().setBranchAlias( alias_ + "RecHits" );
29  produces<std::vector<Trajectory> >() ;
30  produces<TrajTrackAssociationCollection>();
31 }
T getParameter(std::string const &) const
void setAlias(std::string alias)
set the aliases of produced collections
MTFTrackProducerAlgorithm theAlgo
void setConf(edm::ParameterSet conf)
Set parameter set.
void setSrc(edm::InputTag src, edm::InputTag bsSrc)
set label of source collection
KfTrackProducerBase(bool trajectoryInEvent, bool split)
Constructor.

Member Function Documentation

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

88 {
89 
91  theEvent.getByLabel(src_,theTrajectoryCollection );
92 
93  //get the BeamSpot
94  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
95  theEvent.getByLabel(bsSrc_,recoBeamSpotHandle);
96  bs = *recoBeamSpotHandle;
97 }
T getParameter(std::string const &) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
const edm::ParameterSet & getConf() const
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< class >::product(), KfTrackProducerBase::putInEvt(), MTFTrackProducerAlgorithm::runWithCandidate(), and theAlgo.

35 {
36  edm::LogInfo("MTFTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n";
37  //
38  // create empty output collections
39  //
40  std::auto_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection);
41  std::auto_ptr<reco::TrackCollection> outputTColl(new reco::TrackCollection);
42  std::auto_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
43  std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>);
44 
45  //
46  //declare and get stuff to be retrieved from ES
47  //
51  edm::ESHandle<Propagator> thePropagator;
54  getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
55  //get additional es_modules needed by the MTF
56  edm::ESHandle<MultiTrackFilterHitCollector> measurementCollectorHandle;
58  std::string measurementCollectorName = getConf().getParameter<std::string>("MeasurementCollector");
59  setup.get<MultiRecHitRecord>().get(measurementCollectorName, measurementCollectorHandle);
60  std::string updatorName = getConf().getParameter<std::string>("UpdatorName");
61  setup.get<MultiRecHitRecord>().get(updatorName, updatorHandle);
62 
63  AlgoProductCollection algoResults;
64 
65  edm::Handle<std::vector<Trajectory> > theTrajectoryCollection;
66 
67  reco::BeamSpot bs;
68 
69 
70  getFromEvt(theEvent,theTrajectoryCollection,bs);
71 
72  measurementCollectorHandle->updateEvent(theEvent);
73  //
74  //run the algorithm
75  //
76 
77  theAlgo.runWithCandidate(theG.product(), theMF.product(), *theTrajectoryCollection,
78  theFitter.product(), theBuilder.product(), measurementCollectorHandle.product(), updatorHandle.product(),bs,algoResults);
79  //
80  //put everything in the event
81  putInEvt(theEvent, thePropagator.product(), theMeasTk.product(),
82  outputRHColl, outputTColl, outputTEColl, outputTrajectoryColl, algoResults);
83  LogDebug("MTFTrackProducer") << "end" << "\n";
84 }
#define LogDebug(id)
T getParameter(std::string const &) const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
MTFTrackProducerAlgorithm theAlgo
void runWithCandidate(const TrackingGeometry *, const MagneticField *, const std::vector< Trajectory > &, const TrajectoryFitter *, const TransientTrackingRecHitBuilder *, const MultiTrackFilterHitCollector *measurementTracker, const SiTrackerMultiRecHitUpdatorMTF *, const reco::BeamSpot &, AlgoProductCollection &) const
Run the Final Fit taking TrackCandidates as input.
std::vector< AlgoProduct > AlgoProductCollection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:9
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
void getFromEvt(edm::Event &, edm::Handle< TrajectoryCollection > &, reco::BeamSpot &)
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::auto_ptr< TrackingRecHitCollection > &, std::auto_ptr< reco::TrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &)
Put produced collections in the event.
const edm::ParameterSet & getConf() const
virtual void getFromES(const edm::EventSetup &, edm::ESHandle< TrackerGeometry > &, edm::ESHandle< MagneticField > &, edm::ESHandle< TrajectoryFitter > &, edm::ESHandle< Propagator > &, edm::ESHandle< MeasurementTracker > &, edm::ESHandle< TransientTrackingRecHitBuilder > &)
Get needed services from the Event Setup.

Member Data Documentation

MTFTrackProducerAlgorithm MTFTrackProducer::theAlgo
private

Definition at line 18 of file MTFTrackProducer.h.

Referenced by produce().