Skip to content

Commit

Permalink
Bugfix for pseudotop bjet constituents
Browse files Browse the repository at this point in the history
  • Loading branch information
mseidel42 committed Oct 18, 2016
1 parent 30a065d commit 691ca6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TopQuarkAnalysis/TopEventProducers/src/PseudoTopProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ void PseudoTopProducer::produce(edm::Event& event, const edm::EventSetup& eventS
auto pseudoTopRefHandle = event.getRefBeforePut<reco::GenParticleCollection>();

// Collect unstable B-hadrons
std::set<size_t> bHadronIdxs;
std::set<int> bHadronIdxs;
for ( size_t i=0, n=genParticleHandle->size(); i<n; ++i ) {
const reco::Candidate& p = genParticleHandle->at(i);
const int status = p.status();
if ( status == 1 ) continue;

// Collect B-hadrons, to be used in b tagging
if ( isBHadron(&p) ) bHadronIdxs.insert(i);
if ( isBHadron(&p) ) bHadronIdxs.insert(-i-1);
}

// Collect stable leptons and neutrinos
Expand Down Expand Up @@ -175,7 +175,7 @@ void PseudoTopProducer::produce(edm::Event& event, const edm::EventSetup& eventS
}
//// Also don't forget to put B hadrons
for ( auto index : bHadronIdxs ) {
const reco::Candidate& p = genParticleHandle->at(index);
const reco::Candidate& p = genParticleHandle->at(abs(index+1));
if ( std::isnan(p.pt()) or p.pt() <= 0 ) continue;

const double scale = 1e-20/p.p();
Expand All @@ -199,7 +199,7 @@ void PseudoTopProducer::produce(edm::Event& event, const edm::EventSetup& eventS
std::vector<reco::CandidatePtr> constituents;
bool hasBHadron = false;
for ( size_t j=0, m=fjConstituents.size(); j<m; ++j ) {
const size_t index = fjConstituents[j].user_index();
const int index = fjConstituents[j].user_index();
if ( bHadronIdxs.find(index) != bHadronIdxs.end() ) {
hasBHadron = true;
continue;
Expand Down

0 comments on commit 691ca6f

Please sign in to comment.