CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
GsfTrackProducer Class Reference
Inheritance diagram for GsfTrackProducer:
GsfTrackProducerBase edm::stream::EDProducer<> TrackProducerBase< reco::GsfTrack > AlgoProductTraits< reco::GsfTrack >

Public Member Functions

 GsfTrackProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &, const edm::EventSetup &) override
 Method where the procduction take place. To be implemented in concrete classes. More...
 
- 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::unique_ptr< TrackingRecHitCollection > &, std::unique_ptr< reco::GsfTrackCollection > &, std::unique_ptr< reco::TrackExtraCollection > &, std::unique_ptr< reco::GsfTrackExtraCollection > &, std::unique_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const reco::BeamSpot &, const TrackerTopology *ttopo)
 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< TrackView > &, reco::BeamSpot &)
 Get TrackCollection from the Event (needed by TrackRefitter) More...
 
void initTrackProducerBase (const edm::ParameterSet &conf, edm::ConsumesCollector cc, const edm::EDGetToken &src)
 Call this method in inheriting class' constructor. More...
 
void setAlias (std::string alias)
 set the aliases of produced collections More...
 
void setSecondHitPattern (Trajectory *traj, reco::GsfTrack &track, const Propagator *prop, const MeasurementTrackerEvent *measTk, const TrackerTopology *ttopo)
 
 TrackProducerBase (bool trajectoryInEvent=false)
 Constructor. More...
 
virtual ~TrackProducerBase () noexcept(false)
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

TrackProducerAlgorithm< reco::GsfTracktheAlgo
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtheTopoToken
 

Additional Inherited Members

- Public Types inherited from TrackProducerBase< reco::GsfTrack >
using AlgoProductCollection = typename Base::AlgoProductCollection
 
using Base = AlgoProductTraits< reco::GsfTrack >
 
using TrackCollection = typename Base::TrackCollection
 
using TrackView = typename Base::TrackView
 
- Public Types inherited from AlgoProductTraits< reco::GsfTrack >
using AlgoProductCollection = std::vector< AlgoProduct >
 
using TrackCollection = std::vector< reco::GsfTrack >
 
using TrackView = edm::View< reco::GsfTrack >
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- 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 Attributes inherited from TrackProducerBase< reco::GsfTrack >
std::string alias_
 
edm::EDGetTokenT< reco::BeamSpotbsSrc_
 
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecordbuilderSrc_
 
edm::ParameterSet conf_
 
edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::RecordfitterSrc_
 
edm::ESGetToken< MeasurementTracker, CkfComponentsRecordmeasTkSrc_
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmfSrc_
 
edm::EDGetTokenT< MeasurementTrackerEventmteSrc_
 
edm::ESGetToken< Propagator, TrackingComponentsRecordpropagatorSrc_
 
edm::OrphanHandle< TrackCollectionrTracks_
 
edm::ESGetToken< NavigationSchool, NavigationSchoolRecordschoolSrc_
 
edm::EDGetToken src_
 
edm::ESHandle< NavigationSchooltheSchool
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackGeomSrc_
 
bool trajectoryInEvent_
 
bool useSchool_
 

Detailed Description

Definition at line 15 of file GsfTrackProducer.cc.

Constructor & Destructor Documentation

◆ GsfTrackProducer()

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

Definition at line 28 of file GsfTrackProducer.cc.

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

29  : GsfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"),
30  iConfig.getParameter<bool>("useHitsSplitting")),
31  theAlgo(iConfig),
34  iConfig, consumesCollector(), consumes<TrackCandidateCollection>(iConfig.getParameter<edm::InputTag>("src")));
35  setAlias(iConfig.getParameter<std::string>("@module_label"));
36  // string a = alias_;
37  // a.erase(a.size()-6,a.size());
38  //register your products
39  produces<reco::TrackExtraCollection>().setBranchAlias(alias_ + "TrackExtras");
40  produces<reco::GsfTrackExtraCollection>().setBranchAlias(alias_ + "GsfTrackExtras");
41  produces<TrackingRecHitCollection>().setBranchAlias(alias_ + "RecHits");
42  // GsfTrackCollection refers to TrackingRechit, TrackExtra, and
43  // GsfTrackExtra collections, need to declare its production after
44  // them to work around a rare race condition in framework scheduling
45  produces<reco::GsfTrackCollection>().setBranchAlias(alias_ + "GsfTracks");
46  produces<std::vector<Trajectory> >();
47  produces<TrajGsfTrackAssociationCollection>();
48 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
void initTrackProducerBase(const edm::ParameterSet &conf, edm::ConsumesCollector cc, const edm::EDGetToken &src)
Call this method in inheriting class&#39; constructor.
void setAlias(std::string alias)
set the aliases of produced collections
GsfTrackProducerBase(bool trajectoryInEvent, bool split)
Constructor.
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTopoToken

Member Function Documentation

◆ fillDescriptions()

void GsfTrackProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 120 of file GsfTrackProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_2022v12_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

120  {
122 
123  desc.add<edm::InputTag>("src", edm::InputTag("CkfElectronCandidates"));
124  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
125  desc.add<std::string>("producer", std::string(""));
126  desc.add<std::string>("Fitter", std::string("GsfElectronFittingSmoother"));
127  desc.add<bool>("useHitsSplitting", false);
128  desc.add<bool>("TrajectoryInEvent", false);
129  desc.add<std::string>("TTRHBuilder", std::string("WithTrackAngle"));
130  desc.add<std::string>("Propagator", std::string("fwdElectronPropagator"));
131  desc.add<std::string>("NavigationSchool", std::string("SimpleNavigationSchool"));
132  desc.add<std::string>("MeasurementTracker", std::string(""));
133  desc.add<edm::InputTag>("MeasurementTrackerEvent", edm::InputTag("MeasurementTrackerEvent"));
134  desc.add<bool>("GeometricInnerState", false);
135  desc.add<std::string>("AlgorithmName", std::string("gsf"));
136 
137  descriptions.add("gsfTrackProducer", desc);
138 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Method where the procduction take place. To be implemented in concrete classes.

Implements TrackProducerBase< reco::GsfTrack >.

Definition at line 50 of file GsfTrackProducer.cc.

References cms::cuda::bs, MillePedeFileConverter_cfg::e, TrackProducerBase< reco::GsfTrack >::getFromES(), TrackProducerBase< reco::GsfTrack >::getFromEvt(), edm::EventBase::id(), LogDebug, edm::ESHandle< T >::product(), GsfTrackProducerBase::putInEvt(), TrackProducerAlgorithm< T >::runWithCandidate(), singleTopDQM_cfi::setup, theAlgo, and theTopoToken.

50  {
51  edm::LogInfo("GsfTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n";
52  //
53  // create empty output collections
54  //
55  std::unique_ptr<TrackingRecHitCollection> outputRHColl(new TrackingRecHitCollection);
56  std::unique_ptr<reco::GsfTrackCollection> outputTColl(new reco::GsfTrackCollection);
57  std::unique_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
58  std::unique_ptr<reco::GsfTrackExtraCollection> outputGsfTEColl(new reco::GsfTrackExtraCollection);
59  std::unique_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>);
60 
61  //
62  //declare and get stuff to be retrieved from ES
63  //
67  edm::ESHandle<Propagator> thePropagator;
70  getFromES(setup, theG, theMF, theFitter, thePropagator, theMeasTk, theBuilder);
71 
72  TrackerTopology const& ttopo = setup.getData(theTopoToken);
73 
74  //
75  //declare and get TrackColection to be retrieved from the event
76  //
77  AlgoProductCollection algoResults;
79  try {
81  getFromEvt(theEvent, theTCCollection, bs);
82 
83  //
84  //run the algorithm
85  //
86  LogDebug("GsfTrackProducer") << "run the algorithm"
87  << "\n";
89  theMF.product(),
90  *theTCCollection,
91  theFitter.product(),
92  thePropagator.product(),
93  theBuilder.product(),
94  bs,
95  algoResults);
96  } catch (cms::Exception& e) {
97  edm::LogInfo("GsfTrackProducer") << "cms::Exception caught!!!"
98  << "\n"
99  << e << "\n";
100  throw;
101  }
102  //
103  //put everything in the event
104  putInEvt(theEvent,
105  thePropagator.product(),
106  theMeasTk.product(),
107  outputRHColl,
108  outputTColl,
109  outputTEColl,
110  outputGsfTEColl,
111  outputTrajectoryColl,
112  algoResults,
113  theBuilder.product(),
114  bs,
115  &ttopo);
116  LogDebug("GsfTrackProducer") << "end"
117  << "\n";
118 }
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
typename Base::AlgoProductCollection AlgoProductCollection
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
T const * product() const
Definition: ESHandle.h:86
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTopoToken
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::unique_ptr< TrackingRecHitCollection > &, std::unique_ptr< reco::GsfTrackCollection > &, std::unique_ptr< reco::TrackExtraCollection > &, std::unique_ptr< reco::GsfTrackExtraCollection > &, std::unique_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const reco::BeamSpot &, const TrackerTopology *ttopo)
Put produced collections in the event.
Log< level::Info, false > LogInfo
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:10
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.
#define LogDebug(id)

Member Data Documentation

◆ theAlgo

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

Definition at line 23 of file GsfTrackProducer.cc.

Referenced by produce().

◆ theTopoToken

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> GsfTrackProducer::theTopoToken
private

Definition at line 25 of file GsfTrackProducer.cc.

Referenced by produce().