DAS  3.0
Das Analysis System
Event.h
Go to the documentation of this file.
1 #pragma once
2 
3 // STD
4 #include <vector>
5 
6 // Darwin
7 #include <GenericObject.h>
8 #include <Variation.h>
9 #include <Weight.h>
10 
11 // ROOT
12 #include <TRandom3.h>
13 #include <Math/Point3D.h>
14 
15 namespace Darwin::Physics {
16 
20 
21  std::string_view WeightGroup () const override { return WeightVar; }
22 
23 public:
24  static inline const char * const WeightVar = "GenEvtWgts"; //< Name of gen weights in variations
25 
26  GenEvent () = default;
27  virtual ~GenEvent () = default;
28 };
29 
33 
34  std::string_view WeightGroup () const override { return WeightVar; }
35 
36 public:
37  static inline const char * const WeightVar = "RecEvtWgts"; //< Name of rec weights in variations
38 
39  int fill = 0,
40  runNo = 0,
41  lumi = 0;
42  unsigned long long evtNo = 0;
43 
44  RecEvent () = default;
45  virtual ~RecEvent () = default;
46 
47  void Clear () override
48  {
49  fill = 0;
50  runNo = 0;
51  lumi = 0;
52  evtNo = 0;
54  }
55 };
56 
58 
59  std::string_view WeightGroup () const override { return WeightVar; }
60 
61 public:
62  static inline const char * const WeightVar = "GenVtxWgts"; //< Name of gen weights in variations
63 
64  ROOT::Math::RhoZPhiPointF location = ROOT::Math::RhoZPhiPointF(std::nan("rho"), std::nan("z"), std::nan("phi"));
65 
66  GenPV () = default;
67  virtual ~GenPV () = default;
68 
69  void Clear () override
70  {
72  location.SetCoordinates(std::nan("rho"), std::nan("z"), std::nan("phi"));
73  }
74 };
75 
76 class RecPV : public GenPV {
77 
78  std::string_view WeightGroup () const override { return WeightVar; }
79 
80 public:
81  static inline const char * const WeightVar = "RecVtxWgts"; //< Name of gen weights in variations
82 
83  float chi2 = std::nan("chi2");
84  int ndf = -1;
85 
86  RecPV () = default;
87  virtual ~RecPV () = default;
88 
89  void Clear () override
90  {
91  GenPV::Clear();
92  chi2 = std::nan("chi2");
93  ndf = -1;
94  }
95 };
96 
97 } // end of Darwin::Physics
98 
99 inline std::ostream& operator<< (std::ostream& s, const Darwin::Physics::GenPV& pv)
100 {
101  return s << '(' << pv.location.rho() << ','
102  << pv.location.z () << ','
103  << pv.location.phi() << ')';
104 }
105 
106 inline std::ostream& operator<< (std::ostream& s, const Darwin::Physics::RecEvent& event)
107 {
108  return s << event.fill << ' ' << event.runNo << ' ' << event.lumi << ' ' << event.evtNo;
109 }
Darwin::Physics::RecEvent::~RecEvent
virtual ~RecEvent()=default
Darwin::Physics::GenPV
Definition: Event.h:57
Darwin::Physics::GenPV::WeightGroup
std::string_view WeightGroup() const override
Definition: Event.h:59
Darwin::Physics::RecPV::chi2
float chi2
figure of merit of the vertex fit
Definition: Event.h:83
Darwin::Physics::GenEvent::GenEvent
GenEvent()=default
Darwin::Physics::GenPV::Clear
void Clear() override
Definition: Event.h:69
Darwin::Physics::GenEvent::WeightVar
static const char *const WeightVar
Definition: Event.h:24
Darwin::Physics::RecPV::Clear
void Clear() override
Definition: Event.h:89
Darwin::Physics::RecEvent::evtNo
unsigned long long evtNo
event number
Definition: Event.h:42
Darwin::Physics::RecPV::ndf
int ndf
number of degrees of freedom in vertex fit
Definition: Event.h:84
Darwin::Physics::RecPV::WeightGroup
std::string_view WeightGroup() const override
Definition: Event.h:78
Weight.h
Darwin::Physics::RecEvent::runNo
int runNo
at LHC, typically a 6-digit run number
Definition: Event.h:40
Darwin::Physics::GenPV::WeightVar
static const char *const WeightVar
Definition: Event.h:62
Darwin::Physics::RecEvent::WeightGroup
std::string_view WeightGroup() const override
Definition: Event.h:34
Darwin::Physics::GenPV::GenPV
GenPV()=default
Variation.h
operator<<
std::ostream & operator<<(std::ostream &s, const Darwin::Physics::GenPV &pv)
Definition: Event.h:99
Darwin::Physics::AnonymousWeightableObject
Abstract class for any object that carries its own weights. A std::vector is used to carry the scale ...
Definition: GenericObject.h:36
Darwin::Physics::GenEvent
Generic generator-level event.
Definition: Event.h:19
Darwin::Physics::RecPV::WeightVar
static const char *const WeightVar
Definition: Event.h:81
Darwin::Physics::RecPV::~RecPV
virtual ~RecPV()=default
Darwin::Physics::RecPV
Definition: Event.h:76
Darwin::Physics::GenPV::location
ROOT::Math::RhoZPhiPointF location
Definition: Event.h:64
Darwin::Physics::RecEvent
Generic detector-level event.
Definition: Event.h:32
Darwin::Physics::RecEvent::WeightVar
static const char *const WeightVar
Definition: Event.h:37
Darwin::Physics::GenEvent::~GenEvent
virtual ~GenEvent()=default
Darwin::Physics::GenPV::~GenPV
virtual ~GenPV()=default
Darwin::Physics::AnonymousWeightableObject::Clear
virtual void Clear()
Definition: GenericObject.h:62
Darwin::Physics::RecEvent::fill
int fill
at LHC, typically a 4- or 5-digit number
Definition: Event.h:39
GenericObject.h
Darwin::Physics::RecEvent::lumi
int lumi
lumi section (shortest unit time in LHC jargon)
Definition: Event.h:41
Darwin::Physics
Everything what concerns physics analysis directly.
Definition: darwin.h:24
Darwin::Physics::GenEvent::WeightGroup
std::string_view WeightGroup() const override
Definition: Event.h:21
Darwin::Physics::RecEvent::RecEvent
RecEvent()=default
Darwin::Physics::RecEvent::Clear
void Clear() override
< to clear for each new event in n-tupliser
Definition: Event.h:47
Darwin::Physics::RecPV::RecPV
RecPV()=default