CMS 3D CMS Logo

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