Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:06:49

0001 // -*- C++ -*-
0002 #ifndef RIVET_RHIC_COMMON_HH
0003 #define RIVET_RHIC_COMMON_HH
0004 
0005 #include "Rivet/Projections/FinalState.hh"
0006 #include "Rivet/Projections/ChargedFinalState.hh"
0007 #include "Rivet/Projections/SingleValueProjection.hh"
0008 #include "Rivet/Projections/TriggerProjection.hh"
0009 
0010 /// @file Common projections for RHIC experiments' trigger conditions and centrality.
0011 namespace Rivet {
0012 
0013 
0014   class STAR_BES_Centrality : public SingleValueProjection {
0015   public:
0016 
0017     STAR_BES_Centrality() {
0018       declare(ChargedFinalState(Cuts::abseta < 0.5 &&
0019                                 Cuts::absrap < 0.1 && Cuts::pT > 0.2 * GeV),
0020               "STAR_BES_Centrality");
0021     }
0022 
0023     // Destructor
0024     virtual ~STAR_BES_Centrality() {}
0025 
0026     /// Clone on the heap.
0027     RIVET_DEFAULT_PROJ_CLONE(STAR_BES_Centrality);
0028 
0029     /// Import to avoid warnings about overload-hiding
0030     using Projection::operator =;
0031 
0032   protected:
0033 
0034     void project(const Event& e) {
0035       clear();
0036       double estimate =
0037         apply<FinalState>(e, "STAR_BES_Centrality").particles().size();
0038       setValue(estimate);
0039     }
0040 
0041     /// Compare projections
0042     virtual CmpState compare(const Projection& p) const {
0043       return mkNamedPCmp(p, "STAR_BES_Centrality");
0044     }
0045 
0046   };
0047 
0048 
0049   /// @brief BRAHMS Centrality projection.
0050   class BRAHMSCentrality : public SingleValueProjection {
0051   public:
0052 
0053     // Constructor
0054     BRAHMSCentrality() : SingleValueProjection() {
0055       // Using here the BRAHMS reaction centrality from eg. 1602.01183, which
0056       // might not be correct.
0057       declare(ChargedFinalState(Cuts::pT > 0.1*GeV && Cuts::abseta < 2.2),
0058               "ChargedFinalState");
0059     }
0060 
0061     // Destructor
0062     virtual ~BRAHMSCentrality() {}
0063 
0064     // Clone on the heap.
0065     RIVET_DEFAULT_PROJ_CLONE(BRAHMSCentrality);
0066 
0067     /// Import to avoid warnings about overload-hiding
0068     using Projection::operator =;
0069 
0070   protected:
0071 
0072     // Do the projection. Count the number of charged particles in
0073     // the specified range.
0074     virtual void project(const Event& e) {
0075       clear();
0076       setValue(apply<ChargedFinalState>(e, "ChargedFinalState").particles().size());
0077     }
0078 
0079     // Compare to another projection.
0080     virtual CmpState compare(const Projection& p) const {
0081       return mkNamedPCmp(p, "ChargedFinalState");
0082     }
0083 
0084   };
0085 
0086 
0087 }
0088 
0089 #endif