CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtFullLeptonicEvent.cc
Go to the documentation of this file.
4 
5 // print info via MessageLogger
6 void
8 {
9  if(verbosity%10 <= 0)
10  return;
11 
12  edm::LogInfo log("TtFullLeptonicEvent");
13 
14  log << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \n";
15 
16  // get some information from the genEvent
17  log << " TtGenEvent says: ";
18  if( !this->genEvent()->isTtBar() ) log << "Not TtBar";
19  else if( this->genEvent()->isFullHadronic() ) log << "Fully Hadronic TtBar";
20  else if( this->genEvent()->isSemiLeptonic() ) log << "Semi-leptonic TtBar";
21  else if( this->genEvent()->isFullLeptonic() ) {
22  log << "Fully Leptonic TtBar, ";
23  switch( this->genEvent()->fullLeptonicChannel().first ) {
24  case WDecay::kElec : log << "Electron-"; break;
25  case WDecay::kMuon : log << "Muon-" ; break;
26  case WDecay::kTau : log << "Tau-" ; break;
27  default : log << "Unknown-" ; break;
28  }
29  switch( this->genEvent()->fullLeptonicChannel().second ) {
30  case WDecay::kElec : log << "Electron-"; break;
31  case WDecay::kMuon : log << "Muon-" ; break;
32  case WDecay::kTau : log << "Tau-" ; break;
33  default : log << "Unknown-" ; break;
34  }
35  log << "Channel";
36  }
37  log << "\n";
38 
39  // get number of available hypothesis classes
40  log << " Number of available event hypothesis classes: " << this->numberOfAvailableHypoClasses() << " \n";
41 
42  // create a legend for the jetLepComb
43  log << " - JetLepComb: ";
44  log << " b ";
45  log << " bbar ";
46  log << " e1(+) ";
47  log << " e2(-) ";
48  log << " mu1(+)";
49  log << " mu2(-)";
50  log << "\n";
51 
52  // get details from the hypotheses
53  typedef std::map<HypoClassKey, std::vector<HypoCombPair> >::const_iterator EventHypo;
54  for(EventHypo hyp = evtHyp_.begin(); hyp != evtHyp_.end(); ++hyp) {
55  HypoClassKey hypKey = (*hyp).first;
56  // header for each hypothesis
57  log << "------------------------------------------------------------ \n";
58  switch(hypKey) {
59  case kGeom : log << " Geom" ; break;
60  case kWMassMaxSumPt : log << " WMassMaxSumPt"; break;
61  case kMaxSumPtWMass : log << " MaxSumPtWMass"; break;
62  case kGenMatch : log << " GenMatch" ; break;
63  case kMVADisc : log << " MVADisc" ; break;
64  case kKinFit : log << " KinFit" ; break;
65  case kKinSolution : log << " KinSolution" ; break;
66  default : log << " Unknown";
67  }
68  log << "-Hypothesis: \n";
69  unsigned nOfHyp = this->numberOfAvailableHypos(hypKey);
70  if(nOfHyp > 1) {
71  log << " * Number of available jet combinations: " << nOfHyp << "\n";
72  if(verbosity < 10)
73  log << " The following was found to be the best one:\n";
74  }
75  // if verbosity level is smaller than 10, never show more than the best jet combination
76  if(verbosity < 10)
77  nOfHyp = 1;
78  for(unsigned cmb=0; cmb<nOfHyp; cmb++) {
79  // check if hypothesis is valid
80  if( !this->isHypoValid(hypKey, cmb) )
81  log << " * Not valid! \n";
82  // get meta information for valid hypothesis
83  else {
84  // jetLepComb
85  log << " * JetLepComb:";
86  std::vector<int> jets = this->jetLeptonCombination(hypKey, cmb);
87  for(unsigned int iJet = 0; iJet < jets.size(); iJet++) {
88  log << " " << jets[iJet] << " ";
89  }
90  log << "\n";
91  // specialties for some hypotheses
92  switch(hypKey) {
93  case kGenMatch : log << " * Sum(DeltaR) : " << this->genMatchSumDR(cmb) << " \n"
94  << " * Sum(DeltaPt): " << this->genMatchSumPt(cmb) << " \n"; break;
95  case kKinSolution : log << " * Weight : " << this->solWeight(cmb) << " \n"
96  << " * isWrongCharge: " << this->isWrongCharge() << " \n"; break;
97  default : break;
98  }
99  // kinematic quantities of particles (if last digit of verbosity level > 1)
100  if(verbosity%10 >= 2) {
101  log << " * Candidates (pt; eta; phi; mass):\n";
102  printParticle(log, "top ", this->top (hypKey, cmb));
103  printParticle(log, "W plus ", this->wPlus(hypKey, cmb));
104  if(verbosity%10 >= 3) {
105  printParticle(log, "b ", this->b (hypKey, cmb));
106  printParticle(log, "leptonBar ", this->leptonBar(hypKey, cmb));
107  printParticle(log, "neutrino ", this->neutrino (hypKey, cmb));
108  }
109  printParticle(log, "topBar ", this->topBar(hypKey, cmb));
110  printParticle(log, "W minus ", this->wMinus(hypKey, cmb));
111  if(verbosity%10 >= 3) {
112  printParticle(log, "bBar ", this->bBar (hypKey, cmb));
113  printParticle(log, "lepton ", this->lepton (hypKey, cmb));
114  printParticle(log, "neutrinoBar ", this->neutrinoBar(hypKey, cmb));
115  }
116  }
117  }
118  }
119  }
120 
121  log << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
122 }
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:31
const reco::Candidate * bBar(const std::string &key, const unsigned &cmb=0) const
get anti-b of the given hypothesis
const edm::RefProd< TtGenEvent > & genEvent() const
get TtGenEvent
Definition: TtEvent.h:53
unsigned int numberOfAvailableHypos(const std::string &key) const
return number of available hypotheses within a given hypothesis class
Definition: TtEvent.h:70
const reco::Candidate * top(const std::string &key, const unsigned &cmb=0) const
get top of the given hypothesis
unsigned int numberOfAvailableHypoClasses() const
return number of available hypothesis classes
Definition: TtEvent.h:68
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:50
const reco::Candidate * lepton(const std::string &key, const unsigned &cmb=0) const
get lepton of the given hypothesis
U second(std::pair< T, U > const &p)
double genMatchSumDR(const unsigned &cmb=0) const
return the sum dr of the generator match if available; -1 else
Definition: TtEvent.h:80
void print(const int verbosity=1) const
const reco::Candidate * neutrino(const std::string &key, const unsigned &cmb=0) const
get neutrino of the given hypothesis
bool isWrongCharge() const
return if the kinematic solution of hypothesis &#39;cmb&#39; is right or wrong charge if available; -1 else ...
bool first
Definition: L1TdeRCT.cc:79
const reco::Candidate * neutrinoBar(const std::string &key, const unsigned &cmb=0) const
get anti-neutrino of the given hypothesis
const int verbosity
const reco::Candidate * b(const std::string &key, const unsigned &cmb=0) const
get b of the given hypothesis
Log< T >::type log(const T &t)
Definition: Log.h:22
const reco::Candidate * topBar(const std::string &key, const unsigned &cmb=0) const
get anti-top of the given hypothesis
double solWeight(const unsigned &cmb=0) const
return the weight of the kinematic solution of hypothesis &#39;cmb&#39; if available; -1 else ...
const reco::Candidate * wPlus(const std::string &key, const unsigned &cmb=0) const
get Wplus of the given hypothesis
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:64
double genMatchSumPt(const unsigned &cmb=0) const
return the sum pt of the generator match if available; -1 else
Definition: TtEvent.h:78
const reco::Candidate * wMinus(const std::string &key, const unsigned &cmb=0) const
get Wminus of the given hypothesis
std::map< HypoClassKey, std::vector< HypoCombPair > > evtHyp_
Definition: TtEvent.h:124
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:74
const reco::Candidate * leptonBar(const std::string &key, const unsigned &cmb=0) const
get anti-lepton of the given hypothesis