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
DAFTrackProducer Class Reference

#include <DAFTrackProducer.h>

Inheritance diagram for DAFTrackProducer:
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

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

DAFTrackProducerAlgorithm 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 DAFTrackProducer.h.

Member Typedef Documentation

Definition at line 10 of file DAFTrackProducer.h.

Constructor & Destructor Documentation

DAFTrackProducer::DAFTrackProducer ( const edm::ParameterSet iConfig)
explicit

Constructor.

Definition at line 20 of file DAFTrackProducer.cc.

References TrackProducerBase< reco::Track >::alias_, edm::ParameterSet::getParameter(), TrackProducerBase< reco::Track >::setAlias(), TrackProducerBase< reco::Track >::setConf(), and TrackProducerBase< reco::Track >::setSrc().

20  :
21  KfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"),false),
22  theAlgo(iConfig)
23 {
24  setConf(iConfig);
25  setSrc( iConfig.getParameter<edm::InputTag>( "src" ), iConfig.getParameter<edm::InputTag>( "beamSpot" ));
26  setAlias( iConfig.getParameter<std::string>( "@module_label" ) );
27  //register your products
28  produces<reco::TrackCollection>().setBranchAlias( alias_ + "Tracks" );
29  produces<reco::TrackExtraCollection>().setBranchAlias( alias_ + "TrackExtras" );
30  produces<TrackingRecHitCollection>().setBranchAlias( alias_ + "RecHits" );
31  produces<std::vector<Trajectory> >();
32  produces<TrajTrackAssociationCollection>();
33 
34 
35 }
T getParameter(std::string const &) const
DAFTrackProducerAlgorithm theAlgo
void setAlias(std::string alias)
set the aliases of produced collections
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 DAFTrackProducer::getFromEvt ( edm::Event theEvent,
edm::Handle< TrajectoryCollection > &  theTrajectoryCollection,
reco::BeamSpot bs 
)
private

Definition at line 88 of file DAFTrackProducer.cc.

References TrackProducerBase< reco::Track >::bsSrc_, edm::Event::getByLabel(), TrackProducerBase< reco::Track >::getConf(), edm::ParameterSet::getParameter(), and TrackProducerBase< reco::Track >::src_.

Referenced by produce().

89 {
90  //
91  //get the TrajectoryCollection from the event
92  //
93 
95  theEvent.getByLabel(src_,theTrajectoryCollection );
96 
97  //get the BeamSpot
98  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
99  theEvent.getByLabel(bsSrc_,recoBeamSpotHandle);
100  bs = *recoBeamSpotHandle;
101 }
T getParameter(std::string const &) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
const edm::ParameterSet & getConf() const
void DAFTrackProducer::produce ( edm::Event theEvent,
const edm::EventSetup setup 
)
virtual

Implementation of produce method.

Implements edm::EDProducer.

Definition at line 38 of file DAFTrackProducer.cc.

References edm::EventSetup::get(), TrackProducerBase< reco::Track >::getConf(), TrackProducerBase< reco::Track >::getFromES(), getFromEvt(), edm::ParameterSet::getParameter(), edm::EventBase::id(), edm::ESHandle< class >::product(), KfTrackProducerBase::putInEvt(), DAFTrackProducerAlgorithm::runWithCandidate(), and theAlgo.

39 {
40  edm::LogInfo("DAFTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n";
41 
42  // create empty output collections
43  //
44  std::auto_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection);
45  std::auto_ptr<reco::TrackCollection> outputTColl(new reco::TrackCollection);
46  std::auto_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
47  std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>);
48 
49  //
50  //declare and get stuff to be retrieved from ES
51  //
55  edm::ESHandle<Propagator> thePropagator;
58  getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
59  //get additional es_modules needed by the DAF
60  edm::ESHandle<MultiRecHitCollector> measurementCollectorHandle;
62  std::string measurementCollectorName = getConf().getParameter<std::string>("MeasurementCollector");
63  setup.get<MultiRecHitRecord>().get(measurementCollectorName, measurementCollectorHandle);
64  std::string updatorName = getConf().getParameter<std::string>("UpdatorName");
65  setup.get<MultiRecHitRecord>().get(updatorName, updatorHandle);
66 
67  AlgoProductCollection algoResults;
68 
69  edm::Handle<std::vector<Trajectory> > theTrajectoryCollection;
70  reco::BeamSpot bs;
71 
72  getFromEvt(theEvent,theTrajectoryCollection,bs);
73 
74  measurementCollectorHandle->updateEvent(theEvent);
75 
76  //
77  //run the algorithm
78  //
79 
80  theAlgo.runWithCandidate(theG.product(), theMF.product(), *theTrajectoryCollection,
81  theFitter.product(), theBuilder.product(), measurementCollectorHandle.product(), updatorHandle.product(),bs,algoResults);
82 
83  putInEvt(theEvent, thePropagator.product(), theMeasTk.product(),
84  outputRHColl, outputTColl, outputTEColl, outputTrajectoryColl, algoResults);
85 
86 }
T getParameter(std::string const &) const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
DAFTrackProducerAlgorithm theAlgo
void runWithCandidate(const TrackingGeometry *, const MagneticField *, const std::vector< Trajectory > &, const TrajectoryFitter *, const TransientTrackingRecHitBuilder *, const MultiRecHitCollector *measurementTracker, const SiTrackerMultiRecHitUpdator *, const reco::BeamSpot &, AlgoProductCollection &) const
Run the Final Fit taking TrackCandidates as input.
void getFromEvt(edm::Event &, edm::Handle< TrajectoryCollection > &, reco::BeamSpot &)
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
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

DAFTrackProducerAlgorithm DAFTrackProducer::theAlgo
private

Definition at line 18 of file DAFTrackProducer.h.

Referenced by produce().