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

#include <TemplatedVertexArbitrator.h>

Inheritance diagram for TemplatedVertexArbitrator< InputContainer, VTX >:
edm::stream::EDProducer<>

Public Types

typedef std::vector< VTX > Product
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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::EDGetTokenT< InputContainer > token_tracks
 

Detailed Description

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

Definition at line 48 of file TemplatedVertexArbitrator.h.

Member Typedef Documentation

◆ Product

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

Definition at line 50 of file TemplatedVertexArbitrator.h.

Constructor & Destructor Documentation

◆ TemplatedVertexArbitrator()

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

Definition at line 100 of file TemplatedVertexArbitrator.h.

100  {
101  token_primaryVertex = consumes<reco::VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
102  token_secondaryVertex = consumes<Product>(params.getParameter<edm::InputTag>("secondaryVertices"));
103  token_beamSpot = consumes<reco::BeamSpot>(params.getParameter<edm::InputTag>("beamSpot"));
104  token_tracks = consumes<InputContainer>(params.getParameter<edm::InputTag>("tracks"));
105  produces<Product>();
107 }

References CalibrationSummaryClient_cfi::params.

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 53 of file TemplatedVertexArbitrator.h.

53  {
55  pdesc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
56  pdesc.add<edm::InputTag>("primaryVertices", edm::InputTag("offlinePrimaryVertices"));
58  pdesc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
59  pdesc.add<edm::InputTag>("secondaryVertices", edm::InputTag("vertexMerger"));
61  pdesc.add<edm::InputTag>("tracks", edm::InputTag("particleFlow"));
62  pdesc.add<edm::InputTag>("secondaryVertices", edm::InputTag("candidateVertexMerger"));
63  } else {
64  pdesc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
65  pdesc.add<edm::InputTag>("secondaryVertices", edm::InputTag("vertexMerger"));
66  }
67  pdesc.add<double>("dLenFraction", 0.333);
68  pdesc.add<double>("dRCut", 0.4);
69  pdesc.add<double>("distCut", 0.04);
70  pdesc.add<double>("sigCut", 5.0);
71  pdesc.add<double>("fitterSigmacut", 3.0);
72  pdesc.add<double>("fitterTini", 256);
73  pdesc.add<double>("fitterRatio", 0.25);
74  pdesc.add<int>("trackMinLayers", 4);
75  pdesc.add<double>("trackMinPt", 0.4);
76  pdesc.add<int>("trackMinPixels", 1);
77  pdesc.add<double>("maxTimeSignificance", 3.5);
79  cdesc.add("trackVertexArbitratorDefault", pdesc);
81  cdesc.add("candidateVertexArbitratorDefault", pdesc);
82  } else {
83  cdesc.addDefault(pdesc);
84  }
85  }

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

◆ produce()

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

Definition at line 110 of file TemplatedVertexArbitrator.h.

110  {
111  using namespace reco;
112 
114  event.getByToken(token_secondaryVertex, secondaryVertices);
115  Product theSecVertexColl = *(secondaryVertices.product());
116 
118  event.getByToken(token_primaryVertex, primaryVertices);
119 
120  auto recoVertices = std::make_unique<Product>();
121  if (!primaryVertices->empty()) {
122  const reco::Vertex &pv = (*primaryVertices)[0];
123 
125  event.getByToken(token_tracks, tracks);
126 
128  es.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
129 
131  event.getByToken(token_beamSpot, beamSpot);
132 
133  std::vector<TransientTrack> selectedTracks;
134  for (typename InputContainer::const_iterator track = tracks->begin(); track != tracks->end(); ++track) {
135  selectedTracks.push_back(tthelpers::buildTT(tracks, trackBuilder, track - tracks->begin()));
136  }
137 
138  // const edm::RefVector< TrackCollection > tracksForArbitration= selectedTracks;
139  Product theRecoVertices = theArbitrator->trackVertexArbitrator(beamSpot, pv, selectedTracks, theSecVertexColl);
140 
141  for (unsigned int ivtx = 0; ivtx < theRecoVertices.size(); ivtx++) {
142  if (!(nTracks(theRecoVertices[ivtx]) > 1))
143  continue;
144  recoVertices->push_back(theRecoVertices[ivtx]);
145  }
146  }
147  event.put(std::move(recoVertices));
148 }

References pwdgSkimBPark_cfi::beamSpot, tthelpers::buildTT(), reco::get(), edm::EventSetup::get(), eostools::move(), nTracks(), zMuMuMuonUserData::primaryVertices, MetAnalyzer::pv(), HLT_2018_cff::secondaryVertices, TrackCollections2monitor_cff::selectedTracks, HLT_2018_cff::track, and PDWG_EXOHSCP_cff::tracks.

◆ 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 96 of file TemplatedVertexArbitrator.h.

◆ token_beamSpot

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

Definition at line 95 of file TemplatedVertexArbitrator.h.

◆ token_primaryVertex

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

Definition at line 92 of file TemplatedVertexArbitrator.h.

◆ token_secondaryVertex

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

Definition at line 93 of file TemplatedVertexArbitrator.h.

◆ token_tracks

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

Definition at line 94 of file TemplatedVertexArbitrator.h.

nTracks
const unsigned int nTracks(const reco::Vertex &sv)
Definition: TemplatedVertexArbitrator.h:44
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
HLT_2018_cff.secondaryVertices
secondaryVertices
Definition: HLT_2018_cff.py:50429
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
TrackVertexArbitration
Definition: TrackVertexArbitration.h:54
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TemplatedVertexArbitrator::token_primaryVertex
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
Definition: TemplatedVertexArbitrator.h:92
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
TemplatedVertexArbitrator::token_beamSpot
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
Definition: TemplatedVertexArbitrator.h:95
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TransientTrackRecord
Definition: TransientTrackRecord.h:11
edm::ESHandle< TransientTrackBuilder >
TemplatedVertexArbitrator::theArbitrator
std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
Definition: TemplatedVertexArbitrator.h:96
TemplatedVertexArbitrator::token_tracks
edm::EDGetTokenT< InputContainer > token_tracks
Definition: TemplatedVertexArbitrator.h:94
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
zMuMuMuonUserData.primaryVertices
primaryVertices
Definition: zMuMuMuonUserData.py:12
tthelpers::buildTT
reco::TransientTrack buildTT(edm::Handle< reco::TrackCollection > &tracks, edm::ESHandle< TransientTrackBuilder > &trackbuilder, unsigned int k)
Definition: TTHelpers.h:10
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
get
#define get
TemplatedVertexArbitrator::Product
std::vector< VTX > Product
Definition: TemplatedVertexArbitrator.h:50
eostools.move
def move(src, dest)
Definition: eostools.py:511
relativeConstraints.value
value
Definition: relativeConstraints.py:53
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
TemplatedVertexArbitrator::token_secondaryVertex
edm::EDGetTokenT< Product > token_secondaryVertex
Definition: TemplatedVertexArbitrator.h:93
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
TrackCollections2monitor_cff.selectedTracks
selectedTracks
Definition: TrackCollections2monitor_cff.py:32