rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
MC_Cent_pPb.hh
1 // -*- C++ -*-
2 #ifndef RIVET_MC_Cent_pPb_HH
3 #define RIVET_MC_Cent_pPb_HH
4 
5 #include "Rivet/Projections/FinalState.hh"
6 #include "Rivet/Projections/ChargedFinalState.hh"
7 #include "Rivet/Projections/SingleValueProjection.hh"
8 #include "Rivet/Projections/TriggerProjection.hh"
9 
10 namespace Rivet {
11 
15 
16 public:
17 
20  declare(FinalState(Cuts::eta < -3.2 && Cuts::eta > -4.9 && Cuts::pT > 0.1*GeV),
21  "FSSumETFwdCentrality");
22  }
23 
26 
27 protected:
28 
30  void project(const Event& e) {
31  clear();
32  const FinalState & fsfwd =
33  apply<FinalState>(e, "FSSumETFwdCentrality");
34  double estimate = 0.0;
35  for ( const Particle & p : fsfwd.particles() ) {
36  estimate += p.Et();
37  }
38  set(estimate);
39  }
40 
42  int compare(const Projection& p) const {
43  return mkNamedPCmp(p, "FSSumETFwdCentrality");
44  }
45 
46 };
47 
51 
52 public:
53 
56  declare(FinalState(Cuts::eta < -3.2 && Cuts::eta > -4.9 && Cuts::pT > 0.1*GeV),
57  "FSSumETFwdCentrality");
58  declare(ChargedFinalState(Cuts::eta > 2.09 && Cuts::eta < 3.84 &&
59  Cuts::pT > 0.1*GeV), "MBB");
60  declare(ChargedFinalState(Cuts::eta < -2.09 && Cuts::eta > -3.84 &&
61  Cuts::pT > 0.1*GeV), "MBF");
62  }
63 
66 
67 protected:
68 
70  void project(const Event& event) {
71  pass();
72  if ( applyProjection<FinalState>(event,"MBF").particles().empty() ||
73  applyProjection<FinalState>(event,"MBB").particles().empty() )
74  fail();
75  }
76 
78  int compare(const Projection& p) const {
79  return mkNamedPCmp(p, "MBF") || mkNamedPCmp(p, "MBB");
80  }
81 
82 };
83 
84 
85 }
86 
87 #endif
Definition: ALICE_2010_I880049.cc:13
Base class for projections returning a single floating point value.
Definition: SingleValueProjection.hh:18
virtual const Particles & particles() const
Get the particles in no particular order, with no cuts.
Definition: ParticleFinder.hh:49
MC_SumETFwdPbCentrality()
Constructor.
Definition: MC_Cent_pPb.hh:19
Definition: MC_Cent_pPb.hh:14
Definition: MC_Cent_pPb.hh:50
std::vector< GenParticle const * > particles(const GenEvent *ge)
Definition: RivetHepMC.hh:36
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition: Particle.hh:18
int compare(const Projection &p) const
Compare projections.
Definition: MC_Cent_pPb.hh:42
void project(const Event &event)
Perform the projection on the Event.
Definition: MC_Cent_pPb.hh:70
Definition: Event.hh:22
Base class for projections returning a bool corresponding to a trigger.
Definition: TriggerProjection.hh:19
MC_pPbMinBiasTrigger()
Constructor.
Definition: MC_Cent_pPb.hh:55
int compare(const Projection &p) const
Compare projections.
Definition: MC_Cent_pPb.hh:78
DEFAULT_RIVET_PROJ_CLONE(MC_SumETFwdPbCentrality)
Clone on the heap.
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Definition: Projection.cc:51
void project(const Event &e)
Perform the projection on the Event.
Definition: MC_Cent_pPb.hh:30
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:12
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:160
Project only charged final state particles.
Definition: ChargedFinalState.hh:11
Base class for all Rivet projections.
Definition: Projection.hh:29
void clear()
Unset the value.
Definition: SingleValueProjection.hh:47