BmnRoot
Loading...
Searching...
No Matches
BmnHistHodo.cxx
Go to the documentation of this file.
1#include "BmnHistHodo.h"
2
3#include "TGaxis.h"
4
5#include <RtypesCore.h>
6
7BmnHistHodo::BmnHistHodo(TString title, TString path)
8 : BmnHist()
9{
10 fTitle = title;
11 fName = title + "_cl";
12 TGaxis::SetMaxDigits(2);
14}
15
17{
18 TString name;
19 name = fTitle + "_down_low";
20 h2d_EstripDL =
21 new TH2F(name, "Hodo signal in strips side DOWN gain LOW", kNstrips + 2, 0, kNstrips + 2, 250, 0, 5000);
22 h2d_EstripDL->GetXaxis()->SetTitle("Strip id");
23 h2d_EstripDL->GetXaxis()->SetTitleColor(kOrange + 10);
24 h2d_EstripDL->GetYaxis()->SetTitle("Z^2");
25 h2d_EstripDL->GetYaxis()->SetTitleColor(kOrange + 10);
26 h2d_EstripDL->SetStats(0);
27 name = fTitle + "_up_low";
28 h2d_EstripUL =
29 new TH2F(name, "Hodo signal in strips side UP gain LOW", kNstrips + 2, 0, kNstrips + 2, 250, 0, 5000);
30 h2d_EstripUL->GetXaxis()->SetTitle("Strip id");
31 h2d_EstripUL->GetXaxis()->SetTitleColor(kOrange + 10);
32 h2d_EstripUL->GetYaxis()->SetTitle("Z^2");
33 h2d_EstripUL->GetYaxis()->SetTitleColor(kOrange + 10);
34 h2d_EstripUL->SetStats(0);
35 name = fTitle + "_down_high";
36 h2d_EstripDH =
37 new TH2F(name, "Hodo signal in strips side DOWN gain HIGH", kNstrips + 2, 0, kNstrips + 2, 250, 0, 5000);
38 h2d_EstripDH->GetXaxis()->SetTitle("Strip id");
39 h2d_EstripDH->GetXaxis()->SetTitleColor(kOrange + 10);
40 h2d_EstripDH->GetYaxis()->SetTitle("Z^2");
41 h2d_EstripDH->GetYaxis()->SetTitleColor(kOrange + 10);
42 h2d_EstripDH->SetStats(0);
43 name = fTitle + "_up_high";
44 h2d_EstripUH =
45 new TH2F(name, "Hodo signal in strips side UP gain HIGH", kNstrips + 2, 0, kNstrips + 2, 250, 0, 5000);
46 h2d_EstripUH->GetXaxis()->SetTitle("Strip id");
47 h2d_EstripUH->GetXaxis()->SetTitleColor(kOrange + 10);
48 h2d_EstripUH->GetYaxis()->SetTitle("Z^2");
49 h2d_EstripUH->GetYaxis()->SetTitleColor(kOrange + 10);
50 h2d_EstripUH->SetStats(0);
51
52 name = fTitle + "Canvas_h2d";
53 canAmps = new TCanvas(name, name, PAD_WIDTH * Hodo_ROWS, PAD_HEIGHT * Hodo_COLS);
54 canAmps->Divide(Hodo_ROWS, Hodo_COLS);
55 canAmpsPads.resize(Hodo_ROWS * Hodo_COLS);
56 NamesAmps.resize(Hodo_ROWS * Hodo_COLS);
57 PadInfo* puh2 = new PadInfo();
58 puh2->current = h2d_EstripUH;
59 puh2->opt = "colz logz";
60 canAmpsPads.at(0) = puh2;
61 NamesAmps.at(0) = puh2->current->GetName();
62 PadInfo* pul2 = new PadInfo();
63 pul2->current = h2d_EstripUL;
64 pul2->opt = "colz logz";
65 canAmpsPads.at(1) = pul2;
66 NamesAmps.at(1) = pul2->current->GetName();
67 PadInfo* pdh2 = new PadInfo();
68 pdh2->current = h2d_EstripDH;
69 pdh2->opt = "colz logz";
70 canAmpsPads.at(2) = pdh2;
71 NamesAmps.at(2) = pdh2->current->GetName();
72 PadInfo* pdl2 = new PadInfo();
73 pdl2->current = h2d_EstripDL;
74 pdl2->opt = "colz logz";
75 canAmpsPads.at(3) = pdl2;
76 NamesAmps.at(3) = pdl2->current->GetName();
77
78 name = fTitle + "_profile_down_low";
79 h1d_profileDL = new TH1F(name, "Hodo signal in strips side DOWN gain LOW", kNstrips + 2, 0, kNstrips + 2);
80 h1d_profileDL->GetXaxis()->SetTitle("Strip id");
81 h1d_profileDL->GetXaxis()->SetTitleColor(kOrange + 10);
82 h1d_profileDL->GetYaxis()->SetTitle("dE/dx [Z^2]");
83 h1d_profileDL->GetYaxis()->SetTitleColor(kOrange + 10);
84 h1d_profileDL->SetStats(0);
85 name = fTitle + "_profile_up_low";
86 h1d_profileUL = new TH1F(name, "Hodo signal in strips side UP gain LOW", kNstrips + 2, 0, kNstrips + 2);
87 h1d_profileUL->GetXaxis()->SetTitle("Strip id");
88 h1d_profileUL->GetXaxis()->SetTitleColor(kOrange + 10);
89 h1d_profileUL->GetYaxis()->SetTitle("dE/dx [Z^2]");
90 h1d_profileUL->GetYaxis()->SetTitleColor(kOrange + 10);
91 h1d_profileUL->SetStats(0);
92 name = fTitle + "_profile_down_high";
93 h1d_profileDH = new TH1F(name, "Hodo signal in strips side DOWN gain HIGH", kNstrips + 2, 0, kNstrips + 2);
94 h1d_profileDH->GetXaxis()->SetTitle("Strip id");
95 h1d_profileDH->GetXaxis()->SetTitleColor(kOrange + 10);
96 h1d_profileDH->GetYaxis()->SetTitle("dE/dx [Z^2]");
97 h1d_profileDH->GetYaxis()->SetTitleColor(kOrange + 10);
98 h1d_profileDH->SetStats(0);
99 name = fTitle + "_profile_up_high";
100 h1d_profileUH = new TH1F(name, "Hodo signal in strips side UP gain HIGH", kNstrips + 2, 0, kNstrips + 2);
101 h1d_profileUH->GetXaxis()->SetTitle("Strip id");
102 h1d_profileUH->GetXaxis()->SetTitleColor(kOrange + 10);
103 h1d_profileUH->GetYaxis()->SetTitle("dE/dx [Z^2]");
104 h1d_profileUH->GetYaxis()->SetTitleColor(kOrange + 10);
105 h1d_profileUH->SetStats(0);
106
107 name = fTitle + "Canvas_h1d_prof";
108 canProf = new TCanvas(name, name, PAD_WIDTH * Hodo_ROWS, PAD_HEIGHT * Hodo_COLS);
109 canProf->Divide(Hodo_ROWS, Hodo_COLS);
110 canProfPads.resize(Hodo_ROWS * Hodo_COLS);
111 NamesProf.resize(Hodo_ROWS * Hodo_COLS);
112 PadInfo* puh1 = new PadInfo();
113 puh1->current = h1d_profileUH;
114 puh1->opt = "hist";
115 canProfPads.at(0) = puh1;
116 NamesProf.at(0) = puh1->current->GetName();
117 PadInfo* pul1 = new PadInfo();
118 pul1->current = h1d_profileUL;
119 pul1->opt = "hist";
120 canProfPads.at(1) = pul1;
121 NamesProf.at(1) = pul1->current->GetName();
122 PadInfo* pdh1 = new PadInfo();
123 pdh1->current = h1d_profileDH;
124 pdh1->opt = "hist";
125 canProfPads.at(2) = pdh1;
126 NamesProf.at(2) = pdh1->current->GetName();
127 PadInfo* pdl1 = new PadInfo();
128 pdl1->current = h1d_profileDL;
129 pdl1->opt = "hist";
130 canProfPads.at(3) = pdl1;
131 NamesProf.at(3) = pdl1->current->GetName();
132
133 // TODO it better!
134 name = fTitle + "_canv_proj_UH";
135 canv_proj_UH = new TCanvas(name, name, 1, 1);
136 canv_proj_UH->DivideSquare(kNstrips);
137 name = fTitle + "_canv_proj_DH";
138 canv_proj_DH = new TCanvas(name, name, 1, 1);
139 canv_proj_DH->DivideSquare(kNstrips);
140 name = fTitle + "_canv_proj_UL";
141 canv_proj_UL = new TCanvas(name, name, 1, 1);
142 canv_proj_UL->DivideSquare(kNstrips);
143 name = fTitle + "_canv_proj_DL";
144 canv_proj_DL = new TCanvas(name, name, 1, 1);
145 canv_proj_DL->DivideSquare(kNstrips);
146 for (uint32_t i = 1; i <= kNstrips; i++)
147 for (uint32_t j = 0; j < kNsides; j++)
148 for (uint32_t k = 0; k < kNgains; k++) {
149 TString side, gain, nameH;
150 uint32_t address = BmnHodoAddress::GetAddress(i, j, k);
151 (j == 0) ? side = "DOWN" : side = "UP";
152 (k == 0) ? gain = "LOW" : gain = "HIGH";
153 nameH = fTitle + Form("_strip_%d_side_%s_gain_%s", i, side.Data(), gain.Data());
154 vecProj[address] = new TH1F(nameH, nameH, 250, 0, 5000);
155 PadInfo* p = new PadInfo();
156 p->current = vecProj[address];
157 p->opt = "hist logy";
158 canv_proj_Pads[address] = p;
159 Namescanv_proj[address] = p->current->GetName();
160 }
161
162 name = fTitle + "_hStripSideGain";
163 hStripSideGain = new TH1F(name, name, 300, 0, 5000);
164 hStripSideGain->SetStats(0);
165 hStripSideGain->GetYaxis()->SetTitle("Counts");
166 hStripSideGain->GetXaxis()->SetTitle("Apml");
167
168 name = fTitle + "_wfmStrip";
169 wfmStrip = new TH1F(name, name, 200, 0, 200);
170 wfmStrip->SetMarkerStyle(31);
171 wfmStrip->SetMarkerSize(0.5);
172 wfmStrip->SetStats(0);
173
174 name = fTitle + "CanvasSelection";
175 canSelect = new TCanvas(name, name, PAD_WIDTH * 1, PAD_HEIGHT * 2);
176 canSelect->Divide(1, 2);
177 canSelectPads.resize(1 * 2);
178 NamesSelect.resize(1 * 2);
179 PadInfo* ps1 = new PadInfo();
180 ps1->current = hStripSideGain;
181 ps1->opt = "hist";
182 canSelectPads.at(0) = ps1;
183 NamesSelect.at(0) = ps1->current->GetName();
184 PadInfo* ps2 = new PadInfo();
185 ps2->current = wfmStrip;
186 ps2->opt = "hist lp";
187 canSelectPads.at(1) = ps2;
188 NamesSelect.at(1) = ps2->current->GetName();
189
190 name = fTitle + "_hZ2_hodo";
191 hZ2_hodo = new TH1F(name, "hZ2_hodo", 250, 0, 5000);
192 hZ2_hodo->GetXaxis()->SetTitle("Z^2");
193 hZ2_hodo->GetXaxis()->SetTitleColor(kOrange + 10);
194 hZ2_hodo->GetYaxis()->SetTitle("Counts / event");
195 hZ2_hodo->GetYaxis()->SetTitleColor(kOrange + 10);
196 hZ2_hodo->SetOption("hist");
197 hZ2_hodo->SetStats(0);
198
199 name = fTitle + "CanvasZ2";
200 canZ2 = new TCanvas(name, name, 1, 1);
201 canZ2->Divide(1, 1);
202 canZ2Pads.resize(1);
203 NamesZ2.resize(1);
204 PadInfo* pz = new PadInfo();
205 pz->current = hZ2_hodo;
206 canZ2Pads.at(0) = pz;
207 NamesZ2.at(0) = pz->current->GetName();
208}
209
210void BmnHistHodo::Register(THttpServer* serv)
211{
212 fServer = serv;
213 fServer->Register("/", this);
214 TString path = "/" + fTitle + "/";
215 fServer->Register(path, canAmps);
216 fServer->Register(path, canProf);
217 fServer->Register(path, canZ2);
218 fServer->Register(path, canv_proj_DH);
219 fServer->Register(path, canv_proj_DL);
220 fServer->Register(path, canv_proj_UH);
221 fServer->Register(path, canv_proj_UL);
222 fServer->Register(path, canSelect);
223 TString cmd = "/" + fName + "/->Reset()";
224 fServer->SetItemField(path.Data(), "_monitoring", "2000");
225 fServer->SetItemField(path.Data(), "_layout", "grid3x3");
226 TString cmdTitle = path + "Reset";
227 fServer->RegisterCommand(cmdTitle.Data(), cmd.Data(), "button;");
228 fServer->Restrict(cmdTitle, "visible=shift");
229 fServer->Restrict(cmdTitle, "allow=shift");
230 cmd = "/" + fName + "/->SetRefRun(%arg1%)";
231 cmdTitle = path + "SetRefRun";
232 fServer->RegisterCommand(cmdTitle.Data(), cmd.Data(), "button;");
233 cmdTitle = path + "ChangeSelection";
234 fServer->RegisterCommand(cmdTitle, TString("/") + fName.Data() + "/->SetSelection(%arg1%,%arg2%,%arg3%,%arg4%)",
235 "button;");
236 fServer->Restrict(cmdTitle, "visible=shift");
237 fServer->Restrict(cmdTitle, "allow=shift");
238 fServer->Restrict(cmdTitle.Data(), "deny=guest");
239}
240
241void BmnHistHodo::SetDir(TFile* outFile = NULL, TTree* recoTree = NULL)
242{
243 frecoTree = recoTree;
244 fDir = NULL;
245 if (outFile != NULL)
246 fDir = outFile->mkdir(fTitle + "_hists");
247 h2d_EstripUH->SetDirectory(fDir);
248 h2d_EstripDH->SetDirectory(fDir);
249 h2d_EstripUL->SetDirectory(fDir);
250 h2d_EstripDL->SetDirectory(fDir);
251 h1d_profileUH->SetDirectory(fDir);
252 h1d_profileDH->SetDirectory(fDir);
253 h1d_profileUL->SetDirectory(fDir);
254 h1d_profileDL->SetDirectory(fDir);
255 hZ2_hodo->SetDirectory(fDir);
256 for (uint32_t i = 1; i <= kNstrips; i++)
257 for (uint32_t j = 0; j < kNsides; j++)
258 for (uint32_t k = 0; k < kNgains; k++) {
259 int flatIdx = BmnHodoAddress::GetAddress(i, j, k);
260 vecProj.at(flatIdx)->SetDirectory(fDir);
261 }
262 hStripSideGain->SetDirectory(fDir);
263 wfmStrip->SetDirectory(fDir);
264}
265
266void BmnHistHodo::SetSelection(Int_t Strip, Int_t Side, Int_t Gain, Int_t Trigger)
267{
268 fSelectedStrip = Strip;
269 fSelectedSide = Side;
270 fSelectedGain = Gain;
271 fSelectedTrigger = Trigger;
272 TString command = "(1)";
273 TString digiInTree = "HodoDigi";
274 if (fSelectedStrip >= 0)
275 command = command + Form(" && %s.GetStripId() == %d", digiInTree.Data(), fSelectedStrip);
276 if (fSelectedSide >= 0)
277 command = command + Form(" && %s.GetStripSide() == %d", digiInTree.Data(), fSelectedSide);
278 if (fSelectedGain >= 0)
279 command = command + Form(" && %s.GetGain() == %d", digiInTree.Data(), fSelectedGain);
280 TString triggerCondition = "";
281 if (fSelectedTrigger >= 0)
282 triggerCondition = Form(" && %s trigger bit == %d (bitBT=2, bitBC1=3, bitMBT=6, bitNiT=4, bitCCT1=5, "
283 "bitCCT2=8, bitCCT3=12, bitFHCAL=9)",
284 digiInTree.Data(), fSelectedTrigger);
285 TString titleSignal = Form("#splitline{Signal %s}{%s}", command.Data(), triggerCondition.Data());
286 hStripSideGain->SetTitle(titleSignal);
287 TString titleWfm = Form("#splitline{Wfm %s}{%s}", command.Data(), triggerCondition.Data());
288 wfmStrip->SetTitle(titleWfm);
289 hStripSideGain->Reset();
290 wfmStrip->Reset();
291 if (frecoTree != NULL) {
292 TString direction = Form("%s.fAmpl>>%s", digiInTree.Data(), hStripSideGain->GetName());
293 frecoTree->Draw(direction.Data(), command.Data(), "goff");
294 wfmStrip->SetTitle(titleWfm);
295 }
296}
297
299{
300 BmnHist::DrawRef(canAmps, &canAmpsPads);
301 BmnHist::DrawRef(canProf, &canProfPads);
302 BmnHist::DrawRef(canZ2, &canZ2Pads);
303 std::vector<PadInfo*> hsubPadsUH;
304 std::vector<PadInfo*> hsubPadsDH;
305 std::vector<PadInfo*> hsubPadsUL;
306 std::vector<PadInfo*> hsubPadsDL;
307 hsubPadsUH.resize(kNstrips);
308 hsubPadsDH.resize(kNstrips);
309 hsubPadsUL.resize(kNstrips);
310 hsubPadsDL.resize(kNstrips);
311 for (uint32_t i = 1; i <= kNstrips; i++)
312 for (uint32_t j = 0; j < kNsides; j++)
313 for (uint32_t k = 0; k < kNgains; k++) {
314 int flatIdx = BmnHodoAddress::GetAddress(i, j, k);
315 if (j == 0 && k == 0)
316 hsubPadsDL.at(i - 1) = canv_proj_Pads.at(flatIdx);
317 if (j == 0 && k == 1)
318 hsubPadsDH.at(i - 1) = canv_proj_Pads.at(flatIdx);
319 if (j == 1 && k == 0)
320 hsubPadsUL.at(i - 1) = canv_proj_Pads.at(flatIdx);
321 if (j == 1 && k == 1)
322 hsubPadsUH.at(i - 1) = canv_proj_Pads.at(flatIdx);
323 }
324 BmnHist::DrawRef(canv_proj_UH, &hsubPadsUH);
325 BmnHist::DrawRef(canv_proj_DH, &hsubPadsDH);
326 BmnHist::DrawRef(canv_proj_UL, &hsubPadsUL);
327 BmnHist::DrawRef(canv_proj_DL, &hsubPadsDL);
328 BmnHist::DrawRef(canSelect, &canSelectPads);
329 return;
330}
331
333{
334 BmnEventHeader* head = fDigiArrays->header;
335 TClonesArray* digits = fDigiArrays->hodo;
336 if (!digits)
337 return;
338
339 float responses[kNstrips + 1][kNsides];
340 memset(responses, 0, sizeof(responses[0][0]) * (kNstrips + 1) * kNsides);
341 hZ2_hodo->Scale(fEventCounter);
342 h1d_profileDL->Scale(fEventCounter);
343 h1d_profileDH->Scale(fEventCounter);
344 h1d_profileUL->Scale(fEventCounter);
345 h1d_profileUH->Scale(fEventCounter);
346
347 // Loop over digis
348 for (Int_t iDig = 0; iDig < digits->GetEntriesFast(); iDig++) {
349 BmnHodoDigi* digi = (BmnHodoDigi*)digits->At(iDig);
350 double signal = digi->GetSignal();
351 auto strip = digi->GetStripId();
352 auto side = digi->GetStripSide();
353 auto gain = digi->GetGain();
354 int flatIdx = BmnHodoAddress::GetAddress(strip, side, gain);
355
356 vecProj.at(flatIdx)->Fill(signal);
357 if (side == 0 && gain == 0) {
358 h2d_EstripDL->Fill(strip, signal);
359 h1d_profileDL->Fill(strip, signal);
360 }
361 if (side == 0 && gain == 1) {
362 h2d_EstripDH->Fill(strip, signal);
363 h1d_profileDH->Fill(strip, signal);
364 }
365 if (side == 1 && gain == 0) {
366 h2d_EstripUL->Fill(strip, signal);
367 h1d_profileUL->Fill(strip, signal);
368 }
369 if (side == 1 && gain == 1) {
370 h2d_EstripUH->Fill(strip, signal);
371 h1d_profileUH->Fill(strip, signal);
372 }
373
374 UInt_t TrigPattern = head->GetInputSignalsAR();
375 // auto bitBT = (TrigPattern >> 2) & 1; // BT
376 // auto bitBC1 = (TrigPattern >> 3) & 1; // BC1
377 // auto bitMBT = (TrigPattern >> 6) & 1; // MBT
378 // auto bitNiT = (TrigPattern >> 4) & 1; // NiT
379 // auto bitCCT1 = (TrigPattern >> 5) & 1; // CCT1
380 // auto bitCCT2 = (TrigPattern >> 8) & 1; // CCT2
381 // auto bitCCT3 = (TrigPattern >> 12) & 1; // CCT3
382 // auto bitFHCAL = (TrigPattern >> 9) & 1; // FHCAL
383
384 bool isSelected =
385 (Int_t)strip == fSelectedStrip && (Int_t)side == fSelectedSide && (Int_t)gain == fSelectedGain;
386 if (isSelected) {
387 if ((TrigPattern >> fSelectedTrigger) & 1) {
388 hStripSideGain->Fill(digi->fAmpl);
389 auto Wfm = digi->GetWfm();
390 std::vector<float> points(Wfm.size());
391 std::iota(std::begin(points), std::end(points), 0); // Fill with 0, 1, ..., wfm.back().
392 wfmStrip->Reset();
393 wfmStrip->GetXaxis()->SetRangeUser(0, Wfm.size());
394 for (UInt_t wfm_iter = 0; wfm_iter < Wfm.size(); wfm_iter++)
395 wfmStrip->Fill(wfm_iter, Wfm.at(wfm_iter));
396 }
397 }
398 if (gain != 1)
399 continue;
400 responses[strip][side] = signal;
401 }
402 fEventCounter++;
403 for (int i = 1; i <= kNstrips; i++)
404 if (responses[i][0] * responses[i][1] > 0.001)
405 hZ2_hodo->Fill((responses[i][0] + responses[i][1]) / 2);
406 hZ2_hodo->Scale(1. / fEventCounter);
407 h1d_profileDL->Scale(1. / fEventCounter);
408 h1d_profileDH->Scale(1. / fEventCounter);
409 h1d_profileUL->Scale(1. / fEventCounter);
410 h1d_profileUH->Scale(1. / fEventCounter);
411}
412
414{
415 TString FileName = Form("bmn_run%04d_hist.root", id);
416 printf("SetRefRun: %s\n", FileName.Data());
417 if (refRunName != FileName) {
418 refRunName = FileName;
419 refID = id;
420 // BmnHist::LoadRefRun(refID, refPath + FileName, fTitle, canAmpsPads, NamesAmps);
421 BmnHist::LoadRefRun(refID, refPath + FileName, fTitle, canProfPads, NamesProf);
422 BmnHist::LoadRefRun(refID, refPath + FileName, fTitle, canZ2Pads, NamesZ2);
423
424 std::vector<PadInfo*> padVec;
425 std::vector<TString> nameVec;
426
427 padVec.resize(canv_proj_Pads.size());
428 nameVec.resize(Namescanv_proj.size());
429
430 std::transform(canv_proj_Pads.begin(), canv_proj_Pads.end(), padVec.begin(),
431 [](const auto& kv) { return kv.second; });
432
433 std::transform(Namescanv_proj.begin(), Namescanv_proj.end(), nameVec.begin(),
434 [](const auto& kv) { return kv.second; });
435
436 BmnHist::LoadRefRun(refID, refPath + FileName, fTitle, padVec, nameVec);
437 DrawBoth();
438 }
439 return kBMNSUCCESS;
440}
441
443{
444 for (auto pad : canAmpsPads) {
445 if (pad->ref)
446 delete pad->ref;
447 pad->ref = NULL;
448 }
449 for (auto pad : canProfPads) {
450 if (pad->ref)
451 delete pad->ref;
452 pad->ref = NULL;
453 }
454 for (auto pad : canZ2Pads) {
455 if (pad->ref)
456 delete pad->ref;
457 pad->ref = NULL;
458 }
459 for (uint32_t i = 1; i <= kNstrips; i++)
460 for (uint32_t j = 0; j < kNsides; j++)
461 for (uint32_t k = 0; k < kNgains; k++) {
462 int flatIdx = BmnHodoAddress::GetAddress(i, j, k);
463 auto pad = canv_proj_Pads.at(flatIdx);
464 if (pad->ref)
465 delete pad->ref;
466 pad->ref = NULL;
467 }
468 refID = 0;
469}
470
472{
473 printf("BmnHistHodo : Reset histos\n");
474 fEventCounter = 1;
475 h2d_EstripUH->Reset();
476 h2d_EstripDH->Reset();
477 h2d_EstripUL->Reset();
478 h2d_EstripDL->Reset();
479 h1d_profileUH->Reset();
480 h1d_profileDH->Reset();
481 h1d_profileUL->Reset();
482 h1d_profileDL->Reset();
483 hStripSideGain->Reset();
484 hZ2_hodo->Reset();
485
486 for (uint32_t i = 1; i <= kNstrips; i++)
487 for (uint32_t j = 0; j < kNsides; j++)
488 for (uint32_t k = 0; k < kNgains; k++) {
489 int flatIdx = BmnHodoAddress::GetAddress(i, j, k);
490 vecProj.at(flatIdx)->Reset();
491 }
492}
493
495{
496 delete canAmps;
497 delete canProf;
498 delete canZ2;
499 delete canSelect;
500 if (fDir != NULL)
501 return;
502 delete h2d_EstripUH;
503 delete h2d_EstripDH;
504 delete h2d_EstripUL;
505 delete h2d_EstripDL;
506 delete h1d_profileUH;
507 delete h1d_profileDH;
508 delete h1d_profileUL;
509 delete h1d_profileDL;
510 delete hStripSideGain;
511 delete hZ2_hodo;
512 for (uint32_t i = 1; i <= kNstrips; i++)
513 for (uint32_t j = 0; j < kNsides; j++)
514 for (uint32_t k = 0; k < kNgains; k++) {
515 int flatIdx = BmnHodoAddress::GetAddress(i, j, k);
516 delete vecProj.at(flatIdx);
517 }
518}
#define PAD_WIDTH
Definition BmnAdcQA.cxx:3
#define PAD_HEIGHT
Definition BmnAdcQA.cxx:4
void memset(T *dest, T i, size_t num)
uses binary expansion of copied volume for speed up
Definition L1Grid.h:25
int i
Definition P4_F32vec4.h:22
BmnStatus
Definition BmnEnums.h:24
@ kBMNSUCCESS
Definition BmnEnums.h:25
double GetSignal() const
std::vector< float > GetWfm() const
Waveform.
UInt_t GetInputSignalsAR()
BmnStatus SetRefRun(Int_t id)
virtual ~BmnHistHodo()
BmnHistHodo(TString title="Hodo", TString path="")
void SetDir(TFile *outFile, TTree *recoTree)
void CreateHistos()
void FillFromDigi(DigiArrays *fDigiArrays)
void Register(THttpServer *serv)
void SetSelection(Int_t Strip, Int_t Side, Int_t Gain, Int_t Trigger)
void ClearRefRun()
TTree * frecoTree
Definition BmnHist.h:88
Int_t refID
Definition BmnHist.h:92
TString refPath
Definition BmnHist.h:90
TDirectory * fDir
Definition BmnHist.h:89
static void DrawRef(unique_ptr< TCanvas > &canGemStrip, vector< PadInfo * > *canGemStripPads)
Definition BmnHist.cxx:15
TString refRunName
Definition BmnHist.h:91
static BmnStatus LoadRefRun(Int_t refID, TString FullName, TString fTitle, vector< PadInfo * > canPads, vector< TString > Names)
Definition BmnHist.cxx:100
THttpServer * fServer
Definition BmnHist.h:87
static uint32_t GetAddress(uint32_t StripId, uint32_t StripSide, uint32_t Gain)
Return address from system ID, StripId, StripSide, Gain.
Data class for BmnHodo digital signal processing.
Definition BmnHodoDigi.h:25
uint32_t GetGain() const
Gain.
Definition BmnHodoDigi.h:70
uint32_t GetStripSide() const
Strip Side.
Definition BmnHodoDigi.h:65
uint32_t GetStripId() const
BmnEventHeader * header
Definition DigiArrays.h:146
TClonesArray * hodo
Definition DigiArrays.h:135
Storage for pad content and it's options.
Definition PadInfo.h:20
string opt
Definition PadInfo.h:88
TH1 * current
Definition PadInfo.h:78
#define Hodo_COLS
Definition BmnHistHodo.h:20
#define Hodo_ROWS
Definition BmnHistHodo.h:19