CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 64 of file FlavorHistory.cc.

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

65 {
66  char buff[1000];
67  sprintf(buff, "%5d, status = %5d, nmo = %5d, nda = %5d, pt = %6.2f, eta = %6.2f, phi = %6.2f, m = %6.2f",
68  cand.pdgId(), cand.status(),
69  static_cast<int>(cand.numberOfMothers()),
70  static_cast<int>(cand.numberOfDaughters()),
71  cand.pt(), cand.eta(), cand.phi(), cand.mass() );
72  out << buff;
73  return out;
74 }
ostream& operator<< ( ostream &  out,
FlavorHistory const &  cand 
)

Definition at line 76 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(), GenerateHcalLaserBadRunList::out, reco::FlavorHistory::parton(), reco::FlavorHistory::progenitor(), reco::FlavorHistory::sister(), and reco::FlavorHistory::sisterJet().

77 {
78  out << "Source = " << cand.flavorSource() << endl;
79  if ( cand.hasParton() )
80  out << "Parton = " << cand.parton().key() << " : " << *(cand.parton()) << endl;
81  if ( cand.hasProgenitor() )
82  out << "Progenitor = " << cand.progenitor().key() << " : " << *(cand.progenitor()) << endl;
83  if ( cand.hasSister() )
84  out << "Sister = " << cand.sister().key() << " : " << *(cand.sister()) << endl;
85  if ( cand.hasMatchedJet() )
86  out << "jet = " << cand.matchedJet() << endl;
87  if ( cand.hasSisterJet() )
88  out << "sister jet = " << cand.sisterJet() << endl;
89  if ( cand.hasParton() ) {
90  out << "Ancestry: " << endl;
91  Candidate const * ipar = cand.parton()->mother();
92  while ( ipar->numberOfMothers() > 0 ) {
93  out << *ipar << endl;
94  ipar = ipar->mother();
95  }
96  }
97  return out;
98 }
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)