CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtFullHadronicEvent.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("TtFullHadronicEvent");
13 
14  log << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \n";
15 
16  // get some information from the genEvent
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()->isSemiLeptonic() ) log << "Semi-leptonic TtBar";
23  else if( this->genEvent()->isFullLeptonic() ) log << "Fully Leptonic TtBar";
24  log << "\n";
25  }
26  // get number of available hypothesis classes
27  log << " Number of available event hypothesis classes: " << this->numberOfAvailableHypoClasses() << " \n";
28 
29  // create a legend for the jetLepComb
30  log << " - JetCombi : ";
31  for(unsigned idx = 0; idx < 6; idx++) {
32  switch(idx) {
33  case TtFullHadEvtPartons::LightQ : log << " LightQ "; break;
34  case TtFullHadEvtPartons::LightQBar : log << " LightQBar"; break;
35  case TtFullHadEvtPartons::B : log << " B "; break;
36  case TtFullHadEvtPartons::LightP : log << " LightP "; break;
37  case TtFullHadEvtPartons::LightPBar : log << " LightPBar"; break;
38  case TtFullHadEvtPartons::BBar : log << " BBar "; break;
39  }
40  }
41  log << "\n";
42 
43 
44  // get details from the hypotheses
45  typedef std::map<HypoClassKey, std::vector<HypoCombPair> >::const_iterator EventHypo;
46  for(EventHypo hyp = evtHyp_.begin(); hyp != evtHyp_.end(); ++hyp) {
47  HypoClassKey hypKey = (*hyp).first;
48  // header for each hypothesis
49  log << "---------------------------------------------------------------------------- \n";
50  switch(hypKey) {
51  case kGeom : log << " Geom not (yet) applicable to TtFullHadronicEvent --> skipping" ; continue;
52  case kWMassMaxSumPt : log << " WMassMaxSumPt not (yet) applicable to TtFullHadronicEvent --> skipping" ; continue;
53  case kMaxSumPtWMass : log << " MaxSumPtWMass not (yet) applicable to TtFullHadronicEvent --> skipping" ; continue;
54  case kGenMatch : log << " GenMatch" ; break;
55  case kMVADisc : log << " MVADisc not (yet) applicable to TtFullHadronicEvent --> skipping" ; continue;
56  case kKinFit : log << " KinFit" ; break;
57  case kKinSolution : log << " KinSolution not (yet) applicable to TtFullHadronicEvent --> skipping" ; continue;
58  case kWMassDeltaTopMass : log << " WMassDeltaTopMass not (yet) applicable to TtFullHadronicEvent --> skipping"; continue;
59  case kHitFit : log << " HitFit not (yet) applicable to TtFullHadronicEvent --> skipping" ; continue;
60  default : log << " Unknown TtEvent::HypoClassKey provided --> skipping" ; continue;
61  }
62  log << "-Hypothesis: \n";
63  unsigned nOfHyp = this->numberOfAvailableHypos(hypKey);
64  if( nOfHyp > 1 ) {
65  log << " * Number of available jet combinations: " << nOfHyp << " \n";
66  if(verbosity < 10) log << " The following was found to be the best one: \n";
67  }
68  // if verbosity level is smaller than 10, never show more than the best jet combination
69  if(verbosity < 10)
70  nOfHyp = 1;
71  for(unsigned cmb=0; cmb<nOfHyp; ++cmb) {
72  // check if hypothesis is valid
73  if( !this->isHypoValid(hypKey, cmb) )
74  log << " * Not valid! \n";
75  // get meta information for valid hypothesis
76  else {
77  // jetLepComb
78  log << " * JetCombi :";
79  std::vector<int> jets = this->jetLeptonCombination( hypKey , cmb );
80  for(unsigned int iJet = 0; iJet < jets.size(); iJet++) {
81  log << " " << jets[iJet] << " ";
82  }
83  log << "\n";
84  // specialties for some hypotheses
85  switch(hypKey) {
86  case kGenMatch : log << " * Sum(DeltaR) : " << this->genMatchSumDR(cmb) << " \n"
87  << " * Sum(DeltaPt): " << this->genMatchSumPt(cmb) << " \n"; break;
88  case kKinFit : log << " * Chi^2 : " << this->fitChi2(cmb) << " \n"
89  << " * Prob(Chi^2) : " << this->fitProb(cmb) << " \n"; break;
90  default : break;
91  }
92  // kinematic quantities of particles (if last digit of verbosity level > 1)
93  if(verbosity%10 >= 2) {
94  log << " * Candidates (pt; eta; phi; mass) :\n";
95  if(verbosity%10 >= 3)
96  printParticle(log, "top pair", this->topPair(hypKey, cmb));
97  printParticle(log, "top ", this->top (hypKey, cmb));
98  printParticle(log, "W plus ", this->wPlus(hypKey, cmb));
99  if(verbosity%10 >= 3) {
100  printParticle(log, "b ", this->b (hypKey, cmb));
101  printParticle(log, "lightQ ", this->lightQ (hypKey, cmb));
102  printParticle(log, "lightQBar ", this->lightQBar(hypKey, cmb));
103  }
104  printParticle(log, "topBar ", this->topBar(hypKey, cmb));
105  printParticle(log, "W minus ", this->wMinus(hypKey, cmb));
106  if(verbosity%10 >= 3) {
107  printParticle(log, "bBar ", this->bBar (hypKey, cmb));
108  printParticle(log, "lightP ", this->lightP (hypKey, cmb));
109  printParticle(log, "lightPBar ", this->lightPBar(hypKey, cmb));
110  }
111  }
112  }
113  }
114  }
115  log << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
116 }
HypoClassKey
supported classes of event hypotheses
Definition: TtEvent.h:31
const reco::GenParticle * lightQBar() const
get light Q bar of the TtGenEvent
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
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:70
const reco::GenParticle * lightQ() const
get light Q of the TtGenEvent
unsigned int numberOfAvailableHypoClasses() const
return number of available hypothesis classes
Definition: TtEvent.h:68
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:26
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:90
double genMatchSumDR(const unsigned &cmb=0) const
return the sum dr of the generator match if available; -1 else
Definition: TtEvent.h:84
vector< PseudoJet > jets
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
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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:150
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
double genMatchSumPt(const unsigned &cmb=0) const
return the sum pt of the generator match if available; -1 else
Definition: TtEvent.h:82
std::map< HypoClassKey, std::vector< HypoCombPair > > evtHyp_
Definition: TtEvent.h:153
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
tuple log
Definition: cmsBatch.py:347