CMS 3D CMS Logo

TtFullLeptonicEvent.h
Go to the documentation of this file.
1 #ifndef TopObjects_TtFullLeptonicEvent_h
2 #define TopObjects_TtFullLeptonicEvent_h
3 
5 
6 namespace TtFullLepDaughter {
9  static const std::string Nu = "Nu", LepBar = "LepBar", WPlus = "WPlus", B = "B", Top = "Top";
10  static const std::string NuBar = "NuBar", Lep = "Lep", WMinus = "WMinus", BBar = "BBar", TopBar = "TopBar";
11 } // namespace TtFullLepDaughter
12 
24 class TtFullLeptonicEvent : public TtEvent {
25 public:
29  ~TtFullLeptonicEvent() override{};
30 
32  const reco::Candidate* top(const std::string& key, const unsigned& cmb = 0) const {
33  return top(hypoClassKeyFromString(key), cmb);
34  };
36  const reco::Candidate* top(const HypoClassKey& key, const unsigned& cmb = 0) const {
37  return !isHypoValid(key, cmb) ? nullptr : eventHypo(key, cmb).daughter(TtFullLepDaughter::Top);
38  };
40  const reco::Candidate* b(const std::string& key, const unsigned& cmb = 0) const {
41  return b(hypoClassKeyFromString(key), cmb);
42  };
44  const reco::Candidate* b(const HypoClassKey& key, const unsigned& cmb = 0) const {
45  return !isHypoValid(key, cmb) ? nullptr : top(key, cmb)->daughter(TtFullLepDaughter::B);
46  };
48  const reco::Candidate* wPlus(const std::string& key, const unsigned& cmb = 0) const {
49  return wPlus(hypoClassKeyFromString(key), cmb);
50  };
52  const reco::Candidate* wPlus(const HypoClassKey& key, const unsigned& cmb = 0) const {
53  return !isHypoValid(key, cmb) ? nullptr : top(key, cmb)->daughter(TtFullLepDaughter::WPlus);
54  };
56  const reco::Candidate* leptonBar(const std::string& key, const unsigned& cmb = 0) const {
57  return leptonBar(hypoClassKeyFromString(key), cmb);
58  };
60  const reco::Candidate* leptonBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
61  return !isHypoValid(key, cmb) ? nullptr : wPlus(key, cmb)->daughter(TtFullLepDaughter::LepBar);
62  };
64  const reco::Candidate* neutrino(const std::string& key, const unsigned& cmb = 0) const {
65  return neutrino(hypoClassKeyFromString(key), cmb);
66  };
68  const reco::Candidate* neutrino(const HypoClassKey& key, const unsigned& cmb = 0) const {
69  return !isHypoValid(key, cmb) ? nullptr : wPlus(key, cmb)->daughter(TtFullLepDaughter::Nu);
70  };
72  const reco::Candidate* topBar(const std::string& key, const unsigned& cmb = 0) const {
73  return topBar(hypoClassKeyFromString(key), cmb);
74  };
76  const reco::Candidate* topBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
77  return !isHypoValid(key, cmb) ? nullptr : eventHypo(key, cmb).daughter(TtFullLepDaughter::TopBar);
78  };
80  const reco::Candidate* bBar(const std::string& key, const unsigned& cmb = 0) const {
81  return bBar(hypoClassKeyFromString(key), cmb);
82  };
84  const reco::Candidate* bBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
85  return !isHypoValid(key, cmb) ? nullptr : topBar(key, cmb)->daughter(TtFullLepDaughter::BBar);
86  };
88  const reco::Candidate* wMinus(const std::string& key, const unsigned& cmb = 0) const {
89  return wMinus(hypoClassKeyFromString(key), cmb);
90  };
92  const reco::Candidate* wMinus(const HypoClassKey& key, const unsigned& cmb = 0) const {
93  return !isHypoValid(key, cmb) ? nullptr : topBar(key, cmb)->daughter(TtFullLepDaughter::WMinus);
94  };
96  const reco::Candidate* lepton(const std::string& key, const unsigned& cmb = 0) const {
97  return lepton(hypoClassKeyFromString(key), cmb);
98  };
100  const reco::Candidate* lepton(const HypoClassKey& key, const unsigned& cmb = 0) const {
101  return !isHypoValid(key, cmb) ? nullptr : wMinus(key, cmb)->daughter(TtFullLepDaughter::Lep);
102  };
104  const reco::Candidate* neutrinoBar(const std::string& key, const unsigned& cmb = 0) const {
105  return neutrinoBar(hypoClassKeyFromString(key), cmb);
106  };
108  const reco::Candidate* neutrinoBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
109  return !isHypoValid(key, cmb) ? nullptr : wMinus(key, cmb)->daughter(TtFullLepDaughter::NuBar);
110  };
111 
113  const reco::GenParticle* genTop() const { return (!genEvt_ ? nullptr : this->genEvent()->top()); };
115  const reco::GenParticle* genB() const { return (!genEvt_ ? nullptr : this->genEvent()->b()); };
117  const reco::GenParticle* genWPlus() const { return (!genEvt_ ? nullptr : this->genEvent()->wPlus()); };
119  const reco::GenParticle* genLeptonBar() const { return (!genEvt_ ? nullptr : this->genEvent()->leptonBar()); };
121  const reco::GenParticle* genNeutrino() const { return (!genEvt_ ? nullptr : this->genEvent()->neutrino()); };
123  const reco::GenParticle* genTopBar() const { return (!genEvt_ ? nullptr : this->genEvent()->topBar()); };
125  const reco::GenParticle* genBBar() const { return (!genEvt_ ? nullptr : this->genEvent()->bBar()); };
127  const reco::GenParticle* genWMinus() const { return (!genEvt_ ? nullptr : this->genEvent()->wMinus()); };
129  const reco::GenParticle* genLepton() const { return (!genEvt_ ? nullptr : this->genEvent()->lepton()); };
131  const reco::GenParticle* genNeutrinoBar() const { return (!genEvt_ ? nullptr : this->genEvent()->neutrinoBar()); };
132 
134  double solWeight(const unsigned& cmb = 0) const { return (cmb < solWeight_.size() ? solWeight_[cmb] : -1.); }
136  bool isWrongCharge() const { return wrongCharge_; }
137 
139  void setSolWeight(const std::vector<double>& val) { solWeight_ = val; };
141  void setWrongCharge(const bool& val) { wrongCharge_ = val; };
142 
145  void print(const int verbosity = 1) const;
146 
147 protected:
149  std::vector<double> solWeight_;
152 };
153 
154 #endif
TtFullLeptonicEvent::lepton
const reco::Candidate * lepton(const std::string &key, const unsigned &cmb=0) const
get lepton of the given hypothesis
Definition: TtFullLeptonicEvent.h:96
reco::Candidate::daughter
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
TtEvent::genEvt_
edm::RefProd< TtGenEvent > genEvt_
reference to TtGenEvent (has to be kept in the event!)
Definition: TtEvent.h:188
TtFullLepDaughter
Definition: TtFullLeptonicEvent.h:6
TtFullLeptonicEvent::genB
const reco::GenParticle * genB() const
get b of the TtGenEvent
Definition: TtFullLeptonicEvent.h:115
TtFullLeptonicEvent
Class derived from the TtEvent for the full leptonic decay channel.
Definition: TtFullLeptonicEvent.h:24
TtEvent::isHypoValid
bool isHypoValid(const std::string &key, const unsigned &cmb=0) const
check if hypothesis 'cmb' within the hypothesis class was valid; if not it lead to an empty Composite...
Definition: TtEvent.h:78
TtFullLeptonicEvent::solWeight_
std::vector< double > solWeight_
result of kinematic solution
Definition: TtFullLeptonicEvent.h:149
TtFullLeptonicEvent::genTopBar
const reco::GenParticle * genTopBar() const
get anti-top of the TtGenEvent
Definition: TtFullLeptonicEvent.h:123
reco::GenParticle
Definition: GenParticle.h:21
TtFullLeptonicEvent::TtFullLeptonicEvent
TtFullLeptonicEvent()
empty constructor
Definition: TtFullLeptonicEvent.h:27
TtFullLeptonicEvent::neutrino
const reco::Candidate * neutrino(const HypoClassKey &key, const unsigned &cmb=0) const
get neutrino of the given hypothesis
Definition: TtFullLeptonicEvent.h:68
TtFullLepDaughter::B
static const std::string B
Definition: TtFullLeptonicEvent.h:9
TtFullLeptonicEvent::neutrino
const reco::Candidate * neutrino(const std::string &key, const unsigned &cmb=0) const
get neutrino of the given hypothesis
Definition: TtFullLeptonicEvent.h:64
TtFullLeptonicEvent::wrongCharge_
bool wrongCharge_
right/wrong charge booleans
Definition: TtFullLeptonicEvent.h:151
TtFullLepDaughter::LepBar
static const std::string LepBar
Definition: TtFullLeptonicEvent.h:9
TtFullLeptonicEvent::top
const reco::Candidate * top(const std::string &key, const unsigned &cmb=0) const
get top of the given hypothesis
Definition: TtFullLeptonicEvent.h:32
TtFullLeptonicEvent::leptonBar
const reco::Candidate * leptonBar(const HypoClassKey &key, const unsigned &cmb=0) const
get anti-lepton of the given hypothesis
Definition: TtFullLeptonicEvent.h:60
TtFullLeptonicEvent::genTop
const reco::GenParticle * genTop() const
get top of the TtGenEvent
Definition: TtFullLeptonicEvent.h:113
TtFullLeptonicEvent::setWrongCharge
void setWrongCharge(const bool &val)
set right or wrong charge combination of kKinSolution hypothesis
Definition: TtFullLeptonicEvent.h:141
TtEvent::eventHypo
const reco::CompositeCandidate & eventHypo(const HypoClassKey &key, const unsigned &cmb=0) const
Definition: TtEvent.h:59
TtFullLeptonicEvent::solWeight
double solWeight(const unsigned &cmb=0) const
return the weight of the kinematic solution of hypothesis 'cmb' if available; -1 else
Definition: TtFullLeptonicEvent.h:134
TtFullLeptonicEvent::setSolWeight
void setSolWeight(const std::vector< double > &val)
set weight of kKinSolution hypothesis
Definition: TtFullLeptonicEvent.h:139
TtFullLeptonicEvent::neutrinoBar
const reco::Candidate * neutrinoBar(const HypoClassKey &key, const unsigned &cmb=0) const
get anti-neutrino of the given hypothesis
Definition: TtFullLeptonicEvent.h:108
TtEvent
Base class to hold information for ttbar event interpretation.
Definition: TtEvent.h:23
TtFullLeptonicEvent::lepton
const reco::Candidate * lepton(const HypoClassKey &key, const unsigned &cmb=0) const
get lepton of the given hypothesis
Definition: TtFullLeptonicEvent.h:100
TtEvent::genEvent
const edm::RefProd< TtGenEvent > & genEvent() const
get TtGenEvent
Definition: TtEvent.h:63
TtFullLeptonicEvent::print
void print(const int verbosity=1) const
Definition: TtFullLeptonicEvent.cc:9
TtFullLeptonicEvent::topBar
const reco::Candidate * topBar(const std::string &key, const unsigned &cmb=0) const
get anti-top of the given hypothesis
Definition: TtFullLeptonicEvent.h:72
TtFullLeptonicEvent::wPlus
const reco::Candidate * wPlus(const HypoClassKey &key, const unsigned &cmb=0) const
get Wplus of the given hypothesis
Definition: TtFullLeptonicEvent.h:52
TtEvent::hypoClassKeyFromString
HypoClassKey hypoClassKeyFromString(const std::string &label) const
return the corresponding enum value from a string
Definition: TtEvent.cc:15
TtFullLeptonicEvent::leptonBar
const reco::Candidate * leptonBar(const std::string &key, const unsigned &cmb=0) const
get anti-lepton of the given hypothesis
Definition: TtFullLeptonicEvent.h:56
TtFullLepDaughter::NuBar
static const std::string NuBar
Definition: TtFullLeptonicEvent.h:10
TtFullLeptonicEvent::wPlus
const reco::Candidate * wPlus(const std::string &key, const unsigned &cmb=0) const
get Wplus of the given hypothesis
Definition: TtFullLeptonicEvent.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TtFullLepDaughter::WPlus
static const std::string WPlus
Definition: TtFullLeptonicEvent.h:9
TtFullLeptonicEvent::~TtFullLeptonicEvent
~TtFullLeptonicEvent() override
default destructor
Definition: TtFullLeptonicEvent.h:29
TtFullLeptonicEvent::genWMinus
const reco::GenParticle * genWMinus() const
get Wminus of the TtGenEvent
Definition: TtFullLeptonicEvent.h:127
TtEvent::HypoClassKey
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:26
TtFullLepDaughter::WMinus
static const std::string WMinus
Definition: TtFullLeptonicEvent.h:10
TtFullLeptonicEvent::topBar
const reco::Candidate * topBar(const HypoClassKey &key, const unsigned &cmb=0) const
get anti-top of the given hypothesis
Definition: TtFullLeptonicEvent.h:76
TtFullLeptonicEvent::genLeptonBar
const reco::GenParticle * genLeptonBar() const
get anti-lepton of the TtGenEvent
Definition: TtFullLeptonicEvent.h:119
TtFullLeptonicEvent::wMinus
const reco::Candidate * wMinus(const HypoClassKey &key, const unsigned &cmb=0) const
get Wminus of the given hypothesis
Definition: TtFullLeptonicEvent.h:92
TtFullLepDaughter::Lep
static const std::string Lep
Definition: TtFullLeptonicEvent.h:10
TtFullLepDaughter::BBar
static const std::string BBar
Definition: TtFullLeptonicEvent.h:10
TtFullLeptonicEvent::b
const reco::Candidate * b(const HypoClassKey &key, const unsigned &cmb=0) const
get b of the given hypothesis
Definition: TtFullLeptonicEvent.h:44
reco::Candidate
Definition: Candidate.h:27
TtFullLeptonicEvent::bBar
const reco::Candidate * bBar(const HypoClassKey &key, const unsigned &cmb=0) const
get anti-b of the given hypothesis
Definition: TtFullLeptonicEvent.h:84
heppy_batch.val
val
Definition: heppy_batch.py:351
TtFullLeptonicEvent::genNeutrino
const reco::GenParticle * genNeutrino() const
get neutrino of the TtGenEvent
Definition: TtFullLeptonicEvent.h:121
TtFullLeptonicEvent::bBar
const reco::Candidate * bBar(const std::string &key, const unsigned &cmb=0) const
get anti-b of the given hypothesis
Definition: TtFullLeptonicEvent.h:80
TtFullLeptonicEvent::wMinus
const reco::Candidate * wMinus(const std::string &key, const unsigned &cmb=0) const
get Wminus of the given hypothesis
Definition: TtFullLeptonicEvent.h:88
TtFullLeptonicEvent::genWPlus
const reco::GenParticle * genWPlus() const
get Wplus of the TtGenEvent
Definition: TtFullLeptonicEvent.h:117
TtFullLeptonicEvent::genNeutrinoBar
const reco::GenParticle * genNeutrinoBar() const
get anti-neutrino of the TtGenEvent
Definition: TtFullLeptonicEvent.h:131
TtFullLepDaughter::Nu
static const std::string Nu
Definition: TtFullLeptonicEvent.h:9
TtFullLeptonicEvent::b
const reco::Candidate * b(const std::string &key, const unsigned &cmb=0) const
get b of the given hypothesis
Definition: TtFullLeptonicEvent.h:40
TtFullLeptonicEvent::genBBar
const reco::GenParticle * genBBar() const
get anti-b of the TtGenEvent
Definition: TtFullLeptonicEvent.h:125
TtFullLeptonicEvent::genLepton
const reco::GenParticle * genLepton() const
get lepton of the TtGenEvent
Definition: TtFullLeptonicEvent.h:129
TtEvent.h
TtFullLeptonicEvent::isWrongCharge
bool isWrongCharge() const
return if the kinematic solution of hypothesis 'cmb' is right or wrong charge if available; -1 else
Definition: TtFullLeptonicEvent.h:136
TtFullLepDaughter::TopBar
static const std::string TopBar
Definition: TtFullLeptonicEvent.h:10
crabWrapper.key
key
Definition: crabWrapper.py:19
reco::CompositeCandidate::daughter
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
Definition: CompositeCandidate.cc:30
TtFullLeptonicEvent::neutrinoBar
const reco::Candidate * neutrinoBar(const std::string &key, const unsigned &cmb=0) const
get anti-neutrino of the given hypothesis
Definition: TtFullLeptonicEvent.h:104
TtFullLeptonicEvent::top
const reco::Candidate * top(const HypoClassKey &key, const unsigned &cmb=0) const
get top of the given hypothesis
Definition: TtFullLeptonicEvent.h:36
TtFullLepDaughter::Top
static const std::string Top
Definition: TtFullLeptonicEvent.h:9