CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
VertexProducer Class Reference

#include <VertexProducer.h>

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

Public Member Functions

 VertexProducer (const edm::ParameterSet &)
 
 ~VertexProducer () 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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > 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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef edm::View< TTTrack< Ref_Phase2TrackerDigi_ > > TTTrackCollectionView
 

Private Member Functions

void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const edm::EDGetTokenT< TTTrackCollectionViewl1TracksToken_
 
const std::string outputCollectionName_
 
l1tVertexFinder::AlgoSettings settings_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopologyToken_
 

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
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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

Definition at line 27 of file VertexProducer.h.

Member Typedef Documentation

◆ TTTrackCollectionView

Definition at line 33 of file VertexProducer.h.

Constructor & Destructor Documentation

◆ VertexProducer()

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

Definition at line 19 of file VertexProducer.cc.

20  : l1TracksToken_(consumes<TTTrackCollectionView>(iConfig.getParameter<edm::InputTag>("l1TracksInputTag"))),
21  trackerTopologyToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>()),
22  outputCollectionName_(iConfig.getParameter<std::string>("l1VertexCollectionName")),
23  settings_(AlgoSettings(iConfig)) {
24  // Get configuration parameters
25 
26  switch (settings_.vx_algo()) {
27  case Algorithm::FastHisto:
28  edm::LogInfo("VertexProducer") << "VertexProducer::Finding vertices using the FastHisto binning algorithm";
29  break;
30  case Algorithm::FastHistoLooseAssociation:
31  edm::LogInfo("VertexProducer")
32  << "VertexProducer::Finding vertices using the FastHistoLooseAssociation binning algorithm";
33  break;
34  case Algorithm::GapClustering:
35  edm::LogInfo("VertexProducer") << "VertexProducer::Finding vertices using a gap clustering algorithm";
36  break;
37  case Algorithm::AgglomerativeHierarchical:
38  edm::LogInfo("VertexProducer") << "VertexProducer::Finding vertices using a Simple Merge Clustering algorithm";
39  break;
40  case Algorithm::DBSCAN:
41  edm::LogInfo("VertexProducer") << "VertexProducer::Finding vertices using a DBSCAN algorithm";
42  break;
43  case Algorithm::PVR:
44  edm::LogInfo("VertexProducer") << "VertexProducer::Finding vertices using a PVR algorithm";
45  break;
46  case Algorithm::AdaptiveVertexReconstruction:
47  edm::LogInfo("VertexProducer")
48  << "VertexProducer::Finding vertices using an AdaptiveVertexReconstruction algorithm";
49  break;
50  case Algorithm::HPV:
51  edm::LogInfo("VertexProducer") << "VertexProducer::Finding vertices using a Highest Pt Vertex algorithm";
52  break;
53  case Algorithm::Kmeans:
54  edm::LogInfo("VertexProducer") << "VertexProducer::Finding vertices using a kmeans algorithm";
55  break;
56  }
57 
58  //--- Define EDM output to be written to file (if required)
59  produces<l1t::VertexCollection>(outputCollectionName_);
60 }

References outputCollectionName_, settings_, and l1tVertexFinder::AlgoSettings::vx_algo().

◆ ~VertexProducer()

VertexProducer::~VertexProducer ( )
inlineoverride

Definition at line 30 of file VertexProducer.h.

30 {}

Member Function Documentation

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 62 of file VertexProducer.cc.

62  {
64  iEvent.getByToken(l1TracksToken_, l1TracksHandle);
65 
66  std::vector<l1tVertexFinder::L1Track> l1Tracks;
67  l1Tracks.reserve(l1TracksHandle->size());
68  for (const auto& track : l1TracksHandle->ptrs()) {
69  auto l1track = L1Track(track);
70  // Check the minimum pT of the tracks
71  // This is left here because it represents the smallest pT to be sent by the track finding boards
72  // This has less to do with the algorithms than the constraints of what will be sent to the vertexing algorithm
73  if (l1track.pt() > settings_.vx_TrackMinPt()) {
74  l1Tracks.push_back(l1track);
75  }
76  }
77 
78  VertexFinder vf(l1Tracks, settings_);
79 
80  switch (settings_.vx_algo()) {
81  case Algorithm::FastHisto: {
83  vf.fastHisto(tTopoHandle.product());
84  break;
85  }
86  case Algorithm::FastHistoLooseAssociation:
87  vf.fastHistoLooseAssociation();
88  break;
89  case Algorithm::GapClustering:
90  vf.GapClustering();
91  break;
92  case Algorithm::AgglomerativeHierarchical:
93  vf.agglomerativeHierarchicalClustering();
94  break;
95  case Algorithm::DBSCAN:
96  vf.DBSCAN();
97  break;
98  case Algorithm::PVR:
99  vf.PVR();
100  break;
101  case Algorithm::AdaptiveVertexReconstruction:
102  vf.adaptiveVertexReconstruction();
103  break;
104  case Algorithm::HPV:
105  vf.HPV();
106  break;
107  case Algorithm::Kmeans:
108  vf.Kmeans();
109  break;
110  }
111 
112  vf.SortVerticesInPt();
113  vf.findPrimaryVertex();
114 
115  // //=== Store output EDM track and hardware stub collections.
116  std::unique_ptr<l1t::VertexCollection> lProduct(new std::vector<l1t::Vertex>());
117 
118  for (const auto& vtx : vf.vertices()) {
119  std::vector<edm::Ptr<l1t::Vertex::Track_t>> lVtxTracks;
120  lVtxTracks.reserve(vtx.tracks().size());
121  for (const auto& t : vtx.tracks())
122  lVtxTracks.push_back(t->getTTTrackPtr());
123  lProduct->emplace_back(l1t::Vertex(vtx.pt(), vtx.z0(), lVtxTracks));
124  }
125  iEvent.put(std::move(lProduct), outputCollectionName_);
126 }

References l1tVertexFinder::VertexFinder::adaptiveVertexReconstruction(), l1tVertexFinder::VertexFinder::agglomerativeHierarchicalClustering(), l1tVertexFinder::VertexFinder::DBSCAN(), l1tVertexFinder::VertexFinder::fastHisto(), l1tVertexFinder::VertexFinder::fastHistoLooseAssociation(), l1tVertexFinder::VertexFinder::findPrimaryVertex(), l1tVertexFinder::VertexFinder::GapClustering(), edm::EventSetup::getHandle(), l1tVertexFinder::VertexFinder::HPV(), iEvent, l1tVertexFinder::VertexFinder::Kmeans(), eostools::move(), edm::ESHandle< T >::product(), l1tVertexFinder::VertexFinder::PVR(), l1tVertexFinder::VertexFinder::SortVerticesInPt(), submitPVValidationJobs::t, HLT_FULL_cff::track, l1tVertexFinder::VertexFinder::vertices(), and extraflags_cff::vtx.

Member Data Documentation

◆ l1TracksToken_

const edm::EDGetTokenT<TTTrackCollectionView> VertexProducer::l1TracksToken_
private

Definition at line 38 of file VertexProducer.h.

◆ outputCollectionName_

const std::string VertexProducer::outputCollectionName_
private

Definition at line 40 of file VertexProducer.h.

Referenced by VertexProducer().

◆ settings_

l1tVertexFinder::AlgoSettings VertexProducer::settings_
private

Definition at line 42 of file VertexProducer.h.

Referenced by VertexProducer().

◆ trackerTopologyToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> VertexProducer::trackerTopologyToken_
private

Definition at line 39 of file VertexProducer.h.

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
l1t::Vertex
Definition: Vertex.h:15
edm::View::ptrs
std::vector< Ptr< value_type > > const & ptrs() const
l1tVertexFinder::AlgoSettings::vx_algo
Algorithm vx_algo() const
Definition: AlgoSettings.h:31
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
edm::ESHandle< TrackerTopology >
L1Track
TTTrack< Ref_Phase2TrackerDigi_ > L1Track
Definition: L1Track.h:8
edm::View::size
size_type size() const
VertexProducer::settings_
l1tVertexFinder::AlgoSettings settings_
Definition: VertexProducer.h:42
iEvent
int iEvent
Definition: GenABIO.cc:224
l1tVertexFinder::AlgoSettings
Definition: AlgoSettings.h:24
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
VertexProducer::l1TracksToken_
const edm::EDGetTokenT< TTTrackCollectionView > l1TracksToken_
Definition: VertexProducer.h:38
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
l1tVertexFinder::VertexFinder
Definition: VertexFinder.h:21
VertexProducer::trackerTopologyToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Definition: VertexProducer.h:39
VertexProducer::outputCollectionName_
const std::string outputCollectionName_
Definition: VertexProducer.h:40
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
l1tVertexFinder::AlgoSettings::vx_TrackMinPt
float vx_TrackMinPt() const
Definition: AlgoSettings.h:63
edm::InputTag
Definition: InputTag.h:15