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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
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::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::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)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 49 of file TrackAssociatorByHitsProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 87 of file TrackAssociatorByHitsProducer.cc.

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

87  :
89  simHitTpMapToken_(consumes<SimHitTPAssociationList>(iConfig.getParameter<edm::InputTag>("simHitTpMapTag"))),
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 {
100  std::string tmp = iConfig.getParameter<std::string>("SimToRecoDenominator");
101  if (tmp=="sim") {
103  } else if (tmp == "reco") {
105  }
106 
108  throw cms::Exception("TrackAssociatorByHitsImpl") << "SimToRecoDenominator not specified as sim or reco";
109  }
110 
111  //register your products
112  produces<reco::TrackToTrackingParticleAssociator>();
113 }
T getParameter(std::string const &) const
TrackerHitAssociator::Config trackerHitAssociatorConfig_
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_
TrackAssociatorByHitsProducer::~TrackAssociatorByHitsProducer ( )
override

Definition at line 116 of file TrackAssociatorByHitsProducer.cc.

117 {
118 
119  // do anything here that needs to be done at desctruction time
120  // (e.g. close files, deallocate resources etc.)
121 
122 }

Member Function Documentation

void TrackAssociatorByHitsProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 164 of file TrackAssociatorByHitsProducer.cc.

165 {
166 }
void TrackAssociatorByHitsProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 170 of file TrackAssociatorByHitsProducer.cc.

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

Definition at line 176 of file TrackAssociatorByHitsProducer.cc.

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

176  {
177  //The following says we do not know what parameters are allowed so do no validation
178  // Please change this to state exactly what you do use, even if it is no parameters
180  desc.setUnknown();
181  descriptions.addDefault(desc);
182 }
void addDefault(ParameterSetDescription const &psetDescription)
void TrackAssociatorByHitsProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivate

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

132 {
133  using namespace edm;
134 
135  std::unique_ptr<TrackerHitAssociator> thAssoc( new TrackerHitAssociator(iEvent,trackerHitAssociatorConfig_));
136 
138  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
139 
141  //warning: make sure the TP collection used in the map is the same used in the associator!
142  iEvent.getByToken(simHitTpMapToken_,simHitsTPAssoc);
143 
144  std::unique_ptr<reco::TrackToTrackingParticleAssociatorBaseImpl> impl(
146  std::move(thAssoc),
147  &(*tTopoHand),
148  &(*simHitsTPAssoc),
153  UsePixels,
154  UseGrouped,
155  UseSplitting,
158  std::unique_ptr<reco::TrackToTrackingParticleAssociator> toPut( new reco::TrackToTrackingParticleAssociator(std::move(impl)));
159  iEvent.put(std::move(toPut));
160 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
TrackerHitAssociator::Config trackerHitAssociatorConfig_
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
EDProductGetter const & productGetter() const
Definition: Event.cc:104
HLT enums.
T get() const
Definition: EventSetup.h:62
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_

Member Data Documentation

const bool TrackAssociatorByHitsProducer::AbsoluteNumberOfHits
private

Definition at line 72 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::cut_RecoToSim
private

Definition at line 67 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::purity_SimToReco
private

Definition at line 66 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::quality_SimToReco
private

Definition at line 65 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

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

Definition at line 63 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

TrackAssociatorByHitsImpl::SimToRecoDenomType TrackAssociatorByHitsProducer::SimToRecoDenominator
private

Definition at line 64 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce(), and TrackAssociatorByHitsProducer().

const bool TrackAssociatorByHitsProducer::ThreeHitTracksAreSpecial
private

Definition at line 71 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

TrackerHitAssociator::Config TrackAssociatorByHitsProducer::trackerHitAssociatorConfig_
private

Definition at line 62 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UseGrouped
private

Definition at line 69 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UsePixels
private

Definition at line 68 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UseSplitting
private

Definition at line 70 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().