DAS  3.0
Das Analysis System
DistVariation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include <list>
5 #include <memory>
6 
8 
9 #include <TString.h>
10 
11 #include <MetaInfo.h>
12 
13 class TH1;
14 class TH2;
15 class TDirectory;
16 class TUnfoldBinning;
17 
18 namespace DAS::Unfolding {
19 
26 
27  static bool isMC;
28 
29  static TUnfoldBinning * genBinning,
31 
32  std::unique_ptr<TH1> rec,
33  tmp,
34  gen,
39  // TODO: include miss entries in RM
40  // TODO: use TUnfoldBinning to decorrelate categories of miss/fake entries
41  std::unique_ptr<TH2> cov,
42  RM;
43 
46  ~DistVariation ();
47 
50  DistVariation (const TString& group, const TString& name, size_t index = 0, int bit = 0);
51 
55  DAS::Uncertainties::Variation(v),
56  rec (std::unique_ptr<TH1>(dynamic_cast<TH1*>(v.rec ->Clone()))),
57  tmp (std::unique_ptr<TH1>(dynamic_cast<TH1*>(v.tmp ->Clone()))),
58  gen (std::unique_ptr<TH1>(dynamic_cast<TH1*>(v.gen ->Clone()))),
59  missNoMatch(std::unique_ptr<TH1>(dynamic_cast<TH1*>(v.missNoMatch->Clone()))),
60  missOut (std::unique_ptr<TH1>(dynamic_cast<TH1*>(v.missOut ->Clone()))),
61  fakeNoMatch(std::unique_ptr<TH1>(dynamic_cast<TH1*>(v.fakeNoMatch->Clone()))),
62  fakeOut (std::unique_ptr<TH1>(dynamic_cast<TH1*>(v.fakeOut ->Clone()))),
63  cov (std::unique_ptr<TH2>(dynamic_cast<TH2*>(v.cov ->Clone()))),
64  RM (std::unique_ptr<TH2>(dynamic_cast<TH2*>(v.RM ->Clone())))
65  { }
66 
70  DAS::Uncertainties::Variation(v),
71  rec(std::move(v.rec)), tmp(std::move(v.tmp)), gen(std::move(v.gen)),
72  missNoMatch(std::move(v.missNoMatch)), missOut(std::move(v.missOut)),
73  fakeNoMatch(std::move(v.fakeNoMatch)), fakeOut(std::move(v.fakeOut)),
74  cov(std::move(v.cov)), RM(std::move(v.RM))
75  { }
76 
80  void Write (TDirectory * d);
81 };
82 
86 void fillCov (const DistVariation&, const std::list<int>&); // TODO: make this function a static member of Observable
87 
90 std::vector<DistVariation> GetVariations
92  bool = false,
93  std::ostream& = std::cout);
94 
95 } // end of namespace DAS::Unfolding
DAS::Unfolding::DistVariation::isMC
static bool isMC
flag from metainfo
Definition: DistVariation.h:27
DAS
Definition: applyBTagSF.cc:31
DAS::Unfolding::DistVariation::rec
std::unique_ptr< TH1 > rec
reconstructed-level distribution
Definition: DistVariation.h:32
DAS::Uncertainties::Variation::Variation
Variation(const TString &group, const TString &name, size_t index=0, int bit=0)
Normal constructor.
Definition: Variation.h:36
DAS::Uncertainties::Variation::name
const TString name
variation name (including "Up" or "Down")
Definition: Variation.h:25
DAS::Unfolding::GetVariations
std::vector< DistVariation > GetVariations(Darwin::Tools::MetaInfo &, bool=false, std::ostream &=std::cout)
Get all variations availables according to metainfo.
Definition: DistVariation.cc:199
Darwin::Tools::MetaInfo
Generic meta-information for n-tuple (including speficities to Darwin).
Definition: MetaInfo.h:65
DAS::Unfolding::DistVariation::DistVariation
DistVariation(const TString &group, const TString &name, size_t index=0, int bit=0)
Normal constructor.
Definition: DistVariation.cc:21
DAS::Unfolding
Definition: getToyCalculation.cc:37
DAS::Unfolding::DistVariation::DistVariation
DistVariation(DistVariation &&v)
move constructor
Definition: DistVariation.h:69
DAS::Unfolding::DistVariation
Definition: DistVariation.h:25
DAS::Unfolding::DistVariation::recBinning
static TUnfoldBinning * recBinning
full binning at detector level
Definition: DistVariation.h:30
DAS::Unfolding::DistVariation::Write
void Write(TDirectory *d)
Definition: DistVariation.cc:85
DAS::Uncertainties::Variation::bit
const int bit
correlation bit
Definition: Variation.h:28
DAS::Unfolding::DistVariation::~DistVariation
~DistVariation()
Destructor.
Definition: DistVariation.cc:107
DAS::Unfolding::DistVariation::cov
std::unique_ptr< TH2 > cov
covariance matrix
Definition: DistVariation.h:41
DAS::Unfolding::fillCov
void fillCov(const DistVariation &, const std::list< int > &)
Definition: DistVariation.cc:185
DAS::Unfolding::DistVariation::gen
std::unique_ptr< TH1 > gen
generated-level distribution
Definition: DistVariation.h:34
DAS::Unfolding::DistVariation::tmp
std::unique_ptr< TH1 > tmp
temporary histogram help fill the covariance matrix
Definition: DistVariation.h:33
DAS::Unfolding::DistVariation::missNoMatch
std::unique_ptr< TH1 > missNoMatch
losses (unmatched entries)
Definition: DistVariation.h:35
DAS::Uncertainties::Variation::group
const TString group
e.g. event, recjet
Definition: Variation.h:24
DAS::Unfolding::DistVariation::RM
std::unique_ptr< TH2 > RM
response matrix
Definition: DistVariation.h:42
DAS::Unfolding::DistVariation::missOut
std::unique_ptr< TH1 > missOut
losses (migration out of phase space)
Definition: DistVariation.h:36
DAS::Unfolding::DistVariation::fakeNoMatch
std::unique_ptr< TH1 > fakeNoMatch
background (unmatched entries)
Definition: DistVariation.h:37
DAS::Unfolding::DistVariation::genBinning
static TUnfoldBinning * genBinning
full binning at particle level
Definition: DistVariation.h:29
DAS::Uncertainties::Variation
Definition: Variation.h:22
DAS::Uncertainties::Variation::index
const std::size_t index
index in the vector where the variation factor is stored
Definition: Variation.h:27
Variation.h
DAS::Unfolding::DistVariation::DistVariation
DistVariation(const DistVariation &v)
copy constructor
Definition: DistVariation.h:54
DAS::Unfolding::DistVariation::fakeOut
std::unique_ptr< TH1 > fakeOut
background (migration out of phase space)
Definition: DistVariation.h:38