DAS  3.0
Das Analysis System
HTn.h
Go to the documentation of this file.
1 #ifndef DAS_UNFOLDING_HTN
2 #define DAS_UNFOLDING_HTN
3 
4 #include <vector>
5 #include <list>
6 #include <algorithm>
7 #include <optional>
8 
9 #include <TUnfoldBinning.h>
10 #include <TTreeReaderArray.h>
11 #include <TTreeReaderValue.h>
12 #include <TH1.h>
13 #include <TH2.h>
14 
15 #if !defined(__CLING__) || defined(__ROOTCLING__)
19 #endif
20 
22 
23 static const std::vector<double> genHt_edges = { 300, 360, 430, 510, 600, 700, 800,
24  920, 1060, 1220, 1400, 1600, 1840, 2100,
25  2400, 2740, 3140, 3590, 4120, /*4700,*/ 5500 },
26  recHt_edges = { 300, 330, 360, 390, 430, 470, 510,
27  550, 600, 650, 700, 750, 800, 860,
28  920, 980, 1060, 1140, 1220, 1300, 1400,
29  1500, 1600, 1720, 1840, 1960, 2100, 2240,
30  2400, 2560, 2740, 2940, 3140, 3340, 3590,
31  3840, 4120, /*4400,*/ 4700, /*5050,*/ 5500 },
32  n_jets_edges = { 1.5, 2.5, 3.5, 4.5, 5.5 };
33 
34 static const int nRecHtBins = recHt_edges.size()-1,
35  nGenHtBins = genHt_edges.size()-1,
36  nJetsBins = n_jets_edges.size()-1;
37 
38 static const double Htmin = recHt_edges.front(),
39  Htmax = recHt_edges.back(),
40  nJetsmin = n_jets_edges.front()+0.5,
41  nJetsmax = n_jets_edges.back()-0.5,
42  ptmin = 150,
43  ymax = 3.0;
44 
45 #if !defined(__CLING__) || defined(__ROOTCLING__)
46 struct HTn final : public Observable {
49  HTn ();
50 
53  std::unique_ptr<Filler> getFiller (TTreeReader& reader) const override;
54 
57  std::unique_ptr<Transformer> getTransformer (TUnfoldBinning *) const override;
58 
61  void setLmatrix (const std::unique_ptr<TH1>&, std::unique_ptr<TH2>&) override;
62 };
63 
64 struct Ratios final : public Observable {
67  Ratios ();
68 };
69 
70 struct HTnFiller final : public Filler {
71  HTn obs;
72 
73  std::optional<TTreeReaderArray<GenJet>> genJets;
74  TTreeReaderArray<RecJet> recJets;
75  std::optional<TTreeReaderValue<GenEvent>> gEv;
76  TTreeReaderValue<RecEvent> rEv;
77 
80  HTnFiller (const HTn& obs, TTreeReader& reader);
81 
84  std::list<int> fillRec (DistVariation&) override;
85 
86  std::vector<std::pair<GenJet,RecJet>> matches;
87  std::vector<GenJet> misses;
88  std::vector<RecJet> fakes;
89 
90  std::optional<bool> matched;
91 
94  void match () override;
95 
98  void fillMC (DistVariation&) override;
99 };
100 
101 struct HTnTransformer final : public Transformer {
102 
103  const size_t nHtBins;
104 
107  HTnTransformer (TUnfoldBinning *
108  );
109 
112  ~HTnTransformer () = default;
113 
117  void Transform (const Eigen::VectorXd&
118  ) const override;
119 
120 };
121 #endif
122 
123 } // end of DAS::Unfolding::Rij namespace
124 #endif
DAS::Unfolding::Rij::nRecHtBins
static const int nRecHtBins
Definition: HTn.h:34
DAS::Unfolding::Rij::HTn::getFiller
std::unique_ptr< Filler > getFiller(TTreeReader &reader) const override
Constructs a filler for the observable.
Definition: HTn.cc:169
DAS::Unfolding::Rij::nJetsBins
static const int nJetsBins
Definition: HTn.h:36
DAS::Unfolding::Rij::Ratios::Ratios
Ratios()
Constructor.
Definition: HTn.cc:261
DAS::Unfolding::Rij::HTnFiller::HTnFiller
HTnFiller(const HTn &obs, TTreeReader &reader)
Constructor.
Definition: HTn.cc:25
DAS::Unfolding::Rij::HTnFiller::rEv
TTreeReaderValue< RecEvent > rEv
Definition: HTn.h:76
DAS::Unfolding::Rij::Htmin
static const double Htmin
Definition: HTn.h:38
DAS::Unfolding::Rij::HTn::setLmatrix
void setLmatrix(const std::unique_ptr< TH1 > &, std::unique_ptr< TH2 > &) override
See Observable::getLmatrix
Definition: HTn.cc:179
DAS::Unfolding::Rij::HTn::HTn
HTn()
Constructor.
Definition: HTn.cc:160
DAS::Unfolding::Rij::recHt_edges
static const std::vector< double > recHt_edges
Definition: HTn.h:26
DAS::Unfolding::Rij::HTnFiller
Definition: HTn.h:70
DAS::Unfolding::Rij
Definition: HTn.h:21
DAS::Unfolding::Rij::HTnTransformer::~HTnTransformer
~HTnTransformer()=default
Destructor.
Event.h
DAS::Unfolding::Rij::HTnFiller::obs
HTn obs
Backreference to the observable.
Definition: HTn.h:71
DAS::Unfolding::Rij::Htmax
static const double Htmax
Definition: HTn.h:39
DAS::Unfolding::Rij::nJetsmax
static const double nJetsmax
Definition: HTn.h:41
DAS::Unfolding::Transformer
Definition: Observable.h:85
DAS::Unfolding::Rij::HTnFiller::recJets
TTreeReaderArray< RecJet > recJets
Definition: HTn.h:74
Jet.h
DAS::Unfolding::Rij::HTnFiller::gEv
std::optional< TTreeReaderValue< GenEvent > > gEv
Definition: HTn.h:75
DAS::Unfolding::Rij::HTnFiller::fakes
std::vector< RecJet > fakes
Definition: HTn.h:88
DAS::Unfolding::Rij::HTnTransformer::nHtBins
const size_t nHtBins
Definition: HTn.h:103
DAS::Unfolding::Rij::HTnFiller::genJets
std::optional< TTreeReaderArray< GenJet > > genJets
Definition: HTn.h:73
DAS::Unfolding::Rij::ymax
static const double ymax
Definition: HTn.h:43
DAS::Unfolding::Rij::HTnFiller::fillRec
std::list< int > fillRec(DistVariation &) override
See Filler::fillRec
Definition: HTn.cc:108
DAS::Unfolding::DistVariation
Definition: DistVariation.h:25
DAS::Unfolding::Filler
Definition: Observable.h:56
DAS::Unfolding::Rij::HTnTransformer
Definition: HTn.h:101
DAS::Unfolding::Rij::HTnFiller::matched
std::optional< bool > matched
Definition: HTn.h:90
DAS::Unfolding::Rij::HTn::getTransformer
std::unique_ptr< Transformer > getTransformer(TUnfoldBinning *) const override
Constructs a transformer for the observable.
Definition: HTn.cc:174
DAS::Unfolding::Rij::ptmin
static const double ptmin
Definition: HTn.h:42
DAS::Unfolding::Rij::n_jets_edges
static const std::vector< double > n_jets_edges
Definition: HTn.h:32
Observable.h
DAS::Unfolding::Rij::nGenHtBins
static const int nGenHtBins
Definition: HTn.h:35
DAS::Unfolding::Rij::HTn
Definition: HTn.h:46
DAS::Unfolding::Rij::Ratios
Definition: HTn.h:64
DAS::Unfolding::Rij::HTnFiller::matches
std::vector< std::pair< GenJet, RecJet > > matches
Definition: HTn.h:86
DAS::Unfolding::Rij::HTnTransformer::Transform
void Transform(const Eigen::VectorXd &) const override
Definition: HTn.cc:236
DAS::Unfolding::Rij::HTnFiller::misses
std::vector< GenJet > misses
Definition: HTn.h:87
DAS::Unfolding::Rij::HTnTransformer::HTnTransformer
HTnTransformer(TUnfoldBinning *)
Constructor.
Definition: HTn.cc:227
DAS::Unfolding::Observable
Definition: Observable.h:142
DAS::Unfolding::Rij::genHt_edges
static const std::vector< double > genHt_edges
Definition: HTn.h:23
DAS::Unfolding::Rij::nJetsmin
static const double nJetsmin
Definition: HTn.h:40
DAS::Unfolding::Rij::HTnFiller::fillMC
void fillMC(DistVariation &) override
See Filler::fillMC
Definition: HTn.cc:127
DAS::Unfolding::Rij::HTnFiller::match
void match() override
Match the two pairs of leading jets (if any) and set matched member.
Definition: HTn.cc:34