Go to the documentation of this file.00001 #ifndef HepMCCandidate_FlavorHistory_h
00002 #define HepMCCandidate_FlavorHistory_h
00003
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "DataFormats/Common/interface/Ptr.h"
00036 #include "DataFormats/Common/interface/OwnVector.h"
00037 #include "DataFormats/Common/interface/Handle.h"
00038 #include "DataFormats/Common/interface/View.h"
00039 #include "DataFormats/Candidate/interface/Candidate.h"
00040 #include "DataFormats/Candidate/interface/CandidateFwd.h"
00041 #include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h"
00042
00043 #include <fstream>
00044
00045 namespace reco {
00046
00047
00048 class FlavorHistory {
00049 public:
00050
00051 enum FLAVOR_T { FLAVOR_NULL=0,
00052 FLAVOR_GS,
00053 FLAVOR_EXC,
00054 FLAVOR_ME,
00055 FLAVOR_DECAY,
00056 N_FLAVOR_TYPES };
00057
00058 static const int gluonId=21;
00059 static const int tQuarkId=6;
00060 static const int bQuarkId=5;
00061 static const int cQuarkId=4;
00062
00063
00064 FlavorHistory();
00065 FlavorHistory( FLAVOR_T flavorSource,
00066 reco::CandidatePtr const & parton,
00067 reco::CandidatePtr const & progenitor,
00068 reco::CandidatePtr const & sister,
00069 reco::ShallowClonePtrCandidate const & matchedJet,
00070 reco::ShallowClonePtrCandidate const & sisterJet);
00071 FlavorHistory( FLAVOR_T flavorSource,
00072 edm::Handle<edm::View<reco::Candidate> > h_partons,
00073 int iparton,
00074 int iprogenitor,
00075 int isister,
00076 reco::ShallowClonePtrCandidate const & matchedJet,
00077 reco::ShallowClonePtrCandidate const & sisterJet);
00078 FlavorHistory( FLAVOR_T flavorSource,
00079 edm::Handle<reco::CandidateCollection > h_partons,
00080 int iparton,
00081 int iprogenitor,
00082 int isister,
00083 reco::ShallowClonePtrCandidate const & matchedJet,
00084 reco::ShallowClonePtrCandidate const & sisterJet );
00085 ~FlavorHistory(){}
00086
00087
00088
00089 FLAVOR_T flavorSource () const { return flavorSource_; }
00090 bool hasParton () const { return parton_.isNonnull(); }
00091 bool hasSister () const { return sister_.isNonnull(); }
00092 bool hasProgenitor () const { return progenitor_.isNonnull();}
00093 bool hasMatchedJet () const { return matchedJet_.masterClonePtr().isNonnull(); }
00094 bool hasSisterJet () const { return sisterJet_.masterClonePtr().isNonnull(); }
00095 const reco::CandidatePtr & parton () const { return parton_; }
00096 const reco::CandidatePtr & sister () const { return sister_; }
00097 const reco::CandidatePtr & progenitor() const { return progenitor_; }
00098 const reco::ShallowClonePtrCandidate &
00099 matchedJet() const { return matchedJet_; }
00100 const reco::ShallowClonePtrCandidate &
00101 sisterJet() const { return sisterJet_; }
00102
00103
00104 bool operator< ( FlavorHistory const & right ) const {
00105 return parton_.key() < right.parton_.key();
00106 }
00107 bool operator> ( FlavorHistory const & right ) const {
00108 return parton_.key() > right.parton_.key();
00109 }
00110 bool operator== ( FlavorHistory const & right ) const {
00111 return parton_.key() == right.parton_.key();
00112 }
00113
00114
00115
00116 protected:
00117 FLAVOR_T flavorSource_;
00118 reco::CandidatePtr parton_;
00119 reco::CandidatePtr progenitor_;
00120 reco::CandidatePtr sister_;
00121 reco::ShallowClonePtrCandidate matchedJet_;
00122 reco::ShallowClonePtrCandidate sisterJet_;
00123 };
00124
00125 }
00126
00127 std::ostream & operator<<( std::ostream & out, reco::FlavorHistory const & cand);
00128
00129 #endif