CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TemplatedVertexArbitrator< InputContainer, VTX > Class Template Reference
Inheritance diagram for TemplatedVertexArbitrator< InputContainer, VTX >:
edm::stream::EDProducer<>

Public Types

typedef std::vector< VTX > Product
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

void produce (edm::Event &event, const edm::EventSetup &es) override
 
 TemplatedVertexArbitrator (const edm::ParameterSet &params)
 
- Public Member Functions inherited from edm::stream::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
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &cdesc)
 

Private Member Functions

bool trackFilter (const reco::TrackRef &track) const
 

Private Attributes

std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 
edm::EDGetTokenT< reco::VertexCollectiontoken_primaryVertex
 
edm::EDGetTokenT< Producttoken_secondaryVertex
 
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecordtoken_trackBuilder
 
edm::EDGetTokenT< InputContainer > token_tracks
 

Detailed Description

template<class InputContainer, class VTX>
class TemplatedVertexArbitrator< InputContainer, VTX >

Definition at line 49 of file VertexArbitrators.cc.

Member Typedef Documentation

◆ Product

template<class InputContainer , class VTX >
typedef std::vector<VTX> TemplatedVertexArbitrator< InputContainer, VTX >::Product

Definition at line 51 of file VertexArbitrators.cc.

Constructor & Destructor Documentation

◆ TemplatedVertexArbitrator()

template<class InputContainer , class VTX >
TemplatedVertexArbitrator< InputContainer, VTX >::TemplatedVertexArbitrator ( const edm::ParameterSet params)

Definition at line 102 of file VertexArbitrators.cc.

References submitPVValidationJobs::params.

102  {
103  token_primaryVertex = consumes<reco::VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
104  token_secondaryVertex = consumes<Product>(params.getParameter<edm::InputTag>("secondaryVertices"));
105  token_beamSpot = consumes<reco::BeamSpot>(params.getParameter<edm::InputTag>("beamSpot"));
106  token_tracks = consumes<InputContainer>(params.getParameter<edm::InputTag>("tracks"));
108  esConsumes<TransientTrackBuilder, TransientTrackRecord>(edm::ESInputTag("", "TransientTrackBuilder"));
109  produces<Product>();
111 }
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
edm::EDGetTokenT< Product > token_secondaryVertex
std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
edm::EDGetTokenT< InputContainer > token_tracks
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > token_trackBuilder

Member Function Documentation

◆ fillDescriptions()

template<class InputContainer , class VTX >
static void TemplatedVertexArbitrator< InputContainer, VTX >::fillDescriptions ( edm::ConfigurationDescriptions cdesc)
inlinestatic

Definition at line 54 of file VertexArbitrators.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), HLT_2022v12_cff::InputTag, and relativeConstraints::value.

54  {
56  pdesc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
57  pdesc.add<edm::InputTag>("primaryVertices", edm::InputTag("offlinePrimaryVertices"));
59  pdesc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
60  pdesc.add<edm::InputTag>("secondaryVertices", edm::InputTag("vertexMerger"));
62  pdesc.add<edm::InputTag>("tracks", edm::InputTag("particleFlow"));
63  pdesc.add<edm::InputTag>("secondaryVertices", edm::InputTag("candidateVertexMerger"));
64  } else {
65  pdesc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
66  pdesc.add<edm::InputTag>("secondaryVertices", edm::InputTag("vertexMerger"));
67  }
68  pdesc.add<double>("dLenFraction", 0.333);
69  pdesc.add<double>("dRCut", 0.4);
70  pdesc.add<double>("distCut", 0.04);
71  pdesc.add<double>("sigCut", 5.0);
72  pdesc.add<double>("fitterSigmacut", 3.0);
73  pdesc.add<double>("fitterTini", 256);
74  pdesc.add<double>("fitterRatio", 0.25);
75  pdesc.add<int>("trackMinLayers", 4);
76  pdesc.add<double>("trackMinPt", 0.4);
77  pdesc.add<int>("trackMinPixels", 1);
78  pdesc.add<double>("maxTimeSignificance", 3.5);
80  cdesc.add("trackVertexArbitratorDefault", pdesc);
82  cdesc.add("candidateVertexArbitratorDefault", pdesc);
83  } else {
84  cdesc.addDefault(pdesc);
85  }
86  }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

template<class InputContainer , class VTX >
void TemplatedVertexArbitrator< InputContainer, VTX >::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 114 of file VertexArbitrators.cc.

References pwdgSkimBPark_cfi::beamSpot, tthelpers::buildTT(), edm::EventSetup::getHandle(), eostools::move(), nTracks(), HLT_2022v12_cff::primaryVertices, MetAnalyzer::pv(), HLT_2022v12_cff::secondaryVertices, TrackCollections2monitor_cff::selectedTracks, HLT_2022v12_cff::track, and tracks.

114  {
115  using namespace reco;
116 
118  event.getByToken(token_secondaryVertex, secondaryVertices);
119  Product theSecVertexColl = *(secondaryVertices.product());
120 
122  event.getByToken(token_primaryVertex, primaryVertices);
123 
124  auto recoVertices = std::make_unique<Product>();
125  if (!primaryVertices->empty()) {
126  const reco::Vertex &pv = (*primaryVertices)[0];
127 
129  event.getByToken(token_tracks, tracks);
130 
132 
134  event.getByToken(token_beamSpot, beamSpot);
135 
136  std::vector<TransientTrack> selectedTracks;
137  for (typename InputContainer::const_iterator track = tracks->begin(); track != tracks->end(); ++track) {
138  selectedTracks.push_back(tthelpers::buildTT(tracks, trackBuilder, track - tracks->begin()));
139  }
140 
141  // const edm::RefVector< TrackCollection > tracksForArbitration= selectedTracks;
142  Product theRecoVertices = theArbitrator->trackVertexArbitrator(beamSpot, pv, selectedTracks, theSecVertexColl);
143 
144  for (unsigned int ivtx = 0; ivtx < theRecoVertices.size(); ivtx++) {
145  if (!(nTracks(theRecoVertices[ivtx]) > 1))
146  continue;
147  recoVertices->push_back(theRecoVertices[ivtx]);
148  }
149  }
150  event.put(std::move(recoVertices));
151 }
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
const unsigned int nTracks(const reco::Vertex &sv)
std::vector< VTX > Product
edm::EDGetTokenT< Product > token_secondaryVertex
std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
edm::EDGetTokenT< InputContainer > token_tracks
def pv(vc)
Definition: MetAnalyzer.py:7
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
auto const & tracks
cannot be loose
fixed size matrix
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > token_trackBuilder
reco::TransientTrack buildTT(edm::Handle< reco::TrackCollection > &tracks, edm::ESHandle< TransientTrackBuilder > &trackbuilder, unsigned int k)
Definition: TTHelpers.h:10
def move(src, dest)
Definition: eostools.py:511

◆ trackFilter()

template<class InputContainer , class VTX >
bool TemplatedVertexArbitrator< InputContainer, VTX >::trackFilter ( const reco::TrackRef track) const
private

Member Data Documentation

◆ theArbitrator

template<class InputContainer , class VTX >
std::unique_ptr<TrackVertexArbitration<VTX> > TemplatedVertexArbitrator< InputContainer, VTX >::theArbitrator
private

Definition at line 98 of file VertexArbitrators.cc.

◆ token_beamSpot

template<class InputContainer , class VTX >
edm::EDGetTokenT<reco::BeamSpot> TemplatedVertexArbitrator< InputContainer, VTX >::token_beamSpot
private

Definition at line 96 of file VertexArbitrators.cc.

◆ token_primaryVertex

template<class InputContainer , class VTX >
edm::EDGetTokenT<reco::VertexCollection> TemplatedVertexArbitrator< InputContainer, VTX >::token_primaryVertex
private

Definition at line 93 of file VertexArbitrators.cc.

◆ token_secondaryVertex

template<class InputContainer , class VTX >
edm::EDGetTokenT<Product> TemplatedVertexArbitrator< InputContainer, VTX >::token_secondaryVertex
private

Definition at line 94 of file VertexArbitrators.cc.

◆ token_trackBuilder

template<class InputContainer , class VTX >
edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> TemplatedVertexArbitrator< InputContainer, VTX >::token_trackBuilder
private

Definition at line 97 of file VertexArbitrators.cc.

◆ token_tracks

template<class InputContainer , class VTX >
edm::EDGetTokenT<InputContainer> TemplatedVertexArbitrator< InputContainer, VTX >::token_tracks
private

Definition at line 95 of file VertexArbitrators.cc.