CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
GsfTrackProducer Class Reference

#include <GsfTrackProducer.h>

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 ()(false)
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 14 of file GsfTrackProducer.h.

Constructor & Destructor Documentation

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

Definition at line 21 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.

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

Definition at line 93 of file GsfTrackProducer.cc.

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

93  {
95 
96  desc.add<edm::InputTag>("src", edm::InputTag("CkfElectronCandidates"));
97  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
98  desc.add<std::string>("producer", std::string(""));
99  desc.add<std::string>("Fitter", std::string("GsfElectronFittingSmoother"));
100  desc.add<bool>("useHitsSplitting", false);
101  desc.add<bool>("TrajectoryInEvent", false);
102  desc.add<std::string>("TTRHBuilder", std::string("WithTrackAngle"));
103  desc.add<std::string>("Propagator", std::string("fwdElectronPropagator"));
104  desc.add<std::string>("NavigationSchool", std::string("SimpleNavigationSchool"));
105  desc.add<std::string>("MeasurementTracker", std::string(""));
106  desc.add<edm::InputTag>("MeasurementTrackerEvent", edm::InputTag("MeasurementTrackerEvent"));
107  desc.add<bool>("GeometricInnerState", false);
108  desc.add<std::string>("AlgorithmName", std::string("gsf"));
109 
110  descriptions.add("gsfTrackProducer", desc);
111 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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 44 of file GsfTrackProducer.cc.

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

45 {
46  edm::LogInfo("GsfTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n";
47  //
48  // create empty output collections
49  //
50  std::unique_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection);
51  std::unique_ptr<reco::GsfTrackCollection> outputTColl(new reco::GsfTrackCollection);
52  std::unique_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
53  std::unique_ptr<reco::GsfTrackExtraCollection> outputGsfTEColl(new reco::GsfTrackExtraCollection);
54  std::unique_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>);
55 
56  //
57  //declare and get stuff to be retrieved from ES
58  //
62  edm::ESHandle<Propagator> thePropagator;
65  getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
66 
68  setup.get<TrackerTopologyRcd>().get(httopo);
69 
70  //
71  //declare and get TrackColection to be retrieved from the event
72  //
73  AlgoProductCollection algoResults;
74  reco::BeamSpot bs;
75  try{
77  getFromEvt(theEvent,theTCCollection,bs);
78 
79  //
80  //run the algorithm
81  //
82  LogDebug("GsfTrackProducer") << "run the algorithm" << "\n";
83  theAlgo.runWithCandidate(theG.product(), theMF.product(), *theTCCollection,
84  theFitter.product(), thePropagator.product(), theBuilder.product(), bs, algoResults);
85  } catch (cms::Exception &e){ edm::LogInfo("GsfTrackProducer") << "cms::Exception caught!!!" << "\n" << e << "\n"; throw; }
86  //
87  //put everything in the event
88  putInEvt(theEvent, thePropagator.product(), theMeasTk.product(), outputRHColl, outputTColl, outputTEColl, outputGsfTEColl,
89  outputTrajectoryColl, algoResults, theBuilder.product(), bs, httopo.product());
90  LogDebug("GsfTrackProducer") << "end" << "\n";
91 }
#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)
typename Base::AlgoProductCollection AlgoProductCollection
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
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.
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:11
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.
T const * product() const
Definition: ESHandle.h:86
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 23 of file GsfTrackProducer.h.

Referenced by produce().