CMS 3D CMS Logo

TtFullLeptonicEvent.cc
Go to the documentation of this file.
4 
5 // print info via MessageLogger
6 void TtFullLeptonicEvent::print(const int verbosity) const {
7  if (verbosity % 10 <= 0)
8  return;
9 
10  edm::LogInfo log("TtFullLeptonicEvent");
11 
12  log << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \n";
13 
14  // get some information from the genEvent
15  log << " TtGenEvent says: ";
16  if (!this->genEvent()->isTtBar())
17  log << "Not TtBar";
18  else if (this->genEvent()->isFullHadronic())
19  log << "Fully Hadronic TtBar";
20  else if (this->genEvent()->isSemiLeptonic())
21  log << "Semi-leptonic TtBar";
22  else if (this->genEvent()->isFullLeptonic()) {
23  log << "Fully Leptonic TtBar, ";
24  switch (this->genEvent()->fullLeptonicChannel().first) {
25  case WDecay::kElec:
26  log << "Electron-";
27  break;
28  case WDecay::kMuon:
29  log << "Muon-";
30  break;
31  case WDecay::kTau:
32  log << "Tau-";
33  break;
34  default:
35  log << "Unknown-";
36  break;
37  }
38  switch (this->genEvent()->fullLeptonicChannel().second) {
39  case WDecay::kElec:
40  log << "Electron-";
41  break;
42  case WDecay::kMuon:
43  log << "Muon-";
44  break;
45  case WDecay::kTau:
46  log << "Tau-";
47  break;
48  default:
49  log << "Unknown-";
50  break;
51  }
52  log << "Channel";
53  }
54  log << "\n";
55 
56  // get number of available hypothesis classes
57  log << " Number of available event hypothesis classes: " << this->numberOfAvailableHypoClasses() << " \n";
58 
59  // create a legend for the jetLepComb
60  log << " - JetLepComb: ";
61  log << " b ";
62  log << " bbar ";
63  log << " e1(+) ";
64  log << " e2(-) ";
65  log << " mu1(+)";
66  log << " mu2(-)";
67  log << "\n";
68 
69  // get details from the hypotheses
70  typedef std::map<HypoClassKey, std::vector<HypoCombPair> >::const_iterator EventHypo;
71  for (EventHypo hyp = evtHyp_.begin(); hyp != evtHyp_.end(); ++hyp) {
72  HypoClassKey hypKey = (*hyp).first;
73  // header for each hypothesis
74  log << "------------------------------------------------------------ \n";
75  switch (hypKey) {
76  case kGeom:
77  log << " Geom not (yet) applicable to TtFullLeptonicEvent --> skipping";
78  continue;
79  case kWMassMaxSumPt:
80  log << " WMassMaxSumPt not (yet) applicable to TtFullLeptonicEvent --> skipping";
81  continue;
82  case kMaxSumPtWMass:
83  log << " MaxSumPtWMass not (yet) applicable to TtFullLeptonicEvent --> skipping";
84  continue;
85  case kGenMatch:
86  log << " GenMatch";
87  break;
88  case kMVADisc:
89  log << " MVADisc not (yet) applicable to TtFullLeptonicEvent --> skipping";
90  continue;
91  case kKinFit:
92  log << " KinFit not (yet) applicable to TtFullLeptonicEvent --> skipping";
93  continue;
94  case kKinSolution:
95  log << " KinSolution";
96  break;
97  case kWMassDeltaTopMass:
98  log << " WMassDeltaTopMass not (yet) applicable to TtFullLeptonicEvent --> skipping";
99  continue;
100  case kHitFit:
101  log << " HitFit not (yet) applicable to TtFullLeptonicEvent --> skipping";
102  continue;
103  default:
104  log << " Unknown TtEvent::HypoClassKey provided --> skipping";
105  continue;
106  }
107  log << "-Hypothesis: \n";
108  unsigned nOfHyp = this->numberOfAvailableHypos(hypKey);
109  if (nOfHyp > 1) {
110  log << " * Number of available jet combinations: " << nOfHyp << "\n";
111  if (verbosity < 10)
112  log << " The following was found to be the best one:\n";
113  }
114  // if verbosity level is smaller than 10, never show more than the best jet combination
115  if (verbosity < 10)
116  nOfHyp = 1;
117  for (unsigned cmb = 0; cmb < nOfHyp; cmb++) {
118  // check if hypothesis is valid
119  if (!this->isHypoValid(hypKey, cmb))
120  log << " * Not valid! \n";
121  // get meta information for valid hypothesis
122  else {
123  // jetLepComb
124  log << " * JetLepComb:";
125  std::vector<int> jets = this->jetLeptonCombination(hypKey, cmb);
126  for (unsigned int iJet = 0; iJet < jets.size(); iJet++) {
127  log << " " << jets[iJet] << " ";
128  }
129  log << "\n";
130  // specialties for some hypotheses
131  switch (hypKey) {
132  case kGenMatch:
133  log << " * Sum(DeltaR) : " << this->genMatchSumDR(cmb) << " \n"
134  << " * Sum(DeltaPt): " << this->genMatchSumPt(cmb) << " \n";
135  break;
136  case kKinSolution:
137  log << " * Weight : " << this->solWeight(cmb) << " \n"
138  << " * isWrongCharge: " << this->isWrongCharge() << " \n";
139  break;
140  default:
141  break;
142  }
143  // kinematic quantities of particles (if last digit of verbosity level > 1)
144  if (verbosity % 10 >= 2) {
145  log << " * Candidates (pt; eta; phi; mass):\n";
146  if (verbosity % 10 >= 3)
147  printParticle(log, "top pair", this->topPair(hypKey, cmb));
148  printParticle(log, "top ", this->top(hypKey, cmb));
149  printParticle(log, "W plus ", this->wPlus(hypKey, cmb));
150  if (verbosity % 10 >= 3) {
151  printParticle(log, "b ", this->b(hypKey, cmb));
152  printParticle(log, "leptonBar ", this->leptonBar(hypKey, cmb));
153  printParticle(log, "neutrino ", this->neutrino(hypKey, cmb));
154  }
155  printParticle(log, "topBar ", this->topBar(hypKey, cmb));
156  printParticle(log, "W minus ", this->wMinus(hypKey, cmb));
157  if (verbosity % 10 >= 3) {
158  printParticle(log, "bBar ", this->bBar(hypKey, cmb));
159  printParticle(log, "lepton ", this->lepton(hypKey, cmb));
160  printParticle(log, "neutrinoBar ", this->neutrinoBar(hypKey, cmb));
161  }
162  }
163  }
164  }
165  }
166 
167  log << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
168 }
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
TtEvent::kWMassMaxSumPt
Definition: TtEvent.h:32
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
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:82
TtFullLeptonicEvent.h
edm::LogInfo
Definition: MessageLogger.h:254
TtEvent::evtHyp_
std::map< HypoClassKey, std::vector< HypoCombPair > > evtHyp_
Definition: TtEvent.h:198
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
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
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
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
TtEvent::kKinFit
Definition: TtEvent.h:36
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
dqmdumpme.first
first
Definition: dqmdumpme.py:55
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
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
TtEvent::numberOfAvailableHypos
unsigned int numberOfAvailableHypos(const std::string &key) const
return number of available hypotheses within a given hypothesis class
Definition: TtEvent.h:92
TtEvent::genEvent
const edm::RefProd< TtGenEvent > & genEvent() const
get TtGenEvent
Definition: TtEvent.h:67
TtFullLeptonicEvent::print
void print(const int verbosity=1) const
Definition: TtFullLeptonicEvent.cc:6
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
TtEvent::kMVADisc
Definition: TtEvent.h:35
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
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
TtEvent::kHitFit
Definition: TtEvent.h:39
TtEvent::HypoClassKey
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:30
TtEvent::kWMassDeltaTopMass
Definition: TtEvent.h:38
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
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
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
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
TtEvent::kMaxSumPtWMass
Definition: TtEvent.h:33
TtEvent::numberOfAvailableHypoClasses
unsigned int numberOfAvailableHypoClasses() const
return number of available hypothesis classes
Definition: TtEvent.h:90
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
WDecay::kElec
Definition: TopGenEvent.h:27
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
TtFullLepEvtPartons.h
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