hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
Loading...
Searching...
No Matches
ZBiHistos.h
Go to the documentation of this file.
1#ifndef ZBIHISTOS_H
2#define ZBIHISTOS_H
3
4#include <math.h>
5
6#include <fstream>
7#include <string>
8#include <vector>
9
10#include "HistoManager.h"
11#include "MutableTTree.h"
12#include "TCanvas.h"
13#include "TF1.h"
14#include "TFile.h"
15#include "TFitResult.h"
16#include "TFitResultPtr.h"
17#include "TGraphErrors.h"
18#include "TH1.h"
19#include "TH1F.h"
20#include "TKey.h"
21#include "TRandom3.h"
22
23using namespace ROOT;
24
30class ZBiHistos : public HistoManager {
31 public:
32 ZBiHistos();
33 ~ZBiHistos();
34
35 ZBiHistos(const std::string& inputName);
40 virtual void Define3DHistos() {};
41
46 virtual void Define2DHistos() {};
47
52 void writeHistos(TFile* outF, std::string folder);
53
58 void resetHistograms1d();
59
64 void resetHistograms2d();
65
70 void addHisto1d(std::string histoname, std::string xtitle, int nbinsX, float xmin, float xmax);
71
72 void addHisto1d(TH1* histo);
73
74 void addGraph(TGraphErrors* graph);
75
80 void addHisto2d(std::string histoname, std::string xtitle, int nbinsX, float xmin, float xmax, std::string ytitle,
81 int nbinsY, float ymin, float ymax);
82
83 void addHisto2d(TH2* histo);
88 void set2DHistoYlabel(std::string histoName, int ybin, std::string ylabel);
89
94 std::vector<double> defineImpactParameterCut(double alpha = 0.15);
95
101
107 void setDebug(bool value) { debug_ = value; };
108
113 double cutFractionOfSignalVariable(std::string cutvariable, bool isCutGreaterThan, double cutFraction,
114 double initialIntegral);
115
120 double integrateHistogram1D(std::string histoname);
121
126 TF1* fitExponentialTail(std::string histogramName, double start_nevents);
127
132 TF1* fitExponentialPlusConst(std::string histogramName, double starnt_nevents);
137 TF1* fitExponentialPlusExp(std::string histogramName, double starnt_nevents);
142 double fitZTail(std::string zVtxHistoname, double max_tail_events);
143
148 double shosFitZTail(std::string cutname, double max_tail_events);
149
154 TF1* getZTailFit(std::string cutname);
155
160 void writeGraphs(TFile* outF, std::string folder);
161
162 TH1* getPDF(std::string histoname);
163
164 json getConfig() { return _h_configs; };
165
166 TGraphErrors* getGraph(std::string graphname) {
167 if (graphs_.find(m_name + "_" + graphname) != graphs_.end()) {
168 return graphs_[m_name + "_" + graphname];
169 } else {
170 std::cout << "Error: could not find graph " << m_name + "_" + graphname << std::endl;
171 return nullptr;
172 }
173 };
174
175 TGraphErrors* configureGraph(std::string name, std::string xlabel, std::string ylabel);
176
177 private:
178 std::map<std::string, TGraphErrors*> graphs_;
179};
180
181#endif
nlohmann::json json
HistoManager()
default constructor
json _h_configs
description
std::string m_name
description
bool debug_
description
virtual void Define3DHistos()
description
Definition ZBiHistos.h:40
double shosFitZTail(std::string cutname, double max_tail_events)
description
void setDebug(bool value)
Set debug.
Definition ZBiHistos.h:107
TF1 * getZTailFit(std::string cutname)
description
TF1 * fitExponentialTail(std::string histogramName, double start_nevents)
description
void writeGraphs(TFile *outF, std::string folder)
description
TGraphErrors * getGraph(std::string graphname)
Definition ZBiHistos.h:166
TH1 * getPDF(std::string histoname)
virtual void Define2DHistos()
description
Definition ZBiHistos.h:46
double cutFractionOfSignalVariable(std::string cutvariable, bool isCutGreaterThan, double cutFraction, double initialIntegral)
description
Definition ZBiHistos.cxx:85
TF1 * fitExponentialPlusExp(std::string histogramName, double starnt_nevents)
description
double integrateHistogram1D(std::string histoname)
description
Definition ZBiHistos.cxx:59
void addHisto1d(std::string histoname, std::string xtitle, int nbinsX, float xmin, float xmax)
description
Definition ZBiHistos.cxx:13
TGraphErrors * configureGraph(std::string name, std::string xlabel, std::string ylabel)
json getConfig()
Definition ZBiHistos.h:164
double fitZTail(std::string zVtxHistoname, double max_tail_events)
description
std::map< std::string, TGraphErrors * > graphs_
hold graphs
Definition ZBiHistos.h:178
void set2DHistoYlabel(std::string histoName, int ybin, std::string ylabel)
description
void addHisto2d(std::string histoname, std::string xtitle, int nbinsX, float xmin, float xmax, std::string ytitle, int nbinsY, float ymin, float ymax)
description
Definition ZBiHistos.cxx:33
std::vector< double > defineImpactParameterCut(double alpha=0.15)
description
void resetHistograms2d()
description
Definition ZBiHistos.cxx:53
void defineZBiCutflowProcessorHistograms()
description
void resetHistograms1d()
description
Definition ZBiHistos.cxx:47
TF1 * fitExponentialPlusConst(std::string histogramName, double starnt_nevents)
description
void addGraph(TGraphErrors *graph)
Definition ZBiHistos.cxx:25
void writeHistos(TFile *outF, std::string folder)
description