Class to fill partons in a well defined order for fully-hadronic ttbar events. More...
#include <AnalysisDataFormats/TopObjects/interface/TtFullHadEvtPartons.h>
Public Types | |
enum | { LightQ, LightQBar, B, LightP, LightPBar, BBar } |
Public Member Functions | |
TtFullHadEvtPartons (const std::vector< std::string > &partonsToIgnore=std::vector< std::string >()) | |
default constructor | |
std::vector< const reco::Candidate * > | vec (const TtGenEvent &genEvt) |
return vector of partons in the order defined in the corresponding enum | |
~TtFullHadEvtPartons () | |
default destructor |
Class to fill partons in a well defined order for fully-hadronic ttbar events.
This class is mainly used for the jet-parton matching in TopTools.
Definition at line 19 of file TtFullHadEvtPartons.h.
anonymous enum |
TtFullHadEvtPartons::TtFullHadEvtPartons | ( | const std::vector< std::string > & | partonsToIgnore = std::vector<std::string>() | ) |
default constructor
Definition at line 6 of file TtFullHadEvtPartons.cc.
References BBar, Exception, i, TtEventPartons::ignorePartons_, LightP, LightPBar, LightQ, and LightQBar.
{ // default: use all partons for(unsigned int i = 0; i < 6; i++) ignorePartons_.push_back(false); // read vector of strings and flag partons to be ignored for(std::vector<std::string>::const_iterator str = partonsToIgnore.begin(); str != partonsToIgnore.end(); ++str) { if ((*str) == "LightQ" ) ignorePartons_[LightQ ] = true; else if((*str) == "LightQBar" ) ignorePartons_[LightQBar] = true; else if((*str) == "B" ) ignorePartons_[B ] = true; else if((*str) == "LightP" ) ignorePartons_[LightP ] = true; else if((*str) == "LightPBar" ) ignorePartons_[LightPBar] = true; else if((*str) == "BBar" ) ignorePartons_[BBar ] = true; else throw cms::Exception("Configuration") << "The following string in partonsToIgnore is not supported: " << (*str) << "\n"; } }
TtFullHadEvtPartons::~TtFullHadEvtPartons | ( | ) | [inline] |
std::vector< const reco::Candidate * > TtFullHadEvtPartons::vec | ( | const TtGenEvent & | genEvt | ) | [virtual] |
return vector of partons in the order defined in the corresponding enum
Implements TtEventPartons.
Definition at line 25 of file TtFullHadEvtPartons.cc.
References TopGenEvent::b(), B, BBar, TopGenEvent::bBar(), TopGenEvent::daughterQuarkBarOfWMinus(), TopGenEvent::daughterQuarkBarOfWPlus(), TopGenEvent::daughterQuarkOfWMinus(), TopGenEvent::daughterQuarkOfWPlus(), TtEventPartons::dummyCandidatePtr(), i, TtGenEvent::isFullHadronic(), LightP, LightPBar, LightQ, LightQBar, and TtEventPartons::prune().
{ std::vector<const reco::Candidate*> vec; if(genEvt.isFullHadronic()) { // fill vector with partons from genEvent // (use enum for positions of the partons in the vector) vec.resize(6); vec[LightQ ] = genEvt.daughterQuarkOfWPlus() ? genEvt.daughterQuarkOfWPlus() : dummyCandidatePtr(); vec[LightQBar ] = genEvt.daughterQuarkBarOfWPlus() ? genEvt.daughterQuarkBarOfWPlus() : dummyCandidatePtr(); vec[B ] = genEvt.b() ? genEvt.b() : dummyCandidatePtr(); vec[LightP ] = genEvt.daughterQuarkOfWMinus() ? genEvt.daughterQuarkOfWMinus() : dummyCandidatePtr(); vec[LightPBar ] = genEvt.daughterQuarkBarOfWMinus() ? genEvt.daughterQuarkBarOfWMinus() : dummyCandidatePtr(); vec[BBar ] = genEvt.bBar() ? genEvt.bBar() : dummyCandidatePtr(); } else { // fill vector with dummy objects if the event is not fully-hadronic ttbar for(unsigned i=0; i<6; i++) vec.push_back( dummyCandidatePtr() ); } // erase partons from vector if they where chosen to be ignored prune(vec); return vec; }