5#ifndef CBMTRDCHECKUTIL_H
6#define CBMTRDCHECKUTIL_H
10#include <FairRootManager.h>
17#include <TProfile2D.h>
18#include <TProfile3D.h>
47 CbmTrdDigi*
MakeDigi(std::vector<Int_t> samples, Int_t channel, Int_t module, Int_t layer, ULong64_t time);
50 std::map<TString, TH1D*>
f1D;
51 std::map<TString, TH2D*>
f2D;
52 std::map<TString, TH3D*>
f3D;
60 TDirectory* oldir = gDirectory;
61 TFile* outFile = FairRootManager::Instance()->GetOutFile();
62 if (outFile != NULL) {
65 for (
auto const&
x :
f1D)
66 if (
x.second)
x.second->Write(
x.first);
68 for (
auto const&
x :
f2D)
69 if (
x.second)
x.second->Write(
x.first);
71 for (
auto const&
x :
f3D)
72 if (
x.second)
x.second->Write(
x.first);
75 if (
x.second)
x.second->Write(
x.first);
78 if (
x.second)
x.second->Write(
x.first);
81 if (
x.second)
x.second->Write(
x.first);
83 gDirectory->cd(oldir->GetPath());
86 void CreateHist(std::string name, Int_t xbins, Double_t xlow, Double_t xhigh, Int_t ybins = 0, Double_t ylow = 1.,
88 void CreateHist3D(std::string name, Int_t xbins, Double_t xlow, Double_t xhigh, Int_t ybins, Double_t ylow,
89 Double_t yhigh, Int_t zbins, Double_t zlow, Double_t zhigh);
90 void CreateProfile(std::string name, Int_t xbins, Double_t xlow, Double_t xhigh, Int_t ybins = 0, Double_t ylow = 1.,
92 void CreateProfile3D(std::string name, Int_t xbins, Double_t xlow, Double_t xhigh, Int_t ybins, Double_t ylow,
93 Double_t yhigh, Int_t zbins, Double_t zlow, Double_t zhigh);
94 void Fill(std::string name, Double_t
x, Double_t
y = 9999.);
96 void FillProfile(std::string name, Double_t
x, Double_t
y, Double_t z = 9999.);
97 void FillProfile3D(std::string name, Double_t
x, Double_t
y, Double_t z, Double_t w = 1.);
98 void Fill(std::string name, Double_t
x, Double_t
y, Double_t z);
99 void Fill3D(std::string name, Double_t
x, Double_t
y, Double_t z);
100 void FillW(std::string name, Double_t
x, Double_t w);
103 if (!
f2D[name])
return 0.;
104 return f2D[name]->GetBinContent(
x,
y);
CbmTrdCheckUtil()
default Constructor with messages
std::map< TString, TH1D * > f1D
std::map< TString, TH3D * > f3D
ClassDef(CbmTrdCheckUtil, 1)
CbmTrdCheckUtil operator=(const CbmTrdCheckUtil &)
void CreateHist(std::string name, Int_t xbins, Double_t xlow, Double_t xhigh, Int_t ybins=0, Double_t ylow=1., Double_t yhigh=1.)
void SetSetter(Bool_t set)
std::map< TString, TH2D * > f2D
void Fill(std::string name, Double_t x, Double_t y=9999.)
std::map< TString, TProfile3D * > fProfile3D
void FillW(std::string name, Double_t x, Double_t w)
CbmTrdCheckUtil(const CbmTrdCheckUtil &)
std::map< TString, TProfile * > fProfile1D
void CreateProfile3D(std::string name, Int_t xbins, Double_t xlow, Double_t xhigh, Int_t ybins, Double_t ylow, Double_t yhigh, Int_t zbins, Double_t zlow, Double_t zhigh)
std::map< TString, TProfile2D * > fProfile2D
void CreateHist3D(std::string name, Int_t xbins, Double_t xlow, Double_t xhigh, Int_t ybins, Double_t ylow, Double_t yhigh, Int_t zbins, Double_t zlow, Double_t zhigh)
virtual ~CbmTrdCheckUtil()
Destructor.
CbmTrdDigi * MakeDigi(std::vector< Int_t > samples, Int_t channel, Int_t module, Int_t layer, ULong64_t time)
void Fill3D(std::string name, Double_t x, Double_t y, Double_t z)
void FillProfile(std::string name, Double_t x, Double_t y, Double_t z=9999.)
CbmTrdCheckUtil(Double_t cal, Double_t tau, Int_t mode)
Constructor with messages and preset reconstruction mode.
Double_t GetCont2D(std::string name, Double_t x, Double_t y)
void CreateProfile(std::string name, Int_t xbins, Double_t xlow, Double_t xhigh, Int_t ybins=0, Double_t ylow=1., Double_t yhigh=1.)
CbmTrdCheckUtil(std::string readfile)
CbmTrdCheckUtil(Double_t cal, Double_t tau, std::vector< Int_t > mask)
Constructor with messages and selection mask.
void FillProfile3D(std::string name, Double_t x, Double_t y, Double_t z, Double_t w=1.)