CMS 3D CMS Logo

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

#include <GsfTrackProducer.h>

Inheritance diagram for GsfTrackProducer:
GsfTrackProducerBase edm::EDProducer TrackProducerBase< reco::GsfTrack > edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GsfTrackProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from GsfTrackProducerBase
 GsfTrackProducerBase (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::GsfTrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< reco::GsfTrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const reco::BeamSpot &)
 Put produced collections in the event. More...
 
- Public Member Functions inherited from TrackProducerBase< reco::GsfTrack >
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 (const edm::ParameterSet &conf)
 Set parameter set. More...
 
void setSecondHitPattern (Trajectory *traj, reco::GsfTrack &track, const Propagator *prop, const MeasurementTrackerEvent *measTk)
 
void setSrc (const edm::EDGetToken &src, const edm::EDGetTokenT< reco::BeamSpot > &bsSrc, const edm::EDGetTokenT< MeasurementTrackerEvent > &mteSrc)
 set label of source collection More...
 
 TrackProducerBase (bool trajectoryInEvent=false)
 Constructor. More...
 
virtual ~TrackProducerBase ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

TrackProducerAlgorithm
< reco::GsfTrack
theAlgo
 

Additional Inherited Members

- Public Types inherited from TrackProducerBase< reco::GsfTrack >
typedef std::pair< Trajectory
*, std::pair< reco::GsfTrack
*, PropagationDirection > > 
AlgoProduct
 
typedef std::vector< AlgoProductAlgoProductCollection
 
typedef std::vector
< reco::GsfTrack
TrackCollection
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from GsfTrackProducerBase
void fillMode (reco::GsfTrack &track, const TrajectoryStateOnSurface innertsos, const Propagator &gsfProp, const TransverseImpactPointExtrapolator &tipExtrapolator, TrajectoryStateClosestToBeamLineBuilder &tscblBuilder, const reco::BeamSpot &bs) const
 
void fillStates (TrajectoryStateOnSurface tsos, std::vector< reco::GsfComponent5D > &states) const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from TrackProducerBase< reco::GsfTrack >
std::string alias_
 
edm::EDGetTokenT< reco::BeamSpotbsSrc_
 
edm::InputTag clusterRemovalInfo_
 
edm::EDGetTokenT
< MeasurementTrackerEvent
mteSrc_
 
bool rekeyClusterRefs_
 
edm::OrphanHandle
< TrackCollection
rTracks_
 
edm::ESHandle< NavigationSchooltheSchool
 
bool trajectoryInEvent_
 

Detailed Description

Definition at line 12 of file GsfTrackProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file GsfTrackProducer.cc.

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

18  :
19  GsfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"),
20  iConfig.getParameter<bool>("useHitsSplitting")),
21  theAlgo(iConfig)
22 {
23  setConf(iConfig);
24  setSrc( consumes<TrackCandidateCollection>(iConfig.getParameter<edm::InputTag>( "src" )),
25  consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>( "beamSpot" )),
26  consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>( "MeasurementTrackerEvent") ));
27  setAlias( iConfig.getParameter<std::string>( "@module_label" ) );
28 // string a = alias_;
29 // a.erase(a.size()-6,a.size());
30  //register your products
31  produces<reco::GsfTrackCollection>().setBranchAlias( alias_ + "GsfTracks" );
32  produces<reco::TrackExtraCollection>().setBranchAlias( alias_ + "TrackExtras" );
33  produces<reco::GsfTrackExtraCollection>().setBranchAlias( alias_ + "GsfTrackExtras" );
34  produces<TrackingRecHitCollection>().setBranchAlias( alias_ + "RecHits" );
35  produces<std::vector<Trajectory> >() ;
36  produces<TrajGsfTrackAssociationCollection>();
37 
38 }
T getParameter(std::string const &) const
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
void setAlias(std::string alias)
set the aliases of produced collections
void setConf(const edm::ParameterSet &conf)
Set parameter set.
GsfTrackProducerBase(bool trajectoryInEvent, bool split)
Constructor.
void setSrc(const edm::EDGetToken &src, const edm::EDGetTokenT< reco::BeamSpot > &bsSrc, const edm::EDGetTokenT< MeasurementTrackerEvent > &mteSrc)
set label of source collection

Member Function Documentation

void GsfTrackProducer::produce ( edm::Event theEvent,
const edm::EventSetup setup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 41 of file GsfTrackProducer.cc.

References alignCSCRings::e, TrackProducerBase< reco::GsfTrack >::getFromES(), TrackProducerBase< reco::GsfTrack >::getFromEvt(), edm::EventBase::id(), LogDebug, edm::ESHandle< class >::product(), GsfTrackProducerBase::putInEvt(), TrackProducerAlgorithm< T >::runWithCandidate(), and theAlgo.

42 {
43  edm::LogInfo("GsfTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n";
44  //
45  // create empty output collections
46  //
47  std::auto_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection);
48  std::auto_ptr<reco::GsfTrackCollection> outputTColl(new reco::GsfTrackCollection);
49  std::auto_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
50  std::auto_ptr<reco::GsfTrackExtraCollection> outputGsfTEColl(new reco::GsfTrackExtraCollection);
51  std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>);
52 
53  //
54  //declare and get stuff to be retrieved from ES
55  //
59  edm::ESHandle<Propagator> thePropagator;
62  getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
63 
64  //
65  //declare and get TrackColection to be retrieved from the event
66  //
67  AlgoProductCollection algoResults;
68  reco::BeamSpot bs;
69  try{
71  getFromEvt(theEvent,theTCCollection,bs);
72 
73  //
74  //run the algorithm
75  //
76  LogDebug("GsfTrackProducer") << "run the algorithm" << "\n";
77  theAlgo.runWithCandidate(theG.product(), theMF.product(), *theTCCollection,
78  theFitter.product(), thePropagator.product(), theBuilder.product(), bs, algoResults);
79  } catch (cms::Exception &e){ edm::LogInfo("GsfTrackProducer") << "cms::Exception caught!!!" << "\n" << e << "\n"; throw; }
80  //
81  //put everything in the event
82  putInEvt(theEvent, thePropagator.product(), theMeasTk.product(), outputRHColl, outputTColl, outputTEColl, outputGsfTEColl,
83  outputTrajectoryColl, algoResults, theBuilder.product(), bs);
84  LogDebug("GsfTrackProducer") << "end" << "\n";
85 }
#define LogDebug(id)
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
std::vector< AlgoProduct > AlgoProductCollection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:11
T const * product() const
Definition: ESHandle.h:86
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::GsfTrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< reco::GsfTrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const reco::BeamSpot &)
Put produced collections in the event.
void runWithCandidate(const TrackingGeometry *, const MagneticField *, const TrackCandidateCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
Run the Final Fit taking TrackCandidates as input.
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

TrackProducerAlgorithm<reco::GsfTrack> GsfTrackProducer::theAlgo
private

Definition at line 21 of file GsfTrackProducer.h.

Referenced by produce().