22 const Int_t nFiles = 3;
23 const Int_t nVals = 3;
24 const Int_t nBranches = 2;
25 const Int_t nTitles = 3;
26 TString titlesVals[nTitles] = {
"V_{p}",
"Res_{x}",
"Res_{y}"};
27 TString titlesFiles[nTitles] = {
"Orig.",
"Misalign.",
"After align."};
29 TString files[nFiles] = {in1, in2, in3};
30 TString branches[nFiles] = {
"BmnVertex",
"BmnGemResiduals"};
32 TChain* chains[nFiles] = {NULL, NULL, NULL};
34 for (
Int_t iFile = 0; iFile < nFiles; iFile++)
35 for (
Int_t iBranch = 0; iBranch < nBranches; iBranch++)
36 arrays[iFile][iBranch] = NULL;
38 Int_t nEntries[nFiles] = {-1, -1, -1};
39 for (
Int_t iFile = 0; iFile < nFiles; iFile++) {
40 chains[iFile] =
new TChain(
"cbmsim");
41 chains[iFile]->
Add(files[iFile].Data());
48 canv->
Divide(nFiles, nVals);
49 TH1F* histos[nVals][nFiles];
50 for (
Int_t iVal = 0; iVal < nVals; iVal++)
51 for (
Int_t iFile = 0; iFile < nFiles; iFile++)
52 histos[iVal][iFile] =
new TH1F(
Form(
"%s %s", titlesVals[iVal].Data(), titlesFiles[iFile].Data()),
53 Form(
"%s %s", titlesVals[iVal].Data(), titlesFiles[iFile].Data()), 200,
54 (iVal == 0) ? -10. : -1., (iVal == 0) ? +10. : +1.);
57 for (
Int_t iFile = 0; iFile < nFiles; iFile++)
58 for (
Int_t iBranch = 0; iBranch < nBranches; iBranch++)
59 chains[iFile]->SetBranchAddress(branches[iBranch].Data(), &arrays[iFile][iBranch]);
62 for (
Int_t iFile = 0; iFile < nFiles; iFile++) {
67 histos[0][iFile]->
Fill(vertex->
GetZ());
71 Int_t iPad = iFile + 4;
73 histos[1][iFile]->
Fill(resid->GetResiduals().X());
77 histos[2][iFile]->
Fill(resid->GetResiduals().Y());
81 for (
Int_t iVal = 0; iVal < nVals; iVal++) {
82 for (
Int_t iFile = 0; iFile < nFiles; iFile++) {
83 canv->
cd(iFile + nFiles * iVal + 1);
84 histos[iVal][iFile]->
Draw();
86 histos[iVal][iFile]->
Fit(
"gaus",
"SQww");
90 canv->
SaveAs(
"output.pdf");
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