25 name = fTitle +
"_h2d_Grid";
26 h2d_grid =
new TH2F(name,
"ScWall Grid", 18, -135, 135, 8, -60, 60);
29 h2d_grid->GetXaxis()->SetTitle(
"X [cm]");
30 h2d_grid->GetXaxis()->SetTitleColor(kOrange + 10);
31 h2d_grid->GetYaxis()->SetTitle(
"Y [cm]");
32 h2d_grid->GetYaxis()->SetTitleColor(kOrange + 10);
33 h2d_grid->GetZaxis()->SetNoExponent(kFALSE);
35 h2d_grid->SetStats(0);
37 name = fTitle +
"_h2d_GridCenter";
38 h2d_grid_center =
new TH2F(name,
"ScWall Grid center", 36, -135, 135, 16, -60, 60);
40 h2d_grid_center->GetXaxis()->SetTitle(
"X [cm]");
41 h2d_grid_center->GetXaxis()->SetTitleColor(kOrange + 10);
42 h2d_grid_center->GetYaxis()->SetTitle(
"Y [cm]");
43 h2d_grid_center->GetYaxis()->SetTitleColor(kOrange + 10);
44 h2d_grid_center->GetZaxis()->SetNoExponent(kFALSE);
46 h2d_grid_center->SetMarkerSize(0.6);
47 h2d_grid_center->SetStats(0);
49 name = fTitle +
"_h2d_profile";
50 h2d_profile =
new TH2F(name,
"ScWall Profile", 175, 0, 175, 200, 0, 100);
51 h2d_profile->GetXaxis()->SetTitle(
"Cell id");
52 h2d_profile->GetXaxis()->SetTitleColor(kOrange + 10);
53 h2d_profile->GetYaxis()->SetTitle(
"dE/dx [Z^2]");
54 h2d_profile->GetYaxis()->SetTitleColor(kOrange + 10);
55 h2d_profile->SetStats(0);
56 name = fTitle +
"CanvasAmplitudes";
59 name = fTitle +
"_h2d_cell_id";
60 h2d_cell_id =
new TH2F(name,
"h2d_cell_id", 18, -135, 135, 8, -60, 60);
61 h2d_cell_id->GetXaxis()->SetTitle(
"X [cm]");
62 h2d_cell_id->GetXaxis()->SetTitleColor(kOrange + 10);
63 h2d_cell_id->GetYaxis()->SetTitle(
"Y [cm]");
64 h2d_cell_id->GetYaxis()->SetTitleColor(kOrange + 10);
65 h2d_cell_id->GetZaxis()->SetNoExponent(kFALSE);
66 h2d_cell_id->SetMarkerSize(0.8);
67 h2d_cell_id->SetMarkerColor(kBlack);
70 name = fTitle +
"_h2d_cell_id_center";
71 h2d_cell_id_center =
new TH2F(name,
"h2d_cell_id_center", 10, -45, 30, 4, -15, 15);
72 h2d_cell_id_center->GetXaxis()->SetTitle(
"X [cm]");
73 h2d_cell_id_center->GetXaxis()->SetTitleColor(kOrange + 10);
74 h2d_cell_id_center->GetYaxis()->SetTitle(
"Y [cm]");
75 h2d_cell_id_center->GetYaxis()->SetTitleColor(kOrange + 10);
76 h2d_cell_id_center->GetZaxis()->SetNoExponent(kFALSE);
77 h2d_cell_id_center->SetMarkerSize(0.6);
78 h2d_cell_id_center->SetMarkerColor(kBlack);
81 name = fTitle +
"CanvasAmplitudes";
87 p1->
aux = {h2d_grid_center, h2d_grid, h2d_cell_id, h2d_cell_id_center};
88 p1->
auxOpt = {
"colz logz",
"colz",
"text",
"text"};
93 p2->
opt =
"colz logy logz";
96 name = fTitle +
"_hCellAmpl";
97 hCellAmpl =
new TH1F(name, name, 400, 0, 35000);
98 hCellAmpl->SetStats(0);
99 hCellAmpl->GetYaxis()->SetTitle(
"Counts");
100 hCellAmpl->GetXaxis()->SetTitle(
"fAmpl");
102 name = fTitle +
"_hCellE";
103 hCellE =
new TH1F(name, name, 400, 0, 3000);
105 hCellE->GetYaxis()->SetTitle(
"Counts");
106 hCellE->GetXaxis()->SetTitle(
"dE/dx");
108 name = fTitle +
"_wfmCell";
109 wfmCell =
new TH1F(name, name, 100, 0, 100);
110 wfmCell->SetMarkerStyle(31);
111 wfmCell->SetMarkerSize(0.5);
112 wfmCell->SetStats(0);
114 name = fTitle +
"CanvasSelection";
116 canSelect->Divide(1, 3);
117 canSelectPads.resize(1 * 3);
118 NamesSelect.resize(1 * 3);
122 canSelectPads.at(0) = ps1;
123 NamesSelect.at(0) = ps1->
current->GetName();
127 canSelectPads.at(1) = ps2;
128 NamesSelect.at(1) = ps2->
current->GetName();
131 ps3->
opt =
"hist lp";
132 canSelectPads.at(2) = ps3;
133 NamesSelect.at(2) = ps3->
current->GetName();
135 name = fTitle +
"_hModEn_scwall_nt";
136 hModEn_scwall_nt =
new TH1F(name,
"ScWall amp in cells", 200, 0, 200);
137 hModEn_scwall_nt->GetXaxis()->SetTitle(
"Cell id");
138 hModEn_scwall_nt->GetXaxis()->SetTitleColor(kOrange + 10);
139 hModEn_scwall_nt->GetYaxis()->SetTitle(
"dE/dx [Z^2]");
140 hModEn_scwall_nt->GetYaxis()->SetTitleColor(kOrange + 10);
141 hModEn_scwall_nt->SetOption(
"hist");
142 hModEn_scwall_nt->SetStats(0);
144 name = fTitle +
"CanvasModEn";
145 canModEn =
new TCanvas(name, name, 1, 1);
146 canModEn->Divide(1, 1);
147 canModEnPads.resize(1);
148 NamesModEn.resize(1);
150 pm->
current = hModEn_scwall_nt;
151 canModEnPads.at(0) = pm;
152 NamesModEn.at(0) = pm->
current->GetName();
159 TString path =
"/" + fTitle +
"/";
160 fServer->Register(path, canAmps);
161 fServer->Register(path, canModEn);
162 fServer->Register(path, canSelect);
163 TString cmd =
"/" + fName +
"/->Reset()";
164 fServer->SetItemField(path.Data(),
"_monitoring",
"2000");
165 fServer->SetItemField(path.Data(),
"_layout",
"grid3x3");
166 TString cmdTitle = path +
"Reset";
167 fServer->RegisterCommand(cmdTitle.Data(), cmd.Data(),
"button;");
168 fServer->Restrict(cmdTitle,
"visible=shift");
169 fServer->Restrict(cmdTitle,
"allow=shift");
170 cmd =
"/" + fName +
"/->SetRefRun(%arg1%)";
171 cmdTitle = path +
"SetRefRun";
172 fServer->RegisterCommand(cmdTitle.Data(), cmd.Data(),
"button;");
173 cmdTitle = path +
"ChangeSelection";
174 fServer->RegisterCommand(cmdTitle, TString(
"/") + fName.Data() +
"/->SetSelection(%arg1%,%arg2%)",
"button;");
175 fServer->Restrict(cmdTitle,
"visible=shift");
176 fServer->Restrict(cmdTitle,
"allow=shift");
177 fServer->Restrict(cmdTitle.Data(),
"deny=guest");
199 fSelectedCell = Cell;
200 fSelectedTrigger = Trigger;
201 TString command =
"(1)";
202 TString digiInTree =
"ScWallDigi";
203 if (fSelectedCell >= 0)
204 command = Form(
" && %s.GetCellId() == %d", digiInTree.Data(), fSelectedCell);
205 TString triggerCondition =
"";
206 if (fSelectedTrigger >= 0)
207 triggerCondition = Form(
" && %s trigger bit == %d (bitBT=2, bitBC1=3, bitMBT=6, bitNiT=4, bitCCT1=5, "
208 "bitCCT2=8, bitCCT3=12, bitFHCAL=9)",
209 digiInTree.Data(), fSelectedTrigger);
210 TString titleSignal = Form(
"#splitline{Signal %s}{%s}", command.Data(), triggerCondition.Data());
211 TString titleAmpl = Form(
"#splitline{Ampl %s}{%s}", command.Data(), triggerCondition.Data());
212 TString titleWfm = Form(
"#splitline{Wfm %s}{%s}", command.Data(), triggerCondition.Data());
213 hCellE->SetTitle(titleSignal);
214 hCellAmpl->SetTitle(titleAmpl);
215 wfmCell->SetTitle(titleWfm);
220 TString direction = Form(
"%s.fAmpl>>%s", digiInTree.Data(), hCellE->GetName());
221 frecoTree->Draw(direction.Data(), command.Data(),
"goff");
222 wfmCell->SetTitle(titleWfm);
237 TClonesArray* digits = fDigiArrays->
scwall;
241 h2d_grid->Scale(fEventCounter);
242 h2d_grid_center->Scale(fEventCounter);
243 hModEn_scwall_nt->Scale(fEventCounter);
246 for (Int_t iDig = 0; iDig < digits->GetEntriesFast(); iDig++) {
250 if (cell_id > kTOTAL_CELLS)
253 auto it = positionMap.find(digi->
GetAddress());
254 if (it == positionMap.end())
256 float x_pos = it->second.first.X();
257 float y_pos = it->second.first.Y();
269 bool isSelected = ((Int_t)digi->
GetCellId() == fSelectedCell);
271 if ((TrigPattern >> fSelectedTrigger) & 1) {
272 hCellAmpl->Fill(digi->
fAmpl);
273 hCellE->Fill(signal);
274 auto Wfm = digi->
GetWfm();
275 std::vector<float> points(Wfm.size());
276 std::iota(std::begin(points), std::end(points), 0);
278 wfmCell->GetXaxis()->SetRangeUser(0, Wfm.size());
279 for (UInt_t wfm_iter = 0; wfm_iter < Wfm.size(); wfm_iter++)
280 wfmCell->Fill(wfm_iter, Wfm.at(wfm_iter));
284 h2d_profile->Fill(digi->
GetCellId(), signal);
285 hModEn_scwall_nt->Fill(cell_id, signal);
288 h2d_grid_center->Fill(x_pos, y_pos, signal);
289 int bin_x = h2d_cell_id_center->GetXaxis()->FindBin(x_pos);
290 int bin_y = h2d_cell_id_center->GetYaxis()->FindBin(y_pos);
291 int BC = h2d_cell_id_center->GetBinContent(bin_x, bin_y);
293 h2d_cell_id_center->Fill(x_pos, y_pos, cell_id);
296 h2d_grid->Fill(x_pos, y_pos, signal);
297 int bin_x = h2d_cell_id->GetXaxis()->FindBin(x_pos);
298 int bin_y = h2d_cell_id->GetYaxis()->FindBin(y_pos);
299 int BC = h2d_cell_id->GetBinContent(bin_x, bin_y);
301 h2d_cell_id->Fill(x_pos, y_pos, cell_id);
305 h2d_grid->Scale(1. / fEventCounter);
306 h2d_grid_center->Scale(1. / fEventCounter);
307 hModEn_scwall_nt->Scale(1. / fEventCounter);