Rivet API documentation

Rivet 4.1.3
RHICCommon.hh
1// -*- C++ -*-
2#ifndef RIVET_RHIC_COMMON_HH
3#define RIVET_RHIC_COMMON_HH
4
5#include "Rivet/Projections/ChargedFinalState.hh"
6#include "Rivet/Projections/FinalState.hh"
7#include "Rivet/Projections/SingleValueProjection.hh"
8#include "Rivet/Projections/TriggerProjection.hh"
9
11namespace Rivet {
12
13
14 class STAR_BES_Centrality : public SingleValueProjection {
15 public:
16
17 STAR_BES_Centrality() {
18 declare(ChargedFinalState(Cuts::abseta < 0.5 && Cuts::absrap < 0.1 && Cuts::pT > 0.2 * GeV),
19 "STAR_BES_Centrality");
20 }
21
22 // Destructor
23 virtual ~STAR_BES_Centrality() { }
24
26 RIVET_DEFAULT_PROJ_CLONE(STAR_BES_Centrality);
27
29 using Projection::operator=;
30
31 protected:
32
33 void project(const Event& e) {
34 clear();
35 double estimate = apply<FinalState>(e, "STAR_BES_Centrality").particles().size();
36 setValue(estimate);
37 }
38
40 virtual CmpState compare(const Projection& p) const {
41 return mkNamedPCmp(p, "STAR_BES_Centrality");
42 }
43 };
44
45
47 class BRAHMSCentrality : public SingleValueProjection {
48 public:
49
50 // Constructor
51 BRAHMSCentrality()
53 // Using here the BRAHMS reaction centrality from eg. 1602.01183, which
54 // might not be correct.
55 declare(ChargedFinalState(Cuts::pT > 0.1 * GeV && Cuts::abseta < 2.2), "ChargedFinalState");
56 }
57
58 // Destructor
59 virtual ~BRAHMSCentrality() { }
60
61 // Clone on the heap.
62 RIVET_DEFAULT_PROJ_CLONE(BRAHMSCentrality);
63
65 using Projection::operator=;
66
67 protected:
68
69 // Do the projection. Count the number of charged particles in
70 // the specified range.
71 virtual void project(const Event& e) {
72 clear();
73 setValue(apply<ChargedFinalState>(e, "ChargedFinalState").particles().size());
74 }
75
76 // Compare to another projection.
77 virtual CmpState compare(const Projection& p) const {
78 return mkNamedPCmp(p, "ChargedFinalState");
79 }
80 };
81
82
83}
84
85#endif
virtual void project(const Event &e)
Definition RHICCommon.hh:71
virtual CmpState compare(const Projection &p) const
Definition RHICCommon.hh:77
Project only charged final state particles.
Definition ChargedFinalState.hh:11
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(const Event &evt, const Projection &proj) const
Apply the supplied projection on event evt.
Definition ProjectionApplier.hh:124
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version).
Definition ProjectionApplier.hh:205
Base class for all Rivet projections.
Definition Projection.hh:29
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
virtual CmpState compare(const Projection &p) const
Compare projections.
Definition RHICCommon.hh:40
RIVET_DEFAULT_PROJ_CLONE(STAR_BES_Centrality)
Clone on the heap.
void project(const Event &e)
Definition RHICCommon.hh:33
void setValue(double v)
Set the value.
Definition SingleValueProjection.hh:49
SingleValueProjection()
The default constructor.
Definition SingleValueProjection.hh:21
void clear()
Unset the value.
Definition SingleValueProjection.hh:55
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
Definition LHCbCommon.hh:9