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