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 > edm::stream::EDProducerBase AlgoProductTraits< reco::GsfTrack > edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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::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().