CMS 3D CMS Logo

Functions
FlavorHistory.cc File Reference
#include "DataFormats/HepMCCandidate/interface/FlavorHistory.h"

Go to the source code of this file.

Functions

ostream & operator<< (ostream &out, Candidate const &cand)
 
ostream & operator<< (ostream &out, FlavorHistory const &cand)
 

Function Documentation

◆ operator<<() [1/2]

ostream& operator<< ( ostream &  out,
Candidate const &  cand 
)

Definition at line 58 of file FlavorHistory.cc.

References MillePedeFileConverter_cfg::out.

58  {
59  char buff[1000];
60  sprintf(buff,
61  "%5d, status = %5d, nmo = %5d, nda = %5d, pt = %6.2f, eta = %6.2f, phi = %6.2f, m = %6.2f",
62  cand.pdgId(),
63  cand.status(),
64  static_cast<int>(cand.numberOfMothers()),
65  static_cast<int>(cand.numberOfDaughters()),
66  cand.pt(),
67  cand.eta(),
68  cand.phi(),
69  cand.mass());
70  out << buff;
71  return out;
72 }

◆ operator<<() [2/2]

ostream& operator<< ( ostream &  out,
FlavorHistory const &  cand 
)

Definition at line 74 of file FlavorHistory.cc.

References reco::Candidate::mother(), reco::Candidate::numberOfMothers(), and MillePedeFileConverter_cfg::out.

74  {
75  out << "Source = " << cand.flavorSource() << endl;
76  if (cand.hasParton())
77  out << "Parton = " << cand.parton().key() << " : " << *(cand.parton()) << endl;
78  if (cand.hasProgenitor())
79  out << "Progenitor = " << cand.progenitor().key() << " : " << *(cand.progenitor()) << endl;
80  if (cand.hasSister())
81  out << "Sister = " << cand.sister().key() << " : " << *(cand.sister()) << endl;
82  if (cand.hasMatchedJet())
83  out << "jet = " << cand.matchedJet() << endl;
84  if (cand.hasSisterJet())
85  out << "sister jet = " << cand.sisterJet() << endl;
86  if (cand.hasParton()) {
87  out << "Ancestry: " << endl;
88  Candidate const* ipar = cand.parton()->mother();
89  while (ipar->numberOfMothers() > 0) {
90  out << *ipar << endl;
91  ipar = ipar->mother();
92  }
93  }
94  return out;
95 }
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
virtual size_type numberOfMothers() const =0
number of mothers (zero or one in most of but not all the cases)