CMS 3D CMS Logo

TtSemiLeptonicEvent.cc

Go to the documentation of this file.
00001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00002 #include "AnalysisDataFormats/TopObjects/interface/TtSemiLeptonicEvent.h"
00003 
00004 // print info via MessageLogger
00005 void
00006 TtSemiLeptonicEvent::print()
00007 {
00008   edm::LogInfo log("TtSemiLeptonicEvent");
00009 
00010   log << "++++++++++++++++++++++++++++++++++++++++++++++++++ \n";
00011 
00012   // get some information from the genEvent
00013   log << " TtGenEvent says: ";
00014   if( !this->genEvent()->isTtBar() )            log << "Not TtBar";
00015   else if( this->genEvent()->isFullHadronic() ) log << "Fully Hadronic TtBar";
00016   else if( this->genEvent()->isFullLeptonic() ) log << "Fully Leptonic TtBar";
00017   else if( this->genEvent()->isSemiLeptonic() ) {
00018     log << "Semi-leptonic TtBar, ";
00019     switch( this->genEvent()->semiLeptonicChannel() ) {
00020     case WDecay::kElec : log << "Electron"; break;
00021     case WDecay::kMuon : log << "Muon"    ; break;
00022     case WDecay::kTau  : log << "Tau"     ; break;
00023     default                : log << "Unknown" ; break;
00024     }
00025     log << " Channel";
00026   }
00027   log << "\n";
00028 
00029   // get number of available hypothesis classes
00030   log << " Number of available event hypothesis classes: " << this->numberOfAvailableHypoClasses() << " \n";
00031 
00032   // create a legend for the jetLepComb
00033   log << " - JetLepComb: ";
00034   for(unsigned idx = 0; idx < 5; idx++) {
00035     switch(idx) {
00036     case TtSemiLepEvtPartons::LightQ    : log << "LightP "; break;
00037     case TtSemiLepEvtPartons::LightQBar : log << "LightQ "; break;
00038     case TtSemiLepEvtPartons::HadB      : log << " HadB  "; break;
00039     case TtSemiLepEvtPartons::LepB      : log << " LepB  "; break;
00040     case TtSemiLepEvtPartons::Lepton    : log << "Lepton "; break;
00041     }
00042   }
00043   log << "\n";
00044 
00045   // get details from the hypotheses
00046   typedef std::map<HypoClassKey, std::vector<HypoCombPair> >::const_iterator EventHypo;
00047   for(EventHypo hyp = evtHyp_.begin(); hyp != evtHyp_.end(); ++hyp) {
00048     HypoClassKey hypKey = (*hyp).first;
00049     // header for each hypothesis
00050     log << "-------------------------------------------------- \n";
00051     switch(hypKey) {
00052     case kGeom          : log << " Geom"         ; break;
00053     case kWMassMaxSumPt : log << " WMassMaxSumPt"; break;
00054     case kMaxSumPtWMass : log << " MaxSumPtWMass"; break;
00055     case kGenMatch      : log << " GenMatch"     ; break;
00056     case kMVADisc       : log << " MVADisc"      ; break;
00057     case kKinFit        : log << " KinFit"       ; break;
00058     default             : log << " Unknown";
00059     }
00060     log << "-Hypothesis: \n";
00061     if( this->numberOfAvailableHypos(hypKey) > 1 ) {
00062       log << " * Number of available jet combinations: "
00063           << this->numberOfAvailableHypos(hypKey) << " \n"
00064           << " The following was found to be the best one: \n";
00065     }
00066     // check if hypothesis is valid
00067     if( !this->isHypoValid( hypKey ) )
00068       log << " * Not valid! \n";
00069     // get meta information for valid hypothesis
00070     else {
00071       // jetLepComb
00072       log << " * JetLepComb:";
00073       std::vector<int> jets = this->jetLepComb( hypKey );
00074       for(unsigned int iJet = 0; iJet < jets.size(); iJet++) {
00075         log << "   " << jets[iJet] << "   ";
00076       }
00077       log << "\n";
00078       // specialties for some hypotheses
00079       switch(hypKey) {
00080       case kGenMatch : log << " * Sum(DeltaR) : " << this->genMatchSumDR() << " \n"
00081                            << " * Sum(DeltaPt): " << this->genMatchSumPt() << " \n"; break;
00082       case kMVADisc  : log << " * Method  : "     << this->mvaMethod()     << " \n"
00083                            << " * Discrim.: "     << this->mvaDisc()       << " \n"; break;
00084       case kKinFit   : log << " * Chi^2      : "  << this->fitChi2()       << " \n"
00085                            << " * Prob(Chi^2): "  << this->fitProb()       << " \n"; break;
00086       default        : break;
00087       }
00088     }
00089   }
00090 
00091   log << "++++++++++++++++++++++++++++++++++++++++++++++++++";  
00092 }

Generated on Tue Jun 9 17:25:10 2009 for CMSSW by  doxygen 1.5.4