rivet is hosted by Hepforge, IPPP Durham
PromptFinalState.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Projections/PromptFinalState.hh"
00003 
00004 namespace Rivet {
00005 
00006 
00007   PromptFinalState::PromptFinalState(const FinalState& fsp, bool accepttaudecays, bool acceptmudecays)
00008     : _acceptMuDecays(acceptmudecays), _acceptTauDecays(accepttaudecays)
00009   {
00010     setName("PromptFinalState");
00011     addProjection(fsp, "FS");
00012   }
00013 
00014 
00015   PromptFinalState::PromptFinalState(const Cut& c, bool accepttaudecays, bool acceptmudecays)
00016     : _acceptMuDecays(acceptmudecays), _acceptTauDecays(accepttaudecays)
00017   {
00018     setName("PromptFinalState");
00019     addProjection(FinalState(c), "FS");
00020   }
00021 
00022 
00023   int PromptFinalState::compare(const Projection& p) const {
00024     const PCmp fscmp = mkNamedPCmp(p, "FS");
00025     if (fscmp != EQUIVALENT) return fscmp;
00026     const PromptFinalState& other = dynamic_cast<const PromptFinalState&>(p);
00027     return cmp(_acceptMuDecays, other._acceptMuDecays) || cmp(_acceptTauDecays, other._acceptTauDecays);
00028   }
00029 
00030 
00031   void PromptFinalState::project(const Event& e) {
00032     _theParticles.clear();
00033 
00034     const Particles& particles = applyProjection<FinalState>(e, "FS").particles();
00035     for (const Particle& p : particles)
00036       if (isPrompt(p, _acceptTauDecays, _acceptMuDecays)) _theParticles.push_back(p);
00037     MSG_DEBUG("Number of final state particles not from hadron decays = " << _theParticles.size());
00038 
00039     if (getLog().isActive(Log::TRACE)) {
00040       for (const Particle& p : _theParticles)
00041         MSG_TRACE("Selected: " << p.pid() << ", charge = " << p.charge());
00042     }
00043   }
00044 
00045 
00046 }