CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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

Definition at line 58 of file FlavorHistory.cc.

References reco::Candidate::eta(), reco::Candidate::mass(), reco::Candidate::numberOfDaughters(), reco::Candidate::numberOfMothers(), submitPVResolutionJobs::out, reco::Candidate::pdgId(), reco::Candidate::phi(), reco::Candidate::pt(), and reco::Candidate::status().

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 }
ostream& operator<< ( ostream &  out,
FlavorHistory const &  cand 
)

Definition at line 74 of file FlavorHistory.cc.

References reco::FlavorHistory::flavorSource(), reco::FlavorHistory::hasMatchedJet(), reco::FlavorHistory::hasParton(), reco::FlavorHistory::hasProgenitor(), reco::FlavorHistory::hasSister(), reco::FlavorHistory::hasSisterJet(), edm::Ptr< T >::key(), reco::FlavorHistory::matchedJet(), reco::Candidate::mother(), reco::Candidate::numberOfMothers(), submitPVResolutionJobs::out, reco::FlavorHistory::parton(), reco::FlavorHistory::progenitor(), reco::FlavorHistory::sister(), and reco::FlavorHistory::sisterJet().

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)