22 out->
Add(fileName.Data());
24 cout <<
"#recorded entries = " << out->
GetEntries() << endl;
38 TString namesDet[nDet] = {
"CSC",
"DCH1",
"TOF-700",
"DCH2"};
39 TString namesRes[nRes] = {
"X-residuals",
"Y-residuals"};
44 TH1F* hist[nDet][nRes];
46 const Int_t nMod = 60;
47 TH1F* hResTof700Mod[nMod][nRes];
48 for (
Int_t iMod = 0; iMod < nMod; iMod++) {
49 for (
Int_t jRes = 0; jRes < nRes; jRes++) {
50 TString histName =
Form(
"TOF-700 mod-%d %s", iMod, namesRes[jRes].Data());
51 hResTof700Mod[iMod][jRes] =
new TH1F(histName, histName, 100, -7, 7);
55 for (
Int_t iDet = 0; iDet < nDet; iDet++) {
56 for (
Int_t jRes = 0; jRes < nRes; jRes++) {
57 TString histName = namesDet[iDet] + namesRes[jRes];
58 TString histNameEv = namesDet[iDet] + namesRes[jRes] +
"Ev";
59 hist[iDet][jRes] =
new TH1F(histName,
"", 100, -7, 7);
63 for (
Int_t iEv = 0; iEv < nEvents; iEv++) {
66 printf(
"event: %d\n", iEv);
85 Int_t module = (hit->GetDetectorID() >> 8) & 0xFF;
93 gStyle->SetFitFormat(
"5.3f");
101 res->Divide(nDet, nRes, 0, 0);
102 for (
Int_t jRes = 0; jRes < nRes; jRes++) {
103 for (
Int_t iDet = 0; iDet < nDet; iDet++) {
104 Int_t padId = iDet + nDet * jRes + 1;
107 hist[iDet][jRes]->
Fit(
"gaus",
"WWQ");
108 hist[iDet][jRes]->
Draw();
112 latexDet.
DrawLatex(-4.5, 0.9 * hist[iDet][jRes]->GetMaximum(), namesDet[iDet]);
115 latexRes.
DrawLatex(-4.5, 0.8 * hist[iDet][jRes]->GetMaximum(), namesRes[jRes]);
118 res->SaveAs(
"ResidualsSRC.pdf");
120 const Int_t nRow = 6;
121 const Int_t nCol = 10;
123 TCanvas* ResYTof700Mod =
new TCanvas(
"ResYTof700Mod",
"ResYTof700Mod", 2000, 1200);
124 ResYTof700Mod->
Divide(nCol, nRow, 0, 0);
125 for (
Int_t iMod = 0; iMod < nMod; iMod++) {
126 Int_t padId = iMod % nCol + (iMod / nCol) * nCol + 1;
129 hResTof700Mod[iMod][1]->
Fit(
"gaus",
"WWQ");
130 hResTof700Mod[iMod][1]->
Draw();
139 ResYTof700Mod->
SaveAs(
"ResidualsY_SRC_tof700_mod.pdf");
141 TCanvas* ResXTof700Mod =
new TCanvas(
"ResXTof700Mod",
"ResXTof700Mod", 2000, 1200);
142 ResXTof700Mod->
Divide(nCol, nRow, 0, 0);
143 for (
Int_t iMod = 0; iMod < nMod; iMod++) {
144 Int_t padId = iMod % nCol + (iMod / nCol) * nCol + 1;
147 hResTof700Mod[iMod][0]->
Fit(
"gaus",
"WWQ");
148 hResTof700Mod[iMod][0]->
Draw();
157 ResXTof700Mod->
SaveAs(
"ResidualsX_SRC_tof700_mod.pdf");
virtual void SetTextSize(Float_t tsize=1)
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override