Changeset 13499 for fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C
- Timestamp:
- 05/01/12 15:34:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C
r13494 r13499 172 172 //void SaveHistograms( const char*, const char*, TObjArray*, int ); 173 173 174 void FillHistograms(Pixel*, vector<Region>*, int, int, int, int);174 void FillHistograms(Pixel*, vector<Region>*, int, int, TString, int, int); 175 175 void DrawTestHistograms( int); 176 176 void ProduceDebugHistos( vector<Region> *pZXings); … … 185 185 //---------------------------------------------------------------------------- 186 186 int FPulseOverlay( 187 char* datafilename = "../ data/2011/11/09/20111109_006.fits.gz",188 const char* drsfilename = "../ data/2011/11/09/20111109_003.drs.fits.gz",189 const char* OutRootFileName = "../ analysis/FPulseTemplate/20111109_006/20111109_006.pulses.root",190 bool ProduceGraphic = false,187 char* datafilename = "../../data/2011/11/09/20111109_006.fits.gz", 188 const char* drsfilename = "../../data/2011/11/09/20111109_003.drs.fits.gz", 189 const char* OutRootFileName = "../../analysis/FPulseTemplate/20111109_006/20111109_006.pulses.root", 190 bool ProduceGraphic = true, 191 191 bool spikeDebug = false, 192 bool debugPixel = false,192 bool debugPixel = true, 193 193 bool testmode = false, 194 194 bool saveResults = false, 195 int verbosityLevel = 0, // different verbosity levels can be implemented here195 int verbosityLevel = 4, // different verbosity levels can be implemented here 196 196 int firstevent = 0, 197 int nevents = 2000,197 int nevents = 10, 198 198 int firstpixel = 0, 199 int npixel = 37,199 int npixel = 80, 200 200 int sampleSetSize = 36, 201 201 int maxPulseOrder = 1, 202 202 int AmplWindowWidth = 14, //Width of Window for selection of pulses to histograms 203 const char*histoOptions = "S",203 TString histoOptions = "S", 204 204 float GainMean = 8, 205 205 float BSLMean = -1, //4 Histogramms will be drawn, decide how far pulsehights differ from eachother … … 219 219 // Save-Root-File Settings 220 220 //---------------------------------------------------------------------------- 221 if (saveResults) 222 { 221 223 CreateRootFile( OutRootFileName, verbosityLevel ); 224 } 222 225 223 226 //---------------------------------------------------------------------------- … … 271 274 ) 272 275 { 276 cName ="cgpDistributions"; 277 cName += pulse_order; 278 cTitle ="Pulses of Order: "; 279 cTitle += pulse_order; 280 cgpDistributions[pulse_order] = new TCanvas(cName,cTitle, 0,pulse_order*20,800,800); 281 cgpDistributions[pulse_order]->Divide(2, 2); 273 282 cName ="cgpPixelPulses"; 274 283 cName += pulse_order; … … 396 405 { 397 406 cout << "------------------------------------------------" << endl 398 << "...processing Sample from Pixel :"407 << "...processing Sample from Pixel " 399 408 << firstPixelOfSample 400 << " to Pixel:"409 << " to Pixel " 401 410 << firstPixelOfSample+sampleSetSize-1 << endl; 402 411 } … … 421 430 //-------------------------------------------------------------------- 422 431 for ( int pixelID = firstPixelOfSample; 423 pixelID < sampleSetSize || pixelID < firstpixel + npixel; 424 pixelID++ ) 432 pixelID < firstPixelOfSample + sampleSetSize 433 && pixelID < firstpixel + npixel; 434 pixelID++ ) 425 435 { 426 436 if (verbosityLevel > 0) … … 428 438 cout << "-------------------------------------" << endl 429 439 << "...processing Pixel: " << pixelID 430 << "/" << firstpixel + npixel << endl;440 << "/" << firstpixel + npixel -1 << endl; 431 441 } 432 442 … … 516 526 AmplWindowWidth, 517 527 ev, 528 histoOptions, 518 529 maxPulseOrder, 519 530 verbosityLevel … … 588 599 589 600 for ( int pixelID = firstPixelOfSample; 590 pixelID < sampleSetSize || pixelID < firstpixel + npixel; 591 pixelID++ ) 601 pixelID < firstPixelOfSample + sampleSetSize 602 && pixelID < firstpixel + npixel; 603 pixelID++ ) 592 604 { 593 605 //here is what happends at the end of each loop over all Events … … 597 609 // ); 598 610 599 SaveHistograms( //save histograms of generell results into output root file600 OutRootFileName,601 CreateSubDirName(pixel[pixelID]->mChid),602 pixel[pixelID]->hList,603 saveResults,604 verbosityLevel605 );611 // SaveHistograms( //save histograms of generell results into output root file 612 // OutRootFileName, 613 // CreateSubDirName(pixel[pixelID]->mChid), 614 // pixel[pixelID]->hList, 615 // saveResults, 616 // verbosityLevel 617 // ); 606 618 607 619 if (ProduceGraphic) … … 661 673 ); 662 674 663 DeletePixelCanvases( 664 maxPulseOrder, 665 verbosityLevel 666 ); 675 //Process gui events asynchronously during input 676 cout << endl; 677 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE); 678 timer.TurnOn(); 679 Getline("Press <return> to go on"); 680 timer.TurnOff(); 681 682 DeletePixelCanvases( 683 maxPulseOrder, 684 verbosityLevel 685 ); 667 686 } 668 687 return( 0 ); … … 754 773 void 755 774 FillHistograms( 756 Pixel* CurrentPixel,775 Pixel* CurrentPixel, 757 776 vector<Region>* pZXings, 758 int AmplWindowWidth, 759 int eventNumber, 760 int maxPulseOrder, 761 int verbosityLevel 777 int AmplWindowWidth, 778 int eventNumber, 779 TString histoOptions, 780 int maxPulseOrder, 781 int verbosityLevel 762 782 ) 763 783 { … … 770 790 for (reg = pZXings->begin() ; reg < pZXings->end() ; reg++) 771 791 { 792 772 793 //skip those who are at the Rim of the ROI 773 794 if (reg->maxPos < 12 || (unsigned int) reg->maxPos > gRegionOfInterest-12) … … 776 797 continue; 777 798 } 778 //domstest->Fill(reg->maxPos);779 799 780 800 // Define axis range of Histogram 781 int Left = reg->maxPos - gPixelOverlayXaxisLeft;782 int Right = reg->maxPos + gPixelOverlayXaxisRight;783 int EdgeLeft = reg->halfRisingEdgePos - gPixelOverlayXaxisLeft;784 int EdgeRight = reg->halfRisingEdgePos + gPixelOverlayXaxisRight;785 786 if (Left < 0) Left =0;787 if ( Right > (int)Ameas.size() ) Right=Ameas.size();788 if ( EdgeLeft < 0) EdgeLeft =0;789 if (EdgeRight > (int)Ameas.size() ) EdgeRight=Ameas.size();790 791 792 hTesthisto2->Fill( eventNumber, reg->slopeOfRisingEdge ) ;801 int Left = reg->maxPos - gPixelOverlayXaxisLeft; 802 int Right = reg->maxPos + gPixelOverlayXaxisRight; 803 int EdgeLeft = reg->halfRisingEdgePos - gPixelOverlayXaxisLeft; 804 int EdgeRight = reg->halfRisingEdgePos + gPixelOverlayXaxisRight; 805 806 if (Left < 0) Left = 0; 807 if (EdgeLeft < 0) EdgeLeft = 0; 808 if (Right > (int)Ameas.size() ) Right = Ameas.size(); 809 if (EdgeRight > (int)Ameas.size() ) EdgeRight = Ameas.size(); 810 811 812 // hTesthisto2->Fill( eventNumber, reg->slopeOfRisingEdge ) ; 793 813 794 814 if (verbosityLevel > 2) cout << endl << "\t...choosing Histogram" ; … … 804 824 order_of_pulse = order; 805 825 use_this_peak = true; 806 CurrentPixel->hSlopeRisingEdge[order_of_pulse]->Fill( reg->slopeOfRisingEdge ) ;807 826 break; 808 827 } … … 811 830 use_this_peak = false; 812 831 if (verbosityLevel > 2) cout << "...NONE" << endl ; 832 } 833 if (use_this_peak) 834 { 835 if ( histoOptions.Contains("S") ) 836 { 837 if (verbosityLevel > 2) cout << endl << "\t...filling Edge Histogram" ; 838 CurrentPixel->hSlopeRisingEdge[order]->Fill( reg->slopeOfRisingEdge ) ; 839 } 813 840 } 814 841 } … … 879 906 { 880 907 if (verbosityLevel > 2) cout << endl << "...delete pixel Canvases" ; 881 for (int pulse_order = 0; pulse_order < maxPulseOrder; pulse_order ++)908 for (int pulse_order = 0; pulse_order < maxPulseOrder; pulse_order++ ) 882 909 { 883 910 delete cgpPixelPulses[pulse_order]; 911 delete cgpDistributions[pulse_order]; 884 912 } 885 913 delete[] cgpPixelPulses; 914 delete[] cgpDistributions; 886 915 } 887 916
Note:
See TracChangeset
for help on using the changeset viewer.