1 | #include <iostream>
|
---|
2 | #include <TMath.h>
|
---|
3 | #include <TF1.h>
|
---|
4 |
|
---|
5 | #include "rootfilehandler.h"
|
---|
6 | #include "pixel.h" // class implemented
|
---|
7 | using namespace std;
|
---|
8 |
|
---|
9 | /////////////////////////////// PUBLIC ///////////////////////////////////////
|
---|
10 |
|
---|
11 | //============================= LIFECYCLE ====================================
|
---|
12 |
|
---|
13 |
|
---|
14 | Pixel::Pixel(
|
---|
15 | int pixelID,
|
---|
16 | int maxPulsorder,
|
---|
17 | int verbosityLevel,
|
---|
18 | bool stats,
|
---|
19 | TString options,
|
---|
20 | int pixelOverlayXaxisLeft,
|
---|
21 | int pixelOverlayXaxisRight,
|
---|
22 | float bSLMean,
|
---|
23 | float gainMean,
|
---|
24 | TFile* filename,
|
---|
25 | TFile* outfilename
|
---|
26 | )
|
---|
27 | {
|
---|
28 | mConstructorType = 1; //important for deletion 0 delete distribution 1 delete TemplateHistos
|
---|
29 |
|
---|
30 | mChid = pixelID;
|
---|
31 | mMaxPulseOrder = maxPulsorder;
|
---|
32 | mVerbosityLevel = verbosityLevel;
|
---|
33 | mStats = stats;
|
---|
34 | mOptions = options;
|
---|
35 | mPixelOverlayXaxisLeft = pixelOverlayXaxisLeft;
|
---|
36 | mPixelOverlayXaxisRight = pixelOverlayXaxisRight;
|
---|
37 | mBSLMean = bSLMean;
|
---|
38 | mGainMean = gainMean;
|
---|
39 | mRootFile = filename;
|
---|
40 | mOutRootFile = outfilename;
|
---|
41 |
|
---|
42 | hMaxOverlay = new TH2F*[mMaxPulseOrder];
|
---|
43 | hEdgeOverlay = new TH2F*[mMaxPulseOrder];
|
---|
44 | hMaxProfile = new TProfile*[mMaxPulseOrder];
|
---|
45 | hEdgeProfile = new TProfile*[mMaxPulseOrder];
|
---|
46 |
|
---|
47 | hPixelMax = new TH1F*[mMaxPulseOrder];
|
---|
48 | hPixelMedian = new TH1F*[mMaxPulseOrder];
|
---|
49 | hPixelMean = new TH1F*[mMaxPulseOrder];
|
---|
50 |
|
---|
51 | hPixelEdgeMax = new TH1F*[mMaxPulseOrder];
|
---|
52 | hPixelEdgeMedian = new TH1F*[mMaxPulseOrder];
|
---|
53 | hPixelEdgeMean = new TH1F*[mMaxPulseOrder];
|
---|
54 |
|
---|
55 | hList = new TList();
|
---|
56 | hMemberlist = new TList();
|
---|
57 |
|
---|
58 | if (mOptions.Contains("C") )
|
---|
59 | {
|
---|
60 | hChi2EdgetoMax = new TH1F*[mMaxPulseOrder];
|
---|
61 | }
|
---|
62 |
|
---|
63 | if (options.Contains("L"))
|
---|
64 | {
|
---|
65 | LoadPulseHistos( );
|
---|
66 | }
|
---|
67 | else
|
---|
68 | {
|
---|
69 | BookPixelHistos();
|
---|
70 | }
|
---|
71 |
|
---|
72 | if (mOptions.Contains("C"))
|
---|
73 | {
|
---|
74 | BookDistributionHistos();
|
---|
75 | }
|
---|
76 |
|
---|
77 | BookTemplateHistos();
|
---|
78 | BookEdgeTemplateHistos();
|
---|
79 | }
|
---|
80 |
|
---|
81 | Pixel::Pixel(
|
---|
82 | int pixelID,
|
---|
83 | int maxPulsorder,
|
---|
84 | int verbosityLevel,
|
---|
85 | bool stats,
|
---|
86 | TString options,
|
---|
87 | int pixelOverlayXaxisLeft,
|
---|
88 | int pixelOverlayXaxisRight,
|
---|
89 | float bSLMean,
|
---|
90 | float gainMean
|
---|
91 | )
|
---|
92 | {
|
---|
93 | mConstructorType = 0;
|
---|
94 |
|
---|
95 | mChid = pixelID;
|
---|
96 | mMaxPulseOrder = maxPulsorder;
|
---|
97 | mVerbosityLevel = verbosityLevel;
|
---|
98 | mStats = stats; ///TODO: HANDOVER THE VALUE
|
---|
99 | mOptions = options;
|
---|
100 | mPixelOverlayXaxisLeft = pixelOverlayXaxisLeft;
|
---|
101 | mPixelOverlayXaxisRight = pixelOverlayXaxisRight;
|
---|
102 | mBSLMean = bSLMean;
|
---|
103 | mGainMean = gainMean;
|
---|
104 |
|
---|
105 | hMaxOverlay = new TH2F*[mMaxPulseOrder];
|
---|
106 | hEdgeOverlay = new TH2F*[mMaxPulseOrder];
|
---|
107 | hMaxProfile = new TProfile*[mMaxPulseOrder];
|
---|
108 | hEdgeProfile = new TProfile*[mMaxPulseOrder];
|
---|
109 |
|
---|
110 | if (mOptions.Contains("S") )
|
---|
111 | {
|
---|
112 | hSlopeRisingEdge = new TH1F*[mMaxPulseOrder];
|
---|
113 | }
|
---|
114 |
|
---|
115 | if (mOptions.Contains("R") )
|
---|
116 | {
|
---|
117 | hRisingEdgeToMax = new TH1I*[mMaxPulseOrder];
|
---|
118 | }
|
---|
119 |
|
---|
120 | if (mOptions.Contains("M") )
|
---|
121 | {
|
---|
122 | hPosOfMax = new TH1I*[mMaxPulseOrder];
|
---|
123 | }
|
---|
124 |
|
---|
125 | hList = new TList();
|
---|
126 | hMemberlist = new TList();
|
---|
127 |
|
---|
128 | BookPixelHistos();
|
---|
129 | BookDistributionHistos();
|
---|
130 | }
|
---|
131 |
|
---|
132 | Pixel::~Pixel()
|
---|
133 | {
|
---|
134 | if (mVerbosityLevel > 1)
|
---|
135 | {
|
---|
136 | cout << endl << "...delete histograms of pixel " << mChid ;
|
---|
137 | cout << endl << "...mConstructorType = " << mConstructorType ;
|
---|
138 | }
|
---|
139 |
|
---|
140 | if (mConstructorType == 0)
|
---|
141 | {
|
---|
142 | DeleteDistributionHistos();
|
---|
143 | }
|
---|
144 |
|
---|
145 | if (mConstructorType == 1)
|
---|
146 | {
|
---|
147 | DeleteTemplateHistos();
|
---|
148 | DeleteEdgeTemplateHistos();
|
---|
149 | }
|
---|
150 |
|
---|
151 | DeletePixelHistos();
|
---|
152 | delete hList;
|
---|
153 | delete hMemberlist;
|
---|
154 |
|
---|
155 | hList = NULL;
|
---|
156 | hMemberlist = NULL;
|
---|
157 | if (mVerbosityLevel > 1)
|
---|
158 | {
|
---|
159 | cout << endl << "...histograms of pixel " << mChid ;
|
---|
160 | cout << "...deleted " << endl ;
|
---|
161 | }
|
---|
162 | }// ~Pixel
|
---|
163 |
|
---|
164 |
|
---|
165 | //============================= OPERATORS ====================================
|
---|
166 |
|
---|
167 | //XX&
|
---|
168 | //XX::operator=(const XX&);
|
---|
169 | //{
|
---|
170 | // return *this;
|
---|
171 |
|
---|
172 | //}// =
|
---|
173 |
|
---|
174 | //============================= OPERATIONS ===================================
|
---|
175 | void
|
---|
176 | Pixel::DrawOverlayHistograms(
|
---|
177 | TCanvas** pixelCanvas,
|
---|
178 | int* histoFrameNr
|
---|
179 | )
|
---|
180 | {
|
---|
181 | if (mVerbosityLevel > 2) cout << endl << "...drawing pulse histograms" ;
|
---|
182 | for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++)
|
---|
183 | {
|
---|
184 | pixelCanvas[pulse_order]->cd( histoFrameNr[0] );
|
---|
185 | hMaxOverlay[pulse_order]->Draw("COLZ");
|
---|
186 | pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
|
---|
187 | hMaxProfile[pulse_order]->Draw();
|
---|
188 |
|
---|
189 | pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
|
---|
190 | hEdgeOverlay[pulse_order]->Draw("COLZ");
|
---|
191 | pixelCanvas[pulse_order]->cd( histoFrameNr[3] );
|
---|
192 | hEdgeProfile[pulse_order]->Draw();
|
---|
193 | }
|
---|
194 | }
|
---|
195 | // end of DrawOverlayHistograms
|
---|
196 | //----------------------------------------------------------------------------
|
---|
197 |
|
---|
198 | void
|
---|
199 | Pixel::DrawDistributionHistograms(
|
---|
200 | TCanvas** pixelCanvas,
|
---|
201 | int* histoFrameNr
|
---|
202 | )
|
---|
203 | {
|
---|
204 | if (mVerbosityLevel > 2) cout << endl << "...drawing distribution histograms" ;
|
---|
205 | bool nothing_to_fill = true;
|
---|
206 | for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++)
|
---|
207 | {
|
---|
208 | if (mOptions.Contains("S") )
|
---|
209 | {
|
---|
210 | pixelCanvas[pulse_order]->cd( histoFrameNr[0] );
|
---|
211 | hSlopeRisingEdge[pulse_order]->Draw();
|
---|
212 | nothing_to_fill = false;
|
---|
213 | }
|
---|
214 |
|
---|
215 | if (mOptions.Contains("R") )
|
---|
216 | {
|
---|
217 | pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
|
---|
218 | hRisingEdgeToMax[pulse_order]->Draw();
|
---|
219 | nothing_to_fill = false;
|
---|
220 | }
|
---|
221 |
|
---|
222 | if (mOptions.Contains("M") )
|
---|
223 | {
|
---|
224 | pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
|
---|
225 | hPosOfMax[pulse_order]->Draw();
|
---|
226 | nothing_to_fill = false;
|
---|
227 | }
|
---|
228 |
|
---|
229 | }
|
---|
230 | if (nothing_to_fill)
|
---|
231 | {
|
---|
232 | cout << endl << "there were NO DISTRIBUTION HISTOGRAMS to fill" << endl;
|
---|
233 | }
|
---|
234 | }
|
---|
235 | // end of DrawDistributionHistograms
|
---|
236 | //----------------------------------------------------------------------------
|
---|
237 |
|
---|
238 | void
|
---|
239 | Pixel::DrawTemplateHistograms(
|
---|
240 | TCanvas** pixelCanvas,
|
---|
241 | int* histoFrameNr
|
---|
242 | )
|
---|
243 | {
|
---|
244 | int mrkStyle =1;
|
---|
245 | int mrkSize = 2;
|
---|
246 | if (mVerbosityLevel > 2) cout << "...drawing Template histograms" << endl ;
|
---|
247 | for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++)
|
---|
248 | {
|
---|
249 | pixelCanvas[pulse_order]->cd( histoFrameNr[0] );
|
---|
250 | hMaxOverlay[pulse_order]->Draw("COLZ");
|
---|
251 |
|
---|
252 | pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
|
---|
253 | hPixelMax[pulse_order]->Draw("E1");
|
---|
254 | hPixelMax[pulse_order]->SetMarkerColor(kBlue);
|
---|
255 | hPixelMax[pulse_order]->SetLineColor(kBlack);
|
---|
256 | hPixelMax[pulse_order]->SetMarkerStyle(mrkStyle);
|
---|
257 | hPixelMax[pulse_order]->SetMarkerSize(mrkSize);
|
---|
258 |
|
---|
259 | pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
|
---|
260 | hPixelMedian[pulse_order]->Draw("E1");
|
---|
261 | hPixelMedian[pulse_order]->SetMarkerColor(kBlue);
|
---|
262 | hPixelMedian[pulse_order]->SetLineColor(kBlack);
|
---|
263 | hPixelMedian[pulse_order]->SetMarkerStyle(mrkStyle);
|
---|
264 | hPixelMedian[pulse_order]->SetMarkerSize(mrkSize);
|
---|
265 |
|
---|
266 | pixelCanvas[pulse_order]->cd( histoFrameNr[3] );
|
---|
267 | hPixelMean[pulse_order]->Draw("E1");
|
---|
268 | hPixelMean[pulse_order]->SetMarkerColor(kBlue);
|
---|
269 | hPixelMean[pulse_order]->SetLineColor(kBlack);
|
---|
270 | hPixelMean[pulse_order]->SetMarkerStyle(mrkStyle);
|
---|
271 | hPixelMean[pulse_order]->SetMarkerSize(mrkSize);
|
---|
272 | // hPixelMax[pulse_order]->Draw("SAME");
|
---|
273 | // hPixelMedian[pulse_order]->Draw("SAME");
|
---|
274 |
|
---|
275 | }
|
---|
276 | }
|
---|
277 | // end of DrawTemplateHistograms
|
---|
278 | //----------------------------------------------------------------------------
|
---|
279 |
|
---|
280 | void
|
---|
281 | Pixel::DrawEdgeTemplateHistograms(
|
---|
282 | TCanvas** pixelCanvas,
|
---|
283 | int* histoFrameNr
|
---|
284 | )
|
---|
285 | {
|
---|
286 | int mrkStyle = 1;
|
---|
287 | int mrkSize = 3;
|
---|
288 |
|
---|
289 | if (mVerbosityLevel > 2) cout << endl << "...drawing Template histograms" ;
|
---|
290 | for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++)
|
---|
291 | {
|
---|
292 | pixelCanvas[pulse_order]->cd( histoFrameNr[4] );
|
---|
293 | hEdgeOverlay[pulse_order]->Draw("COLZ");
|
---|
294 |
|
---|
295 | pixelCanvas[pulse_order]->cd( histoFrameNr[5] );
|
---|
296 | hPixelEdgeMax[pulse_order]->Draw("E1");
|
---|
297 | hPixelEdgeMax[pulse_order]->SetLineColor(kBlack);
|
---|
298 | hPixelEdgeMax[pulse_order]->SetMarkerColor(kBlue);
|
---|
299 | hPixelEdgeMax[pulse_order]->SetMarkerStyle(mrkStyle);
|
---|
300 | hPixelEdgeMax[pulse_order]->SetMarkerSize(mrkSize);
|
---|
301 |
|
---|
302 | pixelCanvas[pulse_order]->cd( histoFrameNr[6] );
|
---|
303 | hPixelEdgeMedian[pulse_order]->Draw("E1");
|
---|
304 | hPixelEdgeMedian[pulse_order]->SetLineColor(kBlack);
|
---|
305 | hPixelEdgeMedian[pulse_order]->SetMarkerColor(kBlue);
|
---|
306 | hPixelEdgeMedian[pulse_order]->SetMarkerStyle(mrkStyle);
|
---|
307 | hPixelEdgeMedian[pulse_order]->SetMarkerSize(mrkSize);
|
---|
308 |
|
---|
309 | pixelCanvas[pulse_order]->cd( histoFrameNr[7] );
|
---|
310 | hPixelEdgeMean[pulse_order]->Draw("E1");
|
---|
311 | hPixelEdgeMean[pulse_order]->SetLineColor(kBlack);
|
---|
312 | hPixelEdgeMean[pulse_order]->SetMarkerColor(kBlue);
|
---|
313 | hPixelEdgeMean[pulse_order]->SetMarkerStyle(mrkStyle);
|
---|
314 | hPixelEdgeMean[pulse_order]->SetMarkerSize(mrkSize);
|
---|
315 | // hPixelEdgeMax[pulse_order]->Draw("SAME");
|
---|
316 | // hPixelEdgeMedian[pulse_order]->Draw("SAME");
|
---|
317 |
|
---|
318 | }
|
---|
319 | }
|
---|
320 | // end of DrawTemplateHistograms
|
---|
321 | //----------------------------------------------------------------------------
|
---|
322 |
|
---|
323 |
|
---|
324 |
|
---|
325 |
|
---|
326 | void
|
---|
327 | Pixel::SavePixelHistograms(
|
---|
328 | TString outRootFileName,
|
---|
329 | bool saveResults
|
---|
330 | )
|
---|
331 | {
|
---|
332 | if (mVerbosityLevel > 2) cout << endl << "Saving histograms of Pixel# " << mChid;
|
---|
333 | if (!saveResults) return;
|
---|
334 | SaveList(
|
---|
335 | outRootFileName,
|
---|
336 | CreateSubDirName( mChid ),
|
---|
337 | hList,
|
---|
338 | saveResults,
|
---|
339 | mVerbosityLevel
|
---|
340 | );
|
---|
341 |
|
---|
342 | TVectorF chid(1);
|
---|
343 | chid[0] = mChid;
|
---|
344 | hMemberlist->Add( chid );
|
---|
345 |
|
---|
346 | TVectorF MaxPulseOrder(1);
|
---|
347 | MaxPulseOrder[0] = mMaxPulseOrder;
|
---|
348 | hMemberlist->Add( MaxPulseOrder );
|
---|
349 |
|
---|
350 | TVectorF PixelOverlayXaxisLeft(1);
|
---|
351 | PixelOverlayXaxisLeft[0] = mPixelOverlayXaxisLeft;
|
---|
352 | hMemberlist->Add( PixelOverlayXaxisLeft );
|
---|
353 |
|
---|
354 | TVectorF PixelOverlayXaxisRight(1);
|
---|
355 | PixelOverlayXaxisRight[0] = mPixelOverlayXaxisRight;
|
---|
356 | hMemberlist->Add( PixelOverlayXaxisRight );
|
---|
357 |
|
---|
358 | TVectorF BSLMean(1);
|
---|
359 | BSLMean[0] = mBSLMean;
|
---|
360 | hMemberlist->Add( BSLMean );
|
---|
361 |
|
---|
362 | TVectorF GainMean(1);
|
---|
363 | GainMean[0] = mGainMean;
|
---|
364 | hMemberlist->Add( GainMean );
|
---|
365 |
|
---|
366 | hMemberlist->Add( mOptions );
|
---|
367 |
|
---|
368 | SaveList(
|
---|
369 | outRootFileName,
|
---|
370 | CreateSubDirName( mChid ),
|
---|
371 | hMemberlist,
|
---|
372 | saveResults,
|
---|
373 | mVerbosityLevel
|
---|
374 | );
|
---|
375 |
|
---|
376 |
|
---|
377 |
|
---|
378 |
|
---|
379 | /*
|
---|
380 | we also need to save same values:
|
---|
381 |
|
---|
382 | EXAMPLE
|
---|
383 | root > TFile f("v.root","recreate")
|
---|
384 | root > TVectorD v(1)
|
---|
385 | root > v[0] = 3.14
|
---|
386 | root > v.Write("v")
|
---|
387 | and to read the file do
|
---|
388 | CODE: SELECT ALL
|
---|
389 | root > TFile f("v.root")
|
---|
390 | root > TVectorD *v = (TVectorD*)f.get("v");
|
---|
391 | root > v->Print()
|
---|
392 |
|
---|
393 | */
|
---|
394 | }
|
---|
395 | // end of SavePixelHistograms
|
---|
396 | //----------------------------------------------------------------------------
|
---|
397 |
|
---|
398 | TString
|
---|
399 | Pixel::HistoName(
|
---|
400 | TString histoname,
|
---|
401 | int order
|
---|
402 | )
|
---|
403 | {
|
---|
404 | histoname += mChid;
|
---|
405 | histoname += "_";
|
---|
406 | histoname += order;
|
---|
407 | return histoname;
|
---|
408 | }
|
---|
409 |
|
---|
410 | TString
|
---|
411 | Pixel::ChooseCycleNumber(
|
---|
412 | TString histoname,
|
---|
413 | int cycleNumber
|
---|
414 | )
|
---|
415 | {
|
---|
416 | histoname += ";";
|
---|
417 | histoname += cycleNumber;
|
---|
418 | return histoname;
|
---|
419 | }
|
---|
420 |
|
---|
421 | TString
|
---|
422 | Pixel::HistoTitle(
|
---|
423 | TString histo_title,
|
---|
424 | int order
|
---|
425 | )
|
---|
426 | {
|
---|
427 | histo_title += " [Pixel_Order] ";
|
---|
428 | histo_title += mChid;
|
---|
429 | histo_title += "_";
|
---|
430 | histo_title += order;
|
---|
431 | return histo_title;
|
---|
432 | }
|
---|
433 |
|
---|
434 | TString
|
---|
435 | Pixel::CsvFileName(
|
---|
436 | TString path,
|
---|
437 | TString overlayMethod,
|
---|
438 | int order
|
---|
439 | )
|
---|
440 | {
|
---|
441 | path += "CSV/";
|
---|
442 | path += overlayMethod;
|
---|
443 | path += "OverlayTemplate";
|
---|
444 | path += "_";
|
---|
445 | path += mChid;
|
---|
446 | path += "_";
|
---|
447 | path += order;
|
---|
448 | path += ".csv";
|
---|
449 | return path;
|
---|
450 | }
|
---|
451 |
|
---|
452 |
|
---|
453 | //============================= ACESS ===================================
|
---|
454 | //============================= INQUIRY ===================================
|
---|
455 | /////////////////////////////// PROTECTED ///////////////////////////////////
|
---|
456 |
|
---|
457 | /////////////////////////////// PRIVATE ///////////////////////////////////
|
---|
458 |
|
---|
459 | void
|
---|
460 | Pixel::BookPixelHistos()
|
---|
461 | {
|
---|
462 | if (mVerbosityLevel > 2) cout << endl << "...book pixel histograms" << endl;
|
---|
463 | for (int order = 0; order < mMaxPulseOrder; order++)
|
---|
464 | {
|
---|
465 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hMaxOverlay", order) << endl;
|
---|
466 | hMaxOverlay[order]=new TH2F(
|
---|
467 | HistoName("hMaxOverlay", order),
|
---|
468 | HistoTitle("Overlay at peak maximum of detected pulses of", order),
|
---|
469 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
470 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
471 | mPixelOverlayXaxisRight-0.5 ,
|
---|
472 | 512,
|
---|
473 | -55.5,
|
---|
474 | 200.5
|
---|
475 | );
|
---|
476 |
|
---|
477 | hMaxOverlay[order]->SetAxisRange(
|
---|
478 | mBSLMean - 5,
|
---|
479 | (mGainMean*(order+1)) + 10,
|
---|
480 | "Y");
|
---|
481 | hMaxOverlay[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
482 | hMaxOverlay[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
483 | //hMaxProfile->SetBit(TH2F::kCanRebin);
|
---|
484 | hMaxOverlay[order]->SetStats(mStats);
|
---|
485 | hList->Add( hMaxOverlay[order] );
|
---|
486 |
|
---|
487 | //------------------------------------------------------------------------
|
---|
488 |
|
---|
489 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hEdgeOverlay", order) << endl;
|
---|
490 | hEdgeOverlay[order] = new TH2F(
|
---|
491 | HistoName("hEdgeOverlay", order),
|
---|
492 | HistoTitle("Overlay at rising edge of detected pulses of", order),
|
---|
493 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
494 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
495 | mPixelOverlayXaxisRight-0.5 ,
|
---|
496 | 512,
|
---|
497 | -55.5,
|
---|
498 | 200.5
|
---|
499 | );
|
---|
500 |
|
---|
501 | hEdgeOverlay[order]->SetAxisRange(
|
---|
502 | mBSLMean - 5,
|
---|
503 | (mGainMean*(order+1)) + 10,
|
---|
504 | "Y");
|
---|
505 | hEdgeOverlay[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
506 | hEdgeOverlay[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
507 | hEdgeOverlay[order]->SetStats(mStats);
|
---|
508 | hList->Add( hEdgeOverlay[order] );
|
---|
509 |
|
---|
510 | //------------------------------------------------------------------------
|
---|
511 |
|
---|
512 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hMaxProfile", order) << endl;
|
---|
513 | hMaxProfile[order] = new TProfile(
|
---|
514 | HistoName("hMaxProfile", order),
|
---|
515 | HistoTitle("Mean value of each slice in overlay plot (Tprofile)", order),
|
---|
516 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx
|
---|
517 | (-1*mPixelOverlayXaxisLeft)-0.5, //xlow
|
---|
518 | mPixelOverlayXaxisRight-0.5 , //xup
|
---|
519 | // 512, //nbinsy
|
---|
520 | -55.5, //ylow
|
---|
521 | 300.5, //yup
|
---|
522 | "s"); //option
|
---|
523 | hMaxProfile[order]->SetAxisRange(
|
---|
524 | mBSLMean - 5,
|
---|
525 | (mGainMean*(order+1)) + 10,
|
---|
526 | "Y");
|
---|
527 | hMaxProfile[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
528 | hMaxProfile[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
529 | //hMaxProfile->SetBit(TH2F::kCanRebin);
|
---|
530 | hMaxProfile[order]->SetStats(mStats);
|
---|
531 | hList->Add( hMaxProfile[order] );
|
---|
532 |
|
---|
533 |
|
---|
534 | //------------------------------------------------------------------------
|
---|
535 |
|
---|
536 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hEdgeProfile", order) << endl;
|
---|
537 | hEdgeProfile[order] = new TProfile(
|
---|
538 | HistoName("hEdgeProfile", order),
|
---|
539 | HistoTitle("Mean value of each slice in overlay plot (Tprofile)", order),
|
---|
540 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx
|
---|
541 | (-1*mPixelOverlayXaxisLeft)-0.5, //xlow
|
---|
542 | mPixelOverlayXaxisRight-0.5 , //xup
|
---|
543 | // 512, //nbinsy
|
---|
544 | -55.5, //ylow
|
---|
545 | 300.5, //yup
|
---|
546 | "s"); //option
|
---|
547 | hEdgeProfile[order]->SetLineColor(kRed);
|
---|
548 | hEdgeProfile[order]->SetAxisRange(
|
---|
549 | mBSLMean - 5,
|
---|
550 | (mGainMean*(order+1)) + 10,
|
---|
551 | "Y");
|
---|
552 | hEdgeProfile[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
553 | hEdgeProfile[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
554 | //hMaxProfile->SetBit(TH2F::kCanRebin);
|
---|
555 | hEdgeProfile[order]->SetStats(mStats);
|
---|
556 | hList->Add( hEdgeProfile[order] );
|
---|
557 |
|
---|
558 | }
|
---|
559 | if (mVerbosityLevel > 2) cout << "...done" << endl;
|
---|
560 | }
|
---|
561 | //end of BookPixelHistos
|
---|
562 | //----------------------------------------------------------------------------
|
---|
563 |
|
---|
564 | void
|
---|
565 | Pixel::BookDistributionHistos( )
|
---|
566 | {
|
---|
567 | if (!mOptions.IsNull() )
|
---|
568 | {
|
---|
569 | int x_min = 0;
|
---|
570 | int x_max = 0;
|
---|
571 |
|
---|
572 | for (int order =0; order < mMaxPulseOrder; order++)
|
---|
573 | {
|
---|
574 | if (mVerbosityLevel > 2) cout << endl
|
---|
575 | << "...book distribution histograms"
|
---|
576 | << endl;
|
---|
577 |
|
---|
578 | if (mOptions.Contains("S"))
|
---|
579 | {
|
---|
580 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hSlopeRisingEdge", order) << endl;
|
---|
581 | hSlopeRisingEdge[order] = new TH1F (
|
---|
582 | HistoName("hSlopeRisingEdge", order),
|
---|
583 | HistoTitle("Distribution of rising edge's slope", order),
|
---|
584 | 600,
|
---|
585 | -10.1,
|
---|
586 | 10.1
|
---|
587 | );
|
---|
588 | hSlopeRisingEdge[order]->SetAxisRange(
|
---|
589 | -1,
|
---|
590 | 7,
|
---|
591 | "X");
|
---|
592 | hSlopeRisingEdge[order]->GetXaxis()->SetTitle( "Slope Amplitude/time [mV/timeslices]" );
|
---|
593 | hSlopeRisingEdge[order]->GetYaxis()->SetTitle( "counts" );
|
---|
594 | hSlopeRisingEdge[order]->SetStats(mStats);
|
---|
595 | hList->Add( hSlopeRisingEdge[order] );
|
---|
596 | }
|
---|
597 |
|
---|
598 | if (mOptions.Contains("R"))
|
---|
599 | {
|
---|
600 | x_min = -15;
|
---|
601 | x_max = 35;
|
---|
602 |
|
---|
603 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hRisingEdgeToMax", order) << endl;
|
---|
604 | hRisingEdgeToMax[order] = new TH1I (
|
---|
605 | HistoName("hRisingEdgeToMax", order),
|
---|
606 | HistoTitle("Distribution of distance between rising edge and pulse's maximum", order),
|
---|
607 | x_max -x_min,
|
---|
608 | x_min,
|
---|
609 | x_max
|
---|
610 | );
|
---|
611 | hSlopeRisingEdge[order]->SetAxisRange(
|
---|
612 | -5,
|
---|
613 | 25,
|
---|
614 | "X");
|
---|
615 | hRisingEdgeToMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
616 | hRisingEdgeToMax[order]->GetYaxis()->SetTitle( "counts" );
|
---|
617 | hRisingEdgeToMax[order]->SetStats(mStats);
|
---|
618 | hList->Add( hRisingEdgeToMax[order] );
|
---|
619 | }
|
---|
620 |
|
---|
621 | if (mOptions.Contains("M"))
|
---|
622 | {
|
---|
623 | x_min = 10;
|
---|
624 | x_max = 290;
|
---|
625 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPosOfMax", order) << endl;
|
---|
626 | hPosOfMax[order] = new TH1I (
|
---|
627 | HistoName("hPosOfMax", order),
|
---|
628 | HistoTitle("Distribution of pulse's maximum's positon", order),
|
---|
629 | x_max - x_min,
|
---|
630 | x_min,
|
---|
631 | x_max
|
---|
632 | );
|
---|
633 | hPosOfMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
634 | hPosOfMax[order]->GetYaxis()->SetTitle( "counts" );
|
---|
635 | hRisingEdgeToMax[order]->SetStats(mStats);
|
---|
636 | hList->Add( hPosOfMax[order] );
|
---|
637 | }
|
---|
638 |
|
---|
639 | if (mOptions.Contains("C"))
|
---|
640 | {
|
---|
641 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hSlopeRisingEdge", order) << endl;
|
---|
642 | hChi2EdgetoMax[order] = new TH1F (
|
---|
643 | HistoName("hChi2EdgetoMax", order),
|
---|
644 | HistoTitle("Distribution of CHI2 comparison of Edge and Max", order),
|
---|
645 | 600,
|
---|
646 | -299,
|
---|
647 | 300
|
---|
648 | );
|
---|
649 | hChi2EdgetoMax[order]->SetAxisRange(
|
---|
650 | -1,
|
---|
651 | 7,
|
---|
652 | "X");
|
---|
653 | hChi2EdgetoMax[order]->GetXaxis()->SetTitle( "p-Value" );
|
---|
654 | hChi2EdgetoMax[order]->GetYaxis()->SetTitle( "counts" );
|
---|
655 | hChi2EdgetoMax[order]->SetStats(mStats);
|
---|
656 | // hList->Add( hChi2EdgetoMax[order] );
|
---|
657 | }
|
---|
658 |
|
---|
659 | if (mVerbosityLevel > 2) cout << "...done" << endl;
|
---|
660 | }
|
---|
661 | }
|
---|
662 | }
|
---|
663 | //end of BookDistributionHistos
|
---|
664 | //----------------------------------------------------------------------------
|
---|
665 |
|
---|
666 | void
|
---|
667 | Pixel::BookTemplateHistos()
|
---|
668 | {
|
---|
669 | if (mVerbosityLevel > 2) cout << endl << "...book pixel histograms" << endl;
|
---|
670 | for (int order = 0; order < mMaxPulseOrder; order++)
|
---|
671 | {
|
---|
672 | if (mVerbosityLevel > 3)
|
---|
673 | {
|
---|
674 | cout << "\t...booking " << HistoName("hPixelMax", order) << endl;
|
---|
675 | }
|
---|
676 |
|
---|
677 | hPixelMax[order]=new TH1F(
|
---|
678 | HistoName("hPixelMax", order),
|
---|
679 | HistoTitle("Maximum value of each slice in overlay plot of", order),
|
---|
680 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
681 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
682 | mPixelOverlayXaxisRight-0.5
|
---|
683 | );
|
---|
684 |
|
---|
685 | hPixelMax[order]->SetAxisRange(
|
---|
686 | mBSLMean - 5,
|
---|
687 | (mGainMean*(order+1)) + 10,
|
---|
688 | "Y");
|
---|
689 | hPixelMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
690 | hPixelMax[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
691 | //hMaxProfile->SetBit(TH2F::kCanRebin);
|
---|
692 | hPixelMax[order]->SetStats(mStats);
|
---|
693 | hList->Add( hPixelMax[order] );
|
---|
694 |
|
---|
695 | //------------------------------------------------------------------------
|
---|
696 |
|
---|
697 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelMean", order) << endl;
|
---|
698 | hPixelMean[order] = new TH1F(
|
---|
699 | HistoName("hPixelMean", order),
|
---|
700 | HistoTitle("Mean value of each slice in overlay plot of", order),
|
---|
701 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
702 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
703 | mPixelOverlayXaxisRight-0.5
|
---|
704 | );
|
---|
705 | hPixelMean[order]->SetLineColor(kBlue);
|
---|
706 | hPixelMean[order]->SetAxisRange(
|
---|
707 | mBSLMean - 5,
|
---|
708 | (mGainMean*(order+1)) + 10,
|
---|
709 | "Y");
|
---|
710 | hPixelMean[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
711 | hPixelMean[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
712 | hPixelMean[order]->SetStats(mStats);
|
---|
713 | hList->Add( hPixelMean[order] );
|
---|
714 |
|
---|
715 | //------------------------------------------------------------------------
|
---|
716 |
|
---|
717 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelMedian", order) << endl;
|
---|
718 | hPixelMedian[order] = new TH1F(
|
---|
719 | HistoName("hPixelMedian", order),
|
---|
720 | HistoTitle("Median value of each slice in overlay plot of", order),
|
---|
721 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx
|
---|
722 | (-1*mPixelOverlayXaxisLeft)-0.5, //xlow
|
---|
723 | mPixelOverlayXaxisRight-0.5 //xup
|
---|
724 | );
|
---|
725 | hPixelMedian[order]->SetLineColor(kRed);
|
---|
726 | hPixelMedian[order]->SetAxisRange(
|
---|
727 | mBSLMean - 5,
|
---|
728 | (mGainMean*(order+1)) + 10,
|
---|
729 | "Y");
|
---|
730 | hPixelMedian[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
731 | hPixelMedian[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
732 | //hMaxProfile->SetBit(TH2F::kCanRebin);
|
---|
733 | hPixelMedian[order]->SetStats(mStats);
|
---|
734 | hList->Add( hPixelMedian[order] );
|
---|
735 |
|
---|
736 | }
|
---|
737 | if (mVerbosityLevel > 2) cout << "...done" << endl;
|
---|
738 | }
|
---|
739 | //end of BookTemplateHistos
|
---|
740 | //----------------------------------------------------------------------------
|
---|
741 |
|
---|
742 | void
|
---|
743 | Pixel::BookEdgeTemplateHistos()
|
---|
744 | {
|
---|
745 | if (mVerbosityLevel > 2) cout << endl << "...book pixel histograms" << endl;
|
---|
746 | for (int order = 0; order < mMaxPulseOrder; order++)
|
---|
747 | {
|
---|
748 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelEdgeMax", order) << endl;
|
---|
749 | hPixelEdgeMax[order]=new TH1F(
|
---|
750 | HistoName("hPixelEdgeMax", order),
|
---|
751 | HistoTitle("Maximum value of each slice in overlay plot of", order),
|
---|
752 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
753 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
754 | mPixelOverlayXaxisRight-0.5
|
---|
755 | );
|
---|
756 |
|
---|
757 | hPixelEdgeMax[order]->SetAxisRange(
|
---|
758 | mBSLMean - 5,
|
---|
759 | (mGainMean*(order+1)) + 10,
|
---|
760 | "Y");
|
---|
761 | hPixelEdgeMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
762 | hPixelEdgeMax[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
763 | //hMaxProfile->SetBit(TH2F::kCanRebin);
|
---|
764 | hPixelEdgeMax[order]->SetStats(mStats);
|
---|
765 | hList->Add( hPixelEdgeMax[order] );
|
---|
766 |
|
---|
767 | //------------------------------------------------------------------------
|
---|
768 |
|
---|
769 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelEdgeMean", order) << endl;
|
---|
770 | hPixelEdgeMean[order] = new TH1F(
|
---|
771 | HistoName("hPixelEdgeMean", order),
|
---|
772 | HistoTitle("Mean value of each slice in overlay plot of", order),
|
---|
773 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
774 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
775 | mPixelOverlayXaxisRight-0.5
|
---|
776 | );
|
---|
777 | hPixelEdgeMean[order]->SetLineColor(kBlue);
|
---|
778 | hPixelEdgeMean[order]->SetAxisRange(
|
---|
779 | mBSLMean - 5,
|
---|
780 | (mGainMean*(order+1)) + 10,
|
---|
781 | "Y");
|
---|
782 | hPixelEdgeMean[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
783 | hPixelEdgeMean[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
784 | hPixelEdgeMean[order]->SetStats(mStats);
|
---|
785 | hList->Add( hPixelEdgeMean[order] );
|
---|
786 |
|
---|
787 | //------------------------------------------------------------------------
|
---|
788 |
|
---|
789 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelEdgeMedian", order) << endl;
|
---|
790 | hPixelEdgeMedian[order] = new TH1F(
|
---|
791 | HistoName("hPixelEdgeMedian", order),
|
---|
792 | HistoTitle("Median value of each slice in overlay plot of", order),
|
---|
793 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx
|
---|
794 | (-1*mPixelOverlayXaxisLeft)-0.5, //xlow
|
---|
795 | mPixelOverlayXaxisRight-0.5 //xup
|
---|
796 | );
|
---|
797 | hPixelEdgeMedian[order]->SetLineColor(kRed);
|
---|
798 | hPixelEdgeMedian[order]->SetAxisRange(
|
---|
799 | mBSLMean - 5,
|
---|
800 | (mGainMean*(order+1)) + 10,
|
---|
801 | "Y");
|
---|
802 | hPixelEdgeMedian[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
803 | hPixelEdgeMedian[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
804 | //hMaxProfile->SetBit(TH2F::kCanRebin);
|
---|
805 | hPixelEdgeMedian[order]->SetStats(mStats);
|
---|
806 | hList->Add( hPixelEdgeMedian[order] );
|
---|
807 |
|
---|
808 | }
|
---|
809 | if (mVerbosityLevel > 2) cout << "...done" << endl;
|
---|
810 | }
|
---|
811 | //end of BookEdgeTemplateHistos
|
---|
812 | //----------------------------------------------------------------------------
|
---|
813 |
|
---|
814 | void
|
---|
815 | Pixel::LoadPulseHistos()
|
---|
816 | {
|
---|
817 | mRootFile->cd();
|
---|
818 |
|
---|
819 | if (mVerbosityLevel > 2)
|
---|
820 | {
|
---|
821 | if (mVerbosityLevel > 3)
|
---|
822 | {
|
---|
823 | mRootFile->ls();
|
---|
824 | }
|
---|
825 | cout << "loading current File: " ;
|
---|
826 | gFile->pwd();
|
---|
827 | }
|
---|
828 |
|
---|
829 | mRootFile->cd( CreateSubDirName( mChid ) ); //Go to pixel's subdirectory
|
---|
830 | mDirectory = gDirectory;
|
---|
831 |
|
---|
832 | if (mVerbosityLevel > 2)
|
---|
833 | {
|
---|
834 | if (mVerbosityLevel > 3)
|
---|
835 | {
|
---|
836 | gDirectory->ls();
|
---|
837 | }
|
---|
838 | cout << "Current Directory: " ;
|
---|
839 | gDirectory->pwd();
|
---|
840 | }
|
---|
841 |
|
---|
842 |
|
---|
843 | if (mVerbosityLevel > 2) cout << endl << "...load pixel histograms" << endl;
|
---|
844 | for (int order = 0; order < mMaxPulseOrder; order++)
|
---|
845 | {
|
---|
846 |
|
---|
847 | if (mVerbosityLevel > 3) cout << "\t...loading " << ChooseCycleNumber( HistoName("hMaxOverlay", order), 1) << endl;
|
---|
848 | hMaxOverlay[order] = (TH2F*)mDirectory->Get( ChooseCycleNumber( HistoName("hMaxOverlay", order), 1) );
|
---|
849 |
|
---|
850 | if (mVerbosityLevel > 3) cout << "\t...loading " << HistoName("hEdgeOverlay", order) << endl;
|
---|
851 | hEdgeOverlay[order] = (TH2F*)mDirectory->Get( ChooseCycleNumber( HistoName("hEdgeOverlay", order), 1) );
|
---|
852 |
|
---|
853 | if (mVerbosityLevel > 3) cout << "\t...loading " << HistoName("hMaxProfile", order) << endl;
|
---|
854 | hMaxProfile[order] = (TProfile*)mDirectory->Get( ChooseCycleNumber( HistoName("hMaxProfile", order), 1) );
|
---|
855 |
|
---|
856 | if (mVerbosityLevel > 3) cout << "\t...loading " << HistoName("hEdgeProfile", order) << endl;
|
---|
857 | hEdgeProfile[order] = (TProfile*)mDirectory->Get( ChooseCycleNumber( HistoName("hEdgeProfile", order), 1) );
|
---|
858 |
|
---|
859 |
|
---|
860 | }
|
---|
861 | // mPixelOverlayXaxisRight =70; ///TODO: get it from the root file
|
---|
862 | // mPixelOverlayXaxisLeft =230; ///TODO: get it from the root file
|
---|
863 | // mBSLMean =-2; ///TODO: get it from the root file
|
---|
864 | // mGainMean =11; ///TODO: get it from the root file
|
---|
865 | // mOptions ="SRM"; ///TODO: get it from the root file
|
---|
866 |
|
---|
867 | // mPixelOverlayXaxisRight = hEdgeOverlay[0]->GetXaxis()->GetBinLowEdge(
|
---|
868 | // hEdgeOverlay[0]->GetXaxis()->GetFirst()
|
---|
869 | // );
|
---|
870 |
|
---|
871 | // mPixelOverlayXaxisLeft = hEdgeOverlay[0]->GetXaxis()->GetBinUpEdge(
|
---|
872 | // hEdgeOverlay[0]->GetXaxis()->GetLast()
|
---|
873 | // );
|
---|
874 |
|
---|
875 | mPixelOverlayXaxisLeft = hEdgeOverlay[0]->GetBinCenter(
|
---|
876 | hEdgeOverlay[0]->GetXaxis()->GetFirst()
|
---|
877 | );
|
---|
878 |
|
---|
879 | mPixelOverlayXaxisLeft *= -1;
|
---|
880 |
|
---|
881 | mPixelOverlayXaxisRight = hEdgeOverlay[0]->GetBinCenter(
|
---|
882 | hEdgeOverlay[0]->GetXaxis()->GetLast()
|
---|
883 | );
|
---|
884 |
|
---|
885 | }
|
---|
886 | // end of LoadPulseHistos
|
---|
887 | //----------------------------------------------------------------------------
|
---|
888 |
|
---|
889 | void
|
---|
890 | Pixel::DeletePixelHistos()
|
---|
891 | {
|
---|
892 | if (mVerbosityLevel > 2)
|
---|
893 | {
|
---|
894 | cout << endl
|
---|
895 | << endl
|
---|
896 | << "\t...delete current overlay histograms of Pixel# " << mChid;
|
---|
897 | }
|
---|
898 | for (int order = 0;
|
---|
899 | order < mMaxPulseOrder;
|
---|
900 | order ++)
|
---|
901 | {
|
---|
902 | if (mVerbosityLevel > 3)
|
---|
903 | cout << endl << "\t\t...deleting hMaxOverlay"
|
---|
904 | << mChid << "_" << order;
|
---|
905 |
|
---|
906 | delete hMaxOverlay[order];
|
---|
907 | hMaxOverlay[order] = NULL;
|
---|
908 |
|
---|
909 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hEdgeOverlay"
|
---|
910 | << mChid << "_" << order ;
|
---|
911 | delete hEdgeOverlay[order];
|
---|
912 | hEdgeOverlay[order] = NULL;
|
---|
913 |
|
---|
914 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hMaxProfile"
|
---|
915 | << mChid << "_" << order ;
|
---|
916 | delete hMaxProfile[order];
|
---|
917 | hMaxProfile[order] = NULL;
|
---|
918 |
|
---|
919 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hMaxProfile2"
|
---|
920 | << mChid << "_" << order ;
|
---|
921 | delete hEdgeProfile[order];
|
---|
922 | hEdgeProfile[order] = NULL;
|
---|
923 | }
|
---|
924 | if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays";
|
---|
925 |
|
---|
926 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hMaxOverlay";
|
---|
927 | delete[] hMaxOverlay;
|
---|
928 | hMaxOverlay = NULL;
|
---|
929 |
|
---|
930 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hEdgeOverlay";
|
---|
931 | delete[] hEdgeOverlay;
|
---|
932 | hEdgeOverlay = NULL;
|
---|
933 |
|
---|
934 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hMaxProfile";
|
---|
935 | delete[] hMaxProfile;
|
---|
936 | hMaxProfile = NULL;
|
---|
937 |
|
---|
938 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hEdgeProfile";
|
---|
939 | delete[] hEdgeProfile;
|
---|
940 | hEdgeProfile = NULL;
|
---|
941 | }
|
---|
942 | // end of DeletePixelHistos
|
---|
943 | //----------------------------------------------------------------------------
|
---|
944 |
|
---|
945 | void
|
---|
946 | Pixel::DeleteDistributionHistos()
|
---|
947 | {
|
---|
948 | if (mVerbosityLevel > 2)
|
---|
949 | {
|
---|
950 | cout << endl
|
---|
951 | << "\t...delete current distribution histograms" ;
|
---|
952 | }
|
---|
953 |
|
---|
954 | for (int order = 0;
|
---|
955 | order < mMaxPulseOrder;
|
---|
956 | order ++)
|
---|
957 | {
|
---|
958 | if (mOptions.Contains("S"))
|
---|
959 | {
|
---|
960 | if (mVerbosityLevel > 3) cout << endl
|
---|
961 | << "\t\t...deleting hSlopeRisingEdge"
|
---|
962 | << mChid << "_" << order ;
|
---|
963 | delete hSlopeRisingEdge[order];
|
---|
964 | }
|
---|
965 |
|
---|
966 | if (mOptions.Contains("R"))
|
---|
967 | {
|
---|
968 | if (mVerbosityLevel > 3) cout << endl
|
---|
969 | << "\t\t...deleting hRisingEdgeToMax"
|
---|
970 | << mChid << "_" << order ;
|
---|
971 | delete hRisingEdgeToMax[order];
|
---|
972 | }
|
---|
973 |
|
---|
974 | if (mOptions.Contains("M"))
|
---|
975 | {
|
---|
976 | if (mVerbosityLevel > 3) cout << endl
|
---|
977 | << "\t\t...deleting hPosOfMax"
|
---|
978 | << mChid << "_" << order ;
|
---|
979 |
|
---|
980 | delete hPosOfMax[order];
|
---|
981 | }
|
---|
982 |
|
---|
983 | }
|
---|
984 | if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays";
|
---|
985 |
|
---|
986 | if (mOptions.Contains("S"))
|
---|
987 | {
|
---|
988 | if (mVerbosityLevel > 3)
|
---|
989 | cout << endl << "\t\t...deleting hSlopeRisingEdge";
|
---|
990 | delete[] hSlopeRisingEdge;
|
---|
991 | hSlopeRisingEdge = NULL;
|
---|
992 | }
|
---|
993 |
|
---|
994 | if (mOptions.Contains("R"))
|
---|
995 | {
|
---|
996 | if (mVerbosityLevel > 3)
|
---|
997 | cout << endl << "\t\t...deleting hRisingEdgeToMax";
|
---|
998 | delete[] hRisingEdgeToMax;
|
---|
999 | hRisingEdgeToMax = NULL;
|
---|
1000 | }
|
---|
1001 |
|
---|
1002 | if (mOptions.Contains("M"))
|
---|
1003 | {
|
---|
1004 | if (mVerbosityLevel > 3)
|
---|
1005 | cout << endl << "\t\t...deleting hPosOfMax";
|
---|
1006 | delete[] hPosOfMax;
|
---|
1007 | hPosOfMax = NULL;
|
---|
1008 | }
|
---|
1009 | }
|
---|
1010 | // end of DeletePixelHistos
|
---|
1011 | //----------------------------------------------------------------------------
|
---|
1012 |
|
---|
1013 | void
|
---|
1014 | Pixel::DeleteTemplateHistos()
|
---|
1015 | {
|
---|
1016 | if (mVerbosityLevel > 2)
|
---|
1017 | {
|
---|
1018 | cout << endl
|
---|
1019 | << "\t...delete current template histograms of Pixel# " << mChid;
|
---|
1020 | }
|
---|
1021 | for (int order = 0;
|
---|
1022 | order < mMaxPulseOrder;
|
---|
1023 | order ++)
|
---|
1024 | {
|
---|
1025 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMean"
|
---|
1026 | << mChid << "_" << order ;
|
---|
1027 | delete hPixelMean[order];
|
---|
1028 | hPixelMean[order] = NULL;
|
---|
1029 |
|
---|
1030 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMedian"
|
---|
1031 | << mChid << "_" << order ;
|
---|
1032 | delete hPixelMedian[order];
|
---|
1033 | hPixelMedian[order] = NULL;
|
---|
1034 |
|
---|
1035 | if (mVerbosityLevel > 3)
|
---|
1036 | cout << endl << "\t\t...deleting hPixelMax"
|
---|
1037 | << mChid << "_" << order;
|
---|
1038 | delete hPixelMax[order];
|
---|
1039 | hPixelMax[order] = NULL;
|
---|
1040 |
|
---|
1041 | }
|
---|
1042 | if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays";
|
---|
1043 |
|
---|
1044 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMax";
|
---|
1045 | delete[] hPixelMax;
|
---|
1046 | hPixelMax = NULL;
|
---|
1047 |
|
---|
1048 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMedian";
|
---|
1049 | delete[] hPixelMedian;
|
---|
1050 | hPixelMedian = NULL;
|
---|
1051 |
|
---|
1052 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMean";
|
---|
1053 | delete[] hPixelMean;
|
---|
1054 | hPixelMean = NULL;
|
---|
1055 | }
|
---|
1056 | // end of DeleteTemplateHistos
|
---|
1057 | //----------------------------------------------------------------------------
|
---|
1058 |
|
---|
1059 | void
|
---|
1060 | Pixel::DeleteEdgeTemplateHistos()
|
---|
1061 | {
|
---|
1062 | if (mVerbosityLevel > 2)
|
---|
1063 | {
|
---|
1064 | cout << endl
|
---|
1065 | << "\t...delete current Edge template histograms of Pixel# " << mChid;
|
---|
1066 | }
|
---|
1067 | for (int order = 0;
|
---|
1068 | order < mMaxPulseOrder;
|
---|
1069 | order ++)
|
---|
1070 | {
|
---|
1071 | if (mVerbosityLevel > 3)
|
---|
1072 | cout << endl << "\t\t...deleting hPixelEdgeMax"
|
---|
1073 | << mChid << "_" << order;
|
---|
1074 |
|
---|
1075 | delete hPixelEdgeMax[order];
|
---|
1076 | hPixelEdgeMax[order] = NULL;
|
---|
1077 |
|
---|
1078 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMedian"
|
---|
1079 | << mChid << "_" << order ;
|
---|
1080 | delete hPixelEdgeMedian[order];
|
---|
1081 | hPixelEdgeMedian[order] = NULL;
|
---|
1082 |
|
---|
1083 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMean"
|
---|
1084 | << mChid << "_" << order ;
|
---|
1085 | delete hPixelEdgeMean[order];
|
---|
1086 | hPixelEdgeMean[order] = NULL;
|
---|
1087 |
|
---|
1088 | }
|
---|
1089 | if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays";
|
---|
1090 |
|
---|
1091 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMax";
|
---|
1092 | delete[] hPixelEdgeMax;
|
---|
1093 | hPixelEdgeMax = NULL;
|
---|
1094 |
|
---|
1095 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMedian";
|
---|
1096 | delete[] hPixelEdgeMedian;
|
---|
1097 | hPixelEdgeMedian = NULL;
|
---|
1098 |
|
---|
1099 | if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMean";
|
---|
1100 | delete[] hPixelEdgeMean;
|
---|
1101 | hPixelEdgeMean = NULL;
|
---|
1102 | }
|
---|
1103 | // end of DeleteTemplateHistos
|
---|
1104 | //----------------------------------------------------------------------------
|
---|
1105 |
|
---|
1106 | void
|
---|
1107 | Pixel::MakeTH1Pretty(
|
---|
1108 | TH1* histo,
|
---|
1109 | TString histName,
|
---|
1110 | TString histTitle,
|
---|
1111 | int order
|
---|
1112 | )
|
---|
1113 | {
|
---|
1114 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName(histName, order) << endl;
|
---|
1115 |
|
---|
1116 | histo->SetNameTitle(
|
---|
1117 | HistoName(histName, order),
|
---|
1118 | HistoTitle(histTitle, order)
|
---|
1119 | );
|
---|
1120 |
|
---|
1121 | histo->SetBins(
|
---|
1122 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
1123 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
1124 | mPixelOverlayXaxisRight-0.5
|
---|
1125 | );
|
---|
1126 |
|
---|
1127 | histo->SetAxisRange(
|
---|
1128 | mBSLMean - 5,
|
---|
1129 | (mGainMean*(order+1)) + 10,
|
---|
1130 | "Y");
|
---|
1131 | histo->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
1132 | histo->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
1133 | //histo->SetBit(TH2F::kCanRebin);
|
---|
1134 | histo->SetStats(mStats);
|
---|
1135 | }
|
---|
1136 | // end of MakeTH2Pretty
|
---|
1137 | //----------------------------------------------------------------------------
|
---|
1138 |
|
---|
1139 |
|
---|
1140 | void
|
---|
1141 | Pixel::MakeTH2Pretty(
|
---|
1142 | TH2* histo,
|
---|
1143 | TString histName,
|
---|
1144 | TString histTitle,
|
---|
1145 | int order
|
---|
1146 | )
|
---|
1147 | {
|
---|
1148 | if (mVerbosityLevel > 3) cout << "\t...designing " << HistoName(histName, order) << endl;
|
---|
1149 |
|
---|
1150 | histo->SetNameTitle(
|
---|
1151 | HistoName(histName, order),
|
---|
1152 | HistoTitle(histTitle, order)
|
---|
1153 | );
|
---|
1154 |
|
---|
1155 | histo->SetBins(
|
---|
1156 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
1157 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
1158 | mPixelOverlayXaxisRight-0.5 ,
|
---|
1159 | 512,
|
---|
1160 | -55.5,
|
---|
1161 | 200.5
|
---|
1162 | );
|
---|
1163 |
|
---|
1164 | histo->SetAxisRange(
|
---|
1165 | mBSLMean - 5,
|
---|
1166 | (mGainMean*(order+1)) + 10,
|
---|
1167 | "Y");
|
---|
1168 |
|
---|
1169 | histo->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
1170 | histo->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
1171 | //histo->SetBit(TH2F::kCanRebin);
|
---|
1172 | histo->SetStats(mStats);
|
---|
1173 | }
|
---|
1174 | // end of MakeTH2Pretty
|
---|
1175 | //----------------------------------------------------------------------------
|
---|
1176 |
|
---|
1177 | void
|
---|
1178 | Pixel::MakeTProfilePretty(
|
---|
1179 | TProfile* histo,
|
---|
1180 | TString histName,
|
---|
1181 | TString histTitle,
|
---|
1182 | int order
|
---|
1183 | )
|
---|
1184 | {
|
---|
1185 | if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName(histName, order) << endl;
|
---|
1186 |
|
---|
1187 | histo->SetNameTitle(
|
---|
1188 | HistoName(histName, order),
|
---|
1189 | HistoTitle(histTitle, order)
|
---|
1190 | );
|
---|
1191 |
|
---|
1192 | histo->SetBins(
|
---|
1193 | mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
|
---|
1194 | (-1*mPixelOverlayXaxisLeft)-0.5,
|
---|
1195 | mPixelOverlayXaxisRight-0.5
|
---|
1196 | );
|
---|
1197 | histo->SetOption( "s" );
|
---|
1198 |
|
---|
1199 | histo->SetAxisRange(
|
---|
1200 | mBSLMean - 5,
|
---|
1201 | (mGainMean*(order+1)) + 10,
|
---|
1202 | "Y");
|
---|
1203 |
|
---|
1204 | histo->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
|
---|
1205 | histo->GetYaxis()->SetTitle( "Amplitude [mV]" );
|
---|
1206 | //histo->SetBit(TH2F::kCanRebin);
|
---|
1207 | histo->SetStats(mStats);
|
---|
1208 | }
|
---|
1209 | // end of MakeTProfilePretty
|
---|
1210 | //----------------------------------------------------------------------------
|
---|
1211 |
|
---|
1212 |
|
---|
1213 | void
|
---|
1214 | Pixel::ShiftHistoInY(
|
---|
1215 | TH1* histo,
|
---|
1216 | float shift
|
---|
1217 | )
|
---|
1218 | {
|
---|
1219 | int min_bin = histo->GetXaxis()->GetFirst();
|
---|
1220 | int max_bin = histo->GetXaxis()->GetLast();
|
---|
1221 |
|
---|
1222 | for (int bin = min_bin; bin <= max_bin; bin++)
|
---|
1223 | {
|
---|
1224 | histo->AddBinContent( bin, shift);
|
---|
1225 | }
|
---|
1226 |
|
---|
1227 | }
|
---|
1228 |
|
---|
1229 |
|
---|