CMS 3D CMS Logo

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

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

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

Public Member Functions

 TrackAssociatorByChi2Producer (const edm::ParameterSet &)
 
 ~TrackAssociatorByChi2Producer () 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 produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbsToken_
 
const double chi2cut_
 
const bool onlyDiagonal_
 

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 45 of file TrackAssociatorByChi2Producer.cc.

Constructor & Destructor Documentation

◆ TrackAssociatorByChi2Producer()

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

Definition at line 72 of file TrackAssociatorByChi2Producer.cc.

73  : bsToken_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"))),
74  chi2cut_(iConfig.getParameter<double>("chi2cut")),
75  onlyDiagonal_(iConfig.getParameter<bool>("onlyDiagonal")) {
76  //register your products
77  produces<reco::TrackToTrackingParticleAssociator>();
78  produces<reco::TrackToGenParticleAssociator>();
79 }

◆ ~TrackAssociatorByChi2Producer()

TrackAssociatorByChi2Producer::~TrackAssociatorByChi2Producer ( )
override

Definition at line 81 of file TrackAssociatorByChi2Producer.cc.

81  {
82  // do anything here that needs to be done at desctruction time
83  // (e.g. close files, deallocate resources etc.)
84 }

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 121 of file TrackAssociatorByChi2Producer.cc.

121  {
122  //The following says we do not know what parameters are allowed so do no validation
123  // Please change this to state exactly what you do use, even if it is no parameters
125  desc.setUnknown();
126  descriptions.addDefault(desc);
127 }

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

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 91 of file TrackAssociatorByChi2Producer.cc.

91  {
92  using namespace edm;
93 
95  iSetup.get<IdealMagneticFieldRecord>().get(magField);
96 
98  iEvent.getByToken(bsToken_, beamSpot);
99 
100  {
101  std::unique_ptr<reco::TrackToTrackingParticleAssociatorBaseImpl> impl(
103 
104  std::unique_ptr<reco::TrackToTrackingParticleAssociator> assoc(
106 
107  iEvent.put(std::move(assoc));
108  }
109 
110  {
111  std::unique_ptr<reco::TrackToGenParticleAssociatorBaseImpl> impl(
113 
114  std::unique_ptr<reco::TrackToGenParticleAssociator> assoc(new reco::TrackToGenParticleAssociator(std::move(impl)));
115 
116  iEvent.put(std::move(assoc));
117  }
118 }

References trackingPlots::assoc, pwdgSkimBPark_cfi::beamSpot, bsToken_, chi2cut_, edm::EventSetup::get(), get, iEvent, eostools::move(), and onlyDiagonal_.

Member Data Documentation

◆ bsToken_

edm::EDGetTokenT<reco::BeamSpot> TrackAssociatorByChi2Producer::bsToken_
private

Definition at line 56 of file TrackAssociatorByChi2Producer.cc.

Referenced by produce().

◆ chi2cut_

const double TrackAssociatorByChi2Producer::chi2cut_
private

Definition at line 57 of file TrackAssociatorByChi2Producer.cc.

Referenced by produce().

◆ onlyDiagonal_

const bool TrackAssociatorByChi2Producer::onlyDiagonal_
private

Definition at line 58 of file TrackAssociatorByChi2Producer.cc.

Referenced by produce().

pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
edm
HLT enums.
Definition: AlignableModifier.h:19
reco::TrackToTrackingParticleAssociator
Definition: TrackToTrackingParticleAssociator.h:51
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
reco::TrackToGenParticleAssociator
Definition: TrackToGenParticleAssociator.h:34
edm::Handle< reco::BeamSpot >
trackingPlots.assoc
assoc
Definition: trackingPlots.py:183
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackAssociatorByChi2Impl
Definition: TrackAssociatorByChi2Impl.h:34
edm::ESHandle< MagneticField >
TrackAssociatorByChi2Producer::chi2cut_
const double chi2cut_
Definition: TrackAssociatorByChi2Producer.cc:57
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
impl
Definition: trackAlgoPriorityOrder.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
TrackAssociatorByChi2Producer::bsToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
Definition: TrackAssociatorByChi2Producer.cc:56
TrackAssociatorByChi2Producer::onlyDiagonal_
const bool onlyDiagonal_
Definition: TrackAssociatorByChi2Producer.cc:58
TrackGenAssociatorByChi2Impl
Definition: TrackGenAssociatorByChi2Impl.h:35
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15