[Rivet-svn] r3399 - in trunk: . include/Rivet include/Rivet/Projections src/Analyses src/Projections

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Sep 29 08:12:40 BST 2011


Author: buckley
Date: Thu Sep 29 08:12:39 2011
New Revision: 3399

Log:
Converting FinalStateHCM to a slightly more general DISFinalState.

Added:
   trunk/include/Rivet/Projections/DISFinalState.hh
   trunk/src/Projections/DISFinalState.cc
Deleted:
   trunk/include/Rivet/Projections/FinalStateHCM.hh
   trunk/src/Projections/FinalStateHCM.cc
Modified:
   trunk/ChangeLog
   trunk/include/Rivet/Makefile.am
   trunk/include/Rivet/Projections/CentralEtHCM.hh
   trunk/src/Analyses/H1_1995_S3167097.cc
   trunk/src/Projections/CentralEtHCM.cc
   trunk/src/Projections/Makefile.am

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Wed Sep 28 20:43:56 2011	(r3398)
+++ trunk/ChangeLog	Thu Sep 29 08:12:39 2011	(r3399)
@@ -1,3 +1,8 @@
+2011-09-29  Andy Buckley  <andy at insectnation.org>
+
+	* Converting FinalStateHCM to a slightly more general
+	DISFinalState.
+
 2011-09-26  Andy Buckley  <andy at insectnation.org>
 
 	* Adding a default libname argument to rivet-buildplugin. If the

Modified: trunk/include/Rivet/Makefile.am
==============================================================================
--- trunk/include/Rivet/Makefile.am	Wed Sep 28 20:43:56 2011	(r3398)
+++ trunk/include/Rivet/Makefile.am	Thu Sep 29 08:12:39 2011	(r3399)
@@ -39,11 +39,11 @@
   Projections/ChargedLeptons.hh \
   Projections/ClusteredPhotons.hh \
   Projections/ConstLossyFinalState.hh \
+  Projections/DISFinalState.hh  \
   Projections/DISKinematics.hh  \
   Projections/DISLepton.hh      \
   Projections/FastJets.hh       \
   Projections/FinalState.hh     \
-  Projections/FinalStateHCM.hh  \
   Projections/FoxWolframMoments.hh \
   Projections/FParameter.hh \
   Projections/HadronicFinalState.hh \

Modified: trunk/include/Rivet/Projections/CentralEtHCM.hh
==============================================================================
--- trunk/include/Rivet/Projections/CentralEtHCM.hh	Wed Sep 28 20:43:56 2011	(r3398)
+++ trunk/include/Rivet/Projections/CentralEtHCM.hh	Thu Sep 29 08:12:39 2011	(r3399)
@@ -4,7 +4,7 @@
 
 #include "Rivet/Particle.hh"
 #include "Rivet/Event.hh"
-#include "Rivet/Projections/FinalStateHCM.hh"
+#include "Rivet/Projections/DISFinalState.hh"
 
 namespace Rivet {
 
@@ -14,12 +14,11 @@
   /// Sum up \f$ E_\perp \f$ of all particles in the hadronic final state in the
   /// central rapidity bin of the HCM system.
   class CentralEtHCM : public Projection {
-
   public:
 
     /// The default constructor. Must specify a FinalStateHCM projection
     /// object which is guaranteed to live throughout the run.
-    CentralEtHCM(const FinalStateHCM& fs)
+    CentralEtHCM(const DISFinalState& fs)
     {
       setName("CentralEtHCM");
       addProjection(fs, "FS");
@@ -30,19 +29,24 @@
       return new CentralEtHCM(*this);
     }
 
+
   protected:
 
     /// Apply the projection on to the Event.
     void project(const Event& e);
 
     /// Compare with other projections
-    int compare(const Projection& p) const;
+    int compare(const Projection& p) const {
+      return mkNamedPCmp(p, "FS");
+    }
+
 
   public:
 
     /// The sum of the Et in the central rapidity bin.
     double sumEt() const { return _sumet; }
 
+
   private:
 
     /// The sum of the Et in the central rapidity bin.

Added: trunk/include/Rivet/Projections/DISFinalState.hh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/include/Rivet/Projections/DISFinalState.hh	Thu Sep 29 08:12:39 2011	(r3399)
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+#ifndef RIVET_DISFinalState_HH
+#define RIVET_DISFinalState_HH
+
+#include "Rivet/Projections/FinalState.hh"
+#include "Rivet/Projections/DISKinematics.hh"
+
+namespace Rivet {
+
+
+  /// @brief Final state particles boosted to the hadronic center of mass system.
+  ///
+  /// NB. The DIS scattered lepton is not included in the final state particles.
+  class DISFinalState: public FinalState {
+  public:
+
+    /// Type of DIS boost to apply
+    enum BoostType { HCM, BREIT };
+
+
+    /// @name Constructors
+    //@{
+
+    /// Constructor
+    DISFinalState(const DISKinematics& kinematicsp, BoostType boosttype)
+      : _boosttype(boosttype)
+    {
+      setName("DISFinalState");
+      addProjection(kinematicsp, "Kinematics");
+    }
+
+    /// Clone on the heap.
+    virtual const Projection* clone() const {
+      return new DISFinalState(*this);
+    }
+
+    //@}
+
+
+  protected:
+
+    /// Apply the projection on the supplied event.
+    void project(const Event& e);
+
+    /// Compare projections.
+    int compare(const Projection& p) const {
+      const DISFinalState& other = dynamic_cast<const DISFinalState&>(p);
+      return mkNamedPCmp(p, "Kinematics") || cmp(_boosttype, other._boosttype);
+    }
+
+
+  private:
+
+    BoostType _boosttype;
+
+  };
+
+
+}
+
+#endif

Modified: trunk/src/Analyses/H1_1995_S3167097.cc
==============================================================================
--- trunk/src/Analyses/H1_1995_S3167097.cc	Wed Sep 28 20:43:56 2011	(r3398)
+++ trunk/src/Analyses/H1_1995_S3167097.cc	Thu Sep 29 08:12:39 2011	(r3399)
@@ -1,7 +1,7 @@
 // -*- C++ -*-
 #include "Rivet/Analysis.hh"
 #include "Rivet/RivetAIDA.hh"
-#include "Rivet/Projections/FinalStateHCM.hh"
+#include "Rivet/Projections/DISFinalState.hh"
 #include "Rivet/Projections/CentralEtHCM.hh"
 
 namespace Rivet {
@@ -24,7 +24,7 @@
 
     void init() {
       const DISKinematics& diskin = addProjection(DISKinematics(), "Kinematics");
-      const FinalStateHCM& fshcm = addProjection(FinalStateHCM(diskin), "FS");
+      const DISFinalState& fshcm = addProjection(DISFinalState(diskin, DISFinalState::HCM), "FS");
       addProjection(CentralEtHCM(fshcm), "Y1HCM");
 
       _hEtFlow = vector<AIDA::IHistogram1D *>(_nbin);
@@ -74,7 +74,7 @@
 
 
     void analyze(const Event& event) {
-      const FinalStateHCM& fs = applyProjection<FinalStateHCM>(event, "FS");
+      const FinalState& fs = applyProjection<FinalState>(event, "FS");
       const DISKinematics& dk = applyProjection<DISKinematics>(event, "Kinematics");
       const CentralEtHCM y1 = applyProjection<CentralEtHCM>(event, "Y1HCM");
 

Modified: trunk/src/Projections/CentralEtHCM.cc
==============================================================================
--- trunk/src/Projections/CentralEtHCM.cc	Wed Sep 28 20:43:56 2011	(r3398)
+++ trunk/src/Projections/CentralEtHCM.cc	Thu Sep 29 08:12:39 2011	(r3399)
@@ -3,23 +3,17 @@
 #include "Rivet/Projections/CentralEtHCM.hh"
 #include "Rivet/Cmp.hh"
 
-
 namespace Rivet {
 
-  int CentralEtHCM::compare(const Projection& p) const {
-    return mkNamedPCmp(p, "FS");
-  }
-
 
   void CentralEtHCM::project(const Event& e) {
-    const FinalStateHCM& fs = applyProjection<FinalStateHCM>(e, "FS");
+    const DISFinalState& fs = applyProjection<DISFinalState>(e, "FS");
     _sumet = 0.0;
-    for (ParticleVector::const_iterator p = fs.particles().begin(); p != fs.particles().end(); ++p) {
-      /// @todo Can this extra rapidity cut be implemented so as to use the cached rapidity result?
-      // Rapidity cut: |rapidity| < 0.5
-      const FourMomentum p4 = p->momentum();
-      if (fabs(p4.rapidity()) < 0.5) _sumet += p4.Et();
+    foreach (const Particle& p, fs.particles()) {
+      /// @todo Generalise rapidity cut value
+      if (fabs(p.momentum().rapidity()) < 0.5) _sumet += p.momentum().Et();
     }
   }
 
+
 }

Added: trunk/src/Projections/DISFinalState.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/src/Projections/DISFinalState.cc	Thu Sep 29 08:12:39 2011	(r3399)
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+#include "Rivet/Projections/DISFinalState.hh"
+#include "Rivet/Cmp.hh"
+
+namespace Rivet {
+
+
+  void DISFinalState::project(const Event& e) {
+    const DISKinematics& diskin = applyProjection<DISKinematics>(e, "Kinematics");
+    const LorentzTransform hcmboost = (_boosttype == HCM) ? diskin.boostHCM() : diskin.boostBreit();
+    const DISLepton& dislep = diskin.applyProjection<DISLepton>(e, "Lepton");
+    const FinalState& fs = dislep.applyProjection<FinalState>(e, "FS");
+
+    // Fill the particle list with all particles _other_ than the DIS scattered
+    // lepton, with momenta boosted into the appropriate frame.
+    _theParticles.clear();
+    _theParticles.reserve(fs.particles().size()-1);
+    const GenParticle& dislepGP = dislep.out().genParticle();
+    foreach (const Particle& p, fs.particles()) {
+      if (&p.genParticle() != &dislepGP) { //< Ensure that we skip the DIS lepton
+        Particle temp(p);
+        temp.setMomentum(hcmboost.transform(temp.momentum()));
+        _theParticles.push_back(temp);
+      }
+    }
+  }
+
+
+}

Modified: trunk/src/Projections/Makefile.am
==============================================================================
--- trunk/src/Projections/Makefile.am	Wed Sep 28 20:43:56 2011	(r3398)
+++ trunk/src/Projections/Makefile.am	Thu Sep 29 08:12:39 2011	(r3399)
@@ -6,11 +6,11 @@
   ChargedLeptons.cc \
   CentralEtHCM.cc \
   ClusteredPhotons.cc \
+  DISFinalState.cc \
   DISKinematics.cc \
   DISLepton.cc \
   FastJets.cc \
   FinalState.cc \
-  FinalStateHCM.cc \
   FoxWolframMoments.cc \
   FParameter.cc \
   HadronicFinalState.cc \


More information about the Rivet-svn mailing list