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=default
 
- Public Member Functions inherited from edm::global::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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const bool AbsoluteNumberOfHits
 
const double cut_RecoToSim
 
const double purity_SimToReco
 
edm::EDPutTokenT< reco::TrackToTrackingParticleAssociatorputToken_
 
const double quality_SimToReco
 
edm::EDGetTokenT< SimHitTPAssociationListsimHitTpMapToken_
 
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
 
const bool ThreeHitTracksAreSpecial
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 
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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 47 of file TrackAssociatorByHitsProducer.cc.

Constructor & Destructor Documentation

◆ TrackAssociatorByHitsProducer()

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

Definition at line 85 of file TrackAssociatorByHitsProducer.cc.

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

87  simHitTpMapToken_(consumes<SimHitTPAssociationList>(iConfig.getParameter<edm::InputTag>("simHitTpMapTag"))),
89  putToken_(produces<reco::TrackToTrackingParticleAssociator>()),
91  quality_SimToReco(iConfig.getParameter<double>("Quality_SimToReco")),
92  purity_SimToReco(iConfig.getParameter<double>("Purity_SimToReco")),
93  cut_RecoToSim(iConfig.getParameter<double>("Cut_RecoToSim")),
94  UsePixels(iConfig.getParameter<bool>("UsePixels")),
95  UseGrouped(iConfig.getParameter<bool>("UseGrouped")),
96  UseSplitting(iConfig.getParameter<bool>("UseSplitting")),
97  ThreeHitTracksAreSpecial(iConfig.getParameter<bool>("ThreeHitTracksAreSpecial")),
98  AbsoluteNumberOfHits(iConfig.getParameter<bool>("AbsoluteNumberOfHits")) {
99  std::string tmp = iConfig.getParameter<std::string>("SimToRecoDenominator");
100  if (tmp == "sim") {
102  } else if (tmp == "reco") {
104  }
105 
107  throw cms::Exception("TrackAssociatorByHitsImpl") << "SimToRecoDenominator not specified as sim or reco";
108  }
109 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TrackerHitAssociator::Config trackerHitAssociatorConfig_
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDPutTokenT< reco::TrackToTrackingParticleAssociator > putToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
tmp
align.sh
Definition: createJobs.py:716
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_

◆ ~TrackAssociatorByHitsProducer()

TrackAssociatorByHitsProducer::~TrackAssociatorByHitsProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 140 of file TrackAssociatorByHitsProducer.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

140  {
141  //The following says we do not know what parameters are allowed so do no validation
142  // Please change this to state exactly what you do use, even if it is no parameters
144  desc.setUnknown();
145  descriptions.addDefault(desc);
146 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 116 of file TrackAssociatorByHitsProducer.cc.

References AbsoluteNumberOfHits, cut_RecoToSim, edm::EventSetup::getData(), iEvent, eostools::move(), purity_SimToReco, putToken_, quality_SimToReco, simHitTpMapToken_, SimToRecoDenominator, ThreeHitTracksAreSpecial, trackerHitAssociatorConfig_, tTopoToken_, UseGrouped, UsePixels, and UseSplitting.

116  {
117  using namespace edm;
118 
119  auto thAssoc = std::make_unique<TrackerHitAssociator>(iEvent, trackerHitAssociatorConfig_);
120 
121  iEvent.emplace(putToken_,
122  std::make_unique<TrackAssociatorByHitsImpl>(
123  iEvent.productGetter(),
124  std::move(thAssoc),
125  &iSetup.getData(tTopoToken_),
126  //warning: make sure the TP collection used in the map is the same used in the associator!
132  UsePixels,
133  UseGrouped,
134  UseSplitting,
137 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
TrackerHitAssociator::Config trackerHitAssociatorConfig_
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
int iEvent
Definition: GenABIO.cc:224
edm::EDPutTokenT< reco::TrackToTrackingParticleAssociator > putToken_
HLT enums.
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_

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().

◆ putToken_

edm::EDPutTokenT<reco::TrackToTrackingParticleAssociator> TrackAssociatorByHitsProducer::putToken_
private

Definition at line 61 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 59 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 58 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

◆ tTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> TrackAssociatorByHitsProducer::tTopoToken_
private

Definition at line 60 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().