DAS  3.0
Das Analysis System
Objects.h
Go to the documentation of this file.
1 #ifndef DARWIN_EVENT_H
2 #define DARWIN_EVENT_H
3 
4 #include <iostream>
5 #include <vector>
6 #include <Math/PtEtaPhiM4D.h>
7 #include <Math/Cylindrical3D.h>
8 #include <Math/Polar2D.h>
9 #include <TRandom3.h>
10 
11 namespace Darwin::Physics {
12 
15 struct Event {
16  std::vector<float> weights;
17  virtual float weight () const = 0;
18  virtual void clear ();
19  Event ();
20  virtual ~Event () = default;
21 };
22 
25 struct GenEvent : public Event {
26  static size_t iWgt;
27  float weight () const final;
28  int process;
29  float hard_scale;
30  void clear () override;
31  GenEvent ();
32 };
33 
40 struct RecEvent : public Event {
41  static size_t iWgt;
42  float weight () const final;
43  int fill,
44  runNo,
45  lumi;
46  unsigned long long evtNo;
47  void clear () override;
48  RecEvent ();
49 };
50 
57 struct Trigger {
58  std::vector<bool> Bit;
59  std::vector<int> PreHLT,
62 
63  void clear ();
64 };
65 
68 struct MET : public ROOT::Math::Polar2D<float> {
69  float SumEt;
70  virtual void clear ();
71  MET ();
72  virtual ~MET () = default;
73 };
74 
75 //struct GenMET : public MET {
76 // // TODO
77 // void clear () override; //!< resets all members to the same values as in the constructor
78 //};
79 
85 struct RecMET : public MET {
86  // TODO: both corr and uncorr?
87  std::vector<bool> Bit;
88  void clear () override;
89 };
90 
96 struct PileUp {
97 
98  static float MBxsec,
100 
101  float rho;
102  int nVtx;
103  float trpu;
104  int intpu;
105  float pthatMax;
106 
107  float GetTrPU (const char = '0') const;
108  float GetIntPU (const char = '0') const;
109  float GetIntPU (TRandom3&, const char = '0') const;
110  void clear ();
111 
112  PileUp ();
113 };
114 
117 struct Vertex : public ROOT::Math::Cylindrical3D<float> {
118  float chi2;
119  int ndf;
120  bool fake;
121 
122  void clear ();
123  Vertex ();
124 };
125 
128 struct FourVector : public ROOT::Math::PtEtaPhiM4D<float> {
129 
130  virtual float Rapidity () const;
131  virtual float AbsRap () const;
132 
133  virtual void clear ();
134 
135  virtual FourVector& operator+= (const ROOT::Math::PtEtaPhiM4D<float>&);
136  virtual FourVector operator+ (const ROOT::Math::PtEtaPhiM4D<float>&) const;
137 
138  FourVector () = default;
139  FourVector (const ROOT::Math::PtEtaPhiM4D<float>&);
140  virtual ~FourVector () = default;
141 };
142 
145 struct Jet : public FourVector {
146 
147  static float R;
148 
149  char pdgID,
152 
153  std::vector<float> scales,
154  weights;
156 
157  virtual float CorrPt () const = 0;
158  virtual float CorrEta () const = 0;
159  // TODO: mass??
160 
161  virtual Jet& operator+= (const Jet&);
162 
163  virtual float weight () const = 0;
164  void clear () override;
165 
166  Jet ();
167  virtual ~Jet () = default;
168 };
169 
172 struct GenJet : public Jet {
173 
174  static size_t iWgt,
176 
177  float weight () const final;
178  float CorrPt () const final;
179  float CorrEta () const final;
180 
181  virtual GenJet operator+ (const GenJet&) const;
182 
183  void clear () override;
184  ~GenJet () = default;
185 };
186 
189 struct RecJet : public Jet {
190 
191  static size_t iWgt,
193 
194  float weight () const final;
195  float CorrPt () const final;
196  float CorrEta () const final;
197 
198  virtual RecJet operator+ (const RecJet&) const;
199 
200  float area;
201  std::vector<std::vector<float>> tags;
202 
203  void clear () override;
204  RecJet ();
205  ~RecJet () = default;
206 };
207 
210 //template<typename First, typename Second> struct Comb {
211 //
212 // First& first; //!< first decay product (typically with the highest energy)
213 // Second& second; //!< second decay product
214 //
215 // FourVector operator() () const //!< creates a 4-vec on the fly, using `iScl` internally
216 // {
217 // FourVector c1 = first(),
218 // c2 = second();
219 // return c1 + c2;
220 // }
221 //
222 // void clear ()
223 // {
224 // first.clear();
225 // second.clear();
226 // }
227 //
228 // inline float weight () //!< weight product of components, using `iWgt` internally
229 // {
230 // return first.weight() * second.weight();
231 // }
232 //};
233 
234 //template<typename Jet> Dijet : public Comb<Jet,Jet>, public FourVector {
235 //
236 // Dijet (Jet& jet1, Jet& jet2) :
237 // Comb<Jet,Jet>{jet1, jet2},
238 // FourVector(Comb<Jet,Jet>::operator()())
239 // { }
240 //
241 // inline float Ymax () { return max(first.AbsRap(), second.AbsRap()); }
242 // inline float Dphi () { return DeltaPhi(first.Phi(), second.Phi()); }
243 // inline float PtAve () { return Pt()/2; }
244 //
245 //};
246 //
247 //typedef Dijet<RecJet> RecDijet;
248 //typedef Dijet<GenJet> GenDijet;
249 
252 //template<typename First, typename Second> struct CombFit : public Comb<First,Second> {
253 // bool valid; //!< flag for convergence
254 // float chi2; //!< output from fit
255 // int ndf; //!< number of degrees of freedom
256 // // TODO: covariance, etc.?
257 //};
258 //
259 //typedef Comb<RecJet,RecJet> RecVecBosonHad;
260 //typedef Comb<GenJet,GenJet> GenVecBosonHad;
261 //
262 //typedef Comb<RecVecBosonHad,RecJet> RecTop;
263 //typedef Comb<RecVecBosonHad,GenJet> GenTop;
264 //
265 //typedef CombFit<RecVecBosonHad,RecJet> RecTTbarFullHad;
266 //typedef CombFit<GenVecBosonHad,GenJet> GenTTbarFullHad;
267 
268 }
269 
272 std::ostream& operator<< (std::ostream&, const Darwin::Physics::GenEvent&);
273 
276 std::ostream& operator<< (std::ostream&, const Darwin::Physics::RecEvent&);
277 
280 std::ostream& operator<< (std::ostream&, const Darwin::Physics::FourVector&);
281 
284 std::ostream& operator<< (std::ostream&, const Darwin::Physics::Jet&);
285 
286 #endif
Darwin::Physics::Vertex::ndf
int ndf
number of degrees of freedom in vertex fit
Definition: Objects.h:119
Darwin::Physics::Jet::scales
std::vector< float > scales
Definition: Objects.h:154
Darwin::Physics::GenEvent::hard_scale
float hard_scale
hard scale, corresponding to pthat in Pythia 8
Definition: Objects.h:29
Darwin::Physics::RecEvent::iWgt
static size_t iWgt
global index for weight
Definition: Objects.h:41
Darwin::Physics::RecEvent
Definition: Objects.h:40
Darwin::Physics::Jet
An abstract class for jets.
Definition: Objects.h:145
Darwin::Physics::Jet::R
static float R
parameter of clustering algorithm
Definition: Objects.h:147
Darwin::Physics::Jet::CorrPt
virtual float CorrPt() const =0
uses the scale internally with global index in daughter class
Darwin::Physics::Event::weight
virtual float weight() const =0
access to weight, using iWgt in daughter classes
Darwin::Physics::Event
Abstract structure for events in data and MC.
Definition: Objects.h:15
Darwin::Physics::Jet::CorrEta
virtual float CorrEta() const =0
uses the scale internally with global index in daughter class
Darwin::Physics::GenJet
A generator level jet.
Definition: Objects.h:172
Darwin::Physics::Event::Event
Event()
Definition: Objects.cc:16
Darwin::Physics::MET::~MET
virtual ~MET()=default
Darwin::Physics::Trigger::PreHLT
std::vector< int > PreHLT
HLT prescale.
Definition: Objects.h:59
Darwin::Physics::RecMET
Definition: Objects.h:85
Darwin::Physics::FourVector
An extended version of ROOT 4-vectors.
Definition: Objects.h:128
Darwin::Physics::PileUp::rho
float rho
soft activity (see formula 7.15 in Patrick's thesis)
Definition: Objects.h:101
Darwin::Physics::GenEvent::process
int process
flag for process (TODO?)
Definition: Objects.h:28
Darwin::Physics::Event::weights
std::vector< float > weights
Definition: Objects.h:16
Darwin::Physics::FourVector::FourVector
FourVector()=default
Darwin::Physics::Vertex
Vertex information for CMS standard quality selection.
Definition: Objects.h:117
Darwin::Physics::RecJet::iWgt
static size_t iWgt
global index for weight
Definition: Objects.h:191
Darwin::Tools::fill
@ fill
activate -f to fill the tree
Definition: Options.h:28
Darwin::Physics::GenEvent::weight
float weight() const final
uses iWgt internally
Definition: Objects.cc:22
Darwin::Physics::GenEvent::clear
void clear() override
resets all members to the same values as in the constructor
Definition: Objects.cc:26
Darwin::Physics::Trigger
Definition: Objects.h:57
Darwin::Physics::Vertex::chi2
float chi2
figure of merit of the vertex fit
Definition: Objects.h:118
Darwin::Physics::GenJet::iScl
static size_t iScl
global index for scale
Definition: Objects.h:175
Darwin::Physics::Jet::pdgID
char pdgID
pdgID (default is 0 = undefined)
Definition: Objects.h:149
Darwin::Physics::RecMET::Bit
std::vector< bool > Bit
flags for application of MET filters (see n-tupliser config file)
Definition: Objects.h:87
Darwin::Physics::PileUp::trpu
float trpu
true pile-up
Definition: Objects.h:103
Darwin::Physics::FourVector::~FourVector
virtual ~FourVector()=default
Darwin::Physics::PileUp
Definition: Objects.h:96
operator+
auto operator+(Obj1 &o1, Obj2 &o2)
Definition: Di.h:95
Darwin
Global namespace for libraries and executables for analysis with Darwin.
Definition: forceMetaInfo.cc:28
Darwin::Physics::PileUp::nVtx
int nVtx
number of vertices in the event
Definition: Objects.h:102
Darwin::Physics::Event::~Event
virtual ~Event()=default
Darwin::Physics::Jet::nCHadrons
char nCHadrons
number of C hadrons (0, 1+ in 2017; 0, 1, 2+ in 2016)
Definition: Objects.h:151
Darwin::Physics::Trigger::PreL1max
std::vector< int > PreL1max
L1 max pre-scale.
Definition: Objects.h:61
Darwin::Physics::Jet::nBHadrons
char nBHadrons
number of B hadrons (0, 1 or 2+)
Definition: Objects.h:150
Darwin::Physics::GenJet::iWgt
static size_t iWgt
global index for weight
Definition: Objects.h:174
Darwin::Physics::MET::SumEt
float SumEt
scalar sum of the transverse momentum of visible object
Definition: Objects.h:69
Darwin::Physics::Vertex::fake
bool fake
flag for fake vertices
Definition: Objects.h:120
Darwin::Physics::PileUp::MBxsec
static float MBxsec
minimum-bias cross section
Definition: Objects.h:98
Darwin::Physics::MET
Abstract structure for MET information.
Definition: Objects.h:68
Darwin::Physics::PileUp::MBxsecRelUnc
static float MBxsecRelUnc
relative uncertainty on minimum-bias cross section
Definition: Objects.h:99
Darwin::Physics::Jet::~Jet
virtual ~Jet()=default
destructor
Darwin::Physics::Event::clear
virtual void clear()
resets all members to the same values as in the constructor
Definition: Objects.cc:10
Darwin::Physics::PileUp::intpu
int intpu
in-time pile-up (i.e. from the same bunch crossing)
Definition: Objects.h:104
DAS::FourVector
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< float > > FourVector
Definition: PhysicsObject.h:15
Darwin::Physics
Everything what concerns physics analysis directly.
Definition: darwin.h:22
Darwin::Physics::GenEvent
Structure for events in MC only with generator information.
Definition: Objects.h:25
Darwin::Physics::Trigger::Bit
std::vector< bool > Bit
indicates which trigger has fired
Definition: Objects.h:58
Darwin::Physics::RecJet
A detector level jet.
Definition: Objects.h:189
Darwin::Physics::RecJet::iScl
static size_t iScl
global index for scale
Definition: Objects.h:192
Darwin::Physics::Jet::weight
virtual float weight() const =0
access to weight, using iWgt in daughter classes
Darwin::Physics::PileUp::pthatMax
float pthatMax
hard-scale of the hardest pile-up event (to deal with anomalous events)
Definition: Objects.h:105
Darwin::Physics::Trigger::PreL1min
std::vector< int > PreL1min
L1 min pre-scale.
Definition: Objects.h:60
Darwin::Physics::GenEvent::iWgt
static size_t iWgt
global index for weight
Definition: Objects.h:26