CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/AnalysisDataFormats/TopObjects/src/TtFullLeptonicEvent.cc

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