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
 
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)
 
 ~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
 
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
 
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)
 
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
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 48 of file TrackAssociatorByHitsProducer.cc.

Constructor & Destructor Documentation

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  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 }
T getParameter(std::string const &) const
TrackerHitAssociator::Config trackerHitAssociatorConfig_
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
tmp
align.sh
Definition: createJobs.py:716
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_
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

void TrackAssociatorByHitsProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 154 of file TrackAssociatorByHitsProducer.cc.

154 {}
void TrackAssociatorByHitsProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 157 of file TrackAssociatorByHitsProducer.cc.

157 {}
void TrackAssociatorByHitsProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 160 of file TrackAssociatorByHitsProducer.cc.

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

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 }
void addDefault(ParameterSetDescription const &psetDescription)
void TrackAssociatorByHitsProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivate

Definition at line 122 of file TrackAssociatorByHitsProducer.cc.

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

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(
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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
TrackerHitAssociator::Config trackerHitAssociatorConfig_
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
EDProductGetter const & productGetter() const
Definition: Event.cc:102
HLT enums.
T get() const
Definition: EventSetup.h:73
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_

Member Data Documentation

const bool TrackAssociatorByHitsProducer::AbsoluteNumberOfHits
private

Definition at line 71 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::cut_RecoToSim
private

Definition at line 66 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::purity_SimToReco
private

Definition at line 65 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::quality_SimToReco
private

Definition at line 64 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

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

Definition at line 62 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

TrackAssociatorByHitsImpl::SimToRecoDenomType TrackAssociatorByHitsProducer::SimToRecoDenominator
private

Definition at line 63 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce(), and TrackAssociatorByHitsProducer().

const bool TrackAssociatorByHitsProducer::ThreeHitTracksAreSpecial
private

Definition at line 70 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

TrackerHitAssociator::Config TrackAssociatorByHitsProducer::trackerHitAssociatorConfig_
private

Definition at line 61 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UseGrouped
private

Definition at line 68 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UsePixels
private

Definition at line 67 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UseSplitting
private

Definition at line 69 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().