IdentifiedFinalState.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Projections/IdentifiedFinalState.hh" 00003 00004 namespace Rivet { 00005 00006 00007 IdentifiedFinalState::IdentifiedFinalState(const FinalState& fsp) { 00008 setName("IdentifiedFinalState"); 00009 addProjection(fsp, "FS"); 00010 } 00011 00012 00013 IdentifiedFinalState::IdentifiedFinalState(double etamin, double etamax, double ptMin) 00014 : FinalState(etamin, etamax, ptMin) 00015 { 00016 setName("IdentifiedFinalState"); 00017 addProjection(FinalState(etamin, etamax, ptMin), "FS"); 00018 } 00019 00020 00021 // IdentifiedFinalState::IdentifiedFinalState(const vector<pair<double, double> >& etaRanges, 00022 // double ptMin) 00023 // : FinalState(etaRanges, ptMin) 00024 // { 00025 // setName("IdentifiedFinalState"); 00026 // addProjection(FinalState(etaRanges, ptMin), "FS"); 00027 // } 00028 00029 00030 int IdentifiedFinalState::compare(const Projection& p) const { 00031 const PCmp fscmp = mkNamedPCmp(p, "FS"); 00032 if (fscmp != EQUIVALENT) return fscmp; 00033 00034 const IdentifiedFinalState& other = dynamic_cast<const IdentifiedFinalState&>(p); 00035 int pidssize = cmp(_pids.size(), other._pids.size()); 00036 if (pidssize != EQUIVALENT) return pidssize; 00037 return cmp(_pids, other._pids); 00038 } 00039 00040 00041 void IdentifiedFinalState::project(const Event& e) { 00042 const FinalState& fs = applyProjection<FinalState>(e, "FS"); 00043 _theParticles.clear(); 00044 _theParticles.reserve(fs.particles().size()); 00045 _remainingParticles.clear(); 00046 _remainingParticles.reserve(fs.particles().size()); 00047 foreach (const Particle& p, fs.particles()) { 00048 if (acceptedIds().find(p.pid()) != acceptedIds().end()) { 00049 _theParticles.push_back(p); // Identified 00050 } 00051 else { 00052 _remainingParticles.push_back(p); // Remaining 00053 } 00054 } 00055 } 00056 00057 00058 } Generated on Tue Sep 30 2014 19:45:45 for The Rivet MC analysis system by ![]() |