|
[Rivet-svn] r1931 - in trunk: . include/Rivet include/Rivet/Projections src/Projectionsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Oct 19 12:12:48 BST 2009
Author: hoeth Date: Mon Oct 19 12:12:47 2009 New Revision: 1931 Log: new NeutralFinalState projection Added: trunk/include/Rivet/Projections/NeutralFinalState.hh trunk/src/Projections/NeutralFinalState.cc Modified: trunk/ChangeLog trunk/include/Rivet/Makefile.am trunk/src/Projections/Makefile.am Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Mon Oct 19 12:08:49 2009 (r1930) +++ trunk/ChangeLog Mon Oct 19 12:12:47 2009 (r1931) @@ -1,3 +1,10 @@ +2009-10-19 Hendrik Hoeth <hendrik.hoeth at cern.ch> + + * Adding new NeutralFinalState projection. Note that this final + state takes E_T instead of p_T as argument (makes more sense for + neutral particles). The compare() method does not yet work as + expected (E_T comparison still missing). + 2009-10-17 Andy Buckley <andy at insectnation.org> * Adding parsing of units in cross-sections passed to the "-x" Modified: trunk/include/Rivet/Makefile.am ============================================================================== --- trunk/include/Rivet/Makefile.am Mon Oct 19 12:08:49 2009 (r1930) +++ trunk/include/Rivet/Makefile.am Mon Oct 19 12:12:47 2009 (r1931) @@ -62,6 +62,7 @@ Projections/LeadingParticlesFinalState.hh \ Projections/LossyFinalState.hh \ Projections/Multiplicity.hh \ + Projections/NeutralFinalState.hh \ Projections/ParisiTensor.hh \ Projections/PVertex.hh \ Projections/Sphericity.hh \ Added: trunk/include/Rivet/Projections/NeutralFinalState.hh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/include/Rivet/Projections/NeutralFinalState.hh Mon Oct 19 12:12:47 2009 (r1931) @@ -0,0 +1,57 @@ +// -*- C++ -*- +#ifndef RIVET_NeutralFinalState_HH +#define RIVET_NeutralFinalState_HH + +#include "Rivet/Tools/Logging.hh" +#include "Rivet/Rivet.hh" +#include "Rivet/Particle.hh" +#include "Rivet/Event.hh" +#include "Rivet/Projection.hh" +#include "Rivet/Projections/FinalState.hh" + +namespace Rivet { + + + /// Project only neutral final state particles. + class NeutralFinalState : public FinalState { + + public: + + /// @name Constructors + //@{ + NeutralFinalState(const FinalState& fsp) : _Etmin(0.0*GeV) { + setName("NeutralFinalState"); + addProjection(fsp, "FS"); + } + + NeutralFinalState(double mineta = -MAXRAPIDITY, + double maxeta = MAXRAPIDITY, + double minEt = 0.0*GeV) : _Etmin(minEt) + { + setName("NeutralFinalState"); + addProjection(FinalState(mineta, maxeta, 0.0*GeV), "FS"); + } + + /// Clone on the heap. + virtual const Projection* clone() const { + return new NeutralFinalState(*this); + } + //@} + + protected: + + /// Apply the projection on the supplied event. + void project(const Event& e); + + /// The minimum allowed transverse energy. + double _Etmin; + + /// Compare projections. + int compare(const Projection& p) const; + }; + + +} + + +#endif Modified: trunk/src/Projections/Makefile.am ============================================================================== --- trunk/src/Projections/Makefile.am Mon Oct 19 12:08:49 2009 (r1930) +++ trunk/src/Projections/Makefile.am Mon Oct 19 12:12:47 2009 (r1931) @@ -21,6 +21,7 @@ LeadingParticlesFinalState.cc \ LossyFinalState.cc \ Multiplicity.cc \ + NeutralFinalState.cc \ ParisiTensor.cc \ PVertex.cc \ Sphericity.cc \ Added: trunk/src/Projections/NeutralFinalState.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/src/Projections/NeutralFinalState.cc Mon Oct 19 12:12:47 2009 (r1931) @@ -0,0 +1,37 @@ +// -*- C++ -*- +#include "Rivet/Rivet.hh" +#include "Rivet/Projections/NeutralFinalState.hh" +#include "Rivet/Tools/ParticleIdUtils.hh" +#include "Rivet/Cmp.hh" +#include <algorithm> + +namespace Rivet { + + + int NeutralFinalState::compare(const Projection& p) const { + /// @todo: This needs to be fixed!! We can't just compare the FinalStates, we also have to check the Etmin!! + return mkNamedPCmp(p, "FS"); + } + + + void NeutralFinalState::project(const Event& e) { + const FinalState& fs = applyProjection<FinalState>(e, "FS"); + _theParticles.clear(); + foreach (const Particle& p, fs.particles()){ + if ((PID::threeCharge(p.pdgId()) != 0) && (p.momentum().Et() > _Etmin)) { + _theParticles.push_back(p); + if (getLog().isActive(Log::TRACE)) { + getLog() << Log::TRACE + << "Selected: ID = " << p.pdgId() + << ", Et = " << p.momentum().Et() + << ", eta = " << p.momentum().eta() + << ", charge = " << PID::threeCharge(p.pdgId())/3.0 << endl; + } + } + } + getLog() << Log::DEBUG << "Number of neutral final-state particles = " + << _theParticles.size() << endl; + } + + +}
More information about the Rivet-svn mailing list |