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

virtual 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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 52 of file TemplatedVertexArbitrator.h.

Member Typedef Documentation

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

Definition at line 54 of file TemplatedVertexArbitrator.h.

Constructor & Destructor Documentation

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

Definition at line 105 of file TemplatedVertexArbitrator.h.

References edm::ParameterSet::getParameter(), TemplatedVertexArbitrator< InputContainer, VTX >::theArbitrator, TemplatedVertexArbitrator< InputContainer, VTX >::token_beamSpot, TemplatedVertexArbitrator< InputContainer, VTX >::token_primaryVertex, TemplatedVertexArbitrator< InputContainer, VTX >::token_secondaryVertex, and TemplatedVertexArbitrator< InputContainer, VTX >::token_tracks.

106 {
107  token_primaryVertex = consumes<reco::VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
108  token_secondaryVertex = consumes<Product>(params.getParameter<edm::InputTag>("secondaryVertices"));
109  token_beamSpot = consumes<reco::BeamSpot>(params.getParameter<edm::InputTag>("beamSpot"));
110  token_tracks = consumes<InputContainer>(params.getParameter<edm::InputTag>("tracks"));
111  produces<Product>();
112  theArbitrator.reset( new TrackVertexArbitration<VTX>(params) );
113 }
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
T getParameter(std::string const &) const
edm::EDGetTokenT< Product > token_secondaryVertex
std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
edm::EDGetTokenT< InputContainer > token_tracks
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex

Member Function Documentation

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

Definition at line 57 of file TemplatedVertexArbitrator.h.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), TemplatedVertexArbitrator< InputContainer, VTX >::produce(), HiIsolationCommonParameters_cff::track, TemplatedVertexArbitrator< InputContainer, VTX >::trackFilter(), and relativeConstraints::value.

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

Definition at line 116 of file TemplatedVertexArbitrator.h.

References ecalDrivenElectronSeedsParameters_cff::beamSpot, tthelpers::buildTT(), edm::EventSetup::get(), eostools::move(), nTracks(), jets_cff::primaryVertices, edm::Handle< T >::product(), MetAnalyzer::pv(), lostTracks_cfi::secondaryVertices, trackingPlots::selectedTracks, TemplatedVertexArbitrator< InputContainer, VTX >::theArbitrator, TemplatedVertexArbitrator< InputContainer, VTX >::token_beamSpot, TemplatedVertexArbitrator< InputContainer, VTX >::token_primaryVertex, TemplatedVertexArbitrator< InputContainer, VTX >::token_secondaryVertex, TemplatedVertexArbitrator< InputContainer, VTX >::token_tracks, HiIsolationCommonParameters_cff::track, and l1t::tracks.

Referenced by TemplatedVertexArbitrator< InputContainer, VTX >::fillDescriptions().

117 {
118  using namespace reco;
119 
121  event.getByToken(token_secondaryVertex, secondaryVertices);
122  Product theSecVertexColl = *(secondaryVertices.product());
123 
125  event.getByToken(token_primaryVertex, primaryVertices);
126 
127  auto recoVertices = std::make_unique<Product>();
128  if(primaryVertices->size()!=0){
129  const reco::Vertex &pv = (*primaryVertices)[0];
130 
132  event.getByToken(token_tracks, tracks);
133 
135  es.get<TransientTrackRecord>().get("TransientTrackBuilder",
136  trackBuilder);
137 
139  event.getByToken(token_beamSpot,beamSpot);
140 
141  std::vector<TransientTrack> selectedTracks;
142  for(typename InputContainer::const_iterator track = tracks->begin();
143  track != tracks->end(); ++track) {
144  selectedTracks.push_back(tthelpers::buildTT(tracks,trackBuilder,track - tracks->begin()));
145  }
146 
147 
148  // const edm::RefVector< TrackCollection > tracksForArbitration= selectedTracks;
149  Product theRecoVertices = theArbitrator->trackVertexArbitrator(beamSpot, pv, selectedTracks,
150  theSecVertexColl);
151 
152  for(unsigned int ivtx=0; ivtx < theRecoVertices.size(); ivtx++){
153  if ( !(nTracks(theRecoVertices[ivtx]) > 1) ) continue;
154  recoVertices->push_back(theRecoVertices[ivtx]);
155  }
156 
157  }
158  event.put(std::move(recoVertices));
159 
160 
161 
162 }
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
const unsigned int nTracks(const reco::Vertex &sv)
edm::EDGetTokenT< Product > token_secondaryVertex
std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
edm::EDGetTokenT< InputContainer > token_tracks
def pv(vc)
Definition: MetAnalyzer.py:7
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
T const * product() const
Definition: Handle.h:74
primaryVertices
Definition: jets_cff.py:24
fixed size matrix
T get() const
Definition: EventSetup.h:71
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
template<class InputContainer , class VTX >
bool TemplatedVertexArbitrator< InputContainer, VTX >::trackFilter ( const reco::TrackRef track) const
private

Member Data Documentation

template<class InputContainer , class VTX >
std::unique_ptr<TrackVertexArbitration<VTX> > TemplatedVertexArbitrator< InputContainer, VTX >::theArbitrator
private
template<class InputContainer , class VTX >
edm::EDGetTokenT<reco::BeamSpot> TemplatedVertexArbitrator< InputContainer, VTX >::token_beamSpot
private
template<class InputContainer , class VTX >
edm::EDGetTokenT<reco::VertexCollection> TemplatedVertexArbitrator< InputContainer, VTX >::token_primaryVertex
private
template<class InputContainer , class VTX >
edm::EDGetTokenT<Product> TemplatedVertexArbitrator< InputContainer, VTX >::token_secondaryVertex
private
template<class InputContainer , class VTX >
edm::EDGetTokenT<InputContainer> TemplatedVertexArbitrator< InputContainer, VTX >::token_tracks
private