Changeset 12919
- Timestamp:
- 02/22/12 17:38:37 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/FPulseTemplate.C
r12742 r12919 13 13 *************************************************************/ 14 14 15 //---------------------------------------------------------------------------- -15 //---------------------------------------------------------------------------- 16 16 // root libraries 17 //---------------------------------------------------------------------------- -17 //---------------------------------------------------------------------------- 18 18 19 19 #include <TROOT.h> … … 41 41 #define HAVE_ZLIB 42 42 43 //---------------------------------------------------------------------------- -43 //---------------------------------------------------------------------------- 44 44 // rootmacros 45 //---------------------------------------------------------------------------- -45 //---------------------------------------------------------------------------- 46 46 47 47 #include "fits.h" … … 62 62 #include "SpikeRemoval.C" 63 63 64 //---------------------------------------------------------------------------- -64 //---------------------------------------------------------------------------- 65 65 // Decleration of global variables 66 //---------------------------------------------------------------------------- -66 //---------------------------------------------------------------------------- 67 67 68 68 bool breakout=false; 69 69 bool UseThisPeak=false; 70 70 int NEvents; 71 71 vector<int16_t> AllPixelDataVector; … … 75 75 UInt_t RegionOfInterest; 76 76 UInt_t NumberOfPixels; 77 TString histotitle; 77 78 78 79 size_t TriggerOffsetROI, RC; … … 92 93 float countOfMax; 93 94 } OverlayMaximum; 95 96 typedef struct{ 97 TString name; 98 TString title; 99 TString Mname; 100 TString Mtitle; 101 float yMax; 102 } hist_t; 103 104 hist_t histSetting[4]; 94 105 95 106 vector<OverlayMaximum> SingleMaximum; … … 106 117 Vcfd2_ = 6; 107 118 108 //---------------------------------------------------------------------------- -119 //---------------------------------------------------------------------------- 109 120 // Initialisation of histograms 110 //---------------------------------------------------------------------------- -111 112 TH1F* h ;113 TH1F *debugHistos ;121 //---------------------------------------------------------------------------- 122 123 TH1F* h= NULL; 124 TH1F *debugHistos= NULL; 114 125 TH2F *hOverlayTemp = NULL; 126 TH2F *hPeakOverlay[4];//histogrammm for overlay of detected Peaks 115 127 TH2F *hSinglePeakOverlay;//histogrammm for overlay of detected Peaks 116 128 TH2F *hDoublePeakOverlay; … … 119 131 120 132 TH1F *hMaximumTemp = NULL; 133 TH1F *hPeakMaximum[4]; 121 134 TH1F *hSinglePeakMaximum; 122 135 TH1F *hDoublePeakMaximum; 123 136 TH1F *hTripplePeakMaximum; 124 137 TH1F *hLargePeakMaximum; 125 126 int hPeakOverlayXaxisLeft,hPeakOverlayXaxisRight; 138 TH1D *hProjPeak = NULL; 139 int gPeakOverlayXaxisLeft; 140 int hPeakOverlayXaxisRight; 127 141 128 142 TObjArray hList; 129 143 TObjArray hListBaseline; 130 144 131 //---------------------------------------------------------------------------- -145 //---------------------------------------------------------------------------- 132 146 // Functions 133 //---------------------------------------------------------------------------- -147 //---------------------------------------------------------------------------- 134 148 135 149 void BookHistos( ); 136 150 void SaveHistograms( const char * ); 137 151 138 //---------------------------------------------------------------------------- -139 //---------------------------------------------------------------------------- -152 //---------------------------------------------------------------------------- 153 //---------------------------------------------------------------------------- 140 154 // MAIN - Funtion 141 //---------------------------------------------------------------------------- -142 //---------------------------------------------------------------------------- -155 //---------------------------------------------------------------------------- 156 //---------------------------------------------------------------------------- 143 157 int FPulseTemplate( 144 char *datafilename = "../data/2011/11/09/20111109_006.fits.gz", 145 const char *drsfilename = "../data/2011/11/09/20111109_003.drs.fits.gz", 146 const char *OutRootFileName = "../analysis/20111109_006.fits.gz.peaktypes.root", 147 int firstevent = 0, 148 int nevents = -1, 149 int firstpixel = 0, 150 int npixel = -1, 151 bool spikeDebug = false, 152 int avg1 = 14, 153 int avg2 = 8, 154 int OverlayWindowLeft = 50, 155 int OverlayWindowRight = 250, 156 int verbosityLevel = 1, // different verbosity levels can be implemented here 157 bool ProduceGraphic = true 158 ) 159 158 char* datafilename = "../data/2011/11/10/20111110_005.fits.gz", 159 const char* drsfilename = "../data/2011/11/10/20111110_003.drs.fits.gz", 160 const char* OutRootFileName = "../analysis/20111110_003.test.root", 161 bool ProduceGraphic = true, 162 bool spikeDebug = false, 163 bool fitdata = false, 164 int verbosityLevel = 1, // different verbosity levels can be implemented here 165 int firstevent = 0, 166 int nevents = -1, 167 int firstpixel = 400, 168 int npixel = 1, 169 int PintervalWidth = 5, 170 int PintervalMin = 8, 171 int PintervalMax = 32, //4 Histogramms will be drawn, decide how far pulsehights differ from eachother 172 int avg1 = 14, 173 int avg2 = 8, 174 int OverlayWindowLeft = 70, 175 int OverlayWindowRight = 230) 160 176 { 161 177 //----------------------------------------------------------------------------- … … 163 179 //----------------------------------------------------------------------------- 164 180 165 hPeakOverlayXaxisLeft = OverlayWindowLeft;181 gPeakOverlayXaxisLeft = OverlayWindowLeft; 166 182 hPeakOverlayXaxisRight = OverlayWindowRight; 167 183 … … 179 195 } 180 196 // Canvases to show the peak template 181 TCanvas *cPulsetypes = NULL; 182 cPulsetypes = new TCanvas("cPulsetypes", "Overlay of detected Peaks", 1, 1, 1400, 700); 183 cPulsetypes->Divide(4,2); 197 TCanvas *cPulsetypes = NULL; 198 cPulsetypes = new TCanvas("cPulsetypes", "Overlay of detected Peaks", 1, 1, 1400, 700); 199 cPulsetypes->Divide(4,2); 200 201 202 for (int stepper = 0; stepper < 4; stepper++){ 203 if (stepper == 0) histSetting[stepper].yMax = PintervalMin; 204 else if (stepper == 3) histSetting[stepper].yMax = PintervalMax; 205 else histSetting[stepper].yMax = ((PintervalMax-PintervalMin)*(stepper)/3)+PintervalMin; 206 cout << "Max @ " << histSetting[stepper].yMax << endl; 207 histSetting[stepper].name = "hPeakOverlay"; 208 histSetting[stepper].name += stepper; 209 histSetting[stepper].title = "PeakOverlay with Amplitude around "; 210 histSetting[stepper].title += histSetting[stepper].yMax; 211 histSetting[stepper].title += " mV"; 212 histSetting[stepper].Mname = "hPeakMaximum"; 213 histSetting[stepper].Mname += stepper; 214 histSetting[stepper].Mtitle = "Peak (approx) derived with Maximum of above Spektrum with Max of "; 215 histSetting[stepper].Mtitle += histSetting[stepper].yMax; 216 histSetting[stepper].Mtitle += " mV"; 217 } 184 218 185 219 //----------------------------------------------------------------------------- … … 246 280 for ( int pix = firstpixel; pix < firstpixel + npixel; pix++ ){ 247 281 if (verbosityLevel > 0){ 248 if (pix == firstpixel){ 249 cout << "Processing Event: " << CurrentEventID << "/" << nevents << endl; 282 cout << endl; 283 if (pix == firstpixel){ 284 cout << "...processing Event: " << CurrentEventID << "/" << nevents << endl; 285 } 250 286 } 251 } 252 287 288 //------------------------------------- 289 // Apply Filters 290 //------------------------------------- 291 cout << "...applying DrsCalibration"; 253 292 applyDrsCalibration( Ameas,pix,12,12, 254 293 drs_basemean, drs_gainmean, drs_triggeroffsetmean, 255 294 RegionOfInterest, AllPixelDataVector, StartCellVector); 295 cout << "...done " << endl; 256 296 257 297 // finds spikes in the raw data, and interpolates the value 258 298 // spikes are: 1 or 2 slice wide, positive non physical artifacts 299 cout << "...removeing Spikes"; 259 300 removeSpikes (Ameas, Vcorr); 260 301 cout << "...done " << endl; 261 302 // filter Vcorr with sliding average using FIR filter function 303 cout << "...applying sliding average filter"; 262 304 sliding_avg(Vcorr, Vslide, avg1); 305 cout << "...done " << endl; 263 306 // filter Vslide with CFD using FIR filter function 307 cout << "...apllying factfir filter"; 264 308 factfir(b_cfd , a_cfd, k_cfd, Vslide, Vcfd); 309 cout << "...done " << endl; 265 310 // filter Vcfd with sliding average using FIR filter function 311 cout << "...applying 2nd sliding average filter"; 266 312 sliding_avg(Vcfd, Vcfd2, avg2); 267 313 cout << "...done " << endl; 314 315 //------------------------------------- 316 // Search vor Zero crossings 317 //------------------------------------- 268 318 // peaks in Ameas[] are found by searching for zero crossings 269 319 // in Vcfd2 … … 292 342 if (Right > (int)Vcorr.size() ) 293 343 Right=Vcorr.size() ; 294 if (Vslide[it->maxPos] >= 5 && Vslide[it->maxPos] < 13) hOverlayTemp = &*hSinglePeakOverlay; 295 else if (Vslide[it->maxPos] >= 13 && Vslide[it->maxPos] < 23) hOverlayTemp = hDoublePeakOverlay; 296 else if (Vslide[it->maxPos] >= 23 && Vslide[it->maxPos] < 33) hOverlayTemp = hTripplePeakOverlay; 297 else if (Vslide[it->maxPos] >= 33) hOverlayTemp = hLargePeakOverlay; 298 299 for ( int pos = Left; pos < Right; pos++){ 300 // if (Vslide[it->maxPos] >= 5 && Vslide[it->maxPos] < 15) hSinglePeakOverlay->Fill( pos - (it->maxPos), Vslide[pos]); 301 // else if (Vslide[it->maxPos] >= 15 && Vslide[it->maxPos] < 25) hDoublePeakOverlay->Fill( pos - (it->maxPos), Vslide[pos]); 302 // else if (Vslide[it->maxPos] >= 25 && Vslide[it->maxPos] < 35) hTripplePeakOverlay->Fill( pos - (it->maxPos), Vslide[pos]); 303 // else if (Vslide[it->maxPos] >= 35) hOverlayTemp = hLargePeakOverlay; 304 hOverlayTemp->Fill( pos - (it->maxPos), Vslide[pos]) ; 344 345 cout << "...choosing Histogram" ; 346 for(int stepper = 0; stepper < 4; stepper++){ 347 if (Vslide[it->maxPos] >= (histSetting[stepper].yMax - (PintervalWidth/2)) && Vslide[it->maxPos] < (histSetting[stepper].yMax + PintervalWidth/2)){ 348 hOverlayTemp = hPeakOverlay[stepper]; 349 cout << "...#" << stepper ; 350 UseThisPeak = true; 351 break; 352 } 353 else if (stepper > 2){ 354 UseThisPeak = false; 355 cout << "...NONE" << endl ; 356 } 305 357 } 358 359 // if (Vslide[it->maxPos] >= 5 && Vslide[it->maxPos] < 13) hOverlayTemp = &*hSinglePeakOverlay; 360 // else if (Vslide[it->maxPos] >= 13 && Vslide[it->maxPos] < 23) hOverlayTemp = hDoublePeakOverlay; 361 // else if (Vslide[it->maxPos] >= 23 && Vslide[it->maxPos] < 33) hOverlayTemp = hTripplePeakOverlay; 362 // else if (Vslide[it->maxPos] >= 33) hOverlayTemp = hLargePeakOverlay; 363 if (UseThisPeak){ 364 cout << "...filling" ; 365 for ( int pos = Left; pos < Right; pos++){ 366 // if (Vslide[it->maxPos] >= 5 && Vslide[it->maxPos] < 15) hSinglePeakOverlay->Fill( pos - (it->maxPos), Vslide[pos]); 367 // else if (Vslide[it->maxPos] >= 15 && Vslide[it->maxPos] < 25) hDoublePeakOverlay->Fill( pos - (it->maxPos), Vslide[pos]); 368 // else if (Vslide[it->maxPos] >= 25 && Vslide[it->maxPos] < 35) hTripplePeakOverlay->Fill( pos - (it->maxPos), Vslide[pos]); 369 // else if (Vslide[it->maxPos] >= 35) hOverlayTemp = hLargePeakOverlay; 370 371 hOverlayTemp->Fill( pos - (it->maxPos), Vslide[pos]) ; 372 } 373 cout << "...done" << endl; 374 } 375 306 376 } 307 377 … … 310 380 //----------------------------------------------------------------------------- 311 381 if ( spikeDebug ){ 312 // TODO do this correct. The vectors should be the rigt ones... this is just luck 382 // TODO do this correct. The vectors should be the rigt ones... this is just luck 313 383 debugHistos[Ameas_].GetXaxis()->Set(Ameas.size() , -0.5 , Ameas.size()-0.5); 314 315 316 317 318 319 384 debugHistos[Vcorr_].GetXaxis()->Set(Ameas.size() , -0.5 , Ameas.size()-0.5); 385 debugHistos[Vslide_].GetXaxis()->Set(Ameas.size() , -0.5 , Ameas.size()-0.5); 386 debugHistos[Vcfd_].GetXaxis()->Set(Ameas.size() , -0.5 , Ameas.size()-0.5); 387 debugHistos[Vcfd2_].GetXaxis()->Set(Ameas.size() , -0.5 , Ameas.size()-0.5); 388 389 for ( unsigned int sl = 0; sl < RegionOfInterest; sl++){ 320 390 debugHistos[Ameas_].SetBinContent(sl, Ameas[sl]); 321 391 debugHistos[Vcorr_].SetBinContent(sl, Vcorr[sl]); … … 360 430 361 431 //OVERLAY PEAKS 362 cPulsetypes->cd(1); 363 gPad->SetGrid(); 364 hSinglePeakOverlay->Draw("COLZ"); 365 366 cPulsetypes->cd(2); 367 gPad->SetGrid(); 368 hDoublePeakOverlay->Draw("COLZ"); 369 370 cPulsetypes->cd(3); 371 gPad->SetGrid(); 372 hTripplePeakOverlay->Draw("COLZ"); 373 374 cPulsetypes->cd(4); 375 gPad->SetGrid(); 376 hLargePeakOverlay->Draw("COLZ"); 377 378 cPulsetypes->Modified(); 379 cPulsetypes->Update(); 432 for(int stepper = 0; stepper < 4; stepper++){ 433 cPulsetypes->cd(stepper+1); 434 gPad->SetGrid(); 435 hPeakOverlay[stepper]->Draw("COLZ"); 436 } 437 438 439 // cPulsetypes->cd(1); 440 // gPad->SetGrid(); 441 // hSinglePeakOverlay->Draw("COLZ"); 442 // 443 // cPulsetypes->cd(2); 444 // gPad->SetGrid(); 445 // hDoublePeakOverlay->Draw("COLZ"); 446 // 447 // cPulsetypes->cd(3); 448 // gPad->SetGrid(); 449 // hTripplePeakOverlay->Draw("COLZ"); 450 // 451 // cPulsetypes->cd(4); 452 // gPad->SetGrid(); 453 // hLargePeakOverlay->Draw("COLZ"); 454 455 cPulsetypes->Modified(); 456 cPulsetypes->Update(); 380 457 381 458 //Process gui events asynchronously during input … … 402 479 // end of loop over pixels 403 480 //------------------------------------- 404 405 if (ev % 50 0== 0){481 if (ProduceGraphic){ 482 if (ev % 50 == 0){ 406 483 407 484 //OVERLAY PEAKS 408 cPulsetypes->cd(1); 409 gPad->SetGrid(); 410 hSinglePeakOverlay->Draw("COLZ"); 411 412 cPulsetypes->cd(2); 413 gPad->SetGrid(); 414 hDoublePeakOverlay->Draw("COLZ"); 415 416 cPulsetypes->cd(3); 417 gPad->SetGrid(); 418 hTripplePeakOverlay->Draw("COLZ"); 419 420 cPulsetypes->cd(4); 421 gPad->SetGrid(); 422 hLargePeakOverlay->Draw("COLZ"); 423 // cPulsetypes->cd(5); 424 // hSinglePeakMaximum->Draw(""); 425 cPulsetypes->Modified(); 426 cPulsetypes->Update(); 485 cout << "...drawing histograms after Loop over Pixels" ; 486 for(int stepper = 0; stepper < 4; stepper++){ 487 cPulsetypes->cd(stepper+1); 488 gPad->SetGrid(); 489 hPeakOverlay[stepper]->Draw("COLZ"); 490 cout << "..." << stepper << "/3" ; 491 } 492 // cPulsetypes->cd(1); 493 // gPad->SetGrid(); 494 // hSinglePeakOverlay->Draw("COLZ"); 495 // 496 // cPulsetypes->cd(2); 497 // gPad->SetGrid(); 498 // hDoublePeakOverlay->Draw("hLargePeakOverlayCOLZ"); 499 // 500 // cPulsetypes->cd(3); 501 // gPad->SetGrid(); 502 // hTripplePeakOverlay->Draw("COLZ"); 503 // 504 // cPulsetypes->cd(4); 505 // gPad->SetGrid(); 506 // hLargePeakOverlay->Draw("COLZ"); 507 // cPulsetypes->cd(5); 508 // hSinglePeakMaximum->Draw(""); 509 cout << "...done" << endl; 510 cPulsetypes->Modified(); 511 cPulsetypes->Update(); 427 512 } 428 513 } 429 514 if (breakout) 430 515 break; … … 438 523 // Histogramm of Maximas in Overlay Spectra 439 524 //------------------------------------- 440 cout << "producing...Maximum peaks" << endl; 441 for (unsigned int cnt = 1 ; cnt <= 4 ; cnt ++){ 442 cout << "peak type: " << cnt << endl; 443 if (cnt == 1){ 444 hMaximumTemp = hSinglePeakMaximum; 445 hOverlayTemp = hSinglePeakOverlay; 446 } 447 else if (cnt == 2){ 448 hMaximumTemp = hDoublePeakMaximum; 449 hOverlayTemp = hDoublePeakOverlay; 450 } 451 else if (cnt == 3){ 452 hMaximumTemp = hTripplePeakMaximum; 453 hOverlayTemp = hTripplePeakOverlay; 454 } 455 else if (cnt == 4){ 456 hMaximumTemp = hLargePeakMaximum; 457 hOverlayTemp = hLargePeakOverlay; 458 } 525 cout << "...producing Maximum peaks:" << endl; 526 for (unsigned int cnt = 0 ; cnt < 4 ; cnt ++){ 527 cout << "\t ...peak type " << cnt; 528 hOverlayTemp = hPeakOverlay[cnt]; 529 hMaximumTemp = hPeakMaximum[cnt]; 530 // if (cnt == 1){ 531 // hMaximumTemp = hSinglePeakMaximum; 532 // hOverlayTemp = hSinglePeakOverlay; 533 // } 534 // else if (cnt == 2){ 535 // hMaximumTemp = hDoublePeakMaximum; 536 // hOverlayTemp = hDoublePeakOverlay; 537 // } 538 // else if (cnt == 3){ 539 // hMaximumTemp = hTripplePeakMaximum; 540 // hOverlayTemp = hTripplePeakOverlay; 541 // } 542 // else if (cnt == 4){ 543 // hMaximumTemp = hLargePeakMaximum; 544 // hOverlayTemp = hLargePeakOverlay; 545 // } 459 546 // resize vector SingleMaximum to number of timeslices in Overlay Spectra 460 SingleMaximum.resize(hOverlayTemp->GetNbinsX()); 547 SingleMaximum.resize(hOverlayTemp->GetNbinsX()); 548 cout << "\t ...peak type " << cnt; 461 549 //put maximumvalue of every Y-projection of every timeslice into vector 462 for (int TimeSlice = 0; TimeSlice <= hOverlayTemp->GetNbinsX(); TimeSlice++ ){ 463 TString histotitle; 464 histotitle += "hproj_py"; 465 histotitle += cnt ; 466 TH1D* hProjPeak = hOverlayTemp->ProjectionY(histotitle, TimeSlice, TimeSlice, ""); 467 SingleMaximum[ TimeSlice ].maxAmpl = (hProjPeak->GetMaximumBin() * 0.5) - 3.5; 550 for (int TimeSlice = 0; TimeSlice <= hOverlayTemp->GetNbinsX(); TimeSlice++ ){ 551 histotitle = "hproj_py"; 552 histotitle += cnt ; 553 hProjPeak = hOverlayTemp->ProjectionY(histotitle, TimeSlice, TimeSlice, ""); 554 SingleMaximum[ TimeSlice ].maxAmpl = (hProjPeak->GetMaximumBin() * 0.5) - 3.5; 468 555 SingleMaximum[ TimeSlice ].countOfMax = hProjPeak->GetBinContent( hProjPeak->GetMaximumBin() ); 469 556 hMaximumTemp->SetBinContent(TimeSlice, SingleMaximum[ TimeSlice ].maxAmpl ); 470 557 } 471 hMaximumTemp->Fit("landau", "", "", -50, 250); 472 } 558 cout << "...done" << endl; 559 if (fitdata){ 560 cout << "...calculating Landaufit" ; 561 hMaximumTemp->Fit("landau", "", "", -50, 250); 562 cout << "...done" << endl; 563 } 564 } 473 565 //------------------------------------- 474 566 // Draw Histograms … … 476 568 if (ProduceGraphic){ 477 569 //OVERLAY PEAKS 478 cout << "producing...So" << endl; 479 cPulsetypes->cd(1); 480 gPad->SetGrid(); 481 hSinglePeakOverlay->ResetStats(); 482 hSinglePeakOverlay->Draw("COLZ"); 483 cout << "producing...DO" << endl; 484 cPulsetypes->cd(2); 485 gPad->SetGrid(); 486 hDoublePeakOverlay->ResetStats(); 487 hDoublePeakOverlay->Draw("COLZ"); 488 cout << "producing...TO" << endl; 489 cPulsetypes->cd(3); 490 gPad->SetGrid(); 491 hTripplePeakOverlay->ResetStats(); 492 hTripplePeakOverlay->Draw("COLZ"); 493 cout << "producing...LO" << endl; 494 cPulsetypes->cd(4); 495 gPad->SetGrid(); 496 hLargePeakOverlay->ResetStats(); 497 hLargePeakOverlay->Draw("COLZ"); 498 cout << "producing...SM" << endl; 499 cPulsetypes->cd(5); 500 hSinglePeakMaximum->ResetStats(); 501 hSinglePeakMaximum->Draw(""); 502 cout << "producing...DM" << endl; 503 cPulsetypes->cd(6); 504 hDoublePeakMaximum->ResetStats(); 505 hDoublePeakMaximum->Draw(""); 506 cout << "producing...TM" << endl; 507 cPulsetypes->cd(7); 508 hTripplePeakMaximum->ResetStats(); 509 hTripplePeakMaximum->Draw(""); 510 cout << "producing...LM" << endl; 511 cPulsetypes->cd(8); 512 hLargePeakMaximum->ResetStats(); 513 hLargePeakMaximum->Draw(""); 514 cout << "producing...Done" << endl; 515 516 517 518 519 cPulsetypes->Modified(); 520 cPulsetypes->Update(); 570 cout << "...drawing overlay histograms" ; 571 for(int stepper = 0; stepper < 4; stepper++){ 572 cPulsetypes->cd(stepper+1); 573 gPad->SetGrid(); 574 hPeakOverlay[stepper]->ResetStats(); 575 hPeakOverlay[stepper]->Draw("COLZ"); 576 } 577 cout << "...done" << endl; 578 cout << "...drawing peak-shape histograms" ; 579 for(int stepper = 0; stepper < 4; stepper++){ 580 cPulsetypes->cd(5+stepper); 581 gPad->SetGrid(); 582 hPeakMaximum[stepper]->ResetStats(); 583 hPeakMaximum[stepper]->Draw(); 584 } 585 cout << "...done" << endl; 586 587 //cout << "producing...So" << endl; 588 // cPulsetypes->cd(1); 589 // gPad->SetGrid(); 590 // hSinglePeakOverlay->ResetStats(); 591 // hSinglePeakOverlay->Draw("COLZ"); 592 //cout << "producing...DO" << endl; 593 // cPulsetypes->cd(2); 594 // gPad->SetGrid(); 595 // hDoublePeakOverlay->ResetStats(); 596 // hDoublePeakOverlay->Draw("COLZ"); 597 //cout << "producing...TO" << endl; 598 // cPulsetypes->cd(3); 599 // gPad->SetGrid(); 600 // hTripplePeakOverlay->ResetStats(); 601 // hTripplePeakOverlay->Draw("COLZ"); 602 //cout << "producing...LO" << endl; 603 // cPulsetypes->cd(4); 604 // gPad->SetGrid(); 605 // hLargePeakOverlay->ResetStats(); 606 // hLargePeakOverlay->Draw("COLZ"); 607 //cout << "producing...SM" << endl; 608 // cPulsetypes->cd(5); 609 // hSinglePeakMaximum->ResetStats(); 610 // hSinglePeakMaximum->Draw(""); 611 //cout << "producing...DM" << endl; 612 // cPulsetypes->cd(6); 613 // hDoublePeakMaximum->ResetStats(); 614 // hDoublePeakMaximum->Draw(""); 615 //cout << "producing...TM" << endl; 616 // cPulsetypes->cd(7); 617 // hTripplePeakMaximum->ResetStats(); 618 // hTripplePeakMaximum->Draw(""); 619 //cout << "producing...LM" << endl; 620 // cPulsetypes->cd(8); 621 // hLargePeakMaximum->ResetStats(); 622 // hLargePeakMaximum->Draw(""); 623 //cout << "producing...Done" << endl; 624 625 626 627 628 cPulsetypes->Modified(); 629 cPulsetypes->Update(); 521 630 522 631 // cPixelPeakOverlay->cd(); … … 572 681 } 573 682 */ 574 //----------------------------------------------------------------------------- 575 hSinglePeakOverlay = new TH2F("hSinglePeakOverlay", "Overlay of detected Single Photon Peaks", 576 hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*hPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 577 512, -55.5, 300.5); 578 hSinglePeakOverlay->SetAxisRange(-5.5, 35.5, "Y"); 579 hSinglePeakOverlay->GetXaxis()->SetTitle( "Timeslices" ); 580 hSinglePeakOverlay->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 581 //hSinglePeakOverlay->SetBit(TH2F::kCanRebin); 582 hList.Add( hSinglePeakOverlay ); 583 584 hSinglePeakMaximum = new TH1F("hSinglePeakMaximum", "Single Peak derived with Maximum of above Spektrum", 585 hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , 586 (-1*hPeakOverlayXaxisLeft)-0.5, 683 684 //----------------------------------------------------------------------------- 685 686 for (int stepper = 0; stepper < 4; stepper ++){ 687 hPeakOverlay[stepper] = new TH2F(histSetting[stepper].name, histSetting[stepper].title, 688 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*gPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 689 512, -55.5, 300.5); 690 hPeakOverlay[stepper]->SetAxisRange(-5.5, histSetting[stepper].yMax+ 25.5, "Y"); 691 hPeakOverlay[stepper]->GetXaxis()->SetTitle( "Timeslices" ); 692 hPeakOverlay[stepper]->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 693 //hSinglePeakOverlay->SetBit(TH2F::kCanRebin); 694 hList.Add( hPeakOverlay[stepper] ); 695 696 hPeakMaximum[stepper] = new TH1F(histSetting[stepper].Mname, histSetting[stepper].Mtitle, 697 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , 698 (-1*gPeakOverlayXaxisLeft)-0.5, 587 699 hPeakOverlayXaxisRight-0.5 588 700 ); 589 hSinglePeakMaximum->SetAxisRange(-0.5, 25.5, "Y"); 590 hSinglePeakMaximum->GetXaxis()->SetTitle( "Timeslices" ); 591 hSinglePeakMaximum->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 592 hList.Add( hSinglePeakMaximum ); 593 //----------------------------------------------------------------------------- 594 595 hDoublePeakOverlay = new TH2F("hDoublePeakOverlay", "Overlay of detected Double Photon Peaks", 596 hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*hPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 597 512, -55.5, 300.5); 598 hDoublePeakOverlay->SetAxisRange(-5.5, 35.5, "Y"); 599 hDoublePeakOverlay->GetXaxis()->SetTitle( "Timeslices" ); 600 hDoublePeakOverlay->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 601 //hSinglePeakOverlay->SetBit(TH2F::kCanRebin); 602 hList.Add( hDoublePeakOverlay );; 603 604 hDoublePeakMaximum = new TH1F("hSinglePeakMaximum", "Double Peak derived with Maximum of above Spektrum", 605 hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , 606 (-1*hPeakOverlayXaxisLeft)-0.5, 607 hPeakOverlayXaxisRight-0.5 608 ); 609 hDoublePeakMaximum->SetAxisRange(-0.5, 25.5, "Y"); 610 hDoublePeakMaximum->GetXaxis()->SetTitle( "Timeslices" ); 611 hDoublePeakMaximum->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 612 hList.Add( hDoublePeakMaximum ); 701 hPeakMaximum[stepper]->SetAxisRange(-0.5, histSetting[stepper].yMax + 15.5, "Y"); 702 hPeakMaximum[stepper]->GetXaxis()->SetTitle( "Timeslices" ); 703 hPeakMaximum[stepper]->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 704 hList.Add( hPeakMaximum[stepper] ); 705 } 706 //----------------------------------------------------------------------------- 707 708 709 710 //----------------------------------------------------------------------------- 711 hSinglePeakOverlay = new TH2F("hSinglePeakOverlay", "Overlay of detected Single Photon Peaks", 712 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*gPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 713 512, -55.5, 300.5); 714 hSinglePeakOverlay->SetAxisRange(-5.5, 35.5, "Y"); 715 hSinglePeakOverlay->GetXaxis()->SetTitle( "Timeslices" ); 716 hSinglePeakOverlay->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 717 //hSinglePeakOverlay->SetBit(TH2F::kCanRebin); 718 hList.Add( hSinglePeakOverlay ); 719 720 hSinglePeakMaximum = new TH1F("hSinglePeakMaximum", "Single Peak derived with Maximum of above Spektrum", 721 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , 722 (-1*gPeakOverlayXaxisLeft)-0.5, 723 hPeakOverlayXaxisRight-0.5 724 ); 725 hSinglePeakMaximum->SetAxisRange(-0.5, 25.5, "Y"); 726 hSinglePeakMaximum->GetXaxis()->SetTitle( "Timeslices" ); 727 hSinglePeakMaximum->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 728 hList.Add( hSinglePeakMaximum ); 729 //----------------------------------------------------------------------------- 730 731 hDoublePeakOverlay = new TH2F("hDoublePeakOverlay", "Overlay of detected Double Photon Peaks", 732 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*gPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 733 512, -55.5, 300.5); 734 hDoublePeakOverlay->SetAxisRange(-5.5, 35.5, "Y"); 735 hDoublePeakOverlay->GetXaxis()->SetTitle( "Timeslices" ); 736 hDoublePeakOverlay->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 737 //hSinglePeakOverlay->SetBit(TH2F::kCanRebin); 738 hList.Add( hDoublePeakOverlay );; 739 740 hDoublePeakMaximum = new TH1F("hSinglePeakMaximum", "Double Peak derived with Maximum of above Spektrum", 741 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , 742 (-1*gPeakOverlayXaxisLeft)-0.5, 743 hPeakOverlayXaxisRight-0.5 744 ); 745 hDoublePeakMaximum->SetAxisRange(-0.5, 25.5, "Y"); 746 hDoublePeakMaximum->GetXaxis()->SetTitle( "Timeslices" ); 747 hDoublePeakMaximum->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 748 hList.Add( hDoublePeakMaximum ); 613 749 //----------------------------------------------------------------------------- 614 750 615 616 hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*hPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 ,617 618 619 620 621 622 623 624 625 hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight ,626 (-1*hPeakOverlayXaxisLeft)-0.5,627 628 629 630 631 632 751 hTripplePeakOverlay= new TH2F("hTripplePeakOverlay", "Overlay of detected Tripple Photon Peaks", 752 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*gPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 753 512, -55.5, 300.5); 754 hTripplePeakOverlay->SetAxisRange(-5.5, 35.5, "Y"); 755 hTripplePeakOverlay->GetXaxis()->SetTitle( "Timeslices" ); 756 hTripplePeakOverlay->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 757 //hTripplePeakOverlay->SetBit(TH2F::kCanRebin); 758 hList.Add( hTripplePeakOverlay );; 759 760 hTripplePeakMaximum = new TH1F("hSinglePeakMaximum", "Triple Peak derived with Maximum of above Spektrum", 761 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , 762 (-1*gPeakOverlayXaxisLeft)-0.5, 763 hPeakOverlayXaxisRight-0.5 764 ); 765 hTripplePeakMaximum->SetAxisRange(-0.5, 25.5, "Y"); 766 hTripplePeakMaximum->GetXaxis()->SetTitle( "Timeslices" ); 767 hTripplePeakMaximum->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 768 hList.Add( hTripplePeakMaximum ); 633 769 //----------------------------------------------------------------------------- 634 770 635 636 hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*hPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 ,637 638 639 640 641 642 643 644 645 hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight ,646 (-1*hPeakOverlayXaxisLeft)-0.5,647 648 649 650 651 652 771 hLargePeakOverlay= new TH2F("hLargePeakOverlay", "Overlay of detected Multi Photon Peaks", 772 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*gPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 773 512, -5.5, 300.5 ); 774 hLargePeakOverlay->SetAxisRange(-5.5, 200.5, "Y"); 775 hLargePeakOverlay->GetXaxis()->SetTitle( "Timeslices" ); 776 hLargePeakOverlay->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 777 //hLargePeakOverlay->SetBit(TH2F::kCanRebin); 778 hList.Add( hLargePeakOverlay );; 779 780 hLargePeakMaximum = new TH1F("hLargePeakMaximum", "Peak derived with Maximum of above Spektrum", 781 gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , 782 (-1*gPeakOverlayXaxisLeft)-0.5, 783 hPeakOverlayXaxisRight-0.5 784 ); 785 hLargePeakMaximum->SetAxisRange(-0.5, 50.5, "Y"); 786 hLargePeakMaximum->GetXaxis()->SetTitle( "Timeslices" ); 787 hLargePeakMaximum->GetYaxis()->SetTitle( "Amplitude [a.u.]" ); 788 hList.Add( hLargePeakMaximum ); 653 789 //----------------------------------------------------------------------------- 654 790 655 791 // hPixelPeakOverlay = new TH2F("hPixelPeakOverlay", "Maximum of Statistic of overlayed Peaks", 656 // hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*hPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 ,792 // gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*gPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 657 793 // 512, -55.5, 200.5 ); 658 794 // hPixelPeakOverlay->GetXaxis()->SetTitle( "Timeslices" ); … … 661 797 662 798 // hEventPeakOverlay = new TH2F("hEventPeakOverlay", "Overlay of detected Peaks of all Pixel of one Event", 663 // hPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*hPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 ,799 // gPeakOverlayXaxisLeft + hPeakOverlayXaxisRight , (-1*gPeakOverlayXaxisLeft)-0.5, hPeakOverlayXaxisRight-0.5 , 664 800 // 4096, -48.5, 200.5 ); 665 801 // hEventPeakOverlay->GetXaxis()->SetTitle( "Timeslices" );
Note:
See TracChangeset
for help on using the changeset viewer.