CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Functions
FlavorHistory.h File Reference
#include "DataFormats/Common/interface/Ptr.h"
#include "DataFormats/Common/interface/OwnVector.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Common/interface/View.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/Candidate/interface/CandidateFwd.h"
#include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h"
#include <fstream>

Go to the source code of this file.

Classes

class  reco::FlavorHistory
 

Namespaces

 reco
 fixed size matrix
 

Functions

std::ostream & operator<< (std::ostream &out, reco::FlavorHistory const &cand)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  out,
reco::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(), dbtoconf::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)
tuple out
Definition: dbtoconf.py:99