Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mbluj committed Mar 5, 2015
1 parent 89996e5 commit d4806d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 3 additions & 1 deletion HLTriggerOffline/Tau/interface/HLTTauMCProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HLTTauMCProducer : public edm::EDProducer {

private:

bool getGenDecayProducts(const reco::GenParticleRef&, reco::GenParticleRefVector&,
void getGenDecayProducts(const reco::GenParticleRef&, reco::GenParticleRefVector&,
int status=1, int pdgId=0);

enum tauDecayModes {kElectron, kMuon,
Expand All @@ -52,6 +52,8 @@ class HLTTauMCProducer : public edm::EDProducer {
std::vector<int> m_PDG_;
double etaMax;

unsigned int nBos_, nTau_, nTauH_, nTauE_, nTauM_, nTauO_; //MB

};

#endif
13 changes: 5 additions & 8 deletions HLTriggerOffline/Tau/src/HLTTauMCProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ void HLTTauMCProducer::produce(edm::Event& iEvent, const edm::EventSetup& iES)
bool pdg_ok = false;
for(size_t pi =0;pi<m_PDG_.size();++pi)
{
//MB if(abs((*p).pdgId())== m_PDG_[pi] && abs((*p).status()) == 3 ){
if(abs((*p).pdgId())== m_PDG_[pi] && ( (*p).isHardProcess() || (*p).status() == 3 ) ){
pdg_ok = true;
//cout<<" Bsoson particles: "<< (*p).pdgId()<< " " <<(*p).status() << " "<< pdg_ok<<endl;
Expand Down Expand Up @@ -86,7 +85,8 @@ void HLTTauMCProducer::produce(edm::Event& iEvent, const edm::EventSetup& iES)
GenParticleRef genRef(genParticles, index);
//check if it is the last tau in decay/radiation chain
GenParticleRefVector daugTaus;
if( !getGenDecayProducts(genRef, daugTaus, 0, 15) )
getGenDecayProducts(genRef, daugTaus, 0, 15);
if( daugTaus.size()==0 )
allTaus.push_back(genRef);
}
}
Expand Down Expand Up @@ -250,10 +250,9 @@ void HLTTauMCProducer::produce(edm::Event& iEvent, const edm::EventSetup& iES)

// Helper Function

bool HLTTauMCProducer::getGenDecayProducts(const GenParticleRef& mother, GenParticleRefVector& products,
void HLTTauMCProducer::getGenDecayProducts(const GenParticleRef& mother, GenParticleRefVector& products,
int status, int pdgId ) {
bool found = false;


const GenParticleRefVector& daughterRefs = mother->daughterRefVector();

for(GenParticleRefVector::const_iterator d = daughterRefs.begin(); d != daughterRefs.end(); ++d) {
Expand All @@ -262,11 +261,9 @@ bool HLTTauMCProducer::getGenDecayProducts(const GenParticleRef& mother, GenPart
(pdgId==0 || std::abs((*d)->pdgId()) == pdgId) ) {

products.push_back(*d);
found = true;
}
else
found = getGenDecayProducts(*d, products, status, pdgId);
getGenDecayProducts(*d, products, status, pdgId);
}

return found;
}

0 comments on commit d4806d1

Please sign in to comment.