File indexing completed on 2024-04-06 12:04:20
0001 #ifndef HepMCCandidate_FlavorHistory_h
0002 #define HepMCCandidate_FlavorHistory_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #include "DataFormats/Common/interface/Ptr.h"
0034 #include "DataFormats/Common/interface/OwnVector.h"
0035 #include "DataFormats/Common/interface/Handle.h"
0036 #include "DataFormats/Common/interface/View.h"
0037 #include "DataFormats/Candidate/interface/Candidate.h"
0038 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0039 #include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h"
0040
0041 #include <fstream>
0042
0043 namespace reco {
0044
0045 class FlavorHistory {
0046 public:
0047 enum FLAVOR_T {
0048 FLAVOR_NULL = 0,
0049 FLAVOR_GS,
0050 FLAVOR_EXC,
0051 FLAVOR_ME,
0052 FLAVOR_DECAY,
0053 N_FLAVOR_TYPES
0054 };
0055
0056 static const int gluonId = 21;
0057 static const int tQuarkId = 6;
0058 static const int bQuarkId = 5;
0059 static const int cQuarkId = 4;
0060
0061 FlavorHistory();
0062 FlavorHistory(FLAVOR_T flavorSource,
0063 reco::CandidatePtr const& parton,
0064 reco::CandidatePtr const& progenitor,
0065 reco::CandidatePtr const& sister,
0066 reco::ShallowClonePtrCandidate const& matchedJet,
0067 reco::ShallowClonePtrCandidate const& sisterJet);
0068 FlavorHistory(FLAVOR_T flavorSource,
0069 edm::Handle<edm::View<reco::Candidate> > h_partons,
0070 int iparton,
0071 int iprogenitor,
0072 int isister,
0073 reco::ShallowClonePtrCandidate const& matchedJet,
0074 reco::ShallowClonePtrCandidate const& sisterJet);
0075 FlavorHistory(FLAVOR_T flavorSource,
0076 edm::Handle<reco::CandidateCollection> h_partons,
0077 int iparton,
0078 int iprogenitor,
0079 int isister,
0080 reco::ShallowClonePtrCandidate const& matchedJet,
0081 reco::ShallowClonePtrCandidate const& sisterJet);
0082 ~FlavorHistory() {}
0083
0084
0085 FLAVOR_T flavorSource() const { return flavorSource_; }
0086 bool hasParton() const { return parton_.isNonnull(); }
0087 bool hasSister() const { return sister_.isNonnull(); }
0088 bool hasProgenitor() const { return progenitor_.isNonnull(); }
0089 bool hasMatchedJet() const { return matchedJet_.masterClonePtr().isNonnull(); }
0090 bool hasSisterJet() const { return sisterJet_.masterClonePtr().isNonnull(); }
0091 const reco::CandidatePtr& parton() const { return parton_; }
0092 const reco::CandidatePtr& sister() const { return sister_; }
0093 const reco::CandidatePtr& progenitor() const { return progenitor_; }
0094 const reco::ShallowClonePtrCandidate& matchedJet() const { return matchedJet_; }
0095 const reco::ShallowClonePtrCandidate& sisterJet() const { return sisterJet_; }
0096
0097
0098 bool operator<(FlavorHistory const& right) const { return parton_.key() < right.parton_.key(); }
0099 bool operator>(FlavorHistory const& right) const { return parton_.key() > right.parton_.key(); }
0100 bool operator==(FlavorHistory const& right) const { return parton_.key() == right.parton_.key(); }
0101
0102 protected:
0103 FLAVOR_T flavorSource_;
0104 reco::CandidatePtr parton_;
0105 reco::CandidatePtr progenitor_;
0106 reco::CandidatePtr sister_;
0107 reco::ShallowClonePtrCandidate matchedJet_;
0108 reco::ShallowClonePtrCandidate sisterJet_;
0109 };
0110
0111 }
0112
0113 std::ostream& operator<<(std::ostream& out, reco::FlavorHistory const& cand);
0114
0115 #endif