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