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
 
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 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 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 58 of file VertexAssociatorByTracksProducer.cc.

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

Definition at line 71 of file VertexAssociatorByTracksProducer.cc.

71 {}

Member Function Documentation

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

Definition at line 73 of file VertexAssociatorByTracksProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

73  {
75 
76  // Matching conditions
77  desc.add<double>("R2SMatchedSimRatio", 0.3);
78  desc.add<double>("R2SMatchedRecoRatio", 0.0);
79  desc.add<double>("S2RMatchedSimRatio", 0.0);
80  desc.add<double>("S2RMatchedRecoRatio", 0.3);
81 
82  //RecoTrack selection
83  desc.add<std::string>("trackQuality", "highPurity");
84 
85  // TrackingParticle selection
87 
88  descTp.add<double>("lipTP", 30.0);
89  descTp.add<bool>("chargedOnlyTP", true);
90  descTp.add<std::vector<int>>("pdgIdTP", std::vector<int>());
91  descTp.add<bool>("signalOnlyTP", true);
92  descTp.add<double>("minRapidityTP", -2.4);
93  descTp.add<int>("minHitTP", 0);
94  descTp.add<double>("ptMinTP", 0.9);
95  descTp.add<double>("ptMaxTP", 1e100);
96  descTp.add<double>("maxRapidityTP", 2.4);
97  descTp.add<double>("tipTP", 3.5);
98  desc.add<edm::ParameterSetDescription>("trackingParticleSelector", descTp);
99 
100  // Track-TrackingParticle association
101  desc.add<edm::InputTag>("trackAssociation", edm::InputTag("trackingParticleRecoTrackAsssociation"));
102 
103  descriptions.add("VertexAssociatorByTracks", desc);
104 }
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 106 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_.

106  {
107  edm::Handle<reco::RecoToSimCollection > recotosimCollectionH;
108  iEvent.getByToken(trackRecoToSimAssociationToken_, recotosimCollectionH);
109 
110  edm::Handle<reco::SimToRecoCollection > simtorecoCollectionH;
111  iEvent.getByToken(trackSimToRecoAssociationToken_, simtorecoCollectionH);
112 
113  auto impl = std::make_unique<VertexAssociatorByTracks>(&(iEvent.productGetter()),
118  &selector_,
120  recotosimCollectionH.product(),
121  simtorecoCollectionH.product());
122 
123  auto toPut = std::make_unique<reco::VertexToTrackingVertexAssociator>(std::move(impl));
124  iEvent.put(std::move(toPut));
125 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
EDProductGetter const & productGetter() const
Definition: Event.cc:104
const reco::TrackBase::TrackQuality trackQuality_
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::SimToRecoCollection > trackSimToRecoAssociationToken_
edm::EDGetTokenT< reco::RecoToSimCollection > trackRecoToSimAssociationToken_
def move(src, dest)
Definition: eostools.py:510

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().