rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
UserCentEstimate.hh
1 // -*- C++ -*-
2 #ifndef RIVET_USERCENTESTIMATE_HH
3 #define RIVET_USERCENTESTIMATE_HH
4 
5 #include "Rivet/Projections/SingleValueProjection.hh"
6 
7 
8 namespace Rivet {
9 
11 
12 public:
13 
15  setName("UserCentEstimate");
16  }
17 
20 
21 protected:
22 
23  void project(const Event& e) {
24  clear();
25 #if HEPMC_VERSION_CODE >= 3000000
26  const HepMC::HeavyIon * hi = e.genEvent()->heavy_ion();
27  if ( hi && hi->user_cent_estimate >= 0.0 )
28  set(hi->centrality*100.0);
29 #endif
30  }
31 
32  int compare(const Projection& p) const {
33  return 0;
34  }
35 
36 };
37 
38 }
39 
40 #endif
41 
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:133
Definition: ALICE_2010_I880049.cc:13
Base class for projections returning a single floating point value.
Definition: SingleValueProjection.hh:18
DEFAULT_RIVET_PROJ_CLONE(UserCentEstimate)
Clone on the heap.
Definition: UserCentEstimate.hh:10
const GenEvent * genEvent() const
The generated event obtained from an external event generator.
Definition: Event.hh:51
Definition: Event.hh:22
int compare(const Projection &p) const
Definition: UserCentEstimate.hh:32
void project(const Event &e)
Definition: UserCentEstimate.hh:23
Base class for all Rivet projections.
Definition: Projection.hh:29
void clear()
Unset the value.
Definition: SingleValueProjection.hh:47