CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtSemiLeptonicEvent.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("TtSemiLeptonicEvent");
13 
14  log << "++++++++++++++++++++++++++++++++++++++++++++++++++ \n";
15 
16  // get some information from the genEvent (if available)
17  if( !genEvt_ ) log << " TtGenEvent not available! \n";
18  else {
19  log << " TtGenEvent says: ";
20  if( !this->genEvent()->isTtBar() ) log << "Not TtBar";
21  else if( this->genEvent()->isFullHadronic() ) log << "Fully Hadronic TtBar";
22  else if( this->genEvent()->isFullLeptonic() ) log << "Fully Leptonic TtBar";
23  else if( this->genEvent()->isSemiLeptonic() ) {
24  log << "Semi-leptonic TtBar, ";
25  switch( this->genEvent()->semiLeptonicChannel() ) {
26  case WDecay::kElec : log << "Electron"; break;
27  case WDecay::kMuon : log << "Muon" ; break;
28  case WDecay::kTau : log << "Tau" ; break;
29  default : log << "Unknown" ; break;
30  }
31  log << " Channel";
32  }
33  log << "\n";
34  }
35 
36  // get number of available hypothesis classes
37  log << " Number of available event hypothesis classes: " << this->numberOfAvailableHypoClasses() << " \n";
38 
39  // create a legend for the jetLepComb
40  log << " - JetLepComb: ";
41  for(unsigned idx = 0; idx < 5; idx++) {
42  switch(idx) {
43  case TtSemiLepEvtPartons::LightQ : log << "LightP "; break;
44  case TtSemiLepEvtPartons::LightQBar : log << "LightQ "; break;
45  case TtSemiLepEvtPartons::HadB : log << " HadB "; break;
46  case TtSemiLepEvtPartons::LepB : log << " LepB "; break;
47  case TtSemiLepEvtPartons::Lepton : log << "Lepton "; break;
48  }
49  }
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 not (yet) applicable to TtSemiLeptonicEvent --> skipping"; continue;
66  case kWMassDeltaTopMass : log << " WMassDeltaTopMass" ; break;
67  case kHitFit : log << " HitFit" ; break;
68  default : log << " Unknown TtEvent::HypoClassKey provided --> skipping" ; continue;
69  }
70  log << "-Hypothesis: \n";
71  log << " * Number of real neutrino solutions: " << this->numberOfRealNeutrinoSolutions(hypKey) << "\n";
72  log << " * Number of considered jets : " << this->numberOfConsideredJets(hypKey) << "\n";
73  unsigned nOfHyp = this->numberOfAvailableHypos(hypKey);
74  if(nOfHyp > 1) {
75  log << " * Number of stored jet combinations: " << nOfHyp << "\n";
76  if(verbosity < 10)
77  log << " The following was found to be the best one:\n";
78  }
79  // if verbosity level is smaller than 10, never show more than the best jet combination
80  if(verbosity < 10)
81  nOfHyp = 1;
82  for(unsigned cmb=0; cmb<nOfHyp; cmb++) {
83  // check if hypothesis is valid
84  if( !this->isHypoValid(hypKey, cmb) )
85  log << " * Not valid! \n";
86  // get meta information for valid hypothesis
87  else {
88  // jetLepComb
89  log << " * JetLepComb:";
90  std::vector<int> jets = this->jetLeptonCombination(hypKey, cmb);
91  for(unsigned int iJet = 0; iJet < jets.size(); iJet++) {
92  log << " " << jets[iJet] << " ";
93  }
94  log << "\n";
95  // specialties for some hypotheses
96  switch(hypKey) {
97  case kGenMatch : log << " * Sum(DeltaR) : " << this->genMatchSumDR(cmb) << " \n"
98  << " * Sum(DeltaPt): " << this->genMatchSumPt(cmb) << " \n"; break;
99  case kMVADisc : log << " * Method : " << this->mvaMethod() << " \n"
100  << " * Discrim.: " << this->mvaDisc(cmb) << " \n"; break;
101  case kKinFit : log << " * Chi^2 : " << this->fitChi2(cmb) << " \n"
102  << " * Prob(Chi^2): " << this->fitProb(cmb) << " \n"; break;
103  case kHitFit : log << " * Chi^2 : " << this->hitFitChi2(cmb) << " \n"
104  << " * Prob(Chi^2): " << this->hitFitProb(cmb) << " \n"
105  << " * Top mass : " << this->hitFitMT(cmb) << " +/- " << this->hitFitSigMT(cmb) << " \n"; break;
106  default : break;
107  }
108  // kinematic quantities of particles (if last digit of verbosity level > 1)
109  if(verbosity%10 >= 2) {
110  log << " * Candidates (pt; eta; phi; mass):\n";
111  if(verbosity%10 >= 3)
112  printParticle(log, "top pair", this->topPair(hypKey, cmb));
113  printParticle(log, "hadronic top", this->hadronicDecayTop(hypKey, cmb));
114  printParticle(log, "hadronic W ", this->hadronicDecayW (hypKey, cmb));
115  if(verbosity%10 >= 3) {
116  printParticle(log, "hadronic b ", this->hadronicDecayB (hypKey, cmb));
117  printParticle(log, "hadronic p ", this->hadronicDecayQuark (hypKey, cmb));
118  printParticle(log, "hadronic q ", this->hadronicDecayQuarkBar(hypKey, cmb));
119  }
120  printParticle(log, "leptonic top", this->leptonicDecayTop(hypKey, cmb));
121  printParticle(log, "leptonic W ", this->leptonicDecayW (hypKey, cmb));
122  if(verbosity%10 >= 3) {
123  printParticle(log, "leptonic b ", this->leptonicDecayB(hypKey, cmb));
124  printParticle(log, "lepton ", this->singleLepton (hypKey, cmb));
125  printParticle(log, "neutrino ", this->singleNeutrino(hypKey, cmb));
126  }
127  }
128  }
129  }
130  }
131 
132  log << "++++++++++++++++++++++++++++++++++++++++++++++++++";
133 }
const reco::GenParticle * leptonicDecayTop() const
get leptonic top of the TtGenEvent
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:31
const edm::RefProd< TtGenEvent > & genEvent() const
get TtGenEvent
Definition: TtEvent.h:53
const math::XYZTLorentzVector * topPair() const
get combined 4-vector of top and topBar from the TtGenEvent
Definition: TtEvent.h:111
unsigned int numberOfAvailableHypos(const std::string &key) const
return number of available hypotheses within a given hypothesis class
Definition: TtEvent.h:70
const reco::GenParticle * leptonicDecayB() const
get leptonic b of the TtGenEvent
unsigned int numberOfAvailableHypoClasses() const
return number of available hypothesis classes
Definition: TtEvent.h:68
const reco::GenParticle * hadronicDecayB() const
get hadronic 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:26
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:90
const reco::GenParticle * singleLepton() const
get lepton top of the TtGenEvent
double genMatchSumDR(const unsigned &cmb=0) const
return the sum dr of the generator match if available; -1 else
Definition: TtEvent.h:84
int numberOfConsideredJets(const std::string &key) const
return number of jets that were considered when building a given hypothesis
Definition: TtEvent.h:74
double hitFitMT(const unsigned &cmb=0) const
return the hitfit top mass of hypothesis &#39;cmb&#39; if available; -1 else
Definition: TtEvent.h:98
vector< PseudoJet > jets
const reco::GenParticle * leptonicDecayW() const
get leptonic W of the TtGenEvent
const reco::GenParticle * hadronicDecayW() const
get hadronic W of the TtGenEvent
void print(const int verbosity=1) const
double mvaDisc(const unsigned &cmb=0) const
return the mva discriminant value of hypothesis &#39;cmb&#39; if available; -1 else
Definition: TtEvent.h:88
const reco::GenParticle * hadronicDecayQuarkBar() const
get hadronic light quark of the TtGenEvent
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
edm::RefProd< TtGenEvent > genEvt_
reference to TtGenEvent (has to be kept in the event!)
Definition: TtEvent.h:150
double hitFitChi2(const unsigned &cmb=0) const
return the hitfit chi2 of hypothesis &#39;cmb&#39; if available; -1 else
Definition: TtEvent.h:92
double fitProb(const unsigned &cmb=0) const
return the fit probability of hypothesis &#39;cmb&#39; if available; -1 else
Definition: TtEvent.h:94
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
const reco::GenParticle * hadronicDecayTop() const
get hadronic top of the TtGenEvent
double genMatchSumPt(const unsigned &cmb=0) const
return the sum pt of the generator match if available; -1 else
Definition: TtEvent.h:82
double hitFitProb(const unsigned &cmb=0) const
return the hitfit probability of hypothesis &#39;cmb&#39; if available; -1 else
Definition: TtEvent.h:96
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:86
const reco::GenParticle * hadronicDecayQuark() const
get hadronic light quark of the TtGenEvent
std::map< HypoClassKey, std::vector< HypoCombPair > > evtHyp_
Definition: TtEvent.h:153
const int numberOfRealNeutrinoSolutions(const HypoClassKey &key) const
get number of real neutrino solutions for a given hypo class
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:78
const reco::GenParticle * singleNeutrino() const
get neutrino of the TtGenEvent
tuple verbosity
Definition: mvaPFMET_cff.py:80
double hitFitSigMT(const unsigned &cmb=0) const
return the hitfit top mass uncertainty of hypothesis &#39;cmb&#39; if available; -1 else
Definition: TtEvent.h:100