CMS 3D CMS Logo

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