CMS 3D CMS Logo

TtSemiLeptonicEvent.cc
Go to the documentation of this file.
4 
5 #include "printParticle.h"
7 
8 // print info via MessageLogger
9 void TtSemiLeptonicEvent::print(const int verbosity) const {
10  if (verbosity % 10 <= 0)
11  return;
12 
13  edm::LogInfo log("TtSemiLeptonicEvent");
14 
15  log << "++++++++++++++++++++++++++++++++++++++++++++++++++ \n";
16 
17  // get some information from the genEvent (if available)
18  if (!genEvt_)
19  log << " TtGenEvent not available! \n";
20  else {
21  log << " TtGenEvent says: ";
22  if (!this->genEvent()->isTtBar())
23  log << "Not TtBar";
24  else if (this->genEvent()->isFullHadronic())
25  log << "Fully Hadronic TtBar";
26  else if (this->genEvent()->isFullLeptonic())
27  log << "Fully Leptonic TtBar";
28  else if (this->genEvent()->isSemiLeptonic()) {
29  log << "Semi-leptonic TtBar, ";
30  switch (this->genEvent()->semiLeptonicChannel()) {
31  case WDecay::kElec:
32  log << "Electron";
33  break;
34  case WDecay::kMuon:
35  log << "Muon";
36  break;
37  case WDecay::kTau:
38  log << "Tau";
39  break;
40  default:
41  log << "Unknown";
42  break;
43  }
44  log << " Channel";
45  }
46  log << "\n";
47  }
48 
49  // get number of available hypothesis classes
50  log << " Number of available event hypothesis classes: " << this->numberOfAvailableHypoClasses() << " \n";
51 
52  // create a legend for the jetLepComb
53  log << " - JetLepComb: ";
54  for (unsigned idx = 0; idx < 5; idx++) {
55  switch (idx) {
57  log << "LightP ";
58  break;
60  log << "LightQ ";
61  break;
63  log << " HadB ";
64  break;
66  log << " LepB ";
67  break;
69  log << "Lepton ";
70  break;
71  }
72  }
73  log << "\n";
74 
75  // get details from the hypotheses
76  typedef std::map<HypoClassKey, std::vector<HypoCombPair> >::const_iterator EventHypo;
77  for (EventHypo hyp = evtHyp_.begin(); hyp != evtHyp_.end(); ++hyp) {
78  HypoClassKey hypKey = (*hyp).first;
79  // header for each hypothesis
80  log << "-------------------------------------------------- \n";
81  switch (hypKey) {
82  case kGeom:
83  log << " Geom";
84  break;
85  case kWMassMaxSumPt:
86  log << " WMassMaxSumPt";
87  break;
88  case kMaxSumPtWMass:
89  log << " MaxSumPtWMass";
90  break;
91  case kGenMatch:
92  log << " GenMatch";
93  break;
94  case kMVADisc:
95  log << " MVADisc";
96  break;
97  case kKinFit:
98  log << " KinFit";
99  break;
100  case kKinSolution:
101  log << " KinSolution not (yet) applicable to TtSemiLeptonicEvent --> skipping";
102  continue;
103  case kWMassDeltaTopMass:
104  log << " WMassDeltaTopMass";
105  break;
106  case kHitFit:
107  log << " HitFit";
108  break;
109  default:
110  log << " Unknown TtEvent::HypoClassKey provided --> skipping";
111  continue;
112  }
113  log << "-Hypothesis: \n";
114  log << " * Number of real neutrino solutions: " << this->numberOfRealNeutrinoSolutions(hypKey) << "\n";
115  log << " * Number of considered jets : " << this->numberOfConsideredJets(hypKey) << "\n";
116  unsigned nOfHyp = this->numberOfAvailableHypos(hypKey);
117  if (nOfHyp > 1) {
118  log << " * Number of stored jet combinations: " << nOfHyp << "\n";
119  if (verbosity < 10)
120  log << " The following was found to be the best one:\n";
121  }
122  // if verbosity level is smaller than 10, never show more than the best jet combination
123  if (verbosity < 10)
124  nOfHyp = 1;
125  for (unsigned cmb = 0; cmb < nOfHyp; cmb++) {
126  // check if hypothesis is valid
127  if (!this->isHypoValid(hypKey, cmb))
128  log << " * Not valid! \n";
129  // get meta information for valid hypothesis
130  else {
131  // jetLepComb
132  log << " * JetLepComb:";
133  std::vector<int> jets = this->jetLeptonCombination(hypKey, cmb);
134  for (unsigned int iJet = 0; iJet < jets.size(); iJet++) {
135  log << " " << jets[iJet] << " ";
136  }
137  log << "\n";
138  // specialties for some hypotheses
139  switch (hypKey) {
140  case kGenMatch:
141  log << " * Sum(DeltaR) : " << this->genMatchSumDR(cmb) << " \n"
142  << " * Sum(DeltaPt): " << this->genMatchSumPt(cmb) << " \n";
143  break;
144  case kMVADisc:
145  log << " * Method : " << this->mvaMethod() << " \n"
146  << " * Discrim.: " << this->mvaDisc(cmb) << " \n";
147  break;
148  case kKinFit:
149  log << " * Chi^2 : " << this->fitChi2(cmb) << " \n"
150  << " * Prob(Chi^2): " << this->fitProb(cmb) << " \n";
151  break;
152  case kHitFit:
153  log << " * Chi^2 : " << this->hitFitChi2(cmb) << " \n"
154  << " * Prob(Chi^2): " << this->hitFitProb(cmb) << " \n"
155  << " * Top mass : " << this->hitFitMT(cmb) << " +/- " << this->hitFitSigMT(cmb) << " \n";
156  break;
157  default:
158  break;
159  }
160  // kinematic quantities of particles (if last digit of verbosity level > 1)
161  if (verbosity % 10 >= 2) {
162  log << " * Candidates (pt; eta; phi; mass):\n";
163  if (verbosity % 10 >= 3)
164  printParticle(log, "top pair", this->topPair(hypKey, cmb));
165  printParticle(log, "hadronic top", this->hadronicDecayTop(hypKey, cmb));
166  printParticle(log, "hadronic W ", this->hadronicDecayW(hypKey, cmb));
167  if (verbosity % 10 >= 3) {
168  printParticle(log, "hadronic b ", this->hadronicDecayB(hypKey, cmb));
169  printParticle(log, "hadronic p ", this->hadronicDecayQuark(hypKey, cmb));
170  printParticle(log, "hadronic q ", this->hadronicDecayQuarkBar(hypKey, cmb));
171  }
172  printParticle(log, "leptonic top", this->leptonicDecayTop(hypKey, cmb));
173  printParticle(log, "leptonic W ", this->leptonicDecayW(hypKey, cmb));
174  if (verbosity % 10 >= 3) {
175  printParticle(log, "leptonic b ", this->leptonicDecayB(hypKey, cmb));
176  printParticle(log, "lepton ", this->singleLepton(hypKey, cmb));
177  printParticle(log, "neutrino ", this->singleNeutrino(hypKey, cmb));
178  }
179  }
180  }
181  }
182  }
183 
184  log << "++++++++++++++++++++++++++++++++++++++++++++++++++";
185 }
TtEvent::kWMassMaxSumPt
Definition: TtEvent.h:28
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
TtEvent::hitFitSigMT
double hitFitSigMT(const unsigned &cmb=0) const
return the hitfit top mass uncertainty of hypothesis 'cmb' if available; -1 else
Definition: TtEvent.h:134
TtSemiLeptonicEvent::numberOfRealNeutrinoSolutions
const int numberOfRealNeutrinoSolutions(const HypoClassKey &key) const
get number of real neutrino solutions for a given hypo class
Definition: TtSemiLeptonicEvent.h:146
TtSemiLepEvtPartons::LightQBar
Definition: TtSemiLepEvtPartons.h:25
MessageLogger.h
TtSemiLeptonicEvent::hadronicDecayB
const reco::GenParticle * hadronicDecayB() const
get hadronic b of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:117
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
TtEvent::numberOfConsideredJets
int numberOfConsideredJets(const std::string &key) const
return number of jets that were considered when building a given hypothesis
Definition: TtEvent.h:96
TtSemiLepEvtPartons::LepB
Definition: TtSemiLepEvtPartons.h:25
printParticle.h
TtEvent::evtHyp_
std::map< HypoClassKey, std::vector< HypoCombPair > > evtHyp_
Definition: TtEvent.h:191
TtEvent::genMatchSumDR
double genMatchSumDR(const unsigned &cmb=0) const
return the sum dr of the generator match if available; -1 else
Definition: TtEvent.h:116
TtSemiLeptonicEvent::hadronicDecayQuark
const reco::GenParticle * hadronicDecayQuark() const
get hadronic light quark of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:121
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
TtEvent::kKinFit
Definition: TtEvent.h:32
TtSemiLepEvtPartons.h
TtEvent::hitFitMT
double hitFitMT(const unsigned &cmb=0) const
return the hitfit top mass of hypothesis 'cmb' if available; -1 else
Definition: TtEvent.h:132
TtEvent::fitChi2
double fitChi2(const unsigned &cmb=0) const
return the chi2 of the kinematic fit of hypothesis 'cmb' if available; -1 else
Definition: TtEvent.h:124
TtEvent::fitProb
double fitProb(const unsigned &cmb=0) const
return the fit probability of hypothesis 'cmb' if available; -1 else
Definition: TtEvent.h:128
TtSemiLeptonicEvent::singleNeutrino
const reco::GenParticle * singleNeutrino() const
get neutrino of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:139
TtEvent::jetLeptonCombination
std::vector< int > jetLeptonCombination(const std::string &key, const unsigned &cmb=0) const
return the vector of jet lepton combinatorics for a given hypothesis and class
Definition: TtEvent.h:104
TtSemiLepEvtPartons::Lepton
Definition: TtSemiLepEvtPartons.h:25
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TtEvent::numberOfAvailableHypos
unsigned int numberOfAvailableHypos(const std::string &key) const
return number of available hypotheses within a given hypothesis class
Definition: TtEvent.h:88
TtSemiLeptonicEvent::singleLepton
const reco::GenParticle * singleLepton() const
get lepton top of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:137
TtEvent::mvaDisc
double mvaDisc(const unsigned &cmb=0) const
return the mva discriminant value of hypothesis 'cmb' if available; -1 else
Definition: TtEvent.h:122
TtEvent::genEvent
const edm::RefProd< TtGenEvent > & genEvent() const
get TtGenEvent
Definition: TtEvent.h:63
TtSemiLeptonicEvent.h
TtEvent::kMVADisc
Definition: TtEvent.h:31
ttevent::printParticle
void printParticle(edm::LogInfo &log, const char *name, const reco::Candidate *cand)
print pt, eta, phi, mass of a given candidate into an existing LogInfo
Definition: printParticle.cc:20
TtSemiLeptonicEvent::hadronicDecayQuarkBar
const reco::GenParticle * hadronicDecayQuarkBar() const
get hadronic light quark of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:125
TtEvent::kHitFit
Definition: TtEvent.h:35
TtEvent::HypoClassKey
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:26
TtSemiLepEvtPartons::HadB
Definition: TtSemiLepEvtPartons.h:25
TtEvent::hitFitProb
double hitFitProb(const unsigned &cmb=0) const
return the hitfit probability of hypothesis 'cmb' if available; -1 else
Definition: TtEvent.h:130
TtSemiLeptonicEvent::hadronicDecayTop
const reco::GenParticle * hadronicDecayTop() const
get hadronic top of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:113
TtSemiLeptonicEvent::leptonicDecayW
const reco::GenParticle * leptonicDecayW() const
get leptonic W of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:135
TtSemiLepEvtPartons::LightQ
Definition: TtSemiLepEvtPartons.h:25
TtEvent::hitFitChi2
double hitFitChi2(const unsigned &cmb=0) const
return the hitfit chi2 of hypothesis 'cmb' if available; -1 else
Definition: TtEvent.h:126
TtEvent::kWMassDeltaTopMass
Definition: TtEvent.h:34
TtSemiLeptonicEvent::leptonicDecayB
const reco::GenParticle * leptonicDecayB() const
get leptonic b of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:133
WDecay::kTau
Definition: TopGenEvent.h:27
TtEvent::kGenMatch
Definition: TtEvent.h:30
TtEvent::kKinSolution
Definition: TtEvent.h:33
WDecay::kMuon
Definition: TopGenEvent.h:27
TtEvent::topPair
const math::XYZTLorentzVector * topPair() const
get combined 4-vector of top and topBar from the TtGenEvent
Definition: TtEvent.h:151
TtSemiLeptonicEvent::leptonicDecayTop
const reco::GenParticle * leptonicDecayTop() const
get leptonic top of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:129
TtEvent::mvaMethod
std::string mvaMethod() const
return the label of the mva method in use for the jet parton association (if kMVADisc is not availabl...
Definition: TtEvent.h:120
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
TtEvent::kMaxSumPtWMass
Definition: TtEvent.h:29
TtEvent::numberOfAvailableHypoClasses
unsigned int numberOfAvailableHypoClasses() const
return number of available hypothesis classes
Definition: TtEvent.h:86
TtSemiLeptonicEvent::print
void print(const int verbosity=1) const
Definition: TtSemiLeptonicEvent.cc:9
TtSemiLeptonicEvent::hadronicDecayW
const reco::GenParticle * hadronicDecayW() const
get hadronic W of the TtGenEvent
Definition: TtSemiLeptonicEvent.h:119
WDecay::kElec
Definition: TopGenEvent.h:27
edm::Log
Definition: MessageLogger.h:70
TtEvent::kGeom
Definition: TtEvent.h:27
TtEvent::genMatchSumPt
double genMatchSumPt(const unsigned &cmb=0) const
return the sum pt of the generator match if available; -1 else
Definition: TtEvent.h:112