DAS  3.0
Das Analysis System
BalanceHists< Jet >

Description

template<typename Jet>
struct DAS::JetEnergy::BalanceHists< Jet >

Dijet balance histograms for all variations.

+ Collaboration diagram for BalanceHists< Jet >:

Public Member Functions

 BalanceHists (const char *name, const vector< TString > vars)
 
void operator() (const Jet &tag, const Jet &probe, const double ev_w)
 
void Write (TDirectory *f)
 

Public Attributes

const TString n
 
vector< TH3 * > hs
 

Constructor & Destructor Documentation

◆ BalanceHists()

BalanceHists ( const char *  name,
const vector< TString >  vars 
)
inline
Parameters
namegeneral name (will be used for the directory)
varsvariation names
89  : n(name)
90  {
91  int nBins = 60;
92  auto balBins = getBinning(nBins, -0.6, 0.6);
93  assertValidBinning(balBins);
94 
95  for (const auto& var: vars) {
96  TString name = n + '_' + var;
97  hs.push_back(new TH3D(name, var, nBins, balBins.data(),
98  nPtBins, pt_edges.data(),
99  nYbins, y_edges.data()));
100  }
101  }

Member Function Documentation

◆ operator()()

void operator() ( const Jet &  tag,
const Jet &  probe,
const double  ev_w 
)
inline
104  {
105  if (std::abs(tag.p4.Eta()) > 1.3) return; // barrel acceptance
106 
107  auto absy_probe = probe.AbsRap();
108  for (size_t i = 0; i < hs.size(); ++i ) {
109 
110  double pt_tag, pt_probe;
111  if constexpr (is_same<Jet,RecJet>()) {
112  pt_tag = tag .CorrPt(i);
113  pt_probe = probe.CorrPt(i);
114  }
115  else {
116  pt_tag = tag .p4.Pt();
117  pt_probe = probe.p4.Pt();
118  }
119 
120  if (pt_probe < 28) continue;
121 
122  auto ptMean = (pt_tag+pt_probe)/2.0;
123  auto bal = (pt_probe-pt_tag)/ptMean;
124 
125  auto jw = tag .weights.front()
126  * probe.weights.front();
127  hs[i]->Fill(bal, ptMean, absy_probe, ev_w*jw);
128  } // end of loop on variations
129  }

◆ Write()

void Write ( TDirectory *  f)
inline
132  {
133  f->cd();
134  TDirectory * d = f->mkdir(n); // member of the class
135  d->cd();
136  for (TH3* h: hs) {
137  h->SetDirectory(d);
138  TString hname = h->GetName();
139  hname.ReplaceAll(n + '_', ""); // n is a member of the class
140  h->Write(hname);
141  }
142  }

Member Data Documentation

◆ hs

vector<TH3*> hs

variations

◆ n

const TString n

name to indicate the selection


The documentation for this struct was generated from the following file:
DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.name
name
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:48
DAS::y_edges
static const std::vector< double > y_edges
Definition: binnings.h:36
DAS::pt_edges
static const std::vector< double > pt_edges
Definition: binnings.h:33
Ntupliser_cfg.f
f
Definition: Ntupliser_cfg.py:252
DAS::JetEnergy::getBinning
std::vector< double > getBinning(int nBins, float first, float last)
Definition: common.h:53
DAS::JetEnergy::BalanceHists::hs
vector< TH3 * > hs
variations
Definition: getPtBalance.cc:85
DAS::JetEnergy::assertValidBinning
void assertValidBinning(const std::vector< double > &v)
Definition: common.h:61
DAS::nPtBins
static const int nPtBins
Definition: binnings.h:39
DAS::JetEnergy::BalanceHists::n
const TString n
name to indicate the selection
Definition: getPtBalance.cc:84
DAS::nYbins
static const int nYbins
Definition: binnings.h:38