checkmate is hosted by Hepforge, IPPP Durham
ETMiss.h
Go to the documentation of this file.
1 #ifndef _ETMISS
2 #define _ETMISS
3 
4 #include <stdio.h>
5 #include <math.h>
6 
7 #include <TObject.h>
8 #include <TROOT.h>
9 
10 #include "classes/DelphesClasses.h"
11 
13 
19 class ETMiss {
20  public:
22 
27  ETMiss(MissingET* met) {
28  double missingET_ET = met->MET;
29  double missingET_Phi = met->Phi;
30  double missingET_Ex = missingET_ET*cos(missingET_Phi);
31  double missingET_Ey = missingET_ET*sin(missingET_Phi);
32 
33  // Smearing of ET due to pile up set at 20GeV
34  double deltaPT = 20.0;
35 
36  double x = rand() /(RAND_MAX+1.);
37  double y = rand() /(RAND_MAX+1.);
38  double uni_gauss = sqrt(-2.*log(x))*cos(2.*3.1415*y);
39  double uni_normal = rand() / (RAND_MAX+1.);
40 
41  double smear_x = deltaPT*uni_gauss*cos(2.*3.1415*uni_normal);
42  double smear_y = deltaPT*uni_gauss*sin(2.*3.1415*uni_normal);
43 
44  double new_ET = sqrt(pow(missingET_Ex+smear_x, 2)+pow(missingET_Ey+smear_y, 2));
45  content.SetPxPyPzE(missingET_Ex+smear_x, missingET_Ey+smear_y, 0, new_ET);
46  PT = content.Pt();
47  Eta = content.Eta();
48  Phi = content.Phi();
49  }
50 
52 
58  void addMuons(std::vector<Muon*> muons) {
59  TLorentzVector sum = TLorentzVector(0,0,0,0);
60  for(int i = 0; i < muons.size(); i++)
61  sum += muons[i]->P4();
62 
63  double new_ET = sqrt(pow(content.Px()-sum.Px(), 2)+pow(content.Py()-sum.Py(), 2));
64  content.SetPxPyPzE(content.Px()-sum.Px(), content.Py()-sum.Py(), 0, new_ET);
65  PT = content.Pt();
66  Eta = content.Eta();
67  Phi = content.Phi();
68  }
69 
70  Float_t PT;
71  Float_t Eta;
72  Float_t Phi;
73  TLorentzVector P4() { return content; }
74 
75  private:
76  TLorentzVector content;
77 };
78 
79 #endif
ETMiss(MissingET *met)
Constructor.
Definition: ETMiss.h:27
TLorentzVector P4()
Returns a TLorentzVector object to the full 4 momentum.
Definition: ETMiss.h:73
Float_t PT
Transverse momentum.
Definition: ETMiss.h:70
Float_t Eta
Pseudorapidity.
Definition: ETMiss.h:71
Float_t Phi
Polar angle.
Definition: ETMiss.h:72
void addMuons(std::vector< Muon * > muons)
Add muons to missingET calculation.
Definition: ETMiss.h:58
A class to parametrise missingET.
Definition: ETMiss.h:19