Rivet  3.1.0
DISLepton.hh
1 // -*- C++ -*-
2 #ifndef RIVET_DISLepton_HH
3 #define RIVET_DISLepton_HH
4 
5 #include "Rivet/Projections/Beam.hh"
6 #include "Rivet/Projections/PromptFinalState.hh"
7 #include "Rivet/Projections/HadronicFinalState.hh"
8 #include "Rivet/Projections/DressedLeptons.hh"
9 #include "Rivet/Projections/UndressBeamLeptons.hh"
10 #include "Rivet/Particle.hh"
11 #include "Rivet/Event.hh"
12 
13 namespace Rivet {
14 
15 
17  class DISLepton : public Projection {
18  public:
19 
22  enum SortOrder { ENERGY, ETA, ET };
23 
25 
26 
36  DISLepton(const std::map<std::string,std::string> & opts =
37  std::map<std::string,std::string>())
38  : _isolDR(0.0), _sort(ENERGY) {
39  setName("DISLepton");
40  declare(HadronicFinalState(), "IFS");
41 
42  auto sorting = opts.find("LSort");
43  if ( sorting != opts.end() && sorting->second == "ETA" )
44  _sort = ETA;
45  else if ( sorting != opts.end() && sorting->second == "ET" )
46  _sort = ET;
47 
48  double undresstheta = 0.0;
49  auto undress = opts.find("Undress");
50  if ( undress != opts.end() )
51  undresstheta = std::stod(undress->second);
52  if ( undresstheta > 0.0 )
53  declare(UndressBeamLeptons(undresstheta), "Beam");
54  else
55  declare(Beam(), "Beam");
56 
57  auto isol = opts.find("IsolDR");
58  if ( isol != opts.end() ) _isolDR = std::stod(isol->second);
59 
60  double dressdr = 0.0;
61  auto dress = opts.find("DressDR");
62  if ( dress != opts.end() )
63  dressdr = std::stod(dress->second);
64 
65  auto lmode = opts.find("LMode");
66  if ( lmode != opts.end() && lmode->second == "any" )
67  declare(FinalState(), "LFS");
68  else if ( lmode != opts.end() && lmode->second == "dressed" )
69  declare(DressedLeptons(dressdr), "LFS");
70  else
71  declare(PromptFinalState(), "LFS");
72  }
73 
76 
78 
79 
80  protected:
81 
83  virtual void project(const Event& e);
84 
86  virtual CmpState compare(const Projection& p) const;
87 
88 
89  public:
90 
92  const Particle& in() const { return _incoming; }
93 
95  const Particle& out() const { return _outgoing; }
96 
98  int pzSign() const { return sign(_incoming.pz()); }
99 
100 
101  private:
102 
104  Particle _incoming;
105 
107  Particle _outgoing;
108 
110  double _isolDR;
111 
113  SortOrder _sort;
114 
115  };
116 
117 }
118 
119 
120 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:142
Definition: MC_Cent_pPb.hh:10
DEFAULT_RIVET_PROJ_CLONE(DISLepton)
Clone on the heap.
SortOrder
Definition: DISLepton.hh:22
DISLepton(const std::map< std::string, std::string > &opts=std::map< std::string, std::string >())
Definition: DISLepton.hh:36
int pzSign() const
Sign of the incoming lepton pz component.
Definition: DISLepton.hh:98
virtual CmpState compare(const Projection &p) const
Compare with other projections.
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition: Particle.hh:18
Cluster photons from a given FS to all charged particles (typically leptons)
Definition: DressedLeptons.hh:56
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
Project only hadronic final state particles.
Definition: HadronicFinalState.hh:16
Project out the incoming beams, but subtract any colinear photons from lepton beams within a given co...
Definition: UndressBeamLeptons.hh:13
virtual void project(const Event &e)
Perform the projection operation on the supplied event.
const Particle & out() const
The outgoing lepton.
Definition: DISLepton.hh:95
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
const Particle & in() const
The incoming lepton.
Definition: DISLepton.hh:92
Project out the incoming beams.
Definition: Beam.hh:129
Get the incoming and outgoing leptons in a DIS event.
Definition: DISLepton.hh:17
Base class for all Rivet projections.
Definition: Projection.hh:29
Find final state particles directly connected to the hard process.
Definition: PromptFinalState.hh:22
std::enable_if< std::is_arithmetic< NUM >::value, int >::type sign(NUM val)
Find the sign of a number.
Definition: MathUtils.hh:245