102#if !(!defined(__CLING__) || defined(__MAKECLING__))
106 const Int_t nColors = 16;
107 Int_t ColorMap[nColors] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 49, 11, 12, 13, 14, 15, 16};
113 TString inFileNameMK =
Form(
"MK_digi_%04i.root", runID);
114 TString inFileNameBmn =
Form(
"bmn_run%04i_digi.root", runID);
116 TString fnames[
COLS] = {inFileNameMK, inFileNameBmn};
128 vector<vector<vector<TH1F*>>> histStrip[
COLS];
129 vector<vector<vector<TH1F*>>> histStripGem[
COLS];
130 vector<vector<vector<TH1F*>>> histStripCsc[
COLS];
134 vector<PadInfo*> canStripPads;
135 vector<PadInfo*> canStripPadsGem;
136 vector<PadInfo*> canStripPadsCsc;
139 const Int_t kNStrips = 640;
142 TH2F* hfilter =
new TH2F(
"hfilter",
"hfilter", kNStrips + 1, 0, kNStrips, hf + 1, 0, hf);
143 TH2F* hfilterMK =
new TH2F(
"hfilterMK",
"hfilterMK", kNStrips + 1, 0, kNStrips, hf + 1, 0, hf);
144 TH1F* hsig =
new TH1F(
"hsig",
"hsig", hf + 1, 0, hf);
146 TH1F* hsigMK =
new TH1F(
"hsigMK",
"hsigMK", hf + 1, 0, hf);
155 TString xmlConfFileName = fPeriodID == 7 ?
"SiliconRunSpring2018.xml" :
"SiliconRunSpring2017.xml";
156 xmlConfFileName =
TString(getenv(
"VMCWORKDIR")) +
"/parameters/silicon/XMLConfigs/" + xmlConfFileName;
157 printf(
"xmlConfFileName %s\n", xmlConfFileName.
Data());
160 for (
Int_t iCol = 0; iCol <
COLS; iCol++) {
162 vector<vector<TH1F*>> rowGEM;
166 vector<TH1F*> colGEM;
171 for (
Int_t iLayer = 0; iLayer < 2; iLayer++) {
173 name =
Form(
"Silicon_%d_Station_%d_module_%d_layer_%d", iCol, iStation, iModule, iLayer);
183 rowGEM.push_back(colGEM);
185 histStrip[iCol].push_back(rowGEM);
188 sumMods = sumMods /
COLS;
191 canStrip->
Divide(maxLayers, sumMods);
193 canStripPads.resize(sumMods * maxLayers);
194 for (
auto& pad : canStripPads) {
201 for (
Int_t iLayer = 0; iLayer < 2; iLayer++) {
202 Int_t iPad = modCtr * maxLayers + iLayer;
204 p->
current = histStrip[0][iStation][iModule][iLayer];
205 p->
ref = histStrip[1][iStation][iModule][iLayer];
207 canStripPads[iPad] = p;
218 xmlConfFileName = fPeriodID == 7 ?
"GemRunSpring2018.xml" :
"GemRunSpring2017.xml";
219 xmlConfFileName =
TString(getenv(
"VMCWORKDIR")) +
"/parameters/gem/XMLConfigs/" + xmlConfFileName;
220 printf(
"xmlConfFileName %s\n", xmlConfFileName.
Data());
222 for (
Int_t iCol = 0; iCol <
COLS; iCol++) {
224 vector<vector<TH1F*>> rowGEM;
228 vector<TH1F*> colGEM;
230 if (maxLayers < mod->GetNStripLayers())
234 name =
Form(
"GEM_%i_Station_%d_module_%d_layer_%d", iCol, iStation, iModule, iLayer);
245 rowGEM.push_back(colGEM);
247 histStripGem[iCol].push_back(rowGEM);
252 canStripGem->
Divide(maxLayers, sumMods);
254 canStripPadsGem.resize(sumMods * maxLayers);
262 p->
current = histStripGem[0][iStation][iModule][iLayer];
263 p->
ref = histStripGem[1][iStation][iModule][iLayer];
265 Int_t iPad = modCtr * maxLayers + iLayer;
266 canStripPadsGem[iPad] = p;
277 xmlConfFileName =
"CSCRunSpring2018.xml";
278 xmlConfFileName =
TString(getenv(
"VMCWORKDIR")) +
"/parameters/csc/XMLConfigs/" + xmlConfFileName;
279 printf(
"xmlConfFileName %s\n", xmlConfFileName.
Data());
281 for (
Int_t iCol = 0; iCol <
COLS; iCol++) {
283 vector<vector<TH1F*>> rowGEM;
287 vector<TH1F*> colGEM;
289 if (maxLayers < mod->GetNStripLayers())
293 name =
Form(
"CSC_%i_Station_%d_module_%d_layer_%d", iCol, iStation, iModule, iLayer);
304 rowGEM.push_back(colGEM);
306 histStripCsc[iCol].push_back(rowGEM);
311 canStripCsc->
Divide(maxLayers, sumMods);
313 canStripPadsCsc.resize(sumMods * maxLayers);
321 p->
current = histStripCsc[0][iStation][iModule][iLayer];
322 p->
ref = histStripCsc[1][iStation][iModule][iLayer];
324 Int_t iPad = modCtr * maxLayers + iLayer;
325 canStripPadsCsc[iPad] = p;
333 files[
i] =
new TFile(fnames[
i],
"READ");
334 if (files[
i]->IsOpen())
335 printf(
"file %s opened\n", fnames[
i].Data());
337 fprintf(stderr,
"file %s open error\n", fnames[
i].Data());
340 trees[
i] = (
TTree*)files[
i]->Get(treeNames[
i]);
341 cout <<
"#recorded entries = " << trees[
i]->
GetEntries() << endl;
347 cout <<
"tree # " <<
i << endl;
349 for (
Int_t iEv = 0; iEv < 10000 ; iEv++) {
351 if (iEv % 10000 == 0)
352 cout <<
"iEv = " << iEv << endl;
363 histStrip[
i][station][module][layer]->Fill(strip);
364 if (station == 0 && module == 0 && layer == 0)
386 histStripGem[
i][station][module][layer]->Fill(strip);
398 histStripCsc[
i][station][module][layer]->Fill(strip);
418 DrawRef(canStrip, &canStripPads);
419 canStrip->
SaveAs(
Form(
"can-run-%d.png", runID));
420 DrawRef(canStripGem, &canStripPadsGem);
421 canStripGem->
SaveAs(
Form(
"can-run-gem-%d.png", runID));
422 DrawRef(canStripCsc, &canStripPadsCsc);
423 canStripCsc->
SaveAs(
Form(
"can-run-csc-%d.png", runID));
425 hfilter->
Draw(
"colz");
427 hfilterMK->
Draw(
"colz");
431 hsigMK->
Draw(
"same");
432 canProf->
SaveAs(
"can-prof.png");