CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/AnalysisDataFormats/TopObjects/src/TtFullHadronicEvent.cc

Go to the documentation of this file.
00001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00002 #include "AnalysisDataFormats/TopObjects/interface/TtFullHadronicEvent.h"
00003 #include "AnalysisDataFormats/TopObjects/interface/TtFullHadEvtPartons.h"
00004 
00005 // print info via MessageLogger
00006 void
00007 TtFullHadronicEvent::print(const int verbosity) const
00008 {
00009   if(verbosity%10<=0)
00010     return;
00011 
00012   edm::LogInfo log("TtFullHadronicEvent");
00013 
00014   log << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \n";
00015 
00016   // get some information from the genEvent
00017   if( !genEvt_ ) log << " TtGenEvent not available! \n";
00018   else {
00019     log << " TtGenEvent says: ";
00020     if( !this->genEvent()->isTtBar() )            log << "Not TtBar";
00021     else if( this->genEvent()->isFullHadronic() ) log << "Fully Hadronic TtBar";
00022     else if( this->genEvent()->isSemiLeptonic() ) log << "Semi-leptonic TtBar";
00023     else if( this->genEvent()->isFullLeptonic() ) log << "Fully Leptonic TtBar";
00024     log << "\n";
00025   }
00026   // get number of available hypothesis classes
00027   log << " Number of available event hypothesis classes: " << this->numberOfAvailableHypoClasses() << " \n";
00028 
00029   // create a legend for the jetLepComb
00030   log << " - JetCombi    : ";
00031   for(unsigned idx = 0; idx < 6; idx++) {
00032     switch(idx) {
00033     case TtFullHadEvtPartons::LightQ    : log << "  LightQ  "; break;
00034     case TtFullHadEvtPartons::LightQBar : log << " LightQBar"; break;
00035     case TtFullHadEvtPartons::B         : log << "     B    "; break;
00036     case TtFullHadEvtPartons::LightP    : log << "   LightP "; break;
00037     case TtFullHadEvtPartons::LightPBar : log << " LightPBar"; break;
00038     case TtFullHadEvtPartons::BBar      : log << "    BBar  "; break;
00039     }
00040   }
00041   log << "\n";
00042 
00043 
00044   // get details from the hypotheses
00045   typedef std::map<HypoClassKey, std::vector<HypoCombPair> >::const_iterator EventHypo;
00046   for(EventHypo hyp = evtHyp_.begin(); hyp != evtHyp_.end(); ++hyp) {
00047     HypoClassKey hypKey = (*hyp).first;
00048     // header for each hypothesis
00049     log << "---------------------------------------------------------------------------- \n";
00050     switch(hypKey) {
00051     case kGeom              : log << " Geom not (yet) applicable to TtFullHadronicEvent --> skipping"             ; continue;
00052     case kWMassMaxSumPt     : log << " WMassMaxSumPt not (yet) applicable to TtFullHadronicEvent --> skipping"    ; continue;
00053     case kMaxSumPtWMass     : log << " MaxSumPtWMass not (yet) applicable to TtFullHadronicEvent --> skipping"    ; continue;
00054     case kGenMatch          : log << " GenMatch"                                                                  ; break;
00055     case kMVADisc           : log << " MVADisc"                                                                   ; break;
00056     case kKinFit            : log << " KinFit"                                                                    ; break;
00057     case kKinSolution       : log << " KinSolution not (yet) applicable to TtFullHadronicEvent --> skipping"      ; continue;
00058     case kWMassDeltaTopMass : log << " WMassDeltaTopMass not (yet) applicable to TtFullHadronicEvent --> skipping"; continue;
00059     case kHitFit            : log << " HitFit not (yet) applicable to TtFullHadronicEvent --> skipping"           ; continue;
00060     default                 : log << " Unknown TtEvent::HypoClassKey provided --> skipping"                       ; continue;
00061     }
00062     log << "-Hypothesis: \n";
00063     unsigned nOfHyp = this->numberOfAvailableHypos(hypKey);
00064     if( nOfHyp > 1 ) {
00065       log << " * Number of available jet combinations: " << nOfHyp << " \n";
00066       if(verbosity < 10) log << " The following was found to be the best one: \n";
00067     }
00068     // if verbosity level is smaller than 10, never show more than the best jet combination
00069     if(verbosity < 10)
00070       nOfHyp = 1;
00071     for(unsigned cmb=0; cmb<nOfHyp; ++cmb) {
00072       // check if hypothesis is valid
00073       if( !this->isHypoValid(hypKey, cmb) )
00074         log << " * Not valid! \n";
00075       // get meta information for valid hypothesis
00076       else {
00077         // jetLepComb
00078         log << " * JetCombi    :";
00079         std::vector<int> jets = this->jetLeptonCombination( hypKey , cmb );
00080         for(unsigned int iJet = 0; iJet < jets.size(); iJet++) {
00081           log << "      " << jets[iJet] << "   ";
00082         }
00083         log << "\n";
00084         // specialties for some hypotheses
00085         switch(hypKey) {
00086         case kGenMatch : log << " * Sum(DeltaR) : " << this->genMatchSumDR(cmb) << " \n"
00087                              << " * Sum(DeltaPt): " << this->genMatchSumPt(cmb) << " \n"; break;
00088         case kMVADisc  : log << " * Method      : " << this->mvaMethod()        << " \n"
00089                              << " * Discrim.    : " << this->mvaDisc(cmb)       << " \n"; break;
00090         case kKinFit   : log << " * Chi^2       : " << this->fitChi2(cmb)       << " \n"
00091                              << " * Prob(Chi^2) : " << this->fitProb(cmb)       << " \n"; break;
00092         default        : break;
00093         }
00094         // kinematic quantities of particles (if last digit of verbosity level > 1)
00095         if(verbosity%10 >= 2) {
00096           log << " * Candidates (pt; eta; phi; mass) :\n";
00097           if(verbosity%10 >= 3)
00098             printParticle(log, "top pair", this->topPair(hypKey, cmb));
00099           printParticle(log, "top       ", this->top  (hypKey, cmb));
00100           printParticle(log, "W plus    ", this->wPlus(hypKey, cmb));
00101           if(verbosity%10 >= 3) {
00102             printParticle(log, "b         ", this->b        (hypKey, cmb));
00103             printParticle(log, "lightQ    ", this->lightQ   (hypKey, cmb));
00104             printParticle(log, "lightQBar ", this->lightQBar(hypKey, cmb));
00105           }
00106           printParticle(log, "topBar    ", this->topBar(hypKey, cmb));
00107           printParticle(log, "W minus   ", this->wMinus(hypKey, cmb));
00108           if(verbosity%10 >= 3) {
00109             printParticle(log, "bBar      ", this->bBar     (hypKey, cmb));
00110             printParticle(log, "lightP    ", this->lightP   (hypKey, cmb));
00111             printParticle(log, "lightPBar ", this->lightPBar(hypKey, cmb));
00112           }
00113         }
00114       }
00115     }
00116   }
00117   log << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
00118 }