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
 
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
 
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 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
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 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

Definition at line 16 of file VertexAssociatorByTracksProducer.cc.

Constructor & Destructor Documentation

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"))),
64  consumes<reco::RecoToSimCollection>(config.getParameter<edm::InputTag>("trackAssociation"))),
66  consumes<reco::SimToRecoCollection>(config.getParameter<edm::InputTag>("trackAssociation"))) {
67  produces<reco::VertexToTrackingVertexAssociator>();
68 }
T getParameter(std::string const &) const
const reco::TrackBase::TrackQuality trackQuality_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
edm::EDGetTokenT< reco::SimToRecoCollection > trackSimToRecoAssociationToken_
edm::EDGetTokenT< reco::RecoToSimCollection > trackRecoToSimAssociationToken_
VertexAssociatorByTracksProducer::~VertexAssociatorByTracksProducer ( )
override

Definition at line 70 of file VertexAssociatorByTracksProducer.cc.

70 {}

Member Function Documentation

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

Definition at line 72 of file VertexAssociatorByTracksProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), 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)
void VertexAssociatorByTracksProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup  
) const
overrideprivate

Definition at line 105 of file VertexAssociatorByTracksProducer.cc.

References DEFINE_FWK_MODULE, edm::Event::getByToken(), eostools::move(), edm::Handle< T >::product(), edm::Event::productGetter(), edm::Event::put(), R2SMatchedRecoRatio_, R2SMatchedSimRatio_, S2RMatchedRecoRatio_, S2RMatchedSimRatio_, selector_, DBConfiguration_cff::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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
EDProductGetter const & productGetter() const
Definition: Event.cc:93
const reco::TrackBase::TrackQuality trackQuality_
T const * product() const
Definition: Handle.h:74
edm::EDGetTokenT< reco::SimToRecoCollection > trackSimToRecoAssociationToken_
edm::EDGetTokenT< reco::RecoToSimCollection > trackRecoToSimAssociationToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

const double VertexAssociatorByTracksProducer::R2SMatchedRecoRatio_
private

Definition at line 28 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

const double VertexAssociatorByTracksProducer::R2SMatchedSimRatio_
private

Definition at line 27 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

const double VertexAssociatorByTracksProducer::S2RMatchedRecoRatio_
private

Definition at line 30 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

const double VertexAssociatorByTracksProducer::S2RMatchedSimRatio_
private

Definition at line 29 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

const TrackingParticleSelector VertexAssociatorByTracksProducer::selector_
private

Definition at line 32 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

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

Definition at line 33 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

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

Definition at line 35 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().

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

Definition at line 36 of file VertexAssociatorByTracksProducer.cc.

Referenced by produce().