CMS 3D CMS Logo

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

#include <SimTracker/TrackAssociatorProducers/plugins/TrackAssociatorByHitsProducer.cc>

Inheritance diagram for TrackAssociatorByHitsProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TrackAssociatorByHitsProducer (const edm::ParameterSet &)
 
 ~TrackAssociatorByHitsProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const bool AbsoluteNumberOfHits
 
const double cut_RecoToSim
 
const double purity_SimToReco
 
const double quality_SimToReco
 
edm::EDGetTokenT< SimHitTPAssociationListsimHitTpMapToken_
 
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
 
const bool ThreeHitTracksAreSpecial
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
const bool UseGrouped
 
const bool UsePixels
 
const bool UseSplitting
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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 edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 48 of file TrackAssociatorByHitsProducer.cc.

Constructor & Destructor Documentation

◆ TrackAssociatorByHitsProducer()

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

Definition at line 85 of file TrackAssociatorByHitsProducer.cc.

87  simHitTpMapToken_(consumes<SimHitTPAssociationList>(iConfig.getParameter<edm::InputTag>("simHitTpMapTag"))),
89  quality_SimToReco(iConfig.getParameter<double>("Quality_SimToReco")),
90  purity_SimToReco(iConfig.getParameter<double>("Purity_SimToReco")),
91  cut_RecoToSim(iConfig.getParameter<double>("Cut_RecoToSim")),
92  UsePixels(iConfig.getParameter<bool>("UsePixels")),
93  UseGrouped(iConfig.getParameter<bool>("UseGrouped")),
94  UseSplitting(iConfig.getParameter<bool>("UseSplitting")),
95  ThreeHitTracksAreSpecial(iConfig.getParameter<bool>("ThreeHitTracksAreSpecial")),
96  AbsoluteNumberOfHits(iConfig.getParameter<bool>("AbsoluteNumberOfHits")) {
97  std::string tmp = iConfig.getParameter<std::string>("SimToRecoDenominator");
98  if (tmp == "sim") {
100  } else if (tmp == "reco") {
102  }
103 
105  throw cms::Exception("TrackAssociatorByHitsImpl") << "SimToRecoDenominator not specified as sim or reco";
106  }
107 
108  //register your products
109  produces<reco::TrackToTrackingParticleAssociator>();
110 }

References TrackAssociatorByHitsImpl::denomnone, TrackAssociatorByHitsImpl::denomreco, TrackAssociatorByHitsImpl::denomsim, Exception, edm::ParameterSet::getParameter(), SimToRecoDenominator, AlCaHLTBitMon_QueryRunRegistry::string, and createJobs::tmp.

◆ ~TrackAssociatorByHitsProducer()

TrackAssociatorByHitsProducer::~TrackAssociatorByHitsProducer ( )
override

Definition at line 112 of file TrackAssociatorByHitsProducer.cc.

112  {
113  // do anything here that needs to be done at desctruction time
114  // (e.g. close files, deallocate resources etc.)
115 }

Member Function Documentation

◆ beginJob()

void TrackAssociatorByHitsProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 154 of file TrackAssociatorByHitsProducer.cc.

154 {}

◆ endJob()

void TrackAssociatorByHitsProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 157 of file TrackAssociatorByHitsProducer.cc.

157 {}

◆ fillDescriptions()

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

Definition at line 160 of file TrackAssociatorByHitsProducer.cc.

160  {
161  //The following says we do not know what parameters are allowed so do no validation
162  // Please change this to state exactly what you do use, even if it is no parameters
164  desc.setUnknown();
165  descriptions.addDefault(desc);
166 }

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

◆ produce()

void TrackAssociatorByHitsProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 122 of file TrackAssociatorByHitsProducer.cc.

122  {
123  using namespace edm;
124 
125  std::unique_ptr<TrackerHitAssociator> thAssoc(new TrackerHitAssociator(iEvent, trackerHitAssociatorConfig_));
126 
128  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
129 
131  //warning: make sure the TP collection used in the map is the same used in the associator!
132  iEvent.getByToken(simHitTpMapToken_, simHitsTPAssoc);
133 
134  std::unique_ptr<reco::TrackToTrackingParticleAssociatorBaseImpl> impl(
135  new TrackAssociatorByHitsImpl(iEvent.productGetter(),
136  std::move(thAssoc),
137  &(*tTopoHand),
138  &(*simHitsTPAssoc),
143  UsePixels,
144  UseGrouped,
145  UseSplitting,
148  std::unique_ptr<reco::TrackToTrackingParticleAssociator> toPut(
150  iEvent.put(std::move(toPut));
151 }

References AbsoluteNumberOfHits, cut_RecoToSim, edm::EventSetup::get(), get, iEvent, eostools::move(), purity_SimToReco, quality_SimToReco, simHitTpMapToken_, SimToRecoDenominator, ThreeHitTracksAreSpecial, DBConfiguration_cff::toPut, trackerHitAssociatorConfig_, UseGrouped, UsePixels, and UseSplitting.

Member Data Documentation

◆ AbsoluteNumberOfHits

const bool TrackAssociatorByHitsProducer::AbsoluteNumberOfHits
private

Definition at line 71 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ cut_RecoToSim

const double TrackAssociatorByHitsProducer::cut_RecoToSim
private

Definition at line 66 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ purity_SimToReco

const double TrackAssociatorByHitsProducer::purity_SimToReco
private

Definition at line 65 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ quality_SimToReco

const double TrackAssociatorByHitsProducer::quality_SimToReco
private

Definition at line 64 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ simHitTpMapToken_

edm::EDGetTokenT<SimHitTPAssociationList> TrackAssociatorByHitsProducer::simHitTpMapToken_
private

Definition at line 62 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ SimToRecoDenominator

TrackAssociatorByHitsImpl::SimToRecoDenomType TrackAssociatorByHitsProducer::SimToRecoDenominator
private

Definition at line 63 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce(), and TrackAssociatorByHitsProducer().

◆ ThreeHitTracksAreSpecial

const bool TrackAssociatorByHitsProducer::ThreeHitTracksAreSpecial
private

Definition at line 70 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ trackerHitAssociatorConfig_

TrackerHitAssociator::Config TrackAssociatorByHitsProducer::trackerHitAssociatorConfig_
private

Definition at line 61 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ UseGrouped

const bool TrackAssociatorByHitsProducer::UseGrouped
private

Definition at line 68 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ UsePixels

const bool TrackAssociatorByHitsProducer::UsePixels
private

Definition at line 67 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ UseSplitting

const bool TrackAssociatorByHitsProducer::UseSplitting
private

Definition at line 69 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

TrackAssociatorByHitsProducer::trackerHitAssociatorConfig_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
Definition: TrackAssociatorByHitsProducer.cc:61
TrackAssociatorByHitsProducer::purity_SimToReco
const double purity_SimToReco
Definition: TrackAssociatorByHitsProducer.cc:65
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackAssociatorByHitsProducer::simHitTpMapToken_
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_
Definition: TrackAssociatorByHitsProducer.cc:62
reco::TrackToTrackingParticleAssociator
Definition: TrackToTrackingParticleAssociator.h:51
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrackAssociatorByHitsProducer::SimToRecoDenominator
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
Definition: TrackAssociatorByHitsProducer.cc:63
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
TrackAssociatorByHitsProducer::UseSplitting
const bool UseSplitting
Definition: TrackAssociatorByHitsProducer.cc:69
edm::Handle
Definition: AssociativeIterator.h:50
TrackAssociatorByHitsImpl::denomnone
Definition: TrackAssociatorByHitsImpl.h:25
TrackAssociatorByHitsProducer::AbsoluteNumberOfHits
const bool AbsoluteNumberOfHits
Definition: TrackAssociatorByHitsProducer.cc:71
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ESHandle< TrackerTopology >
TrackAssociatorByHitsImpl::denomsim
Definition: TrackAssociatorByHitsImpl.h:25
TrackAssociatorByHitsImpl::denomreco
Definition: TrackAssociatorByHitsImpl.h:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackAssociatorByHitsProducer::UsePixels
const bool UsePixels
Definition: TrackAssociatorByHitsProducer.cc:67
iEvent
int iEvent
Definition: GenABIO.cc:224
TrackAssociatorByHitsProducer::ThreeHitTracksAreSpecial
const bool ThreeHitTracksAreSpecial
Definition: TrackAssociatorByHitsProducer.cc:70
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
DBConfiguration_cff.toPut
toPut
Definition: DBConfiguration_cff.py:25
TrackAssociatorByHitsImpl
Definition: TrackAssociatorByHitsImpl.h:23
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TrackerHitAssociator
Definition: TrackerHitAssociator.h:55
TrackAssociatorByHitsProducer::cut_RecoToSim
const double cut_RecoToSim
Definition: TrackAssociatorByHitsProducer.cc:66
impl
Definition: trackAlgoPriorityOrder.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
Exception
Definition: hltDiff.cc:246
TrackAssociatorByHitsProducer::UseGrouped
const bool UseGrouped
Definition: TrackAssociatorByHitsProducer.cc:68
TrackAssociatorByHitsProducer::quality_SimToReco
const double quality_SimToReco
Definition: TrackAssociatorByHitsProducer.cc:64
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15