Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:22

0001 #ifndef TopObjects_TtFullHadronicEvent_h
0002 #define TopObjects_TtFullHadronicEvent_h
0003 
0004 #include "AnalysisDataFormats/TopObjects/interface/TtEvent.h"
0005 
0006 namespace TtFullHadDaughter {
0007   /// full hadronic daughter names for common
0008   /// use and use with the hypotheses
0009   static const std::string LightQ = "LightQ", LightP = "LightP", WPlus = "WPlus", B = "B", Top = "Top";
0010   static const std::string LightQBar = "LightQBar", LightPBar = "LightPBar", WMinus = "WMinus", BBar = "BBar",
0011                            TopBar = "TopBar";
0012 }  // namespace TtFullHadDaughter
0013 
0014 /**
0015    \class   TtFullHadronicEvent TtFullHadronicEvent.h "AnalysisDataFormats/TopObjects/interface/TtFullHadronicEvent.h"
0016 
0017    \brief   Class derived from the TtEvent for the full hadronic decay channel
0018 
0019    The structure holds information on the hadronic decay channels, 
0020    all event hypotheses of different classes (user defined during
0021    production) and a reference to the TtGenEvent (if available). It 
0022    provides access and administration.
0023 */
0024 
0025 class TtFullHadronicEvent : public TtEvent {
0026 public:
0027   /// empty constructor
0028   TtFullHadronicEvent(){};
0029   /// default destructor
0030   ~TtFullHadronicEvent() override{};
0031 
0032   /// get top of the given hypothesis
0033   const reco::Candidate* top(const std::string& key, const unsigned& cmb = 0) const {
0034     return top(hypoClassKeyFromString(key), cmb);
0035   };
0036   /// get top of the given hypothesis
0037   const reco::Candidate* top(const HypoClassKey& key, const unsigned& cmb = 0) const {
0038     return !isHypoValid(key, cmb) ? nullptr : eventHypo(key, cmb).daughter(TtFullHadDaughter::Top);
0039   };
0040   /// get b of the given hypothesis
0041   const reco::Candidate* b(const std::string& key, const unsigned& cmb = 0) const {
0042     return b(hypoClassKeyFromString(key), cmb);
0043   };
0044   /// get b of the given hypothesis
0045   const reco::Candidate* b(const HypoClassKey& key, const unsigned& cmb = 0) const {
0046     return !isHypoValid(key, cmb) ? nullptr : top(key, cmb)->daughter(TtFullHadDaughter::B);
0047   };
0048 
0049   /// get light Q of the given hypothesis
0050   const reco::Candidate* lightQ(const std::string& key, const unsigned& cmb = 0) const {
0051     return lightQ(hypoClassKeyFromString(key), cmb);
0052   };
0053   /// get light Q of the given hypothesis
0054   const reco::Candidate* lightQ(const HypoClassKey& key, const unsigned& cmb = 0) const {
0055     return !isHypoValid(key, cmb) ? nullptr : wPlus(key, cmb)->daughter(TtFullHadDaughter::LightQ);
0056   };
0057 
0058   /// get light P of the given hypothesis
0059   const reco::Candidate* lightP(const std::string& key, const unsigned& cmb = 0) const {
0060     return lightP(hypoClassKeyFromString(key), cmb);
0061   };
0062   /// get light P of the given hypothesis
0063   const reco::Candidate* lightP(const HypoClassKey& key, const unsigned& cmb = 0) const {
0064     return !isHypoValid(key, cmb) ? nullptr : wMinus(key, cmb)->daughter(TtFullHadDaughter::LightP);
0065   };
0066 
0067   /// get Wplus of the given hypothesis
0068   const reco::Candidate* wPlus(const std::string& key, const unsigned& cmb = 0) const {
0069     return wPlus(hypoClassKeyFromString(key), cmb);
0070   };
0071   /// get Wplus of the given hypothesis
0072   const reco::Candidate* wPlus(const HypoClassKey& key, const unsigned& cmb = 0) const {
0073     return !isHypoValid(key, cmb) ? nullptr : top(key, cmb)->daughter(TtFullHadDaughter::WPlus);
0074   };
0075 
0076   /// get anti-top of the given hypothesis
0077   const reco::Candidate* topBar(const std::string& key, const unsigned& cmb = 0) const {
0078     return topBar(hypoClassKeyFromString(key), cmb);
0079   };
0080   /// get anti-top of the given hypothesis
0081   const reco::Candidate* topBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0082     return !isHypoValid(key, cmb) ? nullptr : eventHypo(key, cmb).daughter(TtFullHadDaughter::TopBar);
0083   };
0084   /// get anti-b of the given hypothesis
0085   const reco::Candidate* bBar(const std::string& key, const unsigned& cmb = 0) const {
0086     return bBar(hypoClassKeyFromString(key), cmb);
0087   };
0088   /// get anti-b of the given hypothesis
0089   const reco::Candidate* bBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0090     return !isHypoValid(key, cmb) ? nullptr : topBar(key, cmb)->daughter(TtFullHadDaughter::BBar);
0091   };
0092 
0093   /// get light Q bar of the given hypothesis
0094   const reco::Candidate* lightQBar(const std::string& key, const unsigned& cmb = 0) const {
0095     return lightQBar(hypoClassKeyFromString(key), cmb);
0096   };
0097   /// get light Q bar of the given hypothesis
0098   const reco::Candidate* lightQBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0099     return !isHypoValid(key, cmb) ? nullptr : wPlus(key, cmb)->daughter(TtFullHadDaughter::LightQBar);
0100   };
0101 
0102   /// get light P bar of the given hypothesis
0103   const reco::Candidate* lightPBar(const std::string& key, const unsigned& cmb = 0) const {
0104     return lightPBar(hypoClassKeyFromString(key), cmb);
0105   };
0106   /// get light P bar of the given hypothesis
0107   const reco::Candidate* lightPBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0108     return !isHypoValid(key, cmb) ? nullptr : wMinus(key, cmb)->daughter(TtFullHadDaughter::LightPBar);
0109   };
0110 
0111   /// get Wminus of the given hypothesis
0112   const reco::Candidate* wMinus(const std::string& key, const unsigned& cmb = 0) const {
0113     return wMinus(hypoClassKeyFromString(key), cmb);
0114   };
0115   /// get Wminus of the given hypothesis
0116   const reco::Candidate* wMinus(const HypoClassKey& key, const unsigned& cmb = 0) const {
0117     return !isHypoValid(key, cmb) ? nullptr : topBar(key, cmb)->daughter(TtFullHadDaughter::WMinus);
0118   };
0119 
0120   /// get top of the TtGenEvent
0121   const reco::GenParticle* top() const { return (!genEvt_ ? nullptr : this->genEvent()->top()); };
0122   /// get b of the TtGenEvent
0123   const reco::GenParticle* b() const { return (!genEvt_ ? nullptr : this->genEvent()->b()); };
0124 
0125   /// get light Q of the TtGenEvent
0126   const reco::GenParticle* lightQ() const { return (!genEvt_ ? nullptr : this->genEvent()->daughterQuarkOfWPlus()); };
0127   /// get light P of the TtGenEvent
0128   const reco::GenParticle* lightP() const { return (!genEvt_ ? nullptr : this->genEvent()->daughterQuarkOfWMinus()); };
0129 
0130   /// get Wplus of the TtGenEvent
0131   const reco::GenParticle* wPlus() const { return (!genEvt_ ? nullptr : this->genEvent()->wPlus()); };
0132 
0133   /// get anti-top of the TtGenEvent
0134   const reco::GenParticle* topBar() const { return (!genEvt_ ? nullptr : this->genEvent()->topBar()); };
0135   /// get anti-b of the TtGenEvent
0136   const reco::GenParticle* bBar() const { return (!genEvt_ ? nullptr : this->genEvent()->bBar()); };
0137 
0138   /// get light Q bar of the TtGenEvent
0139   const reco::GenParticle* lightQBar() const {
0140     return (!genEvt_ ? nullptr : this->genEvent()->daughterQuarkBarOfWPlus());
0141   };
0142   /// get light P bar of the TtGenEvent
0143   const reco::GenParticle* lightPBar() const {
0144     return (!genEvt_ ? nullptr : this->genEvent()->daughterQuarkBarOfWMinus());
0145   };
0146 
0147   /// get Wminus of the TtGenEvent
0148   const reco::GenParticle* wMinus() const { return (!genEvt_ ? nullptr : this->genEvent()->wMinus()); };
0149 
0150   /// print full content of the structure as formated
0151   /// LogInfo to the MessageLogger output for debugging
0152   void print(const int verbosity = 1) const;
0153 };
0154 
0155 #endif