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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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::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 TemplatedVertexArbitrator.h.

Member Typedef Documentation

◆ Product

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

Definition at line 51 of file TemplatedVertexArbitrator.h.

Constructor & Destructor Documentation

◆ TemplatedVertexArbitrator()

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

Definition at line 102 of file TemplatedVertexArbitrator.h.

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 }

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

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  }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), HLT_FULL_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 114 of file TemplatedVertexArbitrator.h.

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 }

References pwdgSkimBPark_cfi::beamSpot, tthelpers::buildTT(), edm::EventSetup::getHandle(), eostools::move(), nTracks(), zMuMuMuonUserData::primaryVertices, MetAnalyzer::pv(), HLT_FULL_cff::secondaryVertices, TrackCollections2monitor_cff::selectedTracks, HLT_FULL_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 98 of file TemplatedVertexArbitrator.h.

◆ token_beamSpot

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

Definition at line 96 of file TemplatedVertexArbitrator.h.

◆ token_primaryVertex

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

Definition at line 93 of file TemplatedVertexArbitrator.h.

◆ token_secondaryVertex

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

Definition at line 94 of file TemplatedVertexArbitrator.h.

◆ token_trackBuilder

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

Definition at line 97 of file TemplatedVertexArbitrator.h.

◆ token_tracks

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

Definition at line 95 of file TemplatedVertexArbitrator.h.

nTracks
const unsigned int nTracks(const reco::Vertex &sv)
Definition: TemplatedVertexArbitrator.h:45
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
TemplatedVertexArbitrator::token_trackBuilder
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > token_trackBuilder
Definition: TemplatedVertexArbitrator.h:97
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
TrackVertexArbitration
Definition: TrackVertexArbitration.h:54
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TemplatedVertexArbitrator::token_primaryVertex
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
Definition: TemplatedVertexArbitrator.h:93
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:96
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle< TransientTrackBuilder >
TemplatedVertexArbitrator::theArbitrator
std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
Definition: TemplatedVertexArbitrator.h:98
TemplatedVertexArbitrator::token_tracks
edm::EDGetTokenT< InputContainer > token_tracks
Definition: TemplatedVertexArbitrator.h:95
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
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
HLT_FULL_cff.secondaryVertices
secondaryVertices
Definition: HLT_FULL_cff.py:51955
TemplatedVertexArbitrator::Product
std::vector< VTX > Product
Definition: TemplatedVertexArbitrator.h:51
eostools.move
def move(src, dest)
Definition: eostools.py:511
relativeConstraints.value
value
Definition: relativeConstraints.py:53
TemplatedVertexArbitrator::token_secondaryVertex
edm::EDGetTokenT< Product > token_secondaryVertex
Definition: TemplatedVertexArbitrator.h:94
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