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 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, const TrackerTopology *ttopo)
 
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 () noexcept(false)
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

TrackProducerAlgorithm< reco::GsfTracktheAlgo
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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::InputTag clusterRemovalInfo_
 
edm::ParameterSet conf_
 
edm::EDGetTokenT< MeasurementTrackerEventmteSrc_
 
bool rekeyClusterRefs_
 
edm::OrphanHandle< TrackCollectionrTracks_
 
edm::EDGetToken src_
 
edm::ESHandle< NavigationSchooltheSchool
 
bool trajectoryInEvent_
 

Detailed Description

Definition at line 15 of file GsfTrackProducer.cc.

Constructor & Destructor Documentation

◆ GsfTrackProducer()

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

Definition at line 26 of file GsfTrackProducer.cc.

27  : GsfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"),
28  iConfig.getParameter<bool>("useHitsSplitting")),
29  theAlgo(iConfig) {
30  setConf(iConfig);
31  setSrc(consumes<TrackCandidateCollection>(iConfig.getParameter<edm::InputTag>("src")),
32  consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot")),
33  consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("MeasurementTrackerEvent")));
34  setAlias(iConfig.getParameter<std::string>("@module_label"));
35  // string a = alias_;
36  // a.erase(a.size()-6,a.size());
37  //register your products
38  produces<reco::GsfTrackCollection>().setBranchAlias(alias_ + "GsfTracks");
39  produces<reco::TrackExtraCollection>().setBranchAlias(alias_ + "TrackExtras");
40  produces<reco::GsfTrackExtraCollection>().setBranchAlias(alias_ + "GsfTrackExtras");
41  produces<TrackingRecHitCollection>().setBranchAlias(alias_ + "RecHits");
42  produces<std::vector<Trajectory> >();
43  produces<TrajGsfTrackAssociationCollection>();
44 }

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 117 of file GsfTrackProducer.cc.

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

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ 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 46 of file GsfTrackProducer.cc.

46  {
47  edm::LogInfo("GsfTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n";
48  //
49  // create empty output collections
50  //
51  std::unique_ptr<TrackingRecHitCollection> outputRHColl(new TrackingRecHitCollection);
52  std::unique_ptr<reco::GsfTrackCollection> outputTColl(new reco::GsfTrackCollection);
53  std::unique_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
54  std::unique_ptr<reco::GsfTrackExtraCollection> outputGsfTEColl(new reco::GsfTrackExtraCollection);
55  std::unique_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>);
56 
57  //
58  //declare and get stuff to be retrieved from ES
59  //
63  edm::ESHandle<Propagator> thePropagator;
66  getFromES(setup, theG, theMF, theFitter, thePropagator, theMeasTk, theBuilder);
67 
69  setup.get<TrackerTopologyRcd>().get(httopo);
70 
71  //
72  //declare and get TrackColection to be retrieved from the event
73  //
74  AlgoProductCollection algoResults;
76  try {
78  getFromEvt(theEvent, theTCCollection, bs);
79 
80  //
81  //run the algorithm
82  //
83  LogDebug("GsfTrackProducer") << "run the algorithm"
84  << "\n";
86  theMF.product(),
87  *theTCCollection,
88  theFitter.product(),
89  thePropagator.product(),
90  theBuilder.product(),
91  bs,
92  algoResults);
93  } catch (cms::Exception& e) {
94  edm::LogInfo("GsfTrackProducer") << "cms::Exception caught!!!"
95  << "\n"
96  << e << "\n";
97  throw;
98  }
99  //
100  //put everything in the event
101  putInEvt(theEvent,
102  thePropagator.product(),
103  theMeasTk.product(),
104  outputRHColl,
105  outputTColl,
106  outputTEColl,
107  outputGsfTEColl,
108  outputTrajectoryColl,
109  algoResults,
110  theBuilder.product(),
111  bs,
112  httopo.product());
113  LogDebug("GsfTrackProducer") << "end"
114  << "\n";
115 }

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

Member Data Documentation

◆ theAlgo

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

Definition at line 23 of file GsfTrackProducer.cc.

Referenced by produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TrackProducerBase< reco::GsfTrack >::getFromES
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.
TrackProducerBase< reco::GsfTrack >::getFromEvt
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
TrackProducerBase< reco::GsfTrack >::setConf
void setConf(const edm::ParameterSet &conf)
Set parameter set.
Definition: TrackProducerBase.h:71
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
reco::GsfTrackExtraCollection
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
Definition: GsfTrackExtraFwd.h:9
TrackProducerBase< reco::GsfTrack >::AlgoProductCollection
typename Base::AlgoProductCollection AlgoProductCollection
Definition: TrackProducerBase.h:44
edm::Handle< TrackCandidateCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TrackProducerAlgorithm::runWithCandidate
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.
reco::BeamSpot
Definition: BeamSpot.h:21
edm::ESHandle< TrackerGeometry >
reco::TrackExtraCollection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:10
TrackProducerBase< reco::GsfTrack >::setAlias
void setAlias(std::string alias)
set the aliases of produced collections
Definition: TrackProducerBase.h:83
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
GsfTrackProducerBase::putInEvt
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.
Definition: GsfTrackProducerBase.cc:30
TrackProducerBase< reco::GsfTrack >::alias_
std::string alias_
Definition: TrackProducerBase.h:107
get
#define get
GsfTrackProducerBase::GsfTrackProducerBase
GsfTrackProducerBase(bool trajectoryInEvent, bool split)
Constructor.
Definition: GsfTrackProducerBase.h:29
TrackProducerBase< reco::GsfTrack >::setSrc
void setSrc(const edm::EDGetToken &src, const edm::EDGetTokenT< reco::BeamSpot > &bsSrc, const edm::EDGetTokenT< MeasurementTrackerEvent > &mteSrc)
set label of source collection
Definition: TrackProducerBase.h:74
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::GsfTrackCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
GsfTrackProducer::theAlgo
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
Definition: GsfTrackProducer.cc:23
cms::Exception
Definition: Exception.h:70
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
edm::InputTag
Definition: InputTag.h:15
edm::OwnVector< TrackingRecHit >
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37