DAS  3.0
Das Analysis System
Balance

Description

Balance histogram for a given variation.

#include <Balance.h>

+ Collaboration diagram for Balance:

Public Member Functions

 Balance (TDirectory *d, const DAS::Uncertainties::Variation &v, const vector< double > &pt_edges, const vector< double > &y_edges)
 
void operator() (const DAS::AbstractPhysicsObject &tag, const DAS::AbstractPhysicsObject &probe, const double ev_w)
 
void Write ()
 

Public Attributes

DAS::Uncertainties::Variation v
 

Private Attributes

TDirectory * d
 
unique_ptr< TH3D > asymmetry
 
unique_ptr< TH2D > response
 

Constructor & Destructor Documentation

◆ Balance()

Balance ( TDirectory *  d,
const DAS::Uncertainties::Variation v,
const vector< double > &  pt_edges,
const vector< double > &  y_edges 
)
inline
68  :
69  d(d), v(v)
70  {
71  int nBins = 120;
72  auto balBins = getBinning(nBins, -1.2, 1.2);
73  assertValidBinning(balBins);
74 
75  int nPtBins = pt_edges.size()-1,
76  nYbins = y_edges.size()-1;
77 
78  TString dirname = d->GetName();
79  TString hname = dirname + '_' + v.group + '_' + v.name;
80  asymmetry = make_unique<TH3D>(hname, v.name, nBins, balBins.data(),
81  nPtBins, pt_edges.data(),
82  nYbins, y_edges.data());
83 
84  balBins = getBinning(nBins, 0, 1.2);
85  response = make_unique<TH2D>("response_" + hname, v.name, nBins, balBins.data(),
86  nYbins, y_edges.data());
87  }

Member Function Documentation

◆ operator()()

void operator() ( const DAS::AbstractPhysicsObject tag,
const DAS::AbstractPhysicsObject probe,
const double  ev_w 
)
inline

Calculates balance for two objects following the definition of the Run 1 JetMET reference publication for dijet systems.

95  {
96  float absy_probe = probe.AbsRap(v);
97 
98  float pt_tag = tag .CorrPt(v),
99  pt_probe = probe.CorrPt(v);
100 
101  double jw = tag .Weight(v)
102  * probe.Weight(v);
103 
104  response->Fill(pt_probe/pt_tag, absy_probe, ev_w*jw);
105 
106  // \todo does this also apply to Z+jet balance?
107  // (e.g. not in 1804.05252)
108  float pt_dif = (pt_tag - pt_probe),
109  pt_ave = (pt_tag + pt_probe) * 0.5;
110 
111  float asym = pt_dif / pt_ave;
112 
113  cout << asym << endl;
114 
115  asymmetry->Fill(asym, pt_ave, absy_probe, ev_w*jw);
116  }

◆ Write()

void Write ( )
inline
119  {
120  d->cd();
121  TString dirname = d->GetName();
122 
123  asymmetry->SetDirectory(d);
124  TString hname = asymmetry->GetName();
125  hname.ReplaceAll(dirname + '_', "");
126  asymmetry->Write(hname);
127 
128  response->SetDirectory(d);
129  hname = response->GetName();
130  hname.ReplaceAll(dirname + '_', "");
131  response->Write(hname);
132  }

Member Data Documentation

◆ asymmetry

unique_ptr<TH3D> asymmetry
private

asymmetry histogram

◆ d

TDirectory* d
private

directory in output ROOT file

◆ response

unique_ptr<TH2D> response
private

response

◆ v

systematic variation


The documentation for this class was generated from the following file:
DAS::y_edges
static const std::vector< double > y_edges
Definition: binnings.h:36
DAS::AbstractPhysicsObject::CorrPt
virtual float CorrPt(const Uncertainties::Variation &) const =0
DAS::JetEnergy::Balance::response
unique_ptr< TH2D > response
response
Definition: Balance.h:60
DAS::AbstractPhysicsObject::Weight
virtual double Weight(const Uncertainties::Variation &) const =0
DAS::Uncertainties::Variation::name
const TString name
variation name (including "Up" or "Down")
Definition: Variation.h:25
DAS::pt_edges
static const std::vector< double > pt_edges
Definition: binnings.h:33
DAS::JetEnergy::getBinning
std::vector< double > getBinning(int nBins, float first, float last)
Definition: common.h:53
DAS::JetEnergy::Balance::d
TDirectory * d
directory in output ROOT file
Definition: Balance.h:58
DAS::JetEnergy::assertValidBinning
void assertValidBinning(const std::vector< double > &v)
Definition: common.h:61
DAS::AbstractPhysicsObject::AbsRap
virtual float AbsRap(const Uncertainties::Variation &) const =0
DAS::nPtBins
static const int nPtBins
Definition: binnings.h:39
DAS::Uncertainties::Variation::group
const TString group
e.g. event, recjet
Definition: Variation.h:24
DAS::JetEnergy::Balance::v
DAS::Uncertainties::Variation v
systematic variation
Definition: Balance.h:63
DAS::JetEnergy::Balance::asymmetry
unique_ptr< TH3D > asymmetry
asymmetry histogram
Definition: Balance.h:59
DAS::nYbins
static const int nYbins
Definition: binnings.h:38