source: fact/tools/rootmacros/PulseTemplates/pixel.C@ 13602

Last change on this file since 13602 was 13597, checked in by Jens Buss, 13 years ago
DrawHistograms changed to DrawOverlayHistograms, added function for drawing template histograms
File size: 24.6 KB
Line 
1#include <iostream>
2#include "TObjArray.h"
3#include "TCanvas.h"
4
5#include "rootfilehandler.h"
6#include "pixel.h" // class implemented
7using namespace std;
8
9/////////////////////////////// PUBLIC ///////////////////////////////////////
10
11//============================= LIFECYCLE ====================================
12
13Pixel::Pixel(
14 int pixelID,
15 int maxPulsorder,
16 int verbosityLevel,
17 bool stats,
18 TFile* filename
19 )
20{
21 mConstructorType = 1;
22 mChid = pixelID;
23 mStats = stats;
24 mMaxPulseOrder = maxPulsorder;
25 mVerbosityLevel = verbosityLevel;
26 mRootFile = filename;
27
28 hMaxOverlay = new TH2F*[mMaxPulseOrder];
29 hEdgeOverlay = new TH2F*[mMaxPulseOrder];
30 hMaxProfile = new TProfile*[mMaxPulseOrder];
31 hEdgeProfile = new TProfile*[mMaxPulseOrder];
32
33 hPixelMax = new TH1F*[mMaxPulseOrder];
34 hPixelMedian = new TH1F*[mMaxPulseOrder];
35 hPixelMean = new TH1F*[mMaxPulseOrder];
36
37 hList = new TObjArray;
38
39 LoadPulseHistos( );
40 BookTemplateHistos();
41}
42
43Pixel::Pixel(
44 int pixelID,
45 int maxPulsorder,
46 int verbosityLevel,
47 bool stats,
48 TFile* filename,
49 int pixelOverlayXaxisLeft,
50 int pixelOverlayXaxisRight,
51 int bSLMean,
52 int gainMean,
53 TString options
54 )
55{
56 mConstructorType = 0;
57 mChid = pixelID;
58 mStats = stats; ///TODO: HANDOVER THE VALUE
59 mMaxPulseOrder = maxPulsorder;
60 mVerbosityLevel = verbosityLevel;
61 mOptions = options;
62 mPixelOverlayXaxisLeft = pixelOverlayXaxisLeft;
63 mPixelOverlayXaxisRight = pixelOverlayXaxisRight;
64 mBSLMean = bSLMean;
65 mGainMean = gainMean;
66 mRootFile = filename;
67
68 hMaxOverlay = new TH2F*[mMaxPulseOrder];
69 hEdgeOverlay = new TH2F*[mMaxPulseOrder];
70 hMaxProfile = new TProfile*[mMaxPulseOrder];
71 hEdgeProfile = new TProfile*[mMaxPulseOrder];
72
73 if (mOptions.Contains("S") )
74 {
75 hSlopeRisingEdge = new TH1F*[mMaxPulseOrder];
76 }
77
78 if (mOptions.Contains("R") )
79 {
80 hRisingEdgeToMax = new TH1I*[mMaxPulseOrder];
81 }
82
83 if (mOptions.Contains("M") )
84 {
85 hPosOfMax = new TH1I*[mMaxPulseOrder];
86 }
87
88 hList = new TObjArray;
89
90 BookPixelHistos();
91 BookDistributionHistos();
92}
93
94Pixel::~Pixel()
95{
96 if (mVerbosityLevel > 1) cout << endl << "...delete histograms of pixel " << mChid ;
97
98 DeletePixelHistos();
99 if (mConstructorType == 0)
100 {
101 DeleteDistributionHistos();
102 }
103
104 if (mConstructorType == 1)
105 {
106 DeleteTemplateHistos();
107 }
108 delete hList;
109 hList = NULL;
110
111}// ~Pixel
112
113
114//============================= OPERATORS ====================================
115
116//XX&
117//XX::operator=(const XX&);
118//{
119// return *this;
120
121//}// =
122
123//============================= OPERATIONS ===================================
124void
125Pixel::BookPixelHistos()
126{
127 if (mVerbosityLevel > 2) cout << endl << "...book pixel histograms" << endl;
128 for (int order = 0; order < mMaxPulseOrder; order++)
129 {
130 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hMaxOverlay", order) << endl;
131 hMaxOverlay[order]=new TH2F(
132 HistoName("hMaxOverlay", order),
133 HistoTitle("Overlay at peak maximum of detected pulses of", order),
134 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
135 (-1*mPixelOverlayXaxisLeft)-0.5,
136 mPixelOverlayXaxisRight-0.5 ,
137 512,
138 -55.5,
139 200.5
140 );
141
142 hMaxOverlay[order]->SetAxisRange(
143 mBSLMean - 5,
144 (mGainMean*(order+1)) + 10,
145 "Y");
146 hMaxOverlay[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
147 hMaxOverlay[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
148 //hMaxProfile->SetBit(TH2F::kCanRebin);
149 hMaxOverlay[order]->SetStats(mStats);
150 hList->Add( hMaxOverlay[order] );
151
152//------------------------------------------------------------------------
153
154 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hEdgeOverlay", order) << endl;
155 hEdgeOverlay[order] = new TH2F(
156 HistoName("hEdgeOverlay", order),
157 HistoTitle("Overlay at rising edge of detected pulses of", order),
158 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
159 (-1*mPixelOverlayXaxisLeft)-0.5,
160 mPixelOverlayXaxisRight-0.5 ,
161 512,
162 -55.5,
163 200.5
164 );
165
166 hEdgeOverlay[order]->SetAxisRange(
167 mBSLMean - 5,
168 (mGainMean*(order+1)) + 10,
169 "Y");
170 hEdgeOverlay[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
171 hEdgeOverlay[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
172 hEdgeOverlay[order]->SetStats(mStats);
173 hList->Add( hEdgeOverlay[order] );
174
175 //------------------------------------------------------------------------
176
177 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hMaxProfile", order) << endl;
178 hMaxProfile[order] = new TProfile(
179 HistoName("hMaxProfile", order),
180 HistoTitle("Mean value of each slice in overlay plot (Tprofile)", order),
181 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx
182 (-1*mPixelOverlayXaxisLeft)-0.5, //xlow
183 mPixelOverlayXaxisRight-0.5 , //xup
184 // 512, //nbinsy
185 -55.5, //ylow
186 300.5, //yup
187 "s"); //option
188 hMaxProfile[order]->SetAxisRange(
189 mBSLMean - 5,
190 (mGainMean*(order+1)) + 10,
191 "Y");
192 hMaxProfile[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
193 hMaxProfile[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
194 //hMaxProfile->SetBit(TH2F::kCanRebin);
195 hMaxProfile[order]->SetStats(mStats);
196 hList->Add( hMaxProfile[order] );
197
198
199 //------------------------------------------------------------------------
200
201 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hEdgeProfile", order) << endl;
202 hEdgeProfile[order] = new TProfile(
203 HistoName("hEdgeProfile", order),
204 HistoTitle("Mean value of each slice in overlay plot (Tprofile)", order),
205 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx
206 (-1*mPixelOverlayXaxisLeft)-0.5, //xlow
207 mPixelOverlayXaxisRight-0.5 , //xup
208 // 512, //nbinsy
209 -55.5, //ylow
210 300.5, //yup
211 "s"); //option
212 hEdgeProfile[order]->SetLineColor(kRed);
213 hEdgeProfile[order]->SetAxisRange(
214 mBSLMean - 5,
215 (mGainMean*(order+1)) + 10,
216 "Y");
217 hEdgeProfile[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
218 hEdgeProfile[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
219 //hMaxProfile->SetBit(TH2F::kCanRebin);
220 hEdgeProfile[order]->SetStats(mStats);
221 hList->Add( hEdgeProfile[order] );
222
223 }
224 if (mVerbosityLevel > 2) cout << "...done" << endl;
225}
226//end of BookPixelHistos
227//----------------------------------------------------------------------------
228
229void
230Pixel::BookDistributionHistos( )
231{
232 if (!mOptions.IsNull() )
233 {
234 int x_min = 0;
235 int x_max = 0;
236
237 for (int order =0; order < mMaxPulseOrder; order++)
238 {
239 if (mVerbosityLevel > 2) cout << endl
240 << "...book distribution histograms"
241 << endl;
242
243 if (mOptions.Contains("S"))
244 {
245 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hSlopeRisingEdge", order) << endl;
246 hSlopeRisingEdge[order] = new TH1F (
247 HistoName("hSlopeRisingEdge", order),
248 HistoTitle("Distribution of rising edge's slope", order),
249 600,
250 -10.1,
251 10.1
252 );
253 hSlopeRisingEdge[order]->SetAxisRange(
254 -1,
255 7,
256 "X");
257 hSlopeRisingEdge[order]->GetXaxis()->SetTitle( "Slope Amplitude/time [mV/timeslices]" );
258 hSlopeRisingEdge[order]->GetYaxis()->SetTitle( "counts" );
259 hSlopeRisingEdge[order]->SetStats(mStats);
260 hList->Add( hSlopeRisingEdge[order] );
261 }
262
263 if (mOptions.Contains("R"))
264 {
265 x_min = -15;
266 x_max = 35;
267
268 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hRisingEdgeToMax", order) << endl;
269 hRisingEdgeToMax[order] = new TH1I (
270 HistoName("hRisingEdgeToMax", order),
271 HistoTitle("Distribution of distance between rising edge and pulse's maximum", order),
272 x_max -x_min,
273 x_min,
274 x_max
275 );
276 hSlopeRisingEdge[order]->SetAxisRange(
277 -5,
278 25,
279 "X");
280 hRisingEdgeToMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
281 hRisingEdgeToMax[order]->GetYaxis()->SetTitle( "counts" );
282 hRisingEdgeToMax[order]->SetStats(mStats);
283 hList->Add( hRisingEdgeToMax[order] );
284 }
285
286 if (mOptions.Contains("M"))
287 {
288 x_min = 10;
289 x_max = 290;
290 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPosOfMax", order) << endl;
291 hPosOfMax[order] = new TH1I (
292 HistoName("hPosOfMax", order),
293 HistoTitle("Distribution of pulse's maximum's positon", order),
294 x_max - x_min,
295 x_min,
296 x_max
297 );
298 hPosOfMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
299 hPosOfMax[order]->GetYaxis()->SetTitle( "counts" );
300 hRisingEdgeToMax[order]->SetStats(mStats);
301 hList->Add( hPosOfMax[order] );
302 }
303
304 if (mVerbosityLevel > 2) cout << "...done" << endl;
305 }
306 }
307}
308//end of BookDistributionHistos
309//----------------------------------------------------------------------------
310
311void
312Pixel::BookTemplateHistos()
313{
314 if (mVerbosityLevel > 2) cout << endl << "...book pixel histograms" << endl;
315 for (int order = 0; order < mMaxPulseOrder; order++)
316 {
317 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelMax", order) << endl;
318 hPixelMax[order]=new TH1F(
319 HistoName("hPixelMax", order),
320 HistoTitle("Maximum value of each slice in overlay plot of", order),
321 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
322 (-1*mPixelOverlayXaxisLeft)-0.5,
323 mPixelOverlayXaxisRight-0.5
324 );
325
326 hPixelMax[order]->SetAxisRange(
327 mBSLMean - 5,
328 (mGainMean*(order+1)) + 10,
329 "Y");
330 hPixelMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
331 hPixelMax[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
332 //hMaxProfile->SetBit(TH2F::kCanRebin);
333 hPixelMax[order]->SetStats(mStats);
334 hList->Add( hPixelMax[order] );
335
336//------------------------------------------------------------------------
337
338 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelMean", order) << endl;
339 hPixelMean[order] = new TH1F(
340 HistoName("hPixelMean", order),
341 HistoTitle("Mean value of each slice in overlay plot of", order),
342 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,
343 (-1*mPixelOverlayXaxisLeft)-0.5,
344 mPixelOverlayXaxisRight-0.5
345 );
346 hPixelMean[order]->SetLineColor(kBlue);
347 hPixelMean[order]->SetAxisRange(
348 mBSLMean - 5,
349 (mGainMean*(order+1)) + 10,
350 "Y");
351 hPixelMean[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
352 hPixelMean[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
353 hPixelMean[order]->SetStats(mStats);
354 hList->Add( hPixelMean[order] );
355
356 //------------------------------------------------------------------------
357
358 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelMedian", order) << endl;
359 hPixelMedian[order] = new TH1F(
360 HistoName("hPixelMedian", order),
361 HistoTitle("Median value of each slice in overlay plot of", order),
362 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx
363 (-1*mPixelOverlayXaxisLeft)-0.5, //xlow
364 mPixelOverlayXaxisRight-0.5 //xup
365 );
366 hPixelMedian[order]->SetLineColor(kRed);
367 hPixelMedian[order]->SetAxisRange(
368 mBSLMean - 5,
369 (mGainMean*(order+1)) + 10,
370 "Y");
371 hPixelMedian[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" );
372 hPixelMedian[order]->GetYaxis()->SetTitle( "Amplitude [mV]" );
373 //hMaxProfile->SetBit(TH2F::kCanRebin);
374 hPixelMedian[order]->SetStats(mStats);
375 hList->Add( hPixelMedian[order] );
376
377 }
378 if (mVerbosityLevel > 2) cout << "...done" << endl;
379}
380//end of BookTemplateHistos
381//----------------------------------------------------------------------------
382
383
384void
385Pixel::DrawOverlayHistograms(
386 TCanvas** pixelCanvas,
387 int* histoFrameNr
388 )
389{
390 if (mVerbosityLevel > 2) cout << endl << "...drawing pulse histograms" ;
391 for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++)
392 {
393 pixelCanvas[pulse_order]->cd( histoFrameNr[0] );
394 hMaxOverlay[pulse_order]->Draw("COLZ");
395 pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
396 hMaxProfile[pulse_order]->Draw();
397 hEdgeProfile[pulse_order]->Draw("SAME");
398
399 pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
400 hEdgeOverlay[pulse_order]->Draw("COLZ");
401 }
402}
403// end of DrawOverlayHistograms
404//----------------------------------------------------------------------------
405
406void
407Pixel::DrawDistributionHistograms(
408 TCanvas** pixelCanvas,
409 int* histoFrameNr
410 )
411{
412 if (mVerbosityLevel > 2) cout << endl << "...drawing distribution histograms" ;
413 bool nothing_to_fill = true;
414 for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++)
415 {
416 if (mOptions.Contains("S") )
417 {
418 pixelCanvas[pulse_order]->cd( histoFrameNr[0] );
419 hSlopeRisingEdge[pulse_order]->Draw();
420 nothing_to_fill = false;
421 }
422
423 if (mOptions.Contains("R") )
424 {
425 pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
426 hRisingEdgeToMax[pulse_order]->Draw();
427 nothing_to_fill = false;
428 }
429
430 if (mOptions.Contains("M") )
431 {
432 pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
433 hPosOfMax[pulse_order]->Draw();
434 nothing_to_fill = false;
435 }
436
437 }
438 if (nothing_to_fill)
439 {
440 cout << endl << "there were NO DISTRIBUTION HISTOGRAMS to fill" << endl;
441 }
442}
443// end of DrawDistributionHistograms
444//----------------------------------------------------------------------------
445
446void
447Pixel::DrawTemplateHistograms(
448 TCanvas** pixelCanvas,
449 int* histoFrameNr
450 )
451{
452 if (mVerbosityLevel > 2) cout << endl << "...drawing Template histograms" ;
453 for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++)
454 {
455 pixelCanvas[pulse_order]->cd( histoFrameNr[0] );
456 hPixelMax[pulse_order]->Draw();
457
458 pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
459 hPixelMedian[pulse_order]->Draw();
460
461 pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
462 hPixelMean[pulse_order]->Draw();
463
464 }
465}
466// end of DrawTemplateHistograms
467//----------------------------------------------------------------------------
468
469void
470Pixel::DeletePixelHistos()
471{
472 if (mVerbosityLevel > 2)
473 {
474 cout << endl
475 << "\t...delete current overlay histograms of Pixel# " << mChid;
476 }
477 for (int order = 0;
478 order < mMaxPulseOrder;
479 order ++)
480 {
481 if (mVerbosityLevel > 3)
482 cout << endl << "\t\t...deleting hMaxOverlay"
483 << mChid << "_" << order
484 << " hMaxOverlay[order] adr " << hMaxOverlay[order]
485 << " hMaxOverlay adr " << hMaxOverlay
486 ;
487
488 delete hMaxOverlay[order];
489 hMaxOverlay[order] = NULL;
490
491 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hEdgeOverlay"
492 << mChid << "_" << order ;
493 delete hEdgeOverlay[order];
494 hEdgeOverlay[order] = NULL;
495
496 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hMaxProfile"
497 << mChid << "_" << order ;
498 delete hMaxProfile[order];
499 hMaxProfile[order] = NULL;
500
501 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hMaxProfile2"
502 << mChid << "_" << order ;
503 delete hEdgeProfile[order];
504 hEdgeProfile[order] = NULL;
505 }
506 if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays";
507
508 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hMaxOverlay";
509 delete[] hMaxOverlay;
510 hMaxOverlay = NULL;
511
512 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hEdgeOverlay";
513 delete[] hEdgeOverlay;
514 hEdgeOverlay = NULL;
515
516 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hMaxProfile";
517 delete[] hMaxProfile;
518 hMaxProfile = NULL;
519
520 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hEdgeProfile";
521 delete[] hEdgeProfile;
522 hEdgeProfile = NULL;
523}
524// end of DeletePixelHistos
525//----------------------------------------------------------------------------
526
527void
528Pixel::DeleteDistributionHistos()
529{
530 if (mVerbosityLevel > 2)
531 {
532 cout << endl
533 << "\t...delete current distribution histograms" ;
534 }
535
536 for (int order = 0;
537 order < mMaxPulseOrder;
538 order ++)
539 {
540 if (mOptions.Contains("S"))
541 {
542 if (mVerbosityLevel > 3) cout << endl
543 << "\t\t...deleting hSlopeRisingEdge"
544 << mChid << "_" << order ;
545 delete hSlopeRisingEdge[order];
546 }
547
548 if (mOptions.Contains("R"))
549 {
550 if (mVerbosityLevel > 3) cout << endl
551 << "\t\t...deleting hRisingEdgeToMax"
552 << mChid << "_" << order ;
553// delete hRisingEdgeToMax[order];
554 }
555
556 if (mOptions.Contains("M"))
557 {
558 if (mVerbosityLevel > 3) cout << endl
559 << "\t\t...deleting hPosOfMax"
560 << mChid << "_" << order ;
561
562// delete hPosOfMax[order];
563 }
564
565 }
566 if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays";
567
568 if (mOptions.Contains("S"))
569 {
570 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hSlopeRisingEdge";
571 delete[] hSlopeRisingEdge;
572 hSlopeRisingEdge = NULL;
573 }
574
575 if (mOptions.Contains("R"))
576 {
577 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hRisingEdgeToMax";
578 delete[] hRisingEdgeToMax;
579 hRisingEdgeToMax = NULL;
580 }
581
582 if (mOptions.Contains("M"))
583 {
584 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPosOfMax";
585 delete[] hPosOfMax;
586 hPosOfMax = NULL;
587 }
588}
589// end of DeletePixelHistos
590//----------------------------------------------------------------------------
591
592void
593Pixel::DeleteTemplateHistos()
594{
595 if (mVerbosityLevel > 2)
596 {
597 cout << endl
598 << "\t...delete current template histograms of Pixel# " << mChid;
599 }
600 for (int order = 0;
601 order < mMaxPulseOrder;
602 order ++)
603 {
604 if (mVerbosityLevel > 3)
605 cout << endl << "\t\t...deleting hPixelMax"
606 << mChid << "_" << order
607 << " hPixelMax[order] adr " << hPixelMax[order]
608 << " hPixelMax adr " << hPixelMax
609 ;
610
611 delete hPixelMax[order];
612 hPixelMax[order] = NULL;
613
614 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMedian"
615 << mChid << "_" << order ;
616 delete hPixelMedian[order];
617 hPixelMedian[order] = NULL;
618
619 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMean"
620 << mChid << "_" << order ;
621 delete hPixelMean[order];
622 hPixelMean[order] = NULL;
623
624 }
625 if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays";
626
627 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMax";
628 delete[] hPixelMax;
629 hPixelMax = NULL;
630
631 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMedian";
632 delete[] hPixelMedian;
633 hPixelMedian = NULL;
634
635 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMean";
636 delete[] hPixelMean;
637 hPixelMean = NULL;
638}
639// end of DeleteTemplateHistos
640//----------------------------------------------------------------------------
641
642void
643Pixel::SavePixelHistograms(
644 const char* outRootFileName,
645 bool saveResults
646 )
647{
648 if (mVerbosityLevel > 2) cout << endl << "Saving histograms of Pixel# " << mChid;
649 if (!saveResults) return;
650 SaveHistograms(
651 outRootFileName,
652 CreateSubDirName( mChid ),
653 hList,
654 saveResults,
655 mVerbosityLevel
656 );
657}
658// end of SavePixelHistograms
659//----------------------------------------------------------------------------
660
661void
662Pixel::LoadPulseHistos()
663{
664 mRootFile->cd();
665 mRootFile->cd(CreateSubDirName( mChid ));
666 for (int order = 0; order < mMaxPulseOrder; order++)
667 {
668 hMaxOverlay[order] = (TH2F*)mRootFile->Get( HistoName("hMaxOverlay", order) );
669 hEdgeOverlay[order] = (TH2F*)mRootFile->Get( HistoName("hEdgeOverlay", order) );
670 hMaxProfile[order] = (TProfile*)mRootFile->Get( HistoName("hMaxProfile", order) );
671 hEdgeProfile[order] = (TProfile*)mRootFile->Get( HistoName("hEdgeProfile", order) );
672 }
673}
674// end of LoadPulseHistos
675//----------------------------------------------------------------------------
676
677TString
678Pixel::HistoName(
679 TString histoname,
680 int order
681 )
682{
683 histoname += mChid;
684 histoname += "_";
685 histoname += order;
686 return histoname;
687}
688
689TString
690Pixel::HistoTitle(
691 TString histo_title,
692 int order
693 )
694{
695 histo_title += " [Pixel_Order] ";
696 histo_title += mChid;
697 histo_title += "_";
698 histo_title += order;
699 return histo_title;
700}
701
702
703
704//============================= ACESS ===================================
705//============================= INQUIRY ===================================
706/////////////////////////////// PROTECTED ///////////////////////////////////
707
708/////////////////////////////// PRIVATE ///////////////////////////////////
709
710
711
712
713
714
715
716
Note: See TracBrowser for help on using the repository browser.