Go to the documentation of this file.00001 #include "DataFormats/Candidate/interface/Candidate.h"
00002 #include "AnalysisDataFormats/TopObjects/interface/TtGenEvent.h"
00003
00004 #include "AnalysisDataFormats/TopObjects/interface/TtFullLepEvtPartons.h"
00005
00006 TtFullLepEvtPartons::TtFullLepEvtPartons(const std::vector<std::string>& partonsToIgnore)
00007 {
00008
00009 for(unsigned int i = 0; i < 2; i++)
00010 ignorePartons_.push_back(false);
00011
00012 for(std::vector<std::string>::const_iterator str = partonsToIgnore.begin(); str != partonsToIgnore.end(); ++str) {
00013 if ((*str) == "B" ) ignorePartons_[B ] = true;
00014 else if((*str) == "BBar") ignorePartons_[BBar] = true;
00015 else throw cms::Exception("Configuration")
00016 << "The following string in partonsToIgnore is not supported: " << (*str) << "\n";
00017 }
00018 }
00019
00020 std::vector<const reco::Candidate*>
00021 TtFullLepEvtPartons::vec(const TtGenEvent& genEvt)
00022 {
00023 std::vector<const reco::Candidate*> vec;
00024
00025 if(genEvt.isFullLeptonic()) {
00026
00027
00028 vec.resize(2);
00029 vec[B ] = genEvt.b() ? genEvt.b() : dummyCandidatePtr();
00030 vec[BBar] = genEvt.bBar() ? genEvt.bBar() : dummyCandidatePtr();
00031 }
00032 else {
00033
00034 for(unsigned i=0; i<2; i++)
00035 vec.push_back( dummyCandidatePtr() );
00036 }
00037
00038
00039 prune(vec);
00040
00041 return vec;
00042 }