CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
PrimaryVertexSorter< ParticlesCollection > Class Template Reference

#include <PrimaryVertexSorter.h>

Inheritance diagram for PrimaryVertexSorter< ParticlesCollection >:
edm::stream::EDProducer<>

Public Types

typedef edm::Association
< reco::VertexCollection
CandToVertex
 
typedef edm::ValueMap< int > CandToVertexQuality
 
typedef ParticlesCollection PFCollection
 
typedef edm::ValueMap< float > VertexScore
 
- 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

 PrimaryVertexSorter (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
std::vector< reco::VertexsortedList (const reco::VertexCollection &primaryVertex) const
 
 ~PrimaryVertexSorter () override
 
- 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
 

Private Member Functions

void doConsumesForTiming (const edm::ParameterSet &iConfig)
 
template<>
void doConsumesForTiming (const edm::ParameterSet &iConfig)
 
template<>
void doConsumesForTiming (const edm::ParameterSet &iConfig)
 
template<>
void doConsumesForTiming (const edm::ParameterSet &iConfig)
 
bool needsProductsForTiming ()
 
template<>
bool needsProductsForTiming ()
 
template<>
bool needsProductsForTiming ()
 
template<>
bool needsProductsForTiming ()
 
std::pair< int,
PrimaryVertexAssignment::Quality
runAlgo (const reco::VertexCollection &vertices, const typename ParticlesCollection::value_type &pf, const edm::ValueMap< float > *trackTimeTag, const edm::ValueMap< float > *trackTimeResoTag, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder)
 
template<>
std::pair< int,
PrimaryVertexAssignment::Quality
runAlgo (const reco::VertexCollection &vertices, const reco::RecoChargedRefCandidate &pf, const edm::ValueMap< float > *trackTimeTag, const edm::ValueMap< float > *trackTimeResoTag, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder)
 
template<>
std::pair< int,
PrimaryVertexAssignment::Quality
runAlgo (const reco::VertexCollection &vertices, const reco::PFCandidate &pf, const edm::ValueMap< float > *trackTimeTag, const edm::ValueMap< float > *trackTimeResoTag, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder)
 
template<>
std::pair< int,
PrimaryVertexAssignment::Quality
runAlgo (const reco::VertexCollection &vertices, const pat::PackedCandidate &pf, const edm::ValueMap< float > *trackTimeTag, const edm::ValueMap< float > *trackTimeResoTag, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder)
 

Private Attributes

PrimaryVertexAssignment assignmentAlgo_
 
bool produceOriginalMapping_
 
bool producePFNoPileUp_
 
bool producePFPileUp_
 
bool produceSortedVertices_
 
int qualityCut_
 
PrimaryVertexSorting sortingAlgo_
 
edm::ESGetToken
< TransientTrackBuilder,
TransientTrackRecord
tokenBuilder_
 
edm::EDGetTokenT< PFCollectiontokenCandidates_
 Candidates to be analyzed. More...
 
edm::EDGetTokenT< edm::View
< reco::Candidate > > 
tokenJets_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
tokenTrackTimeResoTag_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
tokenTrackTimeTag_
 
edm::EDGetTokenT
< reco::VertexCollection
tokenVertices_
 vertices More...
 
bool useMET_
 
bool useTiming_
 

Detailed Description

template<class ParticlesCollection>
class PrimaryVertexSorter< ParticlesCollection >

Author
Andrea Rizzi

class to sort VertexCollection in decreasing order of the sum of the squared track pT's

Definition at line 35 of file PrimaryVertexSorter.h.

Member Typedef Documentation

template<class ParticlesCollection >
typedef edm::Association<reco::VertexCollection> PrimaryVertexSorter< ParticlesCollection >::CandToVertex

Definition at line 37 of file PrimaryVertexSorter.h.

template<class ParticlesCollection >
typedef edm::ValueMap<int> PrimaryVertexSorter< ParticlesCollection >::CandToVertexQuality

Definition at line 38 of file PrimaryVertexSorter.h.

template<class ParticlesCollection >
typedef ParticlesCollection PrimaryVertexSorter< ParticlesCollection >::PFCollection

Definition at line 41 of file PrimaryVertexSorter.h.

template<class ParticlesCollection >
typedef edm::ValueMap<float> PrimaryVertexSorter< ParticlesCollection >::VertexScore

Definition at line 39 of file PrimaryVertexSorter.h.

Constructor & Destructor Documentation

template<class ParticlesCollection >
PrimaryVertexSorter< ParticlesCollection >::PrimaryVertexSorter ( const edm::ParameterSet iConfig)
explicit

Definition at line 90 of file PrimaryVertexSorter.h.

References PrimaryVertexSorter< ParticlesCollection >::doConsumesForTiming(), PrimaryVertexSorter< ParticlesCollection >::produceOriginalMapping_, PrimaryVertexSorter< ParticlesCollection >::producePFNoPileUp_, PrimaryVertexSorter< ParticlesCollection >::producePFPileUp_, PrimaryVertexSorter< ParticlesCollection >::produceSortedVertices_, dt_dqm_sourceclient_common_cff::reco, and PrimaryVertexSorter< ParticlesCollection >::useTiming_.

91  : assignmentAlgo_(iConfig.getParameterSet("assignment")),
92  sortingAlgo_(iConfig.getParameterSet("sorting")),
93  tokenCandidates_(consumes<ParticlesCollection>(iConfig.getParameter<edm::InputTag>("particles"))),
94  tokenVertices_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertices"))),
96  tokenBuilder_(esConsumes(edm::ESInputTag("", "TransientTrackBuilder"))),
97  produceOriginalMapping_(iConfig.getParameter<bool>("produceAssociationToOriginalVertices")),
98  produceSortedVertices_(iConfig.getParameter<bool>("produceSortedVertices")),
99  producePFPileUp_(iConfig.getParameter<bool>("producePileUpCollection")),
100  producePFNoPileUp_(iConfig.getParameter<bool>("produceNoPileUpCollection")),
101  qualityCut_(iConfig.getParameter<int>("qualityForPrimary")),
102  useMET_(iConfig.getParameter<bool>("usePVMET")),
103  useTiming_(iConfig.getParameterSet("assignment").getParameter<bool>("useTiming")) {
104  using namespace std;
105  using namespace edm;
106  using namespace reco;
107 
109  produces<CandToVertex>("original");
110  produces<CandToVertexQuality>("original");
111  produces<VertexScore>("original");
112  }
114  produces<reco::VertexCollection>();
115  produces<CandToVertex>();
116  produces<CandToVertexQuality>();
117  produces<VertexScore>();
118  }
119 
120  if (producePFPileUp_) {
122  produces<PFCollection>("originalPileUp");
124  produces<PFCollection>("PileUp");
125  }
126 
127  if (producePFNoPileUp_) {
129  produces<PFCollection>("originalNoPileUp");
131  produces<PFCollection>("NoPileUp");
132  }
133 
134  if (useTiming_)
135  doConsumesForTiming(iConfig);
136 }
void doConsumesForTiming(const edm::ParameterSet &iConfig)
PrimaryVertexSorting sortingAlgo_
edm::EDGetTokenT< PFCollection > tokenCandidates_
Candidates to be analyzed.
ParameterSet const & getParameterSet(std::string const &) const
PrimaryVertexAssignment assignmentAlgo_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > tokenBuilder_
edm::EDGetTokenT< reco::VertexCollection > tokenVertices_
vertices
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::EDGetTokenT< edm::View< reco::Candidate > > tokenJets_
template<class ParticlesCollection >
PrimaryVertexSorter< ParticlesCollection >::~PrimaryVertexSorter ( )
inlineoverride

Definition at line 45 of file PrimaryVertexSorter.h.

45 {}

Member Function Documentation

template<class ParticlesCollection >
void PrimaryVertexSorter< ParticlesCollection >::doConsumesForTiming ( const edm::ParameterSet iConfig)
private
template<>
void PrimaryVertexSorter< std::vector< reco::RecoChargedRefCandidate > >::doConsumesForTiming ( const edm::ParameterSet iConfig)
inlineprivate

Definition at line 308 of file PrimaryVertexSorter.h.

References edm::ParameterSet::getParameter(), PrimaryVertexSorter< ParticlesCollection >::tokenTrackTimeResoTag_, and PrimaryVertexSorter< ParticlesCollection >::tokenTrackTimeTag_.

309  {
310  tokenTrackTimeTag_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("trackTimeTag"));
311  tokenTrackTimeResoTag_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("trackTimeResoTag"));
312 }
edm::EDGetTokenT< edm::ValueMap< float > > tokenTrackTimeTag_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::ValueMap< float > > tokenTrackTimeResoTag_
template<>
void PrimaryVertexSorter< std::vector< reco::PFCandidate > >::doConsumesForTiming ( const edm::ParameterSet iConfig)
inlineprivate

Definition at line 315 of file PrimaryVertexSorter.h.

315  {
316 }
template<>
void PrimaryVertexSorter< std::vector< pat::PackedCandidate > >::doConsumesForTiming ( const edm::ParameterSet iConfig)
inlineprivate

Definition at line 319 of file PrimaryVertexSorter.h.

320  {}
template<class ParticlesCollection >
bool PrimaryVertexSorter< ParticlesCollection >::needsProductsForTiming ( )
private
template<>
bool PrimaryVertexSorter< std::vector< reco::RecoChargedRefCandidate > >::needsProductsForTiming ( )
inlineprivate

Definition at line 323 of file PrimaryVertexSorter.h.

323  {
324  return true;
325 }
template<>
bool PrimaryVertexSorter< std::vector< reco::PFCandidate > >::needsProductsForTiming ( )
inlineprivate

Definition at line 328 of file PrimaryVertexSorter.h.

328  {
329  return false;
330 }
template<>
bool PrimaryVertexSorter< std::vector< pat::PackedCandidate > >::needsProductsForTiming ( )
inlineprivate

Definition at line 333 of file PrimaryVertexSorter.h.

333  {
334  return false;
335 }
template<class ParticlesCollection >
void PrimaryVertexSorter< ParticlesCollection >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 139 of file PrimaryVertexSorter.h.

References edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), edm::EventSetup::getData(), mps_fire::i, edm::helper::Filler< Map >::insert(), fwrapper::jets, eostools::move(), PrimaryVertexSorter< ParticlesCollection >::needsProductsForTiming(), PrimaryVertexSorter< ParticlesCollection >::produceOriginalMapping_, PrimaryVertexSorter< ParticlesCollection >::producePFNoPileUp_, PrimaryVertexSorter< ParticlesCollection >::producePFPileUp_, PrimaryVertexSorter< ParticlesCollection >::produceSortedVertices_, edm::Event::put(), MetAnalyzer::pv(), PrimaryVertexSorter< ParticlesCollection >::qualityCut_, dt_dqm_sourceclient_common_cff::reco, PrimaryVertexSorter< ParticlesCollection >::runAlgo(), alignCSCRings::s, PrimaryVertexSorter< ParticlesCollection >::sortingAlgo_, PrimaryVertexSorter< ParticlesCollection >::tokenBuilder_, PrimaryVertexSorter< ParticlesCollection >::tokenCandidates_, PrimaryVertexSorter< ParticlesCollection >::tokenJets_, PrimaryVertexSorter< ParticlesCollection >::tokenTrackTimeResoTag_, PrimaryVertexSorter< ParticlesCollection >::tokenTrackTimeTag_, PrimaryVertexSorter< ParticlesCollection >::tokenVertices_, PrimaryVertexSorter< ParticlesCollection >::useMET_, PrimaryVertexSorter< ParticlesCollection >::useTiming_, and beam_dqm_sourceclient-live_cfg::vertices.

139  {
140  using namespace std;
141  using namespace edm;
142  using namespace reco;
143 
145  iEvent.getByToken(tokenJets_, jets);
146 
147  TransientTrackBuilder const& builder = iSetup.getData(tokenBuilder_);
148 
151 
152  Handle<ParticlesCollection> particlesHandle;
153  iEvent.getByToken(tokenCandidates_, particlesHandle);
154 
155  Handle<edm::ValueMap<float>> trackTimeTagHandle;
156  Handle<edm::ValueMap<float>> trackTimeResoTagHandle;
157 
158  const edm::ValueMap<float>* trackTimeTag = nullptr;
159  const edm::ValueMap<float>* trackTimeResoTag = nullptr;
161  iEvent.getByToken(tokenTrackTimeTag_, trackTimeTagHandle);
162  iEvent.getByToken(tokenTrackTimeResoTag_, trackTimeResoTagHandle);
163 
164  trackTimeTag = trackTimeTagHandle.product();
165  trackTimeResoTag = trackTimeResoTagHandle.product();
166  }
167 
168  ParticlesCollection particles = *particlesHandle.product();
169  std::vector<int> pfToPVVector;
170  std::vector<PrimaryVertexAssignment::Quality> pfToPVQualityVector;
171  //reverse mapping
172  std::vector<std::vector<int>> pvToPFVector(vertices->size());
173  std::vector<std::vector<const reco::Candidate*>> pvToCandVector(vertices->size());
174  std::vector<std::vector<PrimaryVertexAssignment::Quality>> pvToPFQualityVector(vertices->size());
175  std::vector<float> vertexScoreOriginal(vertices->size());
176  std::vector<float> vertexScore(vertices->size());
177 
178  for (auto const& pf : particles) {
179  std::pair<int, PrimaryVertexAssignment::Quality> vtxWithQuality =
180  runAlgo(*vertices, pf, trackTimeTag, trackTimeResoTag, *jets, builder);
181  pfToPVVector.push_back(vtxWithQuality.first);
182  pfToPVQualityVector.push_back(vtxWithQuality.second);
183  }
184 
185  //Invert the mapping
186  for (size_t i = 0; i < pfToPVVector.size(); i++) {
187  auto pv = pfToPVVector[i];
188  auto qual = pfToPVQualityVector[i];
189  if (pv >= 0 and qual >= qualityCut_) {
190  pvToPFVector[pv].push_back(i);
191  // std::cout << i << std::endl;
192  // const typename ParticlesCollection::value_type & cp = particles[i];
193  // std::cout << "CP " << &cp << std::endl;
194  pvToCandVector[pv].push_back(&particles[i]);
195  pvToPFQualityVector[pv].push_back(qual);
196  }
197  }
198 
199  //Use multimap for sorting of indices
200  std::multimap<float, int> scores;
201  for (unsigned int i = 0; i < vertices->size(); i++) {
202  float s = sortingAlgo_.score((*vertices)[i], pvToCandVector[i], useMET_);
203  vertexScoreOriginal[i] = s;
204  scores.insert(std::pair<float, int>(-s, i));
205  }
206 
207  //create indices
208  std::vector<int> oldToNew(vertices->size()), newToOld(vertices->size());
209  size_t newIdx = 0;
210  for (auto const& idx : scores) {
211  // std::cout << newIdx << " score: " << idx.first << " oldidx: " << idx.second << " "<< producePFPileUp_ << std::endl;
212  vertexScore[newIdx] = -idx.first;
213  oldToNew[idx.second] = newIdx;
214  newToOld[newIdx] = idx.second;
215  newIdx++;
216  }
217 
219  unique_ptr<CandToVertex> pfCandToOriginalVertexOutput(new CandToVertex(vertices));
220  unique_ptr<CandToVertexQuality> pfCandToOriginalVertexQualityOutput(new CandToVertexQuality());
221  CandToVertex::Filler cand2VertexFiller(*pfCandToOriginalVertexOutput);
222  CandToVertexQuality::Filler cand2VertexQualityFiller(*pfCandToOriginalVertexQualityOutput);
223 
224  cand2VertexFiller.insert(particlesHandle, pfToPVVector.begin(), pfToPVVector.end());
225  cand2VertexQualityFiller.insert(particlesHandle, pfToPVQualityVector.begin(), pfToPVQualityVector.end());
226 
227  cand2VertexFiller.fill();
228  cand2VertexQualityFiller.fill();
229  iEvent.put(std::move(pfCandToOriginalVertexOutput), "original");
230  iEvent.put(std::move(pfCandToOriginalVertexQualityOutput), "original");
231 
232  unique_ptr<VertexScore> vertexScoreOriginalOutput(new VertexScore);
233  VertexScore::Filler vertexScoreOriginalFiller(*vertexScoreOriginalOutput);
234  vertexScoreOriginalFiller.insert(vertices, vertexScoreOriginal.begin(), vertexScoreOriginal.end());
235  vertexScoreOriginalFiller.fill();
236  iEvent.put(std::move(vertexScoreOriginalOutput), "original");
237  }
238 
240  std::vector<int> pfToSortedPVVector;
241  // std::vector<int> pfToSortedPVQualityVector;
242  for (size_t i = 0; i < pfToPVVector.size(); i++) {
243  pfToSortedPVVector.push_back(oldToNew[pfToPVVector[i]]);
244  // pfToSortedPVQualityVector.push_back(pfToPVQualityVector[i]); //same as old!
245  }
246 
247  unique_ptr<reco::VertexCollection> sortedVerticesOutput(new reco::VertexCollection);
248  for (size_t i = 0; i < vertices->size(); i++) {
249  sortedVerticesOutput->push_back((*vertices)[newToOld[i]]);
250  }
251  edm::OrphanHandle<reco::VertexCollection> oh = iEvent.put(std::move(sortedVerticesOutput));
252  unique_ptr<CandToVertex> pfCandToVertexOutput(new CandToVertex(oh));
253  unique_ptr<CandToVertexQuality> pfCandToVertexQualityOutput(new CandToVertexQuality());
254  CandToVertex::Filler cand2VertexFiller(*pfCandToVertexOutput);
255  CandToVertexQuality::Filler cand2VertexQualityFiller(*pfCandToVertexQualityOutput);
256 
257  cand2VertexFiller.insert(particlesHandle, pfToSortedPVVector.begin(), pfToSortedPVVector.end());
258  cand2VertexQualityFiller.insert(particlesHandle, pfToPVQualityVector.begin(), pfToPVQualityVector.end());
259 
260  cand2VertexFiller.fill();
261  cand2VertexQualityFiller.fill();
262  iEvent.put(std::move(pfCandToVertexOutput));
263  iEvent.put(std::move(pfCandToVertexQualityOutput));
264 
265  unique_ptr<VertexScore> vertexScoreOutput(new VertexScore);
266  VertexScore::Filler vertexScoreFiller(*vertexScoreOutput);
267  vertexScoreFiller.insert(oh, vertexScore.begin(), vertexScore.end());
268  vertexScoreFiller.fill();
269  iEvent.put(std::move(vertexScoreOutput));
270  }
271 
272  unique_ptr<PFCollection> pfCollectionNOPUOriginalOutput(new PFCollection);
273  unique_ptr<PFCollection> pfCollectionNOPUOutput(new PFCollection);
274  unique_ptr<PFCollection> pfCollectionPUOriginalOutput(new PFCollection);
275  unique_ptr<PFCollection> pfCollectionPUOutput(new PFCollection);
276 
277  for (size_t i = 0; i < particles.size(); i++) {
278  auto pv = pfToPVVector[i];
279  auto qual = pfToPVQualityVector[i];
280 
282  if (pv == newToOld[0] and qual >= qualityCut_)
283  pfCollectionNOPUOutput->push_back(particles[i]);
284 
286  if (pv != newToOld[0] and qual >= qualityCut_)
287  pfCollectionPUOutput->push_back(particles[i]);
288 
290  if (pv == 0 and qual >= qualityCut_)
291  pfCollectionNOPUOriginalOutput->push_back(particles[i]);
292 
294  if (pv != 0 and qual >= qualityCut_)
295  pfCollectionPUOriginalOutput->push_back(particles[i]);
296  }
298  iEvent.put(std::move(pfCollectionNOPUOutput), "NoPileUp");
300  iEvent.put(std::move(pfCollectionPUOutput), "PileUp");
302  iEvent.put(std::move(pfCollectionNOPUOriginalOutput), "originalNoPileUp");
304  iEvent.put(std::move(pfCollectionPUOriginalOutput), "originalPileUp");
305 }
edm::Association< reco::VertexCollection > CandToVertex
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
PrimaryVertexSorting sortingAlgo_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< PFCollection > tokenCandidates_
Candidates to be analyzed.
bool getData(T &iHolder) const
Definition: EventSetup.h:128
ParticlesCollection PFCollection
vector< PseudoJet > jets
def move
Definition: eostools.py:511
bool needsProductsForTiming()
edm::EDGetTokenT< edm::ValueMap< float > > tokenTrackTimeTag_
helper::Filler< ValueMap< int > > Filler
Definition: ValueMap.h:168
edm::ValueMap< float > VertexScore
edm::ValueMap< int > CandToVertexQuality
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > tokenBuilder_
edm::EDGetTokenT< edm::ValueMap< float > > tokenTrackTimeResoTag_
edm::EDGetTokenT< reco::VertexCollection > tokenVertices_
vertices
edm::EDGetTokenT< edm::View< reco::Candidate > > tokenJets_
std::pair< int, PrimaryVertexAssignment::Quality > runAlgo(const reco::VertexCollection &vertices, const typename ParticlesCollection::value_type &pf, const edm::ValueMap< float > *trackTimeTag, const edm::ValueMap< float > *trackTimeResoTag, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder)
template<class ParticlesCollection >
std::pair<int, PrimaryVertexAssignment::Quality> PrimaryVertexSorter< ParticlesCollection >::runAlgo ( const reco::VertexCollection vertices,
const typename ParticlesCollection::value_type &  pf,
const edm::ValueMap< float > *  trackTimeTag,
const edm::ValueMap< float > *  trackTimeResoTag,
const edm::View< reco::Candidate > &  jets,
const TransientTrackBuilder builder 
)
private
template<>
std::pair< int, PrimaryVertexAssignment::Quality > PrimaryVertexSorter< std::vector< reco::RecoChargedRefCandidate > >::runAlgo ( const reco::VertexCollection vertices,
const reco::RecoChargedRefCandidate pf,
const edm::ValueMap< float > *  trackTimeTag,
const edm::ValueMap< float > *  trackTimeResoTag,
const edm::View< reco::Candidate > &  jets,
const TransientTrackBuilder builder 
)
inlineprivate

Definition at line 339 of file PrimaryVertexSorter.h.

References PrimaryVertexSorter< ParticlesCollection >::assignmentAlgo_, and PrimaryVertexAssignment::chargedHadronVertex().

344  {
345  return assignmentAlgo_.chargedHadronVertex(vertices, pf, trackTimeTag, trackTimeResoTag, jets, builder);
346 }
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::TrackRef &trackRef, const reco::Track *track, float trackTime, float trackTimeResolution, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
PrimaryVertexAssignment assignmentAlgo_
template<>
std::pair< int, PrimaryVertexAssignment::Quality > PrimaryVertexSorter< std::vector< reco::PFCandidate > >::runAlgo ( const reco::VertexCollection vertices,
const reco::PFCandidate pf,
const edm::ValueMap< float > *  trackTimeTag,
const edm::ValueMap< float > *  trackTimeResoTag,
const edm::View< reco::Candidate > &  jets,
const TransientTrackBuilder builder 
)
inlineprivate

Definition at line 349 of file PrimaryVertexSorter.h.

References PrimaryVertexSorter< ParticlesCollection >::assignmentAlgo_, and PrimaryVertexAssignment::chargedHadronVertex().

355  {
356  return assignmentAlgo_.chargedHadronVertex(vertices, pf, jets, builder);
357 }
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::TrackRef &trackRef, const reco::Track *track, float trackTime, float trackTimeResolution, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
PrimaryVertexAssignment assignmentAlgo_
template<>
std::pair< int, PrimaryVertexAssignment::Quality > PrimaryVertexSorter< std::vector< pat::PackedCandidate > >::runAlgo ( const reco::VertexCollection vertices,
const pat::PackedCandidate pf,
const edm::ValueMap< float > *  trackTimeTag,
const edm::ValueMap< float > *  trackTimeResoTag,
const edm::View< reco::Candidate > &  jets,
const TransientTrackBuilder builder 
)
inlineprivate

Definition at line 360 of file PrimaryVertexSorter.h.

References PrimaryVertexSorter< ParticlesCollection >::assignmentAlgo_, and PrimaryVertexAssignment::chargedHadronVertex().

366  {
367  return assignmentAlgo_.chargedHadronVertex(vertices, pf, jets, builder);
368 }
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::TrackRef &trackRef, const reco::Track *track, float trackTime, float trackTimeResolution, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
PrimaryVertexAssignment assignmentAlgo_
template<class ParticlesCollection >
VertexCollection PrimaryVertexSorter< ParticlesCollection >::sortedList ( const reco::VertexCollection primaryVertex) const

Definition at line 7 of file PrimaryVertexSorter.cc.

Referenced by QualityCutsAnalyzer::LoopOverJetTracksAssociation().

7  {
8  VertexCollection pvs = unsortedPVColl;
9  sort(pvs.begin(), pvs.end(), VertexHigherPtSquared());
10  return pvs;
11 }
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9

Member Data Documentation

template<class ParticlesCollection >
PrimaryVertexAssignment PrimaryVertexSorter< ParticlesCollection >::assignmentAlgo_
private
template<class ParticlesCollection >
bool PrimaryVertexSorter< ParticlesCollection >::produceOriginalMapping_
private
template<class ParticlesCollection >
bool PrimaryVertexSorter< ParticlesCollection >::producePFNoPileUp_
private
template<class ParticlesCollection >
bool PrimaryVertexSorter< ParticlesCollection >::producePFPileUp_
private
template<class ParticlesCollection >
bool PrimaryVertexSorter< ParticlesCollection >::produceSortedVertices_
private
template<class ParticlesCollection >
int PrimaryVertexSorter< ParticlesCollection >::qualityCut_
private
template<class ParticlesCollection >
PrimaryVertexSorting PrimaryVertexSorter< ParticlesCollection >::sortingAlgo_
private
template<class ParticlesCollection >
edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> PrimaryVertexSorter< ParticlesCollection >::tokenBuilder_
private
template<class ParticlesCollection >
edm::EDGetTokenT<PFCollection> PrimaryVertexSorter< ParticlesCollection >::tokenCandidates_
private

Candidates to be analyzed.

Definition at line 54 of file PrimaryVertexSorter.h.

Referenced by PrimaryVertexSorter< ParticlesCollection >::produce().

template<class ParticlesCollection >
edm::EDGetTokenT<edm::View<reco::Candidate> > PrimaryVertexSorter< ParticlesCollection >::tokenJets_
private
template<class ParticlesCollection >
edm::EDGetTokenT<edm::ValueMap<float> > PrimaryVertexSorter< ParticlesCollection >::tokenTrackTimeResoTag_
private
template<class ParticlesCollection >
edm::EDGetTokenT<edm::ValueMap<float> > PrimaryVertexSorter< ParticlesCollection >::tokenTrackTimeTag_
private
template<class ParticlesCollection >
edm::EDGetTokenT<reco::VertexCollection> PrimaryVertexSorter< ParticlesCollection >::tokenVertices_
private

vertices

Definition at line 57 of file PrimaryVertexSorter.h.

Referenced by PrimaryVertexSorter< ParticlesCollection >::produce().

template<class ParticlesCollection >
bool PrimaryVertexSorter< ParticlesCollection >::useMET_
private
template<class ParticlesCollection >
bool PrimaryVertexSorter< ParticlesCollection >::useTiming_
private