37 if (fileNameMC ==
"" || fileNameEx ==
"") {
38 cout <<
"Files need to be specified!" << endl;
44 Int_t ClusterSizeThr = aClusterSizeThr;
46 Int_t RescalingBins = 1e6;
51 const UInt_t Pad_Width = 1280;
52 const UInt_t Pad_Height = 720;
58 vector<vector<vector<TH1D*>>> histSiliconStrip;
59 vector<vector<vector<TH1D*>>> histSiliconStripEx;
60 vector<PadInfo*> canStripPads;
64 TString xmlConfFileName = periodId == 7 ?
"GemRunSpring2018.xml" :
"GemRunSpring2017.xml";
65 xmlConfFileName =
TString(getenv(
"VMCWORKDIR")) +
"/parameters/gem/XMLConfigs/" + xmlConfFileName;
66 printf(
"xmlConfFileName %s\n", xmlConfFileName.
Data());
69 vector<vector<TH1D*>> rowGEM;
70 vector<vector<TH1D*>> rowGEM2;
75 vector<TH1D*> colGEM2;
78 if (maxLayers < nStripLayers)
79 maxLayers = nStripLayers;
80 for (
Int_t iLayer = 0; iLayer < nStripLayers; iLayer++) {
82 name =
Form(
"GEM_Station_%d_module_%d_layer_%d", iStation, iModule, iLayer);
83 TH1D* h =
new TH1D(name, name, xBins, xLow, xUp);
91 name =
Form(
"GEM_Station_%d_module_%d_layer_%d_Ex", iStation, iModule, iLayer);
92 TH1D* h2 =
new TH1D(name, name, xBins, xLow, xUp);
101 colGEM2.push_back(h2);
103 rowGEM.push_back(colGEM);
104 rowGEM2.push_back(colGEM2);
106 histSiliconStrip.push_back(rowGEM);
107 histSiliconStripEx.push_back(rowGEM2);
111 TCanvas* canStrip =
new TCanvas(name, name, Pad_Width * maxLayers, Pad_Height * sumMods);
112 canStrip->
Divide(maxLayers, sumMods);
119 vector<vector<vector<TH1D*>>> hMC;
120 vector<vector<vector<TH1D*>>> hMCR;
121 vector<vector<vector<TH1D*>>> hEx;
122 vector<vector<vector<TH1D*>>> hExCS;
126 chainMC->
Add(fileNameMC.
Data());
128 printf(
"#recorded MC entries = %lld\n", NEventsMC);
134 chainEx->
Add(fileNameEx.
Data());
136 printf(
"#recorded Exp entries = %lld\n", NEventsEx);
142 chainDST->
Add(fileNameDST.
Data());
144 printf(
"#recorded Track entries = %lld\n", NEventsDST);
152 printf(
"rescaling func created\n");
154 TString title =
"Si MC Rescaled";
155 TH1D* hGemMC =
new TH1D(
"mc", title, xBins, xLow, xUp);
157 TH1D* hGemEx =
new TH1D(
"digs", title, xBins, xLow, xUp);
158 title =
"Gem Exp Hits' Digits";
159 TH1D* hGemExHits =
new TH1D(
"digs-hits", title, xBins, xLow, xUp);
160 title =
"Gem Exp Cluster Signal Lower";
161 TH1D* hGemExCS =
new TH1D(
"cluster-signal-upper", title, xBins, xLow, xUp);
162 title =
"Gem Exp Tracks' Digits";
163 TH1D* hGemExTracks =
new TH1D(
"digs-tracks", title, xBins, xLow, xUp);
164 vector<TH1D*> hGemCluster;
165 for (
Int_t i = 0;
i < nCSize;
i++) {
166 title =
"Gem Cluster Size";
167 TH1D* h =
new TH1D(
Form(
"gem csize %.d",
i), title, xBins, xLow, xUp);
168 hGemCluster.push_back(h);
171 for (
Long64_t iEv = 0; iEv < NEventsEx; ++iEv) {
213 if ((val > lowThr) && (cs > ClusterSizeThr)) {
214 if (histSiliconStripEx[s][
m][l])
215 histSiliconStripEx[s][
m][l]->Fill(val);
217 printf(
"WTF? histStripEx[%d][%d][%d] == NULL!\n", s,
m, l);
234 printf(
"Exp histograms filled\n");
252 for (
Long64_t iEv = 0; iEv < NEventsMC; ++iEv) {
263 TF1* func = ResVec[s][
m][l];
267 histSiliconStrip[s][
m][l]->Fill(func->
Eval(val));
270 printf(
"MC histogram filled\n");
304 Int_t iPad = modCtr * maxLayers + iLayer;
309 TH1D* hR = histSiliconStrip[iStation][iModule][iLayer];
316 TH1D* hExp = histSiliconStripEx[iStation][iModule][iLayer];
324 auto legend =
new TLegend(0.6, 0.65, 0.8, 0.9);
325 legend->SetHeader(
"The Legend",
"C");
326 legend->AddEntry(hExp,
"Cluster signal");
327 legend->AddEntry(hR,
"MC rescaled by cluster exp");
338 canStrip->
Print(
Form(
"%s-th-%.1f-cs-%d-tracks.png", canStrip->
GetName(), lowThr, ClusterSizeThr));