Changeset 13472 for fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C
- Timestamp:
- 04/30/12 19:22:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C
r13467 r13472 43 43 // rootmacros 44 44 //---------------------------------------------------------------------------- 45 #include "rootfilehandler.h"46 #include "rootfilehandler.C"47 45 48 46 #include "../fits.h" … … 62 60 #include "../SpikeRemoval.h" 63 61 #include "../SpikeRemoval.C" 62 63 #include "rootfilehandler.h" 64 #include "rootfilehandler.C" 64 65 65 66 #include "pixel.h" … … 153 154 154 155 //Root-File Objects 155 TObjArray* hList[sampleSetSize] = {NULL};156 // TObjArray* hList[sampleSetSize] = {NULL}; 156 157 TObjArray* hRootList = NULL; 157 158 158 //Canvases 159 TCanvas* cgpPixelPulses[maxPulseOrder] = {NULL}; 160 TCanvas* cgpTestHistos = NULL; 161 //TCanvas* gpcDevelopment = NULL; 159 TCanvas** cgpPixelPulses = NULL; 160 TCanvas * cFiltered = NULL; 162 161 163 162 //---------------------------------------------------------------------------- … … 166 165 167 166 void BookDebugHistos(int ); 168 void BookPixelHistos(int, int, int, int );167 //void BookPixelHistos(int, int, int, int ); 169 168 void BookTestHistos( int ); 170 169 171 void DeletePixelHistos(int );172 void SaveHistograms( const char*, const char*, TObjArray*, int );173 174 void FillHistograms( vector<Region>*, int, int, int);175 void DrawPulseHistograms(int,int);170 //void DeletePixelHistos(int ); 171 //void SaveHistograms( const char*, const char*, TObjArray*, int ); 172 173 void FillHistograms(Pixel*, vector<Region>*, int, int, int, int); 174 //void DrawPulseHistograms(int); 176 175 void DrawTestHistograms( int); 177 176 178 177 void UpdateCanvases( int, int); 179 void DeletePixelCanvases( int );178 void DeletePixelCanvases( int, int ); 180 179 181 180 //---------------------------------------------------------------------------- … … 184 183 //---------------------------------------------------------------------------- 185 184 //---------------------------------------------------------------------------- 186 int FPulse Template(185 int FPulseOverlay( 187 186 char* datafilename = "../data/2011/11/09/20111109_006.fits.gz", 188 187 const char* drsfilename = "../data/2011/11/09/20111109_003.drs.fits.gz", … … 219 218 // Initialize Pixel 220 219 //---------------------------------------------------------------------------- 221 Pixel* pPixelSet = (Pixel*) calloc( sampleSetSize, sizeof(Pixel) );220 Pixel** pPixelSet = new Pixel*[sampleSetSize]; 222 221 223 222 //---------------------------------------------------------------------------- … … 245 244 }; 246 245 246 //Canvases 247 cgpPixelPulses = new TCanvas*[maxPulseOrder]; 248 TCanvas* cgpTestHistos = NULL; 249 247 250 if (ProduceGraphic) 248 251 { 252 //TCanvas* gpcDevelopment = NULL; 253 TString cName = ""; 254 TString cTitle = ""; 255 249 256 for ( 250 257 int pulse_order = maxPulseOrder - 1; … … 253 260 ) 254 261 { 255 TStringcName ="cgpPixelPulses";256 257 TStringcTitle ="Pulses of Order: ";258 262 cName ="cgpPixelPulses"; 263 cName += pulse_order; 264 cTitle ="Pulses of Order: "; 265 cTitle += pulse_order; 259 266 cgpPixelPulses[pulse_order] = new TCanvas(cName,cTitle, 0,pulse_order*20,800,800); 260 267 cgpPixelPulses[pulse_order]->Divide(2, 2); 261 cName = "cgpAllPixelPulses";262 cName += pulse_order;263 cTitle ="AllPixel average of puls shapes of Order: ";264 cTitle += pulse_order;265 cgpAllPixelPulses[pulse_order] = new TCanvas( cName, cTitle, 801, pulse_order*20, 800, 800 );266 cgpAllPixelPulses[pulse_order]->Divide(2, 2);267 268 } 268 269 … … 272 273 // the pointers anyway ... 273 274 274 TCanvas *cFiltered = NULL;275 275 if (spikeDebug) 276 276 { … … 372 372 cout << "------------------------------------------------" << endl 373 373 << "...processing Sample from Pixel: " 374 << firstPixelOfSample ;374 << firstPixelOfSample 375 375 << "to Pixel: " 376 376 << firstPixelOfSample+sampleSetSize-1 << endl; … … 395 395 cout << "-------------------------------------" << endl 396 396 << "...processing Event: " << CurrentEventID 397 << "/" << nevents << " of Pixel: " << pixel <<endl;397 << "/" << nevents << endl; 398 398 } 399 399 … … 409 409 cout << "-------------------------------------" << endl 410 410 << "...processing Pixel: " << pixel 411 << "/" << nPixelSample<< endl;411 << "/" << firstpixel + npixel << endl; 412 412 } 413 413 414 pPixelSet[pixel] = Pixel(414 pPixelSet[pixel] = new Pixel( 415 415 pixel, 416 416 maxPulseOrder, … … 486 486 // Fill Overlay Histos 487 487 //----------------------------------------------------------------------------- 488 FillHistograms(pPixelSet[pixel], pZXings, AmplWindowWidth, ev, verbosityLevel ); 488 FillHistograms( 489 pPixelSet[pixel], 490 pZXings, 491 AmplWindowWidth, 492 ev, 493 maxPulseOrder, 494 verbosityLevel 495 ); 489 496 490 497 //----------------------------------------------------------------------------- … … 574 581 if (debugPixel) 575 582 { 576 pPixelSet[pixel] ->DrawHistograms( 577 cgpPixelPulses, 578 pulsesCanvasFrameNrs 579 ); 580 583 for ( int order = 0; 584 order < maxPulseOrder; 585 order++ 586 ) 587 { 588 pPixelSet[pixel]->DrawHistograms( 589 cgpPixelPulses[order], 590 pulsesCanvasFrameNrs 591 ); 592 } 581 593 DrawTestHistograms( 582 594 verbosityLevel … … 619 631 { 620 632 //here is what happends at the end of each loop over all Events 621 pPixelSet[pixel]->DrawHistograms( 622 cgpPixelPulses, 623 pulsesCanvasFrameNrs 633 // pPixelSet[pixel]->DrawHistograms( 634 // cgpPixelPulses, 635 // pulsesCanvasFrameNrs 636 // ); 637 638 SaveHistograms( //save histograms of generell results into output root file 639 OutRootFileName, 640 CreateSubDirName(pPixelSet[pixel]->mChid), 641 pPixelSet[pixel]->hList, 642 verbosityLevel 624 643 ); 625 644 … … 633 652 634 653 //Save Histograms of Pixels into Output rootfile 635 SaveHistograms( 636 OutRootFileName, 637 CreateSubDirName( pPixelSet[pixel]->mChid ), 638 pPixelSet[pixel]->hList, 639 verbosityLevel 640 ); 654 pPixelSet[pixel]->SavePixelHistograms( OutRootFileName ); 641 655 642 656 … … 677 691 ); 678 692 679 680 681 693 if (ProduceGraphic) 682 694 { … … 687 699 } 688 700 689 DeletePixelCanvases( verbosityLevel ); 701 DeletePixelCanvases( 702 maxPulseOrder, 703 verbosityLevel 704 ); 690 705 return( 0 ); 691 706 } … … 747 762 { 748 763 if (verbosityLevel > 2) cout << endl << "...book histograms" << endl; 749 hAllPixelList = new TObjArray;750 764 hRootList = new TObjArray; 751 765 debugHistos = new TH1F[ Number_Of_Debug_Histo_Types ]; … … 779 793 int AmplWindowWidth, 780 794 int eventNumber, 795 int maxPulseOrder, 781 796 int verbosityLevel 782 797 ) … … 810 825 811 826 812 CurrentPixel->hSlopeRisingEdge->Fill( reg->slopeOfRisingEdge ) ;813 827 hTesthisto2->Fill( eventNumber, reg->slopeOfRisingEdge ) ; 814 828 … … 832 846 if (verbosityLevel > 2) cout << "...NONE" << endl ; 833 847 } 848 if (use_this_peak) 849 { 850 CurrentPixel->hSlopeRisingEdge[order_of_pulse]->Fill( reg->slopeOfRisingEdge ) ; 851 } 834 852 } 835 853 … … 863 881 ) 864 882 { 865 if (verbosityLevel > 2) cout << endl << "...drawing pulse histograms " ;866 867 cgpTestHistos->cd(1);868 hTesthisto->Draw();869 cgpTestHistos->cd(2);870 hTesthisto2->Draw("BOX");883 if (verbosityLevel > 2) cout << endl << "...drawing pulse histograms TODO CANVAS" ; 884 885 // cgpTestHistos->cd(1); 886 // hTesthisto->Draw(); 887 // cgpTestHistos->cd(2); 888 // hTesthisto2->Draw("BOX"); 871 889 } 872 890 // end of DrawTestHistograms … … 878 896 ) 879 897 { 880 if (verbosityLevel > 3) cout << endl << "...updating canvases " ;898 if (verbosityLevel > 3) cout << endl << "...updating canvases TODO CANVAS" ; 881 899 for (int pulse_order = 0; pulse_order < max_pulse_order; pulse_order++) 882 900 { 883 cgpPixelPulses[pulse_order]->Modified();884 cgpPixelPulses[pulse_order]->Update();885 cgpTestHistos->Modified();886 cgpTestHistos->Update();901 // cgpPixelPulses[pulse_order]->Modified(); 902 // cgpPixelPulses[pulse_order]->Update(); 903 // cgpTestHistos->Modified(); 904 // cgpTestHistos->Update(); 887 905 } 888 906 } … … 891 909 892 910 void 893 DeletePixelCanvases( int verbosityLevel ) 911 DeletePixelCanvases( 912 int maxPulseOrder, 913 int verbosityLevel 914 ) 894 915 { 895 if (verbosityLevel > 2) cout << endl << "...delete pixel Canvas " ;896 for (int pulse_order = 0; pulse_order < maxPulseOrder; pulse_order ++)897 {898 delete cgpPixelPulses[pulse_order];899 }916 if (verbosityLevel > 2) cout << endl << "...delete pixel Canvas TODO CANVAS" ; 917 // for (int pulse_order = 0; pulse_order < maxPulseOrder; pulse_order ++) 918 // { 919 // delete cgpPixelPulses[pulse_order]; 920 // } 900 921 } 901 922
Note:
See TracChangeset
for help on using the changeset viewer.