Go to the documentation of this file.00001 #include "AnalysisDataFormats/TopObjects/interface/TtEvent.h"
00002 #include "CommonTools/Utils/interface/StringToEnumValue.h"
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 #include <cstring>
00005
00006
00007 int
00008 TtEvent::correspondingHypo(const HypoClassKey& key1, const unsigned& hyp1, const HypoClassKey& key2) const
00009 {
00010 for(unsigned hyp2 = 0; hyp2 < this->numberOfAvailableHypos(key2); ++hyp2) {
00011 if( this->jetLeptonCombination(key1, hyp1) == this->jetLeptonCombination(key2, hyp2) )
00012 return hyp2;
00013 }
00014 return -1;
00015 }
00016
00017
00018 TtEvent::HypoClassKey
00019 TtEvent::hypoClassKeyFromString(const std::string& label) const
00020 {
00021 return (HypoClassKey) StringToEnumValue<HypoClassKey>(label);
00022 }
00023
00024
00025 void
00026 TtEvent::printParticle(edm::LogInfo &log, const char* name, const reco::Candidate* cand) const
00027 {
00028 if(!cand) {
00029 log << std::setw(15) << name << ": not available!\n";
00030 return;
00031 }
00032 log << std::setprecision(3) << setiosflags(std::ios::fixed | std::ios::showpoint);
00033 log << std::setw(15) << name << ": "
00034 << std::setw( 7) << cand->pt() << "; "
00035 << std::setw( 7) << cand->eta() << "; "
00036 << std::setw( 7) << cand->phi() << "; "
00037 << resetiosflags(std::ios::fixed | std::ios::showpoint) << setiosflags(std::ios::scientific)
00038 << std::setw(10) << cand->mass() << "\n";
00039 log << resetiosflags(std::ios::scientific);
00040 }