CMS 3D CMS Logo

PFCandidate.cc
Go to the documentation of this file.
2 //#include "DataFormats/ParticleFlowReco/interface/PFBlock.h"
3 
12 
14 
15 #include <ostream>
16 #include <iomanip>
17 
18 using namespace reco;
19 using namespace std;
20 
21 const float PFCandidate::bigMva_ = -999.;
22 
24 
26  : elementsInBlocks_(nullptr),
27  ecalERatio_(1.),
28  hcalERatio_(1.),
29  hoERatio_(1.),
30  rawEcalEnergy_(0.),
31  rawHcalEnergy_(0.),
32  rawHoEnergy_(0.),
33  ps1Energy_(0.),
34  ps2Energy_(0.),
35  flags_(0),
36  deltaP_(0.),
37  vertexType_(kCandVertex),
38  mva_Isolated_(bigMva_),
39  mva_e_pi_(bigMva_),
40  mva_e_mu_(bigMva_),
41  mva_pi_mu_(bigMva_),
42  mva_nothing_gamma_(bigMva_),
43  mva_nothing_nh_(bigMva_),
44  mva_gamma_nh_(bigMva_),
45  getter_(nullptr),
46  storedRefsBitPattern_(0),
47  time_(0.f),
48  timeError_(-1.f) {
50 
52  refsInfo_.reserve(3);
54 }
55 
56 PFCandidate::PFCandidate(const PFCandidatePtr& sourcePtr) : PFCandidate(*sourcePtr) {
57  sourcePtr_ = sourcePtr;
58  hcalDepthEnergyFractions_ = sourcePtr->hcalDepthEnergyFractions_; // GP not sure it's needed
59 }
60 
62  :
63 
65  elementsInBlocks_(nullptr),
66  ecalERatio_(1.),
67  hcalERatio_(1.),
68  hoERatio_(1.),
69  rawEcalEnergy_(0.),
70  rawHcalEnergy_(0.),
71  rawHoEnergy_(0.),
72  ps1Energy_(0.),
73  ps2Energy_(0.),
74  flags_(0),
75  deltaP_(0.),
76  vertexType_(kCandVertex),
77  mva_Isolated_(bigMva_),
78  mva_e_pi_(bigMva_),
79  mva_e_mu_(bigMva_),
80  mva_pi_mu_(bigMva_),
81  mva_nothing_gamma_(bigMva_),
82  mva_nothing_nh_(bigMva_),
83  mva_gamma_nh_(bigMva_),
84  getter_(nullptr),
85  storedRefsBitPattern_(0),
86  time_(0.f),
87  timeError_(-1.f) {
88  refsInfo_.reserve(3);
90  elementsStorage_.reserve(10);
92 
94 
95  // proceed with various consistency checks
96 
97  // charged candidate: track ref and charge must be non null
98  if (partId == h || partId == e || partId == mu) {
99  if (charge == 0) {
100  string err;
101  err += "Attempt to construct a charged PFCandidate with a zero charge";
102  throw cms::Exception("InconsistentValue", err.c_str());
103  }
104  } else {
105  if (charge) {
106  string err;
107  err += "Attempt to construct a neutral PFCandidate ";
108  err += "with a non-zero charge";
109  throw cms::Exception("InconsistentValue", err.c_str());
110  }
111  }
113 }
114 
116  : CompositeCandidate(iOther),
117  elementsInBlocks_(nullptr),
118  blocksStorage_(iOther.blocksStorage_),
119  elementsStorage_(iOther.elementsStorage_),
120  sourcePtr_(iOther.sourcePtr_),
121  muonTrackType_(iOther.muonTrackType_),
122  ecalERatio_(iOther.ecalERatio_),
123  hcalERatio_(iOther.hcalERatio_),
124  hoERatio_(iOther.hoERatio_),
125  rawEcalEnergy_(iOther.rawEcalEnergy_),
126  rawHcalEnergy_(iOther.rawHcalEnergy_),
127  rawHoEnergy_(iOther.rawHoEnergy_),
128  ps1Energy_(iOther.ps1Energy_),
129  ps2Energy_(iOther.ps2Energy_),
130  flags_(iOther.flags_),
131  deltaP_(iOther.deltaP_),
132  vertexType_(iOther.vertexType_),
133  mva_Isolated_(iOther.mva_Isolated_),
134  mva_e_pi_(iOther.mva_e_pi_),
135  mva_e_mu_(iOther.mva_e_mu_),
136  mva_pi_mu_(iOther.mva_pi_mu_),
137  mva_nothing_gamma_(iOther.mva_nothing_gamma_),
138  mva_nothing_nh_(iOther.mva_nothing_nh_),
139  mva_gamma_nh_(iOther.mva_gamma_nh_),
140  positionAtECALEntrance_(iOther.positionAtECALEntrance_),
141  getter_(iOther.getter_),
142  storedRefsBitPattern_(iOther.storedRefsBitPattern_),
143  refsInfo_(iOther.refsInfo_),
144  refsCollectionCache_(iOther.refsCollectionCache_),
145  time_(iOther.time_),
146  timeError_(iOther.timeError_),
147  hcalDepthEnergyFractions_(iOther.hcalDepthEnergyFractions_) {
148  auto tmp = iOther.elementsInBlocks_.load(std::memory_order_acquire);
149  if (nullptr != tmp) {
150  elementsInBlocks_.store(new ElementsInBlocks{*tmp}, std::memory_order_release);
151  }
152 }
153 
156  auto tmp = iOther.elementsInBlocks_.load(std::memory_order_acquire);
157  if (nullptr != tmp) {
158  delete elementsInBlocks_.exchange(new ElementsInBlocks{*tmp}, std::memory_order_acq_rel);
159  } else {
160  delete elementsInBlocks_.exchange(nullptr, std::memory_order_acq_rel);
161  }
164  sourcePtr_ = iOther.sourcePtr_;
166  ecalERatio_ = iOther.ecalERatio_;
167  hcalERatio_ = iOther.hcalERatio_;
168  hoERatio_ = iOther.hoERatio_;
171  rawHoEnergy_ = iOther.rawHoEnergy_;
172  ps1Energy_ = iOther.ps1Energy_;
173  ps2Energy_ = iOther.ps2Energy_;
174  flags_ = iOther.flags_;
175  deltaP_ = iOther.deltaP_;
176  vertexType_ = iOther.vertexType_;
177  mva_Isolated_ = iOther.mva_Isolated_;
178  mva_e_pi_ = iOther.mva_e_pi_;
179  mva_e_mu_ = iOther.mva_e_mu_;
180  mva_pi_mu_ = iOther.mva_pi_mu_;
183  mva_gamma_nh_ = iOther.mva_gamma_nh_;
185  getter_ = iOther.getter_;
187  refsInfo_ = iOther.refsInfo_;
189  time_ = iOther.time_;
190  timeError_ = iOther.timeError_;
192  return *this;
193 }
194 
195 PFCandidate::~PFCandidate() { delete elementsInBlocks_.load(std::memory_order_acquire); }
196 
197 PFCandidate* PFCandidate::clone() const { return new PFCandidate(*this); }
198 
199 void PFCandidate::addElementInBlock(const reco::PFBlockRef& blockref, unsigned elementIndex) {
200  //elementsInBlocks_.push_back( make_pair(blockref.key(), elementIndex) );
201  if (blocksStorage_.empty())
202  blocksStorage_ = Blocks(blockref.id());
203  blocksStorage_.push_back(blockref);
204  elementsStorage_.push_back(elementIndex);
205  auto ptr = elementsInBlocks_.exchange(nullptr);
206  delete ptr;
207 }
208 
210  switch (std::abs(pdgid)) {
211  case 211:
212  return h;
213  case 11:
214  return e;
215  case 13:
216  return mu;
217  case 22:
218  return gamma;
219  case 130:
220  return h0;
221  case 1:
222  return h_HF;
223  case 2:
224  return egamma_HF;
225  case 0:
226  return X;
227  default:
228  return X;
229  }
230 }
231 
233  int thecharge = charge();
234 
235  switch (type) {
236  case h:
237  return thecharge * 211; // pi+
238  case e:
239  return thecharge * (-11);
240  case mu:
241  return thecharge * (-13);
242  case gamma:
243  return 22;
244  case h0:
245  return 130; // K_L0
246  case h_HF:
247  return 1; // dummy pdg code
248  case egamma_HF:
249  return 2; // dummy pdg code
250  case X:
251  default:
252  return 0;
253  }
254 }
255 
257 
259  CandidatePtr myPtr = sourceCandidatePtr(0);
260  if (myPtr.isNull())
261  return false;
262  for (size_t i = 0, n = other.numberOfSourceCandidatePtrs(); i < n; ++i) {
263  CandidatePtr otherPtr = other.sourceCandidatePtr(i);
264  if ((otherPtr == myPtr) || (sourcePtr_.isNonnull() && otherPtr.isNonnull() && sourcePtr_->overlap(*otherPtr))) {
265  return true;
266  }
267  }
268  return false;
269 }
270 
271 void PFCandidate::rescaleMomentum(double rescaleFactor) {
272  LorentzVector rescaledp4 = p4();
273  rescaledp4 *= rescaleFactor;
274  setP4(rescaledp4);
275 }
276 
277 void PFCandidate::setFlag(Flags theFlag, bool value) {
278  if (value)
279  flags_ = flags_ | (1 << theFlag);
280  else
281  flags_ = flags_ ^ (1 << theFlag);
282 }
283 
284 bool PFCandidate::flag(Flags theFlag) const { return (flags_ >> theFlag) & 1; }
285 
286 ostream& reco::operator<<(ostream& out, const PFCandidate& c) {
287  if (!out)
288  return out;
289 
290  out << "\tPFCandidate type: " << c.particleId();
291  out << setiosflags(ios::right);
292  out << setiosflags(ios::fixed);
293  out << setprecision(3);
294  out << " E/pT/eta/phi " << c.energy() << "/" << c.pt() << "/" << c.eta() << "/" << c.phi();
295  if (c.flag(PFCandidate::T_FROM_DISP))
296  out << ", T_FROM_DISP" << endl;
297  else if (c.flag(PFCandidate::T_TO_DISP))
298  out << ", T_TO_DISP" << endl;
299  else if (c.flag(PFCandidate::T_FROM_GAMMACONV))
300  out << ", T_FROM_GAMMACONV" << endl;
301  else if (c.flag(PFCandidate::GAMMA_TO_GAMMACONV))
302  out << ", GAMMA_TO_GAMMACONV" << endl;
303 
304  out << ", blocks/iele: ";
305 
306  PFCandidate::ElementsInBlocks eleInBlocks = c.elementsInBlocks();
307  for (unsigned i = 0; i < eleInBlocks.size(); i++) {
308  PFBlockRef blockRef = eleInBlocks[i].first;
309  unsigned indexInBlock = eleInBlocks[i].second;
310 
311  out << "(" << blockRef.key() << "|" << indexInBlock << "), ";
312  }
313 
314  out << " source:" << c.sourcePtr_.id() << "/" << c.sourcePtr_.key();
315 
316  // PFBlockRef blockRef = c.block();
317  // int blockid = blockRef.key();
318  // const edm::OwnVector< reco::PFBlockElement >& elements = c.elements();
319  // out<< "\t# of elements " << elements.size()
320  // <<" from block " << blockid << endl;
321 
322  // // print each element in turn
323 
324  // for(unsigned ie=0; ie<elements.size(); ie++) {
325  // out<<"\t"<< elements[ie] <<endl;
326  // }
327 
328  // Improved printout for electrons if PFCandidateElectronExtra is available
329  if (c.particleId() == PFCandidate::e && c.electronExtraRef().isNonnull() && c.electronExtraRef().isAvailable()) {
330  out << std::endl << *(c.electronExtraRef());
331  }
332  out << resetiosflags(ios::right | ios::fixed);
333  return out;
334 }
335 
336 static unsigned long long bitPackRefInfo(const edm::RefCore& iCore, size_t iIndex) {
337  unsigned long long bitPack = iIndex;
338  bitPack |= static_cast<unsigned long long>(iCore.id().productIndex()) << 32;
339  bitPack |= static_cast<unsigned long long>(iCore.id().processIndex()) << 48;
340  return bitPack;
341 }
342 
343 void PFCandidate::storeRefInfo(unsigned int iMask,
344  unsigned int iBit,
345  bool iIsValid,
346  const edm::RefCore& iCore,
347  size_t iKey,
348  const edm::EDProductGetter* iGetter) {
349  size_t index = s_refsBefore[storedRefsBitPattern_ & iMask];
350  if (nullptr == getter_) {
351  getter_ = iGetter;
352  }
353 
354  if (iIsValid) {
355  if (0 == (storedRefsBitPattern_ & iBit)) {
356  refsInfo_.insert(refsInfo_.begin() + index, bitPackRefInfo(iCore, iKey));
357  if (iGetter == nullptr)
358  refsCollectionCache_.insert(refsCollectionCache_.begin() + index, static_cast<void const*>(iCore.productPtr()));
359  else
360  refsCollectionCache_.insert(refsCollectionCache_.begin() + index, nullptr);
361  } else {
362  assert(refsInfo_.size() > index);
363  *(refsInfo_.begin() + index) = bitPackRefInfo(iCore, iKey);
364  if (iGetter == nullptr)
365  *(refsCollectionCache_.begin() + index) = static_cast<void const*>(iCore.productPtr());
366  else
367  *(refsCollectionCache_.begin() + index) = nullptr;
368  }
369  storedRefsBitPattern_ |= iBit;
370  } else {
371  if (storedRefsBitPattern_ & iBit) {
372  refsInfo_.erase(refsInfo_.begin() + index);
374  storedRefsBitPattern_ ^= iBit;
375  }
376  }
377 }
378 
380  unsigned int iMask, unsigned int iBit, edm::ProductID& oProductID, size_t& oIndex, size_t& aIndex) const {
381  if (0 == (iBit & storedRefsBitPattern_)) {
382  return false;
383  }
384  aIndex = s_refsBefore[storedRefsBitPattern_ & iMask];
385  unsigned long long bitPacked = refsInfo_[aIndex];
386  oIndex = bitPacked & 0xFFFFFFFFULL; //low 32 bits are the index
387  unsigned short productIndex = (bitPacked & 0x0000FFFF00000000ULL) >> 32;
388  unsigned short processIndex = (bitPacked & 0xFFFF000000000000ULL) >> 48;
389  oProductID = edm::ProductID(processIndex, productIndex);
390  return true;
391 }
392 
394  if (!charge()) {
395  string err;
396  err += "PFCandidate::setTrackRef: this is a neutral candidate! ";
397  err += "particleId_=";
398  char num[4];
399  sprintf(num, "%d", particleId());
400  err += num;
401 
402  throw cms::Exception("InconsistentReference", err.c_str());
403  }
404 
405  storeRefInfo(kRefTrackMask, kRefTrackBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
406 }
407 
409 
411  if (trackRef() != iRef->track()) {
412  string err;
413  err += "PFCandidate::setMuonRef: inconsistent track references!";
414 
415  throw cms::Exception("InconsistentReference", err.c_str());
416  }
417 
418  storeRefInfo(kRefMuonMask, kRefMuonBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
419 }
420 
422 
425  // Removed by F. Beaudette. Would like to be able to save the GsfTrackRef even for charged pions
426  // if( particleId() != e ) {
427  // string err;
428  // err += "PFCandidate::setGsfTrackRef: this is not an electron ! particleId_=";
429  // char num[4];
430  // sprintf( num, "%d", particleId());
431  // err += num;
432  //
433  // throw cms::Exception("InconsistentReference",
434  // err.c_str() );
435  // }
436 
438 }
439 
441 
444  if (particleId() != h) {
445  string err;
446  err += "PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
447  char num[4];
448  sprintf(num, "%d", particleId());
449  err += num;
450 
451  throw cms::Exception("InconsistentReference", err.c_str());
452  } else if (!flag(T_FROM_DISP) && !flag(T_TO_DISP)) {
453  string err;
454  err += "PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";
455 
456  throw cms::Exception("InconsistentReference", err.c_str());
457  }
458 
459  if (type == T_TO_DISP && flag(T_TO_DISP))
462  iRef.isNonnull(),
463  iRef.refCore(),
464  iRef.key(),
465  iRef.productGetter());
466  else if (type == T_FROM_DISP && flag(T_FROM_DISP))
469  iRef.isNonnull(),
470  iRef.refCore(),
471  iRef.key(),
472  iRef.productGetter());
473  else if ((type == T_FROM_DISP && !flag(T_FROM_DISP)) || (type == T_TO_DISP && !flag(T_TO_DISP))) {
474  string err;
475  err += "PFCandidate::setDisplacedVertexRef: particule flag is not switched on";
476 
477  throw cms::Exception("InconsistentReference", err.c_str());
478  }
479 }
480 
482  if (type == T_TO_DISP) {
484  } else if (type == T_FROM_DISP) {
486  }
488 }
489 
492  if (particleId() != gamma) {
493  string err;
494  err += "PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
495  char num[4];
496  sprintf(num, "%d", particleId());
497  err += num;
498 
499  throw cms::Exception("InconsistentReference", err.c_str());
500  } else if (!flag(GAMMA_TO_GAMMACONV)) {
501  string err;
502  err += "PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";
503 
504  throw cms::Exception("InconsistentReference", err.c_str());
505  }
506 
507  storeRefInfo(
508  kRefConversionMask, kRefConversionBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
509 }
510 
513 }
514 
517  storeRefInfo(kRefV0Mask, kRefV0Bit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
518 }
519 
522 }
523 
526  storeRefInfo(
527  kRefGsfElectronMask, kRefGsfElectronBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
528 }
529 
532 }
533 
538  iRef.isNonnull(),
539  iRef.refCore(),
540  iRef.key(),
541  iRef.productGetter());
542 }
543 
546 }
547 
549 
552 }
553 
556 }
557 
560 }
561 
563  if (particleId() != gamma && particleId() != e) {
564  string err;
565  err += "PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
566  char num[4];
567  sprintf(num, "%d", particleId());
568  err += num;
569 
570  throw cms::Exception("InconsistentReference", err.c_str());
571  }
572 
573  storeRefInfo(kRefPhotonMask, kRefPhotonBit, iRef.isNonnull(), iRef.refCore(), iRef.key(), iRef.productGetter());
574 }
575 
577  if (particleId() != gamma && particleId() != e) {
578  string err;
579  err += "PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
580  char num[4];
581  sprintf(num, "%d", particleId());
582  err += num;
583 
584  throw cms::Exception("InconsistentReference", err.c_str());
585  }
586 
587  storeRefInfo(
589 }
590 
592  storeRefInfo(
594 }
595 
597  //std::cout << " before storeRefInfo " << kRefPFEGammaExtraMask << " " << kRefPFEGammaExtraBit << " " << iRef.isNonnull() << " " << iRef.key() << " " << std::endl;
598  storeRefInfo(
600 }
601 
603  switch (vertexType_) {
604  case kCandVertex:
605  return LeafCandidate::vertex();
606  break;
607  case kTrkVertex:
608  return trackRef()->vertex();
609  break;
610  case kComMuonVertex:
611  return muonRef()->combinedMuon()->vertex();
612  break;
613  case kSAMuonVertex:
614  return muonRef()->standAloneMuon()->vertex();
615  break;
616  case kTrkMuonVertex:
617  return muonRef()->track()->vertex();
618  break;
619  case kTPFMSMuonVertex:
620  return muonRef()->tpfmsTrack()->vertex();
621  break;
622  case kPickyMuonVertex:
623  return muonRef()->pickyTrack()->vertex();
624  break;
625  case kDYTMuonVertex:
626  return muonRef()->dytTrack()->vertex();
627  break;
628 
629  case kGSFVertex:
630  return gsfTrackRef()->vertex();
631  break;
632  }
633  return LeafCandidate::vertex();
634 }
635 
637  if (nullptr == elementsInBlocks_.load(std::memory_order_acquire)) {
638  std::unique_ptr<ElementsInBlocks> temp(new ElementsInBlocks(blocksStorage_.size()));
639  for (unsigned int icopy = 0; icopy != blocksStorage_.size(); ++icopy)
640  (*temp)[icopy] = std::make_pair(blocksStorage_[icopy], elementsStorage_[icopy]);
641  ElementsInBlocks* expected = nullptr;
642  if (elementsInBlocks_.compare_exchange_strong(expected, temp.get(), std::memory_order_acq_rel)) {
643  temp.release();
644  }
645  }
646  return *(elementsInBlocks_.load(std::memory_order_acquire));
647 }
reco::PFCandidate::trackRef
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:408
reco::PFCandidate::kCandVertex
Definition: PFCandidate.h:75
reco::PFCandidate::sourcePtr_
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Definition: PFCandidate.h:450
reco::LeafCandidate::setPdgId
void setPdgId(int pdgId) final
Definition: LeafCandidate.h:178
reco::PFCandidate::hcalDepthEnergyFractions_
std::array< float, 7 > hcalDepthEnergyFractions_
Definition: PFCandidate.h:532
edm::RefVector::reserve
void reserve(size_type n)
Reserve space for RefVector.
Definition: RefVector.h:108
reco::PFCandidate::addElementInBlock
void addElementInBlock(const reco::PFBlockRef &blockref, unsigned elementIndex)
add an element to the current PFCandidate
Definition: PFCandidate.cc:199
reco::Conversion
Definition: Conversion.h:23
kRefPFPhotonExtraMask
Definition: CountBits.h:4651
reco::PFCandidate::getter_
const edm::EDProductGetter * getter_
Definition: PFCandidate.h:522
edm::RefCore
Definition: RefCore.h:21
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
reco::PFCandidate::setPhotonRef
void setPhotonRef(const reco::PhotonRef &phRef)
set ref to the corresponding reco::Photon if any
Definition: PFCandidate.cc:562
mps_fire.i
i
Definition: mps_fire.py:355
reco::PFCandidate::timeError_
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:530
Muon.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
reco::PFCandidate::T_FROM_GAMMACONV
Definition: PFCandidate.h:70
reco::PFCandidate::operator=
PFCandidate & operator=(PFCandidate const &)
Definition: PFCandidate.cc:154
reco::PFCandidate::setDisplacedVertexRef
void setDisplacedVertexRef(const reco::PFDisplacedVertexRef &ref, Flags flag)
set displaced vertex reference
Definition: PFCandidate.cc:443
reco::PFCandidate::photonRef
reco::PhotonRef photonRef() const
return a reference to the corresponding Photon if any
Definition: PFCandidate.cc:548
kRefV0Bit
Definition: CountBits.h:4632
reco::PFCandidate::e
Definition: PFCandidate.h:46
reco::PFCandidate::ps1Energy_
float ps1Energy_
corrected PS1 energy
Definition: PFCandidate.h:475
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
reco::PFCandidate::rawHcalEnergy_
float rawHcalEnergy_
raw HCAL energy
Definition: PFCandidate.h:469
PFCandidate.h
reco::LeafCandidate::index
unsigned int index
Definition: LeafCandidate.h:31
reco::PFCandidate::setPFEGammaExtraRef
void setPFEGammaExtraRef(const reco::PFCandidateEGammaExtraRef &ref)
set the PF EGamma Extra Ref
Definition: PFCandidate.cc:596
reco::SuperCluster
Definition: SuperCluster.h:18
reco::PFCandidate::flag
bool flag(Flags theFlag) const
return a given flag
Definition: PFCandidate.cc:284
reco::PFCandidatePhotonExtra
Definition: PFCandidatePhotonExtra.h:16
reco::PFCandidate::h
Definition: PFCandidate.h:45
reco::Candidate::Charge
int Charge
electric charge type
Definition: Candidate.h:34
reco::PFCandidate::hcalERatio_
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
Definition: PFCandidate.h:460
reco::PFCandidate::h_HF
Definition: PFCandidate.h:50
cms::cuda::assert
assert(be >=bs)
kRefConversionMask
Definition: CountBits.h:4646
reco::PFCandidate::vertex
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:602
reco::LeafCandidate::operator=
LeafCandidate & operator=(LeafCandidate &&)=default
kRefV0Mask
Definition: CountBits.h:4647
edm::ProductID::processIndex
ProcessIndex processIndex() const
Definition: ProductID.h:33
kRefSuperClusterBit
Definition: CountBits.h:4637
reco::PFCandidate::setGsfElectronRef
void setGsfElectronRef(const reco::GsfElectronRef &ref)
set GsfElectronRef
Definition: PFCandidate.cc:525
reco::PFCandidate::refsInfo_
std::vector< unsigned long long > refsInfo_
Definition: PFCandidate.h:524
reco::VertexCompositeCandidate
Definition: VertexCompositeCandidate.h:16
reco::PFCandidate::mva_pi_mu_
float mva_pi_mu_
mva for pi-muon discrimination
Definition: PFCandidate.h:498
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::PFCandidate::blocksStorage_
Blocks blocksStorage_
Definition: PFCandidate.h:445
reco::PFCandidate::sourceCandidatePtr
CandidatePtr sourceCandidatePtr(size_type i) const override
Definition: PFCandidate.h:123
reco::PFCandidate::elementsInBlocks
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:636
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
kRefDisplacedVertexDauBit
Definition: CountBits.h:4629
reco::PFCandidate::setSuperClusterRef
void setSuperClusterRef(const reco::SuperClusterRef &scRef)
Definition: PFCandidate.cc:576
kRefDisplacedVertexDauMask
Definition: CountBits.h:4644
reco::PFCandidateEGammaExtra
Definition: PFCandidateEGammaExtra.h:25
reco::PFCandidate::positionAtECALEntrance_
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance, from the PFRecTrack
Definition: PFCandidate.h:510
reco::PFCandidate::kDYTMuonVertex
Definition: PFCandidate.h:83
kRefPFElectronExtraMask
Definition: CountBits.h:4649
reco::PFCandidate::mva_e_pi_
float mva_e_pi_
mva for electron-pion discrimination
Definition: PFCandidate.h:492
reco::PFCandidate::X
Definition: PFCandidate.h:44
reco::Muon
Definition: Muon.h:27
edm::Ref< PFBlockCollection >
reco::PFCandidate::hoERatio_
float hoERatio_
corrected HO energy ratio (corrected/raw)
Definition: PFCandidate.h:463
reco::PFCandidate::kSAMuonVertex
Definition: PFCandidate.h:78
reco::PFCandidate::egammaExtraRef
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
Definition: PFCandidate.cc:554
edm::EDProductGetter
Definition: EDProductGetter.h:32
reco::GsfTrack
Definition: GsfTrack.h:12
reco::PFCandidate::displacedVertexRef
reco::PFDisplacedVertexRef displacedVertexRef(Flags type) const
Definition: PFCandidate.cc:481
Photon.h
reco::PFCandidate::ecalERatio_
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
Definition: PFCandidate.h:457
reco::PFCandidate::muonRef
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:421
reco::PFCandidate::mva_nothing_nh_
float mva_nothing_nh_
mva for neutral hadron detection
Definition: PFCandidate.h:504
reco::PFCandidate::time_
float time_
timing information (valid if timeError_ >= 0)
Definition: PFCandidate.h:528
h
kRefDisplacedVertexMotBit
Definition: CountBits.h:4630
PFCandidatePhotonExtra.h
reco::PFCandidate::mu
Definition: PFCandidate.h:47
edm::RefVector::empty
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:99
kRefConversionBit
Definition: CountBits.h:4631
kRefTrackMask
Definition: CountBits.h:4641
edm::ProductID::productIndex
ProcessIndex productIndex() const
Definition: ProductID.h:34
reco::PFCandidate::setFlag
void setFlag(Flags theFlag, bool value)
set a given flag
Definition: PFCandidate.cc:277
s_refsBefore
static const unsigned int s_refsBefore[]
Definition: CountBits.h:14
reco::PFCandidate::setTrackRef
void setTrackRef(const reco::TrackRef &ref)
set track reference
Definition: PFCandidate.cc:393
reco::PFCandidate::overlap
bool overlap(const Candidate &) const override
Polymorphic overlap.
Definition: PFCandidate.cc:258
reco::PFCandidate::rawHoEnergy_
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:472
reco::PFCandidate::elementsStorage_
Elements elementsStorage_
Definition: PFCandidate.h:446
reco::Track
Definition: Track.h:27
reco::PFCandidate::mva_e_mu_
float mva_e_mu_
mva for electron-muon discrimination
Definition: PFCandidate.h:495
trackingPlots.other
other
Definition: trackingPlots.py:1465
reco::PFCandidate::elementsInBlocks_
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:441
reco::GsfElectron
Definition: GsfElectron.h:35
reco::PFCandidate::refsCollectionCache_
std::vector< const void * > refsCollectionCache_
Definition: PFCandidate.h:525
reco::PFCandidate::setConversionRef
void setConversionRef(const reco::ConversionRef &ref)
set ref to original reco conversion
Definition: PFCandidate.cc:491
kRefPFEGammaExtraMask
Definition: CountBits.h:4653
reco::PFCandidate::rescaleMomentum
void rescaleMomentum(double rescaleFactor)
particle momentum *= rescaleFactor
Definition: PFCandidate.cc:271
reco::PFCandidate::ElementsInBlocks
std::vector< ElementInBlock > ElementsInBlocks
Definition: PFCandidate.h:378
reco::PFCandidate::Blocks
edm::RefVector< reco::PFBlockCollection > Blocks
Definition: PFCandidate.h:380
reco::PFCandidate::~PFCandidate
~PFCandidate() override
destructor
Definition: PFCandidate.cc:195
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
reco::PFCandidate::getRefInfo
bool getRefInfo(unsigned int iMask, unsigned int iBit, edm::ProductID &oProdID, size_t &oIndex, size_t &aIndex) const
Definition: PFCandidate.cc:379
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
reco::PFCandidate::PFCandidate
PFCandidate()
default constructor
Definition: PFCandidate.cc:25
reco::PFCandidate::setV0Ref
void setV0Ref(const reco::VertexCompositeCandidateRef &ref)
set ref to original reco conversion
Definition: PFCandidate.cc:516
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::PFCandidate::kGSFVertex
Definition: PFCandidate.h:80
reco::PFCandidate::gsfTrackRef
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:440
reco::PFDisplacedVertex
Block of elements.
Definition: PFDisplacedVertex.h:23
reco::PFCandidate::photonExtraRef
reco::PFCandidatePhotonExtraRef photonExtraRef() const
return a reference to the photon extra
Definition: PFCandidate.cc:550
kRefPFElectronExtraBit
Definition: CountBits.h:4634
kRefTrackBit
Definition: CountBits.h:4626
runTheMatrix.err
err
Definition: runTheMatrix.py:288
reco::PFCandidate::v0Ref
reco::VertexCompositeCandidateRef v0Ref() const
return a reference to the original conversion
Definition: PFCandidate.cc:520
PFDisplacedVertex.h
reco::PFCandidate::particleId
virtual ParticleType particleId() const
Definition: PFCandidate.h:366
reco::PFCandidate::muonTrackType_
reco::Muon::MuonTrackType muonTrackType_
Definition: PFCandidate.h:454
kRefGsfElectronMask
Definition: CountBits.h:4648
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::PFCandidateElectronExtra
Definition: PFCandidateElectronExtra.h:16
reco::PFCandidate::T_FROM_DISP
Definition: PFCandidate.h:68
reco::PFCandidate::egamma_HF
Definition: PFCandidate.h:51
reco::PFCandidate::electronExtraRef
reco::PFCandidateElectronExtraRef electronExtraRef() const
return a reference to the electron extra
Definition: PFCandidate.cc:544
reco::PFCandidate::kTPFMSMuonVertex
Definition: PFCandidate.h:81
CountBits.h
reco::PFCandidate::vertexType_
PFVertexType vertexType_
Definition: PFCandidate.h:486
reco::PFCandidate::GAMMA_TO_GAMMACONV
Definition: PFCandidate.h:71
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
p4
double p4[4]
Definition: TauolaWrapper.h:92
value
Definition: value.py:1
GsfTrack.h
kRefPhotonMask
Definition: CountBits.h:4650
reco::operator<<
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
reco::PFCandidate::superClusterRef
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any
Definition: PFCandidate.cc:558
reco::PFCandidate::gamma
Definition: PFCandidate.h:48
reco::PFCandidate::clone
PFCandidate * clone() const override
return a clone
Definition: PFCandidate.cc:197
reco::LeafCandidate::charge
int charge() const final
electric charge
Definition: LeafCandidate.h:106
edm::RefCore::id
ProductID id() const
Definition: RefCore.h:48
reco::PFCandidate::translateTypeToPdgId
int translateTypeToPdgId(ParticleType type) const
Definition: PFCandidate.cc:232
kRefSuperClusterMask
Definition: CountBits.h:4652
reco::PFCandidate::rawEcalEnergy_
float rawEcalEnergy_
raw ECAL energy
Definition: PFCandidate.h:466
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::Ref::refCore
RefCore const & refCore() const
Definition: Ref.h:265
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
reco::PFCandidate::kTrkMuonVertex
Definition: PFCandidate.h:79
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
reco::PFCandidate::storeRefInfo
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:343
reco::LeafCandidate::vertex
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: LeafCandidate.h:165
edm::Ptr< PFCandidate >
reco::Candidate
Definition: Candidate.h:27
edm::RefCore::productPtr
void const * productPtr() const
Definition: RefCore.h:51
kRefGsfTrackMask
Definition: CountBits.h:4642
reco::Photon
Definition: Photon.h:21
reco::PFCandidate::setGsfTrackRef
void setGsfTrackRef(const reco::GsfTrackRef &ref)
set gsftrack reference
Definition: PFCandidate.cc:424
edm::Ref::id
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
type
type
Definition: HCALResponse.h:21
GETREF
#define GETREF(_class_, _mask_, _bit_)
Definition: CountBits.h:4656
std
Definition: JetResolutionObject.h:76
reco::PFCandidate::bigMva_
static const float bigMva_
Definition: PFCandidate.h:385
kRefPFPhotonExtraBit
Definition: CountBits.h:4636
kRefMuonMask
Definition: CountBits.h:4643
bitPackRefInfo
static unsigned long long bitPackRefInfo(const edm::RefCore &iCore, size_t iIndex)
Definition: PFCandidate.cc:336
PFCandidateEGammaExtra.h
reco::PFCandidate::T_TO_DISP
Definition: PFCandidate.h:67
reco::PFCandidate::h0
Definition: PFCandidate.h:49
Exception
Definition: hltDiff.cc:246
reco::Candidate::index
unsigned int index
index type
Definition: Candidate.h:50
reco::PFCandidate::storedRefsBitPattern_
unsigned short storedRefsBitPattern_
Definition: PFCandidate.h:523
reco::PFCandidate::mva_Isolated_
float mva_Isolated_
Definition: PFCandidate.h:489
reco::PFCandidate::translatePdgIdToType
ParticleType translatePdgIdToType(int pdgid) const
Definition: PFCandidate.cc:209
reco::PFCandidate::kComMuonVertex
Definition: PFCandidate.h:77
edm::Ptr::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
Exception.h
reco::PFCandidate::flags_
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
Definition: PFCandidate.h:481
kRefPhotonBit
Definition: CountBits.h:4635
reco::PFCandidate::kPickyMuonVertex
Definition: PFCandidate.h:82
edm::Ref::productGetter
EDProductGetter const * productGetter() const
Accessor for product getter.
Definition: Ref.h:247
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
reco::PFCandidate::conversionRef
reco::ConversionRef conversionRef() const
return a reference to the original conversion
Definition: PFCandidate.cc:511
kRefDisplacedVertexMotMask
Definition: CountBits.h:4645
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
kRefMuonBit
Definition: CountBits.h:4628
reco::PFCandidate::kTrkVertex
Definition: PFCandidate.h:76
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
reco::PFCandidate::ps2Energy_
float ps2Energy_
corrected PS2 energy
Definition: PFCandidate.h:478
reco::PFCandidate::ParticleType
ParticleType
particle types
Definition: PFCandidate.h:43
reco::PFCandidate::setMuonRef
void setMuonRef(const reco::MuonRef &ref)
set muon reference
Definition: PFCandidate.cc:410
reco::Muon::None
Definition: Muon.h:36
EgammaValidation_cff.pdgid
pdgid
Definition: EgammaValidation_cff.py:30
edm::RefVector::size
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
kRefGsfTrackBit
Definition: CountBits.h:4627
reco::PFCandidate::gsfElectronRef
reco::GsfElectronRef gsfElectronRef() const
return a reference to the corresponding GsfElectron if any
Definition: PFCandidate.cc:530
reco::PFCandidate::setPFElectronExtraRef
void setPFElectronExtraRef(const reco::PFCandidateElectronExtraRef &ref)
set the PF Electron Extra Ref
Definition: PFCandidate.cc:535
kRefPFEGammaExtraBit
Definition: CountBits.h:4638
edm::Ptr::isNull
bool isNull() const
Checks for null.
Definition: Ptr.h:142
reco::PFCandidate::setPFPhotonExtraRef
void setPFPhotonExtraRef(const reco::PFCandidatePhotonExtraRef &ref)
set the PF Photon Extra Ref
Definition: PFCandidate.cc:591
reco::PFCandidate::deltaP_
float deltaP_
uncertainty on 3-momentum
Definition: PFCandidate.h:484
reco::PFCandidate::setParticleType
void setParticleType(ParticleType type)
set Particle Type
Definition: PFCandidate.cc:256
edm::ProductID
Definition: ProductID.h:27
reco::PFCandidate::Flags
Flags
Definition: PFCandidate.h:54
reco::CompositeCandidate
Definition: CompositeCandidate.h:21
PFCandidateElectronExtra.h
reco::PFCandidate::mva_nothing_gamma_
float mva_nothing_gamma_
mva for gamma detection
Definition: PFCandidate.h:501
kRefGsfElectronBit
Definition: CountBits.h:4633
reco::PFCandidate::mva_gamma_nh_
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
Definition: PFCandidate.h:507
reco::PFDisplacedVertexRef
edm::Ref< PFDisplacedVertexCollection > PFDisplacedVertexRef
persistent reference to a PFDisplacedVertex objects
Definition: PFDisplacedVertexFwd.h:16
Conversion.h