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 
22 
23 const float PFCandidate::bigMva_ = -999.;
24 
25 
27 
28 
29 
30 
32  elementsInBlocks_(nullptr),
33  ecalERatio_(1.),
34  hcalERatio_(1.),
35  hoERatio_(1.),
36  rawEcalEnergy_(0.),
37  rawHcalEnergy_(0.),
38  rawHoEnergy_(0.),
39  ps1Energy_(0.),
40  ps2Energy_(0.),
41  flags_(0),
42  deltaP_(0.),
43  vertexType_(kCandVertex),
44  mva_Isolated_(bigMva_),
45  mva_e_pi_(bigMva_),
46  mva_e_mu_(bigMva_),
47  mva_pi_mu_(bigMva_),
48  mva_nothing_gamma_(bigMva_),
49  mva_nothing_nh_(bigMva_),
50  mva_gamma_nh_(bigMva_),
51  getter_(nullptr),storedRefsBitPattern_(0),
52  time_(0.f),timeError_(-1.f)
53 {
54 
56 
58  refsInfo_.reserve(3);
59 }
60 
61 
63  PFCandidate(*sourcePtr)
64 {
65  sourcePtr_ = sourcePtr;
66 }
67 
68 
70  const LorentzVector & p4,
71  ParticleType partId ) :
72 
73  CompositeCandidate(charge, p4),
75  ecalERatio_(1.),
76  hcalERatio_(1.),
77  hoERatio_(1.),
78  rawEcalEnergy_(0.),
79  rawHcalEnergy_(0.),
80  rawHoEnergy_(0.),
81  ps1Energy_(0.),
82  ps2Energy_(0.),
83  flags_(0),
84  deltaP_(0.),
94  time_(0.f),timeError_(-1.f)
95 {
96  refsInfo_.reserve(3);
98  elementsStorage_.reserve(10);
99 
101 
102  // proceed with various consistency checks
103 
104  // charged candidate: track ref and charge must be non null
105  if( partId == h ||
106  partId == e ||
107  partId == mu ) {
108 
109  if( charge == 0 ) {
110  string err;
111  err+="Attempt to construct a charged PFCandidate with a zero charge";
112  throw cms::Exception("InconsistentValue",
113  err.c_str() );
114  }
115  }
116  else {
117  if( charge ) {
118  string err;
119  err += "Attempt to construct a neutral PFCandidate ";
120  err += "with a non-zero charge";
121  throw cms::Exception("InconsistentValue",
122  err.c_str() );
123  }
124  }
125  setPdgId( translateTypeToPdgId( partId ) );
126 }
127 
128 PFCandidate::PFCandidate( PFCandidate const& iOther) :
129  CompositeCandidate(iOther),
130  elementsInBlocks_(nullptr),
133  sourcePtr_(iOther.sourcePtr_),
135  ecalERatio_(iOther.ecalERatio_),
136  hcalERatio_(iOther.hcalERatio_),
137  hoERatio_(iOther.hoERatio_),
140  rawHoEnergy_(iOther.rawHoEnergy_),
141  ps1Energy_(iOther.ps1Energy_),
142  ps2Energy_(iOther.ps2Energy_),
143  flags_(iOther.flags_),
144  deltaP_(iOther.deltaP_),
145  vertexType_(iOther.vertexType_),
147  mva_e_pi_(iOther.mva_e_pi_),
148  mva_e_mu_(iOther.mva_e_mu_),
149  mva_pi_mu_(iOther.mva_pi_mu_),
154  getter_(iOther.getter_),
156  refsInfo_(iOther.refsInfo_),
158  time_(iOther.time_),timeError_(iOther.timeError_)
159 {
160  auto tmp = iOther.elementsInBlocks_.load(std::memory_order_acquire);
161  if(nullptr != tmp) {
162  elementsInBlocks_.store( new ElementsInBlocks{*tmp}, std::memory_order_release);
163  }
164 }
165 
168  auto tmp = iOther.elementsInBlocks_.load(std::memory_order_acquire);
169  if(nullptr != tmp) {
170  delete elementsInBlocks_.exchange( new ElementsInBlocks{*tmp}, std::memory_order_acq_rel);
171  } else {
172  delete elementsInBlocks_.exchange(nullptr, std::memory_order_acq_rel);
173  }
176  sourcePtr_=iOther.sourcePtr_;
178  ecalERatio_=iOther.ecalERatio_;
179  hcalERatio_=iOther.hcalERatio_;
180  hoERatio_=iOther.hoERatio_;
183  rawHoEnergy_=iOther.rawHoEnergy_;
184  ps1Energy_=iOther.ps1Energy_;
185  ps2Energy_=iOther.ps2Energy_;
186  flags_=iOther.flags_;
187  deltaP_=iOther.deltaP_;
188  vertexType_=iOther.vertexType_;
190  mva_e_pi_=iOther.mva_e_pi_;
191  mva_e_mu_=iOther.mva_e_mu_;
192  mva_pi_mu_=iOther.mva_pi_mu_;
197  getter_=iOther.getter_;
199  refsInfo_=iOther.refsInfo_;
201  time_=iOther.time_;
202  timeError_=iOther.timeError_;
203 
204  return *this;
205 }
206 
208  delete elementsInBlocks_.load(std::memory_order_acquire);
209 }
210 
212  return new PFCandidate( * this );
213 }
214 
215 
217  unsigned elementIndex ) {
218  //elementsInBlocks_.push_back( make_pair(blockref.key(), elementIndex) );
219  if (blocksStorage_.empty())
220  blocksStorage_ =Blocks(blockref.id());
221  blocksStorage_.push_back(blockref);
222  elementsStorage_.push_back(elementIndex);
223  auto ptr = elementsInBlocks_.exchange(nullptr);
224  delete ptr;
225 }
226 
227 
228 
230  switch (std::abs(pdgid)) {
231  case 211: return h;
232  case 11: return e;
233  case 13: return mu;
234  case 22: return gamma;
235  case 130: return h0;
236  case 1: return h_HF;
237  case 2: return egamma_HF;
238  case 0: return X;
239  default: return X;
240  }
241 }
242 
244 
245  int thecharge = charge();
246 
247  switch( type ) {
248  case h: return thecharge*211; // pi+
249  case e: return thecharge*(-11);
250  case mu: return thecharge*(-13);
251  case gamma: return 22;
252  case h0: return 130; // K_L0
253  case h_HF: return 1; // dummy pdg code
254  case egamma_HF: return 2; // dummy pdg code
255  case X:
256  default: return 0;
257  }
258 }
259 
260 
262  setPdgId( translateTypeToPdgId( type ) );
263 }
264 
265 
267  CandidatePtr myPtr = sourceCandidatePtr(0);
268  if (myPtr.isNull()) return false;
269  for (size_t i = 0, n = other.numberOfSourceCandidatePtrs(); i < n; ++i) {
270  CandidatePtr otherPtr = other.sourceCandidatePtr(i);
271  if ((otherPtr == myPtr) ||
272  (sourcePtr_.isNonnull() && otherPtr.isNonnull() && sourcePtr_->overlap(*otherPtr))) {
273  return true;
274  }
275  }
276  return false;
277 }
278 
279 
280 
281 
282 
283 void PFCandidate::rescaleMomentum( double rescaleFactor ) {
284  LorentzVector rescaledp4 = p4();
285  rescaledp4 *= rescaleFactor;
286  setP4( rescaledp4 );
287 }
288 
289 
290 void PFCandidate::setFlag(Flags theFlag, bool value) {
291 
292  if(value)
293  flags_ = flags_ | (1<<theFlag);
294  else
295  flags_ = flags_ ^ (1<<theFlag);
296 }
297 
298 
299 
300 bool PFCandidate::flag(Flags theFlag) const {
301 
302  return (flags_>>theFlag) & 1;
303 }
304 
305 
306 
307 
308 ostream& reco::operator<<(ostream& out,
309  const PFCandidate& c ) {
310 
311  if(!out) return out;
312 
313  out<<"\tPFCandidate type: "<<c.particleId();
314  out<<setiosflags(ios::right);
315  out<<setiosflags(ios::fixed);
316  out<<setprecision(3);
317  out<<" E/pT/eta/phi "
318  <<c.energy()<<"/"
319  <<c.pt()<<"/"
320  <<c.eta()<<"/"
321  <<c.phi();
322  if( c.flag( PFCandidate::T_FROM_DISP ) ) out<<", T_FROM_DISP" << endl;
323  else if( c.flag( PFCandidate::T_TO_DISP ) ) out<<", T_TO_DISP" << endl;
324  else if( c.flag( PFCandidate::T_FROM_GAMMACONV ) ) out<<", T_FROM_GAMMACONV" << endl;
325  else if( c.flag( PFCandidate::GAMMA_TO_GAMMACONV ) ) out<<", GAMMA_TO_GAMMACONV" << endl;
326 
327  out<<", blocks/iele: ";
328 
330  for(unsigned i=0; i<eleInBlocks.size(); i++) {
331  PFBlockRef blockRef = eleInBlocks[i].first;
332  unsigned indexInBlock = eleInBlocks[i].second;
333 
334  out<<"("<<blockRef.key()<<"|"<<indexInBlock<<"), ";
335  }
336 
337  out<<" source:"<<c.sourcePtr_.id()<<"/"<<c.sourcePtr_.key();
338 
339 // PFBlockRef blockRef = c.block();
340 // int blockid = blockRef.key();
341 // const edm::OwnVector< reco::PFBlockElement >& elements = c.elements();
342 // out<< "\t# of elements " << elements.size()
343 // <<" from block " << blockid << endl;
344 
345 // // print each element in turn
346 
347 // for(unsigned ie=0; ie<elements.size(); ie++) {
348 // out<<"\t"<< elements[ie] <<endl;
349 // }
350 
351  // Improved printout for electrons if PFCandidateElectronExtra is available
353  out << std::endl << *(c.electronExtraRef()) ;
354  }
355  out<<resetiosflags(ios::right|ios::fixed);
356  return out;
357 }
358 
359 static unsigned long long bitPackRefInfo(const edm::RefCore& iCore, size_t iIndex){
360  unsigned long long bitPack = iIndex;
361  bitPack |= static_cast<unsigned long long>(iCore.id().productIndex())<<32;
362  bitPack |= static_cast<unsigned long long>(iCore.id().processIndex())<<48;
363  return bitPack;
364 }
365 
366 void PFCandidate::storeRefInfo(unsigned int iMask,
367  unsigned int iBit,
368  bool iIsValid,
369  const edm::RefCore& iCore,
370  size_t iKey,
371  const edm::EDProductGetter* iGetter) {
372 
373  size_t index = s_refsBefore[storedRefsBitPattern_ & iMask];
374  if ( nullptr == getter_) {
375  getter_ = iGetter;
376  }
377 
378  if(iIsValid) {
379  if(0 == (storedRefsBitPattern_ & iBit) ) {
380  refsInfo_.insert(refsInfo_.begin()+index, bitPackRefInfo(iCore,iKey));
381  if (iGetter==nullptr)
383  static_cast<void const*>(iCore.productPtr()));
384  else
385  refsCollectionCache_.insert(refsCollectionCache_.begin()+index,nullptr);
386  } else {
387  assert(refsInfo_.size()>index);
388  *(refsInfo_.begin()+index)=bitPackRefInfo(iCore,iKey);
389  if (iGetter==nullptr)
390  *(refsCollectionCache_.begin()+index)=static_cast<void const*>(iCore.productPtr());
391  else
392  *(refsCollectionCache_.begin()+index)=nullptr;
393 
394  }
395  storedRefsBitPattern_ |= iBit;
396  } else{
397  if( storedRefsBitPattern_ & iBit) {
398  refsInfo_.erase(refsInfo_.begin()+index);
400  storedRefsBitPattern_ ^= iBit;
401  }
402  }
403 
404 }
405 
406 bool PFCandidate::getRefInfo(unsigned int iMask, unsigned int iBit,
407  edm::ProductID& oProductID, size_t& oIndex, size_t& aIndex) const {
408 
409  if( 0 == (iBit & storedRefsBitPattern_) ) {
410  return false;
411  }
412  aIndex = s_refsBefore[storedRefsBitPattern_ & iMask];
413  unsigned long long bitPacked = refsInfo_[aIndex];
414  oIndex = bitPacked & 0xFFFFFFFFULL; //low 32 bits are the index
415  unsigned short productIndex = (bitPacked & 0x0000FFFF00000000ULL)>>32;
416  unsigned short processIndex = (bitPacked & 0xFFFF000000000000ULL)>>48;
417  oProductID = edm::ProductID(processIndex,productIndex);
418  return true;
419 }
420 
422  if(!charge()) {
423  string err;
424  err += "PFCandidate::setTrackRef: this is a neutral candidate! ";
425  err += "particleId_=";
426  char num[4];
427  sprintf( num, "%d", particleId());
428  err += num;
429 
430  throw cms::Exception("InconsistentReference",
431  err.c_str() );
432  }
433 
435  iRef.refCore(), iRef.key(),iRef.productGetter());
436 }
437 
439 
440 
442 
443  if( trackRef() != iRef->track() ) {
444  string err;
445  err += "PFCandidate::setMuonRef: inconsistent track references!";
446 
447  throw cms::Exception("InconsistentReference",
448  err.c_str() );
449  }
450 
452  iRef.refCore(), iRef.key(),iRef.productGetter());
453 }
454 
456 
457 
460 // Removed by F. Beaudette. Would like to be able to save the GsfTrackRef even for charged pions
461 // if( particleId() != e ) {
462 // string err;
463 // err += "PFCandidate::setGsfTrackRef: this is not an electron ! particleId_=";
464 // char num[4];
465 // sprintf( num, "%d", particleId());
466 // err += num;
467 //
468 // throw cms::Exception("InconsistentReference",
469 // err.c_str() );
470 // }
471 
473  iRef.refCore(), iRef.key(),iRef.productGetter());
474 }
475 
477 
478 
481 
482  if( particleId() != h ) {
483  string err;
484  err += "PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
485  char num[4];
486  sprintf( num, "%d", particleId());
487  err += num;
488 
489  throw cms::Exception("InconsistentReference",
490  err.c_str() );
491  }
492  else if( !flag( T_FROM_DISP ) && !flag( T_TO_DISP ) ) {
493  string err;
494  err += "PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";
495 
496  throw cms::Exception("InconsistentReference",
497  err.c_str() );
498  }
499 
500 
501  if (type == T_TO_DISP && flag( T_TO_DISP ))
503  iRef.isNonnull(),
504  iRef.refCore(), iRef.key(),iRef.productGetter());
505  else if (type == T_FROM_DISP && flag( T_FROM_DISP ))
507  iRef.isNonnull(),
508  iRef.refCore(), iRef.key(),iRef.productGetter());
509  else if ( (type == T_FROM_DISP && !flag( T_FROM_DISP ))
510  ||
511  (type == T_TO_DISP && !flag( T_TO_DISP )) ){
512  string err;
513  err += "PFCandidate::setDisplacedVertexRef: particule flag is not switched on";
514 
515  throw cms::Exception("InconsistentReference",
516  err.c_str() );
517  }
518 
519 }
520 
521 
522 
523 
525  if (type == T_TO_DISP) {
527  }
528  else if (type == T_FROM_DISP) {
530  }
532 }
533 
536  if( particleId() != gamma ) {
537  string err;
538  err += "PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
539  char num[4];
540  sprintf( num, "%d", particleId());
541  err += num;
542 
543  throw cms::Exception("InconsistentReference",
544  err.c_str() );
545  }
546  else if( !flag( GAMMA_TO_GAMMACONV ) ) {
547  string err;
548  err += "PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";
549 
550  throw cms::Exception("InconsistentReference",
551  err.c_str() );
552  }
553 
555  iRef.refCore(), iRef.key(),iRef.productGetter());
556 }
557 
558 
561 }
562 
566  iRef.refCore(), iRef.key(),iRef.productGetter());
567 }
568 
571 }
572 
576  iRef.refCore(), iRef.key(),iRef.productGetter());
577 }
578 
581 }
582 
586  iRef.refCore(), iRef.key(),iRef.productGetter());
587 }
588 
591 }
592 
595 }
596 
599 }
600 
603 }
604 
607 }
608 
610  if( particleId() != gamma && particleId() != e) {
611  string err;
612  err += "PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
613  char num[4];
614  sprintf( num, "%d", particleId());
615  err += num;
616 
617  throw cms::Exception("InconsistentReference", err.c_str() );
618  }
619 
621  iRef.refCore(), iRef.key(),iRef.productGetter());
622 
623 }
624 
626  if( particleId() != gamma && particleId() != e) {
627  string err;
628  err += "PFCandidate::setSuperClusterRef: this is not an electron neither a photon ! particleId_=";
629  char num[4];
630  sprintf( num, "%d", particleId());
631  err += num;
632 
633  throw cms::Exception("InconsistentReference", err.c_str() );
634  }
635 
637  iRef.refCore(), iRef.key(),iRef.productGetter());
638 
639 }
640 
643  iRef.refCore(), iRef.key(),iRef.productGetter());
644 }
645 
647  //std::cout << " before storeRefInfo " << kRefPFEGammaExtraMask << " " << kRefPFEGammaExtraBit << " " << iRef.isNonnull() << " " << iRef.key() << " " << std::endl;
649  iRef.refCore(), iRef.key(),iRef.productGetter());
650 }
651 
653  switch (vertexType_) {
654  case kCandVertex:
655  return LeafCandidate::vertex();
656  break;
657  case kTrkVertex:
658  return trackRef()->vertex();
659  break;
660  case kComMuonVertex:
661  return muonRef()->combinedMuon()->vertex();
662  break;
663  case kSAMuonVertex:
664  return muonRef()->standAloneMuon()->vertex();
665  break;
666  case kTrkMuonVertex:
667  return muonRef()->track()->vertex();
668  break;
669  case kTPFMSMuonVertex:
670  return muonRef()->tpfmsTrack()->vertex();
671  break;
672  case kPickyMuonVertex:
673  return muonRef()->pickyTrack()->vertex();
674  break;
675  case kDYTMuonVertex:
676  return muonRef()->dytTrack()->vertex();
677  break;
678 
679  case kGSFVertex:
680  return gsfTrackRef()->vertex();
681  break;
682  }
683  return LeafCandidate::vertex();
684 }
685 
688 
689  if (nullptr == elementsInBlocks_.load(std::memory_order_acquire))
690  {
691  std::unique_ptr<ElementsInBlocks> temp( new ElementsInBlocks(blocksStorage_.size()));
692  for(unsigned int icopy=0;icopy!=blocksStorage_.size();++icopy)
693  (*temp)[icopy]=std::make_pair(blocksStorage_[icopy],elementsStorage_[icopy]);
694  ElementsInBlocks* expected=nullptr;
695  if(elementsInBlocks_.compare_exchange_strong(expected,temp.get(),std::memory_order_acq_rel)) {
696  temp.release();
697  }
698  }
699  return *(elementsInBlocks_.load(std::memory_order_acquire));
700 }
bool isAvailable() const
Definition: Ref.h:577
type
Definition: HCALResponse.h:21
~PFCandidate() override
destructor
Definition: PFCandidate.cc:207
float deltaP_
uncertainty on 3-momentum
Definition: PFCandidate.h:480
int Charge
electric charge type
Definition: Candidate.h:35
ParticleType
particle types
Definition: PFCandidate.h:44
reco::Muon::MuonTrackType muonTrackType_
Definition: PFCandidate.h:450
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
double eta() const final
momentum pseudorapidity
const edm::EDProductGetter * getter_
Definition: PFCandidate.h:517
void setPFPhotonExtraRef(const reco::PFCandidatePhotonExtraRef &ref)
set the PF Photon Extra Ref
Definition: PFCandidate.cc:641
void setGsfElectronRef(const reco::GsfElectronRef &ref)
set GsfElectronRef
Definition: PFCandidate.cc:574
void setFlag(Flags theFlag, bool value)
set a given flag
Definition: PFCandidate.cc:290
bool getRefInfo(unsigned int iMask, unsigned int iBit, edm::ProductID &oProdID, size_t &oIndex, size_t &aIndex) const
Definition: PFCandidate.cc:406
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFCandidate.h:525
key_type key() const
Definition: Ptr.h:185
float hcalERatio_
corrected HCAL energy ratio (corrected/raw)
Definition: PFCandidate.h:456
float rawHcalEnergy_
raw HCAL energy
Definition: PFCandidate.h:465
unsigned flags_
all flags, packed (ecal regional, hcal regional, tracking)
Definition: PFCandidate.h:477
virtual CandidatePtr sourceCandidatePtr(size_type i) const
Definition: Candidate.h:170
float mva_e_mu_
mva for electron-muon discrimination
Definition: PFCandidate.h:491
static const float bigMva_
Definition: PFCandidate.h:393
bool overlap(const Candidate &) const override
Polymorphic overlap.
Definition: PFCandidate.cc:266
float mva_nothing_nh_
mva for neutral hadron detection
Definition: PFCandidate.h:500
RefCore const & refCore() const
Definition: Ref.h:280
ProcessIndex productIndex() const
Definition: ProductID.h:37
double pt() const final
transverse momentum
int charge() const final
electric charge
Definition: LeafCandidate.h:91
float hoERatio_
corrected HO energy ratio (corrected/raw)
Definition: PFCandidate.h:459
edm::RefVector< reco::PFBlockCollection > Blocks
Definition: PFCandidate.h:388
key_type key() const
Accessor for product key.
Definition: Ref.h:265
reco::PFCandidatePhotonExtraRef photonExtraRef() const
return a reference to the photon extra
Definition: PFCandidate.cc:597
float mva_gamma_nh_
mva for neutral hadron - gamma discrimination
Definition: PFCandidate.h:503
#define nullptr
float ecalERatio_
corrected ECAL energy ratio (corrected/raw)
Definition: PFCandidate.h:453
virtual size_t numberOfSourceCandidatePtrs() const =0
float mva_pi_mu_
mva for pi-muon discrimination
Definition: PFCandidate.h:494
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:104
std::vector< ElementInBlock > ElementsInBlocks
Definition: PFCandidate.h:386
ProductID id() const
Accessor for product ID.
Definition: Ref.h:259
float rawEcalEnergy_
raw ECAL energy
Definition: PFCandidate.h:462
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:438
float mva_e_pi_
mva for electron-pion discrimination
Definition: PFCandidate.h:488
reco::PFDisplacedVertexRef displacedVertexRef(Flags type) const
Definition: PFCandidate.cc:524
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:652
std::vector< unsigned long long > refsInfo_
Definition: PFCandidate.h:519
static unsigned long long bitPackRefInfo(const edm::RefCore &iCore, size_t iIndex)
Definition: PFCandidate.cc:359
void setDisplacedVertexRef(const reco::PFDisplacedVertexRef &ref, Flags flag)
set displaced vertex reference
Definition: PFCandidate.cc:480
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:71
float ps1Energy_
corrected PS1 energy
Definition: PFCandidate.h:471
CandidatePtr sourceCandidatePtr(size_type i) const override
Definition: PFCandidate.h:131
void addElementInBlock(const reco::PFBlockRef &blockref, unsigned elementIndex)
add an element to the current PFCandidate
Definition: PFCandidate.cc:216
void setPFElectronExtraRef(const reco::PFCandidateElectronExtraRef &ref)
set the PF Electron Extra Ref
Definition: PFCandidate.cc:584
void setParticleType(ParticleType type)
set Particle Type
Definition: PFCandidate.cc:261
reco::PhotonRef photonRef() const
return a reference to the corresponding Photon if any
Definition: PFCandidate.cc:593
bool flag(Flags theFlag) const
return a given flag
Definition: PFCandidate.cc:300
const Point & vertex() const override
vertex position (overwritten by PF...)
void const * productPtr() const
Definition: RefCore.h:52
unsigned short storedRefsBitPattern_
Definition: PFCandidate.h:518
double energy() const final
energy
bool isNull() const
Checks for null.
Definition: Ptr.h:164
int translateTypeToPdgId(ParticleType type) const
Definition: PFCandidate.cc:243
CompositeCandidate(std::string name="")
default constructor
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::GsfElectronRef gsfElectronRef() const
return a reference to the corresponding GsfElectron if any
Definition: PFCandidate.cc:579
double f[11][100]
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
float rawHoEnergy_
raw HO energy
Definition: PFCandidate.h:468
Definition: value.py:1
unsigned int index
Definition: LeafCandidate.h:31
void reserve(size_type n)
Reserve space for RefVector.
Definition: RefVector.h:113
void rescaleMomentum(double rescaleFactor)
particle momentum *= rescaleFactor
Definition: PFCandidate.cc:283
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:455
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
PFCandidate * clone() const override
return a clone
Definition: PFCandidate.cc:211
static const unsigned int s_refsBefore[]
Definition: CountBits.h:14
unsigned int index
index type
Definition: Candidate.h:51
Block of elements.
reco::PFCandidateElectronExtraRef electronExtraRef() const
return a reference to the electron extra
Definition: PFCandidate.cc:589
void setGsfTrackRef(const reco::GsfTrackRef &ref)
set gsftrack reference
Definition: PFCandidate.cc:459
PFCandidate()
default constructor
Definition: PFCandidate.cc:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void setPhotonRef(const reco::PhotonRef &phRef)
set ref to the corresponding reco::Photon if any
Definition: PFCandidate.cc:609
void setConversionRef(const reco::ConversionRef &ref)
set ref to original reco conversion
Definition: PFCandidate.cc:535
edm::Ref< PFDisplacedVertexCollection > PFDisplacedVertexRef
persistent reference to a PFDisplacedVertex objects
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:180
ParticleType translatePdgIdToType(int pdgid) const
Definition: PFCandidate.cc:229
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
PFCandidate & operator=(PFCandidate const &)
Definition: PFCandidate.cc:166
ProductID id() const
Definition: RefCore.h:49
std::atomic< ElementsInBlocks * > elementsInBlocks_
Definition: PFCandidate.h:436
PFVertexType vertexType_
Definition: PFCandidate.h:482
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
PFCandidatePtr sourcePtr_
reference to the source PFCandidate, if any
Definition: PFCandidate.h:445
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
fixed size matrix
float time_
timing information (valid if timeError_ >= 0)
Definition: PFCandidate.h:523
reco::VertexCompositeCandidateRef v0Ref() const
return a reference to the original conversion
Definition: PFCandidate.cc:569
void setMuonRef(const reco::MuonRef &ref)
set muon reference
Definition: PFCandidate.cc:441
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance, from the PFRecTrack
Definition: PFCandidate.h:506
float mva_nothing_gamma_
mva for gamma detection
Definition: PFCandidate.h:497
reco::PFCandidateEGammaExtraRef egammaExtraRef() const
return a reference to the EGamma extra
Definition: PFCandidate.cc:601
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:476
void setPFEGammaExtraRef(const reco::PFCandidateEGammaExtraRef &ref)
set the PF EGamma Extra Ref
Definition: PFCandidate.cc:646
EDProductGetter const * productGetter() const
Accessor for product getter.
Definition: Ref.h:262
float ps2Energy_
corrected PS2 energy
Definition: PFCandidate.h:474
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
void setSuperClusterRef(const reco::SuperClusterRef &scRef)
Definition: PFCandidate.cc:625
void setV0Ref(const reco::VertexCompositeCandidateRef &ref)
set ref to original reco conversion
Definition: PFCandidate.cc:564
virtual ParticleType particleId() const
Definition: PFCandidate.h:373
LeafCandidate & operator=(LeafCandidate &&)=default
void setTrackRef(const reco::TrackRef &ref)
set track reference
Definition: PFCandidate.cc:421
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:687
ProcessIndex processIndex() const
Definition: ProductID.h:36
double phi() const final
momentum azimuthal angle
Elements elementsStorage_
Definition: PFCandidate.h:441
void setPdgId(int pdgId) final
reco::ConversionRef conversionRef() const
return a reference to the original conversion
Definition: PFCandidate.cc:559
void setP4(const LorentzVector &p4) final
set 4-momentum
std::vector< const void * > refsCollectionCache_
Definition: PFCandidate.h:520
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any
Definition: PFCandidate.cc:605
void storeRefInfo(unsigned int iMask, unsigned int iBit, bool iIsValid, const edm::RefCore &iCore, size_t iKey, const edm::EDProductGetter *)
Definition: PFCandidate.cc:366
#define GETREF(_class_, _mask_, _bit_)
Definition: CountBits.h:4660