rivet is hosted by Hepforge, IPPP Durham
TauFinder.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Projections/TauFinder.hh"
00003 #include "Rivet/Projections/UnstableFinalState.hh"
00004 
00005 namespace Rivet {
00006 
00007 
00008 
00009   void TauFinder::project(const Event& e) {
00010     _theParticles.clear();
00011 
00012     const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00013     foreach (const Particle& p, ufs.particles()) {
00014       if (p.abspid() != PID::TAU) {
00015         continue;
00016       }
00017       if ( (_dectype==ANY) || (_dectype==LEPTONIC && isLeptonic(p)) || (_dectype==HADRONIC && isHadronic(p)) ) {
00018         _theParticles.push_back(p);
00019       }
00020     }
00021   }
00022 
00023   int TauFinder::compare(const Projection& p) const {
00024     const PCmp fscmp = mkNamedPCmp(p, "UFS");
00025     if (fscmp != EQUIVALENT) return fscmp;
00026 
00027     const TauFinder& other = dynamic_cast<const TauFinder&>(p);
00028     return cmp(_dectype, other._dectype);
00029   }
00030 
00031 
00032 
00033 }
00034