DAS  3.0
Das Analysis System
Plots

#include <Plots.h>

+ Collaboration diagram for Plots:

Public Member Functions

 Plots (const char *Name)
 
void operator() (const std::vector< GenJet > &genjets, const std::vector< RecJet > &recjets, const GenEvent &genEvt, const RecEvent &recEvt, const PileUp &pileup)
 
void Write (TDirectory *d)
 

Public Attributes

TString name
 
std::unique_ptr< TH1F > pthatME
 
std::unique_ptr< TH1F > pthatPU
 
std::unique_ptr< TH1F > pthatMax
 
std::unique_ptr< TH1F > genht
 
std::unique_ptr< TH1F > recht
 
std::unique_ptr< TH2F > pthatLogw
 
std::unique_ptr< TH2F > genptLogw
 
std::unique_ptr< TH2F > genhtLogw
 
std::unique_ptr< TH2F > genmjjLogw
 
std::unique_ptr< TH2F > recptLogw
 
std::unique_ptr< TH2F > rechtLogw
 
std::unique_ptr< TH2F > recmjjLogw
 

Private Member Functions

float FillPtHat (const GenEvent &event, const PileUp &pileup)
 
template<typename Jet >
void FillObsWgt (std::unique_ptr< TH2F > &ptLogw, std::unique_ptr< TH2F > &mjjLogw, std::unique_ptr< TH2F > &htLogw, std::unique_ptr< TH1F > &ht, const std::vector< Jet > &jets, float evW)
 

Constructor & Destructor Documentation

◆ Plots()

Plots ( const char *  Name)
inline
27  :
28  name(Name),
29  pthatME(std::make_unique<TH1F>("pthatME", ";#hat{p}_{T}^{ME} [GeV];N_{eff}^{collisions}", nPtHatBins, pthat_edges.data())),
30  pthatPU(std::make_unique<TH1F>("pthatPU", ";#hat{p}_{T}^{PU} [GeV];N_{eff}^{collisions}", nPtHatBins, pthat_edges.data())),
31  pthatMax(std::make_unique<TH1F>("pthatMax", ";max #hat{p}_{T}^{ME+PU} [GeV];N_{eff}^{bx}", nPtHatBins, pthat_edges.data())),
32  genht(std::make_unique<TH1F>("genht", ";H_{T}^{gen} [GeV];N_{eff}^{j}", nPtBins, pt_edges.data())),
33  recht(std::make_unique<TH1F>("recht", ";H_{T}^{rec} [GeV];N_{eff}^{j}", nPtBins, pt_edges.data())),
34  pthatLogw(std::make_unique<TH2F>("pthatLogw", ";#hat{p}_{T} [GeV];log(w);N_{eff}^{j}", nPtHatBins, pthat_edges.data(), 400, -30, 20)),
35  genptLogw(std::make_unique<TH2F>("genptLogw", ";Jet p_{T}^{gen} [GeV];log(w);N_{eff}^{j}", nPtBins, pt_edges.data(), 400, -30, 20)),
36  genhtLogw(std::make_unique<TH2F>("genhtLogw", ";H_{T}^{gen} [GeV];log(w);N_{eff}^{j}", nPtBins, pt_edges.data(), 400, -30, 20)),
37  genmjjLogw(std::make_unique<TH2F>("genmjjLogw", ";m_{jj}^{gen} [GeV];log(w);N_{eff}^{jj}", nMjjBins, Mjj_edges.data(), 400, -30, 20)),
38  recptLogw(std::make_unique<TH2F>("recptLogw", ";Jet p_{T}^{rec} [GeV];log(w);N_{eff}^{j}", nPtBins, pt_edges.data(), 400, -30, 20)),
39  rechtLogw(std::make_unique<TH2F>("rechtLogw", ";H_{T}^{rec} [GeV];log(w);N_{eff}^{j}", nPtBins, pt_edges.data(), 400, -30, 20)),
40  recmjjLogw(std::make_unique<TH2F>("recmjjLogw", ";m_{jj}^{rec} [GeV];log(w);N_{eff}^{jj}", nMjjBins, Mjj_edges.data(), 400, -30, 20))
41  { }

Member Function Documentation

◆ FillObsWgt()

void FillObsWgt ( std::unique_ptr< TH2F > &  ptLogw,
std::unique_ptr< TH2F > &  mjjLogw,
std::unique_ptr< TH2F > &  htLogw,
std::unique_ptr< TH1F > &  ht,
const std::vector< Jet > &  jets,
float  evW 
)
inlineprivate
65  {
66  auto pt_sum = 0;
67  auto weight_sum = 0;
68  for (const auto& jet: jets) {
69  auto jW = log(jet.weights.front());
70  weight_sum = weight_sum + jW;
71  ptLogw->Fill(jet.p4.Pt(), evW + jW);
72  pt_sum += jet.p4.Pt();
73  }
74  ht->Fill(pt_sum);
75 
76  htLogw->Fill(pt_sum, evW + weight_sum);
77 
78  if (jets.size() < 2) return;
79  const auto& j0 = jets.at(0),
80  j1 = jets.at(1);
81 
82  if (j0.p4.Pt() < 100. || j1.p4.Pt() < 50.) return;
83  if (std::max(j0.AbsRap(), j1.AbsRap()) >= 3.0) return;
84  auto dijet = j0 + j1;
85  auto djW = log(j0.weights.front()) + log(j1.weights.front());
86  mjjLogw->Fill(dijet.CorrP4().M(), evW + djW);
87  }

◆ FillPtHat()

float FillPtHat ( const GenEvent event,
const PileUp pileup 
)
inlineprivate
46  {
47  float gW = event.weights.front();
48 
49  pthatME->Fill(event.hard_scale, gW);
50  float maxpthat = event.hard_scale;
51  for (auto pthat: pileup.pthats) {
52  pthatPU->Fill(pthat, gW);
53  maxpthat = std::max(maxpthat, pthat);
54  }
55  pthatMax->Fill(maxpthat, gW);
56 
57  return maxpthat;
58  }

◆ operator()()

void operator() ( const std::vector< GenJet > &  genjets,
const std::vector< RecJet > &  recjets,
const GenEvent genEvt,
const RecEvent recEvt,
const PileUp pileup 
)
inline
96  {
97  float maxpthat = FillPtHat(genEvt, pileup);
98 
99  float logw = log(genEvt.weights.front());
100  pthatLogw->Fill(maxpthat, logw);
101  FillObsWgt<GenJet>(genptLogw, genmjjLogw, genhtLogw, genht, genjets, logw);
102 
103  logw += log(recEvt.weights.front());
104  FillObsWgt<RecJet>(recptLogw, recmjjLogw, rechtLogw, recht, recjets, logw);
105 
106  }

◆ Write()

void Write ( TDirectory *  d)
inline
109  {
110  d->cd();
111  TDirectory * dd = d->mkdir(name);
112  dd->cd();
113  std::vector<TH1*> hists {pthatME.get(), pthatPU.get(), pthatMax.get(), genht.get(), recht.get(),
114  dynamic_cast<TH1*>(pthatLogw.get()),
115  dynamic_cast<TH1*>(genptLogw.get()),
116  dynamic_cast<TH1*>(genhtLogw.get()),
117  dynamic_cast<TH1*>(genmjjLogw.get()),
118  dynamic_cast<TH1*>(recptLogw.get()),
119  dynamic_cast<TH1*>(rechtLogw.get()),
120  dynamic_cast<TH1*>(recmjjLogw.get())};
121  for (auto h: hists) {
122  h->SetDirectory(dd);
123  TString hname = h->GetName();
124  hname.ReplaceAll(name, "");
125  h->Write(hname);
126  }
127  }

Member Data Documentation

◆ genht

std::unique_ptr<TH1F> genht

◆ genhtLogw

std::unique_ptr<TH2F> genhtLogw

◆ genmjjLogw

std::unique_ptr<TH2F> genmjjLogw

◆ genptLogw

std::unique_ptr<TH2F> genptLogw

◆ name

TString name

◆ pthatLogw

std::unique_ptr<TH2F> pthatLogw

◆ pthatMax

std::unique_ptr<TH1F> pthatMax

◆ pthatME

std::unique_ptr<TH1F> pthatME

◆ pthatPU

std::unique_ptr<TH1F> pthatPU

◆ recht

std::unique_ptr<TH1F> recht

◆ rechtLogw

std::unique_ptr<TH2F> rechtLogw

◆ recmjjLogw

std::unique_ptr<TH2F> recmjjLogw

◆ recptLogw

std::unique_ptr<TH2F> recptLogw

The documentation for this struct was generated from the following file:
DAS::PUstaub::pthat_edges
static const std::vector< double > pthat_edges
Definition: Plots.h:17
DAS::PUstaub::Plots::FillPtHat
float FillPtHat(const GenEvent &event, const PileUp &pileup)
Definition: Plots.h:45
DAS::PUstaub::Plots::pthatPU
std::unique_ptr< TH1F > pthatPU
Definition: Plots.h:24
DAS::PUstaub::Plots::pthatLogw
std::unique_ptr< TH2F > pthatLogw
Definition: Plots.h:25
DAS::pt_edges
static const std::vector< double > pt_edges
Definition: binnings.h:33
DAS::PUstaub::Plots::pthatMax
std::unique_ptr< TH1F > pthatMax
Definition: Plots.h:24
DAS::nMjjBins
static const int nMjjBins
Definition: binnings.h:40
DAS::PUstaub::Plots::genht
std::unique_ptr< TH1F > genht
Definition: Plots.h:24
DAS::PUstaub::Plots::genptLogw
std::unique_ptr< TH2F > genptLogw
Definition: Plots.h:25
DAS::PUstaub::Plots::rechtLogw
std::unique_ptr< TH2F > rechtLogw
Definition: Plots.h:25
Ntupliser_cfg.genjets
genjets
Definition: Ntupliser_cfg.py:272
Ntupliser_cfg.jets
string jets
Definition: Ntupliser_cfg.py:41
DAS::PUstaub::Plots::genhtLogw
std::unique_ptr< TH2F > genhtLogw
Definition: Plots.h:25
DAS::PUstaub::nPtHatBins
static const int nPtHatBins
Definition: Plots.h:18
Ntupliser_cfg.recjets
recjets
Definition: Ntupliser_cfg.py:273
DAS::Mjj_edges
static const std::vector< double > Mjj_edges
Definition: binnings.h:34
DAS::PUstaub::Plots::recht
std::unique_ptr< TH1F > recht
Definition: Plots.h:24
DAS::nPtBins
static const int nPtBins
Definition: binnings.h:39
pileup
DAS::PileUp pileup
Definition: classes.h:27
DAS::PUstaub::Plots::pthatME
std::unique_ptr< TH1F > pthatME
Definition: Plots.h:24
DAS::PUstaub::Plots::recptLogw
std::unique_ptr< TH2F > recptLogw
Definition: Plots.h:25
DAS::PileUp::pthats
std::vector< float > pthats
all hard scales found in PU
Definition: Event.h:106
DAS::PUstaub::Plots::name
TString name
Definition: Plots.h:22
DAS::PUstaub::Plots::genmjjLogw
std::unique_ptr< TH2F > genmjjLogw
Definition: Plots.h:25
DAS::PUstaub::Plots::recmjjLogw
std::unique_ptr< TH2F > recmjjLogw
Definition: Plots.h:25