DAS  3.0
Das Analysis System
Event.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 
7 
8 #include <TRandom3.h>
9 
10 namespace DAS {
11 
16 protected:
17  virtual std::string_view weight_group () const = 0;
18 
19  AbstractEvent () = default;
20  virtual ~AbstractEvent () = default;
21 
22 public:
24 
25  inline double Weight (const Uncertainties::Variation& v) const
26  {
27  if (v.group == weight_group()) {
28  const DAS::Weight& w = weights.at(v.index);
29  if (w.i == v.bit) return w;
30  }
31  return weights.front();
32  }
33 };
34 
38 struct GenEvent : public AbstractEvent {
39  static inline const char * const WeightVar = "GenEvtWgts"; //< Name of gen weights in variations
40 
41  float hard_scale;
42 
43  void clear ();
44 
45 private:
46  std::string_view weight_group () const override { return WeightVar; }
47 };
48 
52 struct RecEvent : public AbstractEvent {
53  static inline const char * const WeightVar = "RecEvtWgts"; //< Name of rec weights in variations
54 
55  int runNo,
56  lumi;
57  unsigned long long evtNo;
58 
59  void clear ();
60 
61 private:
62  std::string_view weight_group () const override { return WeightVar; }
63 };
64 
71 struct Trigger {
72  std::vector<bool> Bit;
73  std::vector<int> PreHLT,
76 
77  void clear ();
78 };
79 
84 struct MET {
85  float Et,
87  Pt,
88  Phi;
89  std::vector<bool> Bit;
90 
91  void clear ();
92 };
93 
98 struct PileUp {
99 
100  static float MBxsec, MBxsecRelUnc;
101 
102  float rho;
103  int nVtx;
104  float trpu;
105  int intpu;
106  std::vector<float> pthats;
107  std::vector<unsigned long long> MBevents;
108 
109  float GetTrPU (const char v = '0') const;
110  float GetInTimePU (const char v = '0', const bool useDefault = true) const;
111  static TRandom3 r3;
112  void clear ();
113 };
114 
120  float Rho,
121  z,
124  bool fake;
125 
126  float distGen;
127 
128  void clear ();
129 };
130 
131 }
132 
133 #if defined(__ROOTCLING__)
134 #pragma link C++ class DAS::AbstractEvent +;
135 #pragma link C++ class DAS::GenEvent +;
136 #pragma link C++ class DAS::RecEvent +;
137 
138 #pragma link C++ class DAS::Trigger +;
139 
140 #pragma link C++ class DAS::PrimaryVertex +;
141 
142 #pragma link C++ class DAS::PileUp +;
143 
144 #pragma link C++ class DAS::MET +;
145 
146 #endif
DAS::Weights
std::vector< Weight > Weights
Definition: Weight.h:41
DAS::RecEvent::weight_group
std::string_view weight_group() const override
Definition: Event.h:62
DAS
Definition: applyBTagSF.cc:31
DAS::PileUp::MBxsecRelUnc
static float MBxsecRelUnc
Definition: Event.h:100
DAS::PileUp::trpu
float trpu
true pile-up
Definition: Event.h:104
DAS::RecEvent::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:15
DAS::PrimaryVertex::chi2
float chi2
figure of merit of the vertex fit
Definition: Event.h:122
DAS::GenEvent::weight_group
std::string_view weight_group() const override
Definition: Event.h:46
DAS::Trigger
Definition: Event.h:71
DAS::PileUp::nVtx
int nVtx
number of vertices in the event
Definition: Event.h:103
DAS::Trigger::Bit
std::vector< bool > Bit
indicates which trigger has fired
Definition: Event.h:72
DAS::RecEvent
Definition: Event.h:52
DAS::MET
Definition: Event.h:84
DAS::AbstractEvent::AbstractEvent
AbstractEvent()=default
DAS::AbstractEvent::weights
Weights weights
e.g. cross section normalisation
Definition: Event.h:23
DAS::JetEnergy::w
static const float w
Definition: common.h:47
DAS::PrimaryVertex::ndof
float ndof
number of degrees of freedom in vertex fit
Definition: Event.h:123
DAS::MET::Et
float Et
transverse energy
Definition: Event.h:85
DAS::GenEvent::WeightVar
static const char *const WeightVar
Definition: Event.h:39
DAS::RecEvent::runNo
int runNo
6-digit run number
Definition: Event.h:55
DAS::PrimaryVertex::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:82
DAS::Trigger::PreL1max
std::vector< int > PreL1max
L1 max pre-scale.
Definition: Event.h:75
DAS::PileUp
Definition: Event.h:98
DAS::RecEvent::evtNo
unsigned long long evtNo
event number
Definition: Event.h:57
DAS::PileUp::rho
float rho
soft activity (see formula 7.15 in Patrick's thesis)
Definition: Event.h:102
DAS::AbstractEvent::weight_group
virtual std::string_view weight_group() const =0
DAS::AbstractEvent::~AbstractEvent
virtual ~AbstractEvent()=default
DAS::RecEvent::lumi
int lumi
lumi section
Definition: Event.h:56
DAS::MET::Bit
std::vector< bool > Bit
flags for application of MET filters (see n-tupliser config file)
Definition: Event.h:89
DAS::PileUp::GetTrPU
float GetTrPU(const char v='0') const
pile-up variations
Definition: Event.cc:39
DAS::Trigger::PreL1min
std::vector< int > PreL1min
L1 min pre-scale.
Definition: Event.h:74
DAS::PrimaryVertex::distGen
float distGen
distance to gen (only relevant in MC)
Definition: Event.h:126
DAS::RecEvent::WeightVar
static const char *const WeightVar
Definition: Event.h:53
DAS::AbstractEvent::Weight
double Weight(const Uncertainties::Variation &v) const
< weight
Definition: Event.h:25
DAS::PrimaryVertex::z
float z
position on beam axis
Definition: Event.h:121
DAS::PrimaryVertex::Rho
float Rho
transverse distance to beam axis
Definition: Event.h:120
DAS::Weight
Definition: Weight.h:16
DAS::PileUp::r3
static TRandom3 r3
Definition: Event.h:111
DAS::GenEvent::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:9
DAS::PrimaryVertex::fake
bool fake
flag for fake vertices
Definition: Event.h:124
Variation.h
DAS::PileUp::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:74
DAS::PileUp::MBxsec
static float MBxsec
Definition: Event.h:100
DAS::PileUp::pthats
std::vector< float > pthats
all hard scales found in PU
Definition: Event.h:106
DAS::PileUp::GetInTimePU
float GetInTimePU(const char v='0', const bool useDefault=true) const
pile-up variations
Definition: Event.cc:54
DAS::MET::Phi
float Phi
direction of the total transverse momentum
Definition: Event.h:88
DAS::Trigger::PreHLT
std::vector< int > PreHLT
HLT prescale.
Definition: Event.h:73
Weight.h
DAS::GenEvent::hard_scale
float hard_scale
hard scale, corresponding to pthat in Pythia 8
Definition: Event.h:41
DAS::PileUp::intpu
int intpu
in-time pile-up (i.e. from the same bunch crossing)
Definition: Event.h:105
DAS::MET::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:29
DAS::Trigger::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:21
DAS::Uncertainties::Variation
Definition: Variation.h:22
DAS::MET::SumEt
float SumEt
sum of the transverse energies of all the components (jet, leptons, etc.) present in the event
Definition: Event.h:86
DAS::PileUp::MBevents
std::vector< unsigned long long > MBevents
event IDs in MB sample
Definition: Event.h:107
DAS::AbstractEvent
Definition: Event.h:15
DAS::MET::Pt
float Pt
exactly the same as Et
Definition: Event.h:87
DAS::PrimaryVertex
Definition: Event.h:119
DAS::GenEvent
Definition: Event.h:38