CMS 3D CMS Logo

TtFullHadronicEvent.cc
Go to the documentation of this file.
4 
5 #include "printParticle.h"
7 
8 // print info via MessageLogger
9 void TtFullHadronicEvent::print(const int verbosity) const {
10  if (verbosity % 10 <= 0)
11  return;
12 
13  edm::LogInfo log("TtFullHadronicEvent");
14 
15  log << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \n";
16 
17  // get some information from the genEvent
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()->isSemiLeptonic())
27  log << "Semi-leptonic TtBar";
28  else if (this->genEvent()->isFullLeptonic())
29  log << "Fully Leptonic TtBar";
30  log << "\n";
31  }
32  // get number of available hypothesis classes
33  log << " Number of available event hypothesis classes: " << this->numberOfAvailableHypoClasses() << " \n";
34 
35  // create a legend for the jetLepComb
36  log << " - JetCombi : ";
37  for (unsigned idx = 0; idx < 6; idx++) {
38  switch (idx) {
40  log << " LightQ ";
41  break;
43  log << " LightQBar";
44  break;
46  log << " B ";
47  break;
49  log << " LightP ";
50  break;
52  log << " LightPBar";
53  break;
55  log << " BBar ";
56  break;
57  }
58  }
59  log << "\n";
60 
61  // get details from the hypotheses
62  typedef std::map<HypoClassKey, std::vector<HypoCombPair> >::const_iterator EventHypo;
63  for (EventHypo hyp = evtHyp_.begin(); hyp != evtHyp_.end(); ++hyp) {
64  HypoClassKey hypKey = (*hyp).first;
65  // header for each hypothesis
66  log << "---------------------------------------------------------------------------- \n";
67  switch (hypKey) {
68  case kGeom:
69  log << " Geom not (yet) applicable to TtFullHadronicEvent --> skipping";
70  continue;
71  case kWMassMaxSumPt:
72  log << " WMassMaxSumPt not (yet) applicable to TtFullHadronicEvent --> skipping";
73  continue;
74  case kMaxSumPtWMass:
75  log << " MaxSumPtWMass not (yet) applicable to TtFullHadronicEvent --> skipping";
76  continue;
77  case kGenMatch:
78  log << " GenMatch";
79  break;
80  case kMVADisc:
81  log << " MVADisc not (yet) applicable to TtFullHadronicEvent --> skipping";
82  continue;
83  case kKinFit:
84  log << " KinFit";
85  break;
86  case kKinSolution:
87  log << " KinSolution not (yet) applicable to TtFullHadronicEvent --> skipping";
88  continue;
89  case kWMassDeltaTopMass:
90  log << " WMassDeltaTopMass not (yet) applicable to TtFullHadronicEvent --> skipping";
91  continue;
92  case kHitFit:
93  log << " HitFit not (yet) applicable to TtFullHadronicEvent --> skipping";
94  continue;
95  default:
96  log << " Unknown TtEvent::HypoClassKey provided --> skipping";
97  continue;
98  }
99  log << "-Hypothesis: \n";
100  unsigned nOfHyp = this->numberOfAvailableHypos(hypKey);
101  if (nOfHyp > 1) {
102  log << " * Number of available jet combinations: " << nOfHyp << " \n";
103  if (verbosity < 10)
104  log << " The following was found to be the best one: \n";
105  }
106  // if verbosity level is smaller than 10, never show more than the best jet combination
107  if (verbosity < 10)
108  nOfHyp = 1;
109  for (unsigned cmb = 0; cmb < nOfHyp; ++cmb) {
110  // check if hypothesis is valid
111  if (!this->isHypoValid(hypKey, cmb))
112  log << " * Not valid! \n";
113  // get meta information for valid hypothesis
114  else {
115  // jetLepComb
116  log << " * JetCombi :";
117  std::vector<int> jets = this->jetLeptonCombination(hypKey, cmb);
118  for (unsigned int iJet = 0; iJet < jets.size(); iJet++) {
119  log << " " << jets[iJet] << " ";
120  }
121  log << "\n";
122  // specialties for some hypotheses
123  switch (hypKey) {
124  case kGenMatch:
125  log << " * Sum(DeltaR) : " << this->genMatchSumDR(cmb) << " \n"
126  << " * Sum(DeltaPt): " << this->genMatchSumPt(cmb) << " \n";
127  break;
128  case kKinFit:
129  log << " * Chi^2 : " << this->fitChi2(cmb) << " \n"
130  << " * Prob(Chi^2) : " << this->fitProb(cmb) << " \n";
131  break;
132  default:
133  break;
134  }
135  // kinematic quantities of particles (if last digit of verbosity level > 1)
136  if (verbosity % 10 >= 2) {
137  log << " * Candidates (pt; eta; phi; mass) :\n";
138  if (verbosity % 10 >= 3)
139  printParticle(log, "top pair", this->topPair(hypKey, cmb));
140  printParticle(log, "top ", this->top(hypKey, cmb));
141  printParticle(log, "W plus ", this->wPlus(hypKey, cmb));
142  if (verbosity % 10 >= 3) {
143  printParticle(log, "b ", this->b(hypKey, cmb));
144  printParticle(log, "lightQ ", this->lightQ(hypKey, cmb));
145  printParticle(log, "lightQBar ", this->lightQBar(hypKey, cmb));
146  }
147  printParticle(log, "topBar ", this->topBar(hypKey, cmb));
148  printParticle(log, "W minus ", this->wMinus(hypKey, cmb));
149  if (verbosity % 10 >= 3) {
150  printParticle(log, "bBar ", this->bBar(hypKey, cmb));
151  printParticle(log, "lightP ", this->lightP(hypKey, cmb));
152  printParticle(log, "lightPBar ", this->lightPBar(hypKey, cmb));
153  }
154  }
155  }
156  }
157  }
158  log << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
159 }
TtEvent::kWMassMaxSumPt
Definition: TtEvent.h:28
ctppsCommonDQMSource_cfi.verbosity
verbosity
Definition: ctppsCommonDQMSource_cfi.py:14
TtEvent::genEvt_
edm::RefProd< TtGenEvent > genEvt_
reference to TtGenEvent (has to be kept in the event!)
Definition: TtEvent.h:188
MessageLogger.h
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
TtFullHadEvtPartons::LightQ
Definition: TtFullHadEvtPartons.h:25
printParticle.h
TtFullHadronicEvent::lightQ
const reco::GenParticle * lightQ() const
get light Q of the TtGenEvent
Definition: TtFullHadronicEvent.h:126
TtEvent::evtHyp_
std::map< HypoClassKey, std::vector< HypoCombPair > > evtHyp_
Definition: TtEvent.h:191
TtFullHadronicEvent::topBar
const reco::GenParticle * topBar() const
get anti-top of the TtGenEvent
Definition: TtFullHadronicEvent.h:134
TtFullHadronicEvent::bBar
const reco::GenParticle * bBar() const
get anti-b of the TtGenEvent
Definition: TtFullHadronicEvent.h:136
TtFullHadronicEvent::b
const reco::GenParticle * b() const
get b of the TtGenEvent
Definition: TtFullHadronicEvent.h:123
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
TtFullHadEvtPartons::LightP
Definition: TtFullHadEvtPartons.h:25
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
TtEvent::kKinFit
Definition: TtEvent.h:32
TtFullHadronicEvent::print
void print(const int verbosity=1) const
Definition: TtFullHadronicEvent.cc:9
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
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
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
TtEvent::genEvent
const edm::RefProd< TtGenEvent > & genEvent() const
get TtGenEvent
Definition: TtEvent.h:63
TtFullHadronicEvent::lightP
const reco::GenParticle * lightP() const
get light P of the TtGenEvent
Definition: TtFullHadronicEvent.h:128
TtEvent::kMVADisc
Definition: TtEvent.h:31
TtFullHadronicEvent.h
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
TtEvent::kHitFit
Definition: TtEvent.h:35
TtEvent::HypoClassKey
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:26
TtFullHadEvtPartons::LightPBar
Definition: TtFullHadEvtPartons.h:25
TtFullHadEvtPartons::LightQBar
Definition: TtFullHadEvtPartons.h:25
TtEvent::kWMassDeltaTopMass
Definition: TtEvent.h:34
TtFullHadronicEvent::top
const reco::GenParticle * top() const
get top of the TtGenEvent
Definition: TtFullHadronicEvent.h:121
TtFullHadronicEvent::lightQBar
const reco::GenParticle * lightQBar() const
get light Q bar of the TtGenEvent
Definition: TtFullHadronicEvent.h:139
TtEvent::kGenMatch
Definition: TtEvent.h:30
TtEvent::kKinSolution
Definition: TtEvent.h:33
TtFullHadEvtPartons::BBar
Definition: TtFullHadEvtPartons.h:25
TtEvent::topPair
const math::XYZTLorentzVector * topPair() const
get combined 4-vector of top and topBar from the TtGenEvent
Definition: TtEvent.h:151
TtFullHadronicEvent::wPlus
const reco::GenParticle * wPlus() const
get Wplus of the TtGenEvent
Definition: TtFullHadronicEvent.h:131
TtFullHadronicEvent::wMinus
const reco::GenParticle * wMinus() const
get Wminus of the TtGenEvent
Definition: TtFullHadronicEvent.h:148
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
TtFullHadEvtPartons.h
TtEvent::kMaxSumPtWMass
Definition: TtEvent.h:29
TtEvent::numberOfAvailableHypoClasses
unsigned int numberOfAvailableHypoClasses() const
return number of available hypothesis classes
Definition: TtEvent.h:86
TtFullHadronicEvent::lightPBar
const reco::GenParticle * lightPBar() const
get light P bar of the TtGenEvent
Definition: TtFullHadronicEvent.h:143
TtFullHadEvtPartons::B
Definition: TtFullHadEvtPartons.h:25
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