CMS 3D CMS Logo

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