CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
VertexAssociatorByTracksProducer Class Reference
Inheritance diagram for VertexAssociatorByTracksProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 VertexAssociatorByTracksProducer (const edm::ParameterSet &)
 
 ~VertexAssociatorByTracksProducer () override
 
- 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept 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 double R2SMatchedRecoRatio_
 
const double R2SMatchedSimRatio_
 
const double S2RMatchedRecoRatio_
 
const double S2RMatchedSimRatio_
 
const TrackingParticleSelector selector_
 
const reco::TrackBase::TrackQuality trackQuality_
 
edm::EDGetTokenT< reco::RecoToSimCollectiontrackRecoToSimAssociationToken_
 
edm::EDGetTokenT< reco::SimToRecoCollectiontrackSimToRecoAssociationToken_
 

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

Definition at line 16 of file VertexAssociatorByTracksProducer.cc.

Constructor & Destructor Documentation

◆ VertexAssociatorByTracksProducer()

VertexAssociatorByTracksProducer::VertexAssociatorByTracksProducer ( const edm::ParameterSet config)
explicit

Definition at line 56 of file VertexAssociatorByTracksProducer.cc.

57  : R2SMatchedSimRatio_(config.getParameter<double>("R2SMatchedSimRatio")),
58  R2SMatchedRecoRatio_(config.getParameter<double>("R2SMatchedRecoRatio")),
59  S2RMatchedSimRatio_(config.getParameter<double>("S2RMatchedSimRatio")),
60  S2RMatchedRecoRatio_(config.getParameter<double>("S2RMatchedRecoRatio")),
61  selector_(makeSelector(config.getParameter<edm::ParameterSet>("trackingParticleSelector"))),
62  trackQuality_(reco::TrackBase::qualityByName(config.getParameter<std::string>("trackQuality"))),
64  consumes<reco::RecoToSimCollection>(config.getParameter<edm::InputTag>("trackAssociation"))),
66  consumes<reco::SimToRecoCollection>(config.getParameter<edm::InputTag>("trackAssociation"))) {
67  produces<reco::VertexToTrackingVertexAssociator>();
68 }
const reco::TrackBase::TrackQuality trackQuality_
Definition: config.py:1
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
edm::EDGetTokenT< reco::SimToRecoCollection > trackSimToRecoAssociationToken_
edm::EDGetTokenT< reco::RecoToSimCollection > trackRecoToSimAssociationToken_

◆ ~VertexAssociatorByTracksProducer()

VertexAssociatorByTracksProducer::~VertexAssociatorByTracksProducer ( )
override

Definition at line 70 of file VertexAssociatorByTracksProducer.cc.

70 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 72 of file VertexAssociatorByTracksProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

72  {
74 
75  // Matching conditions
76  desc.add<double>("R2SMatchedSimRatio", 0.3);
77  desc.add<double>("R2SMatchedRecoRatio", 0.0);
78  desc.add<double>("S2RMatchedSimRatio", 0.0);
79  desc.add<double>("S2RMatchedRecoRatio", 0.3);
80 
81  // RecoTrack selection
82  desc.add<std::string>("trackQuality", "highPurity");
83 
84  // TrackingParticle selection
86 
87  descTp.add<double>("lipTP", 30.0);
88  descTp.add<bool>("chargedOnlyTP", true);
89  descTp.add<std::vector<int>>("pdgIdTP", std::vector<int>());
90  descTp.add<bool>("signalOnlyTP", true);
91  descTp.add<double>("minRapidityTP", -2.4);
92  descTp.add<int>("minHitTP", 0);
93  descTp.add<double>("ptMinTP", 0.9);
94  descTp.add<double>("ptMaxTP", 1e100);
95  descTp.add<double>("maxRapidityTP", 2.4);
96  descTp.add<double>("tipTP", 3.5);
97  desc.add<edm::ParameterSetDescription>("trackingParticleSelector", descTp);
98 
99  // Track-TrackingParticle association
100  desc.add<edm::InputTag>("trackAssociation", edm::InputTag("trackingParticleRecoTrackAsssociation"));
101 
102  descriptions.add("VertexAssociatorByTracks", desc);
103 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 105 of file VertexAssociatorByTracksProducer.cc.

References iEvent, eostools::move(), edm::Handle< T >::product(), R2SMatchedRecoRatio_, R2SMatchedSimRatio_, S2RMatchedRecoRatio_, S2RMatchedSimRatio_, selector_, convertXMLtoSQLite_cfg::toPut, trackQuality_, trackRecoToSimAssociationToken_, and trackSimToRecoAssociationToken_.

105  {
106  edm::Handle<reco::RecoToSimCollection> recotosimCollectionH;
107  iEvent.getByToken(trackRecoToSimAssociationToken_, recotosimCollectionH);
108 
109  edm::Handle<reco::SimToRecoCollection> simtorecoCollectionH;
110  iEvent.getByToken(trackSimToRecoAssociationToken_, simtorecoCollectionH);
111 
112  auto impl = std::make_unique<VertexAssociatorByTracks>(&(iEvent.productGetter()),
117  &selector_,
119  recotosimCollectionH.product(),
120  simtorecoCollectionH.product());
121 
122  auto toPut = std::make_unique<reco::VertexToTrackingVertexAssociator>(std::move(impl));
123  iEvent.put(std::move(toPut));
124 }
T const * product() const
Definition: Handle.h:70
const reco::TrackBase::TrackQuality trackQuality_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::SimToRecoCollection > trackSimToRecoAssociationToken_
edm::EDGetTokenT< reco::RecoToSimCollection > trackRecoToSimAssociationToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ R2SMatchedRecoRatio_

const double VertexAssociatorByTracksProducer::R2SMatchedRecoRatio_
private

Definition at line 28 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

◆ R2SMatchedSimRatio_

const double VertexAssociatorByTracksProducer::R2SMatchedSimRatio_
private

Definition at line 27 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

◆ S2RMatchedRecoRatio_

const double VertexAssociatorByTracksProducer::S2RMatchedRecoRatio_
private

Definition at line 30 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

◆ S2RMatchedSimRatio_

const double VertexAssociatorByTracksProducer::S2RMatchedSimRatio_
private

Definition at line 29 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

◆ selector_

const TrackingParticleSelector VertexAssociatorByTracksProducer::selector_
private

Definition at line 32 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

◆ trackQuality_

const reco::TrackBase::TrackQuality VertexAssociatorByTracksProducer::trackQuality_
private

Definition at line 33 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

◆ trackRecoToSimAssociationToken_

edm::EDGetTokenT<reco::RecoToSimCollection> VertexAssociatorByTracksProducer::trackRecoToSimAssociationToken_
private

Definition at line 35 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

◆ trackSimToRecoAssociationToken_

edm::EDGetTokenT<reco::SimToRecoCollection> VertexAssociatorByTracksProducer::trackSimToRecoAssociationToken_
private

Definition at line 36 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().