Changeset 13519 for fact/tools
- Timestamp:
- 05/02/12 17:22:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C
r13499 r13519 27 27 #include <TStyle.h> 28 28 #include <TString.h> 29 #include <TObjArray.h> 29 30 30 31 #include <stdio.h> … … 185 186 //---------------------------------------------------------------------------- 186 187 int FPulseOverlay( 187 c har*datafilename = "../../data/2011/11/09/20111109_006.fits.gz",188 const char* datafilename = "../../data/2011/11/09/20111109_006.fits.gz", 188 189 const char* drsfilename = "../../data/2011/11/09/20111109_003.drs.fits.gz", 189 190 const char* OutRootFileName = "../../analysis/FPulseTemplate/20111109_006/20111109_006.pulses.root", 190 bool ProduceGraphic = true,191 bool ProduceGraphic = false, 191 192 bool spikeDebug = false, 192 bool debugPixel = true,193 bool debugPixel = false, 193 194 bool testmode = false, 194 195 bool saveResults = false, 195 int verbosityLevel = 4, // different verbosity levels can be implemented here196 int firstevent = 0,196 int verbosityLevel = 6, // different verbosity levels can be implemented here 197 int firstevent = 1, // Hast to be between 1 and infinity NOT 0!!!! 197 198 int nevents = 10, 198 199 int firstpixel = 0, 199 int npixel = 80,200 int sampleSetSize = 36,201 int maxPulseOrder = 1,200 int npixel = -1, 201 int sampleSetSize = 40, 202 int maxPulseOrder = 3, 202 203 int AmplWindowWidth = 14, //Width of Window for selection of pulses to histograms 203 204 TString histoOptions = "S", … … 216 217 Pixel** pixel = new Pixel*[sampleSetSize]; 217 218 219 for (int i = 0 ; i < sampleSetSize; i++) 220 { 221 pixel[i] = NULL; 222 } 218 223 //---------------------------------------------------------------------------- 219 224 // Save-Root-File Settings … … 402 407 { 403 408 404 if (verbosityLevel >= 0)409 if (verbosityLevel == 0) 405 410 { 406 411 cout << "------------------------------------------------" << endl … … 414 419 // Loop over every Event of Pixel Set 415 420 //-------------------------------------------------------------------- 416 for ( int ev = firstevent ; ev < firstevent + nevents; ev++)421 for ( int ev = firstevent ; ev < firstevent + nevents; ev++) 417 422 { 418 423 // Get an Event --> consists of 1440 Pixel ...erm....data 424 cout << endl << "processing event " << ev << endl; 419 425 datafile->GetRow( ev ); 420 426 421 if (verbosityLevel > 0)427 if (verbosityLevel == 1) 422 428 { 423 429 cout << "-------------------------------------" << endl 424 << "...processing Event: " << CurrentEventID 430 << "...processing Sample from Pixel " 431 << firstPixelOfSample 432 << " to Pixel " 433 << firstPixelOfSample+sampleSetSize-1 434 << "... Event: " << CurrentEventID 425 435 << "/" << nevents << endl; 426 436 } … … 434 444 pixelID++ ) 435 445 { 436 if (verbosityLevel > 0)446 if (verbosityLevel > 1) 437 447 { 438 448 cout << "-------------------------------------" << endl 439 << "...processing Pixel: " << pixelID 449 << "...processing Sample from Pixel " 450 << firstPixelOfSample 451 << " to Pixel " 452 << firstPixelOfSample+sampleSetSize-1 453 << "... Event: " << CurrentEventID 454 << "/" << nevents << endl 455 << " Pixel: " << pixelID 440 456 << "/" << firstpixel + npixel -1 << endl; 441 457 } … … 456 472 histoOptions 457 473 ); 474 cout << "Created Pixel# Set " << pixelID 475 << " Pixel# Get " << pixel[pixelID]->mChid 476 << " Adress " << &pixel[pixelID] << endl; 477 458 478 } 459 479 … … 482 502 // spikes are: 1 or 2 slice wide, positive non physical artifacts 483 503 if (verbosityLevel > 2) cout << "...removeing Spikes"; 504 cout << "blaaa" << endl; 505 cout << "blaaa" << endl; 506 484 507 removeSpikes (Ameas, Vcorr); 485 508 if (verbosityLevel > 2) cout << "...done " << endl; … … 499 522 sliding_avg(Vcfd, Vcfd2, avg2); 500 523 if (verbosityLevel > 2) cout << "...done " << endl; 524 cout << "miauuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu" << endl; 501 525 502 526 //------------------------------------- … … 521 545 // Fill Overlay Histos 522 546 //----------------------------------------------------------------------------- 523 FillHistograms( 524 pixel[pixelID], 525 pZXings, 526 AmplWindowWidth, 527 ev, 528 histoOptions, 529 maxPulseOrder, 530 verbosityLevel 531 ); 532 547 cout << endl << "Filling Histograms of Pixel# [Set] " << pixelID 548 << " Pixel# [Got] " << pixel[pixelID]->mChid 549 << " Adress " << &pixel[pixelID] << endl; 550 // FillHistograms( 551 // pixel[pixelID], 552 // pZXings, 553 // AmplWindowWidth, 554 // ev, 555 // histoOptions, 556 // maxPulseOrder, 557 // verbosityLevel 558 // ); 559 cout << endl << "got out of fillhisto" << endl; 533 560 //----------------------------------------------------------------------------- 534 561 // Spike Debug … … 577 604 if (breakout) break; 578 605 579 if (verbosityLevel > 2)606 if (verbosityLevel > 1) 580 607 { 581 608 cout << endl << "...End of Pixel" … … 586 613 // end of Loops over Sample 587 614 //------------------------------------- 615 616 cout << endl << "Last Pixel# [Set] " << (firstPixelOfSample + sampleSetSize-1); 617 cout << " Pixel# [Got] " << pixel[firstPixelOfSample + sampleSetSize-1]->mChid 618 << " Adress " << &pixel[firstPixelOfSample + sampleSetSize-1] 619 << " Adress [Got]" << &pixel[firstPixelOfSample + sampleSetSize-1]->mChid; 588 620 589 621 }//End of Loop over Events … … 626 658 627 659 //Save Histograms of Pixels into Output rootfile 660 cout << endl << "Saving Pixel# [Set] " << pixelID 661 << " Pixel# [Got] " << pixel[pixelID]->mChid 662 << " Adress " << &pixel[pixelID]; 628 663 pixel[pixelID]->SavePixelHistograms( OutRootFileName, saveResults ); 629 664 … … 642 677 } 643 678 679 cout << endl << "Deleting Pixel# [Set] " << pixelID 680 << " Pixel# [Got] " << pixel[pixelID]->mChid 681 << " Adress " << &pixel[pixelID] 682 << " ChidAdress " << &pixel[pixelID]->mChid ; 644 683 delete pixel[pixelID]; 645 684 … … 782 821 ) 783 822 { 823 cout << endl << "begin Pixel " << CurrentPixel->mChid << endl; 784 824 if (verbosityLevel > 2) cout << endl << "...filling pulse histograms" ; 785 825 bool use_this_peak=false; 786 826 int order_of_pulse=0; 787 827 vector<Region>::iterator reg; 788 828 cout << endl << "begin for " << endl; 789 829 //Loop over all found zerocrossings in Region 790 830 for (reg = pZXings->begin() ; reg < pZXings->end() ; reg++) 791 831 { 792 832 cout << endl << "for" << endl; 793 833 //skip those who are at the Rim of the ROI 794 834 if (reg->maxPos < 12 || (unsigned int) reg->maxPos > gRegionOfInterest-12) … … 797 837 continue; 798 838 } 799 839 cout << endl << "def" << endl; 800 840 // Define axis range of Histogram 801 841 int Left = reg->maxPos - gPixelOverlayXaxisLeft; … … 815 855 816 856 //determine order of pulse and which histogram shall be filled 817 if (verbosityLevel > 2) cout << endl << "\t...choosing Histogram" ; 857 // if (verbosityLevel > 2) 858 cout << endl << "\t...choosing Histogram" ; 818 859 for(int order = 0; order < maxPulseOrder; order++) 819 860 { … … 835 876 if ( histoOptions.Contains("S") ) 836 877 { 837 if (verbosityLevel > 2) cout << endl << "\t...filling Edge Histogram" ; 878 // if (verbosityLevel > 2) 879 cout << endl << "\t...filling Edge Histogram" ; 838 880 CurrentPixel->hSlopeRisingEdge[order]->Fill( reg->slopeOfRisingEdge ) ; 839 881 } 840 882 } 841 883 } 842 884 cout << endl << "middle" << endl; 843 885 //Fill overlay und profile histograms 844 886 if (use_this_peak){ 845 if (verbosityLevel > 2) cout << "...filling" ; 887 // if (verbosityLevel > 2) 888 cout << "...filling" ; 846 889 for ( int pos = Left; pos < Right; pos++){ 847 890 // if (); … … 862 905 } 863 906 if (verbosityLevel > 2) cout << "...done" << endl; 907 cout << endl << "end" << endl; 864 908 } 865 909 // end of FillHistograms … … 992 1036 993 1037 }// end of if(spikeDebug) 1038 1039 1040 int main() 1041 { 1042 1043 FPulseOverlay(); 1044 return 0; 1045 1046 }
Note:
See TracChangeset
for help on using the changeset viewer.