|
DAS
3.0
Das Analysis System
|
Go to the documentation of this file.
9 #include <TDirectory.h>
33 vector<DAS::Uncertainties::Variation> variations;
34 variations.emplace_back(
"nominal",
"nominal");
35 if (!applySyst)
return variations;
39 BOOST_THROW_EXCEPTION( invalid_argument(groupContents->GetName()) );
42 for (
const TObject * obj: *groupContents) {
43 const auto os =
dynamic_cast<const TObjString*
>(obj);
44 if (!os) BOOST_THROW_EXCEPTION( invalid_argument(obj->GetName()) );
45 TString s = os->GetString();
46 s.ReplaceAll(
SysUp,
"");
68 const vector<double>&
y_edges) :
78 TString dirname = d->GetName();
79 TString hname = dirname +
'_' + v.
group +
'_' + v.
name;
80 asymmetry = make_unique<TH3D>(hname, v.
name, nBins, balBins.data(),
85 response = make_unique<TH2D>(
"response_" + hname, v.
name, nBins, balBins.data(),
96 float absy_probe = probe.
AbsRap(v);
98 float pt_tag = tag .
CorrPt(v),
99 pt_probe = probe.
CorrPt(v);
101 double jw = tag .
Weight(v)
104 response->Fill(pt_probe/pt_tag, absy_probe, ev_w*jw);
108 float pt_dif = (pt_tag - pt_probe),
109 pt_ave = (pt_tag + pt_probe) * 0.5;
111 float asym = pt_dif / pt_ave;
113 cout << asym << endl;
115 asymmetry->Fill(asym, pt_ave, absy_probe, ev_w*jw);
121 TString dirname = d->GetName();
123 asymmetry->SetDirectory(d);
124 TString hname = asymmetry->GetName();
125 hname.ReplaceAll(dirname +
'_',
"");
126 asymmetry->Write(hname);
130 hname.ReplaceAll(dirname +
'_',
"");
static const std::vector< double > y_edges
Definition: binnings.h:36
virtual float CorrPt(const Uncertainties::Variation &) const =0
Balance histogram for a given variation.
Definition: Balance.h:56
static const char *const ScaleVar
Name of jet rec scales in variations.
Definition: Jet.h:38
unique_ptr< TH2D > response
response
Definition: Balance.h:60
const std::string SysUp
Suffix used for "up" uncertainties. Follows the Combine convention.
Definition: Format.h:8
virtual double Weight(const Uncertainties::Variation &) const =0
const TString name
variation name (including "Up" or "Down")
Definition: Variation.h:25
static const std::vector< double > pt_edges
Definition: binnings.h:33
std::vector< double > getBinning(int nBins, float first, float last)
Definition: common.h:53
static const std::vector< std::string > JES_variations
Definition: common.h:49
TDirectory * d
directory in output ROOT file
Definition: Balance.h:58
void assertValidBinning(const std::vector< double > &v)
Definition: common.h:61
vector< DAS::Uncertainties::Variation > GetScaleVariations(const DT::MetaInfo &metainfo, bool applySyst)
Definition: Balance.h:30
Definition: PhysicsObject.h:22
virtual float AbsRap(const Uncertainties::Variation &) const =0
static const int nPtBins
Definition: binnings.h:39
const std::string SysDown
Suffix used for "down" uncertainties. Follows the Combine convention.
Definition: Format.h:10
const TString group
e.g. event, recjet
Definition: Variation.h:24
DAS::Uncertainties::Variation v
systematic variation
Definition: Balance.h:63
Balance(TDirectory *d, const DAS::Uncertainties::Variation &v, const vector< double > &pt_edges, const vector< double > &y_edges)
Definition: Balance.h:65
Definition: Variation.h:22
Definition: applyJERsmearing.cc:41
void Write()
Definition: Balance.h:118
static const int nYbins
Definition: binnings.h:38
unique_ptr< TH3D > asymmetry
asymmetry histogram
Definition: Balance.h:59