Changeset 15372 for fact/tools
- Timestamp:
- 04/19/13 01:42:28 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FPulseOverlay_filelist.C
r15121 r15372 215 215 TString sequenzFileName = "/home_nfs/isdc/jbbuss/analysis/pulseShape/lists/20120802templ_vs_100mV.csv", 216 216 TString OutputPath = "analysis/PulsTemplateAnalysis/20120802/", 217 TString OutRootFileName = "20120802_100mV_Stacking_G12B-2AWW8.root", 217 //TString OutRootFileName = "20120802_100mV_Stacking_G12B-2AWW8.root", 218 TString OutRootFileName = "new_dist_test.root", 218 219 //---------------{Process parameters}--------------- 219 int nRuns = -1,220 int nRuns = 5, 220 221 int firstevent = 1, // Hast to be between 1 and infinity NOT 0!!!! 221 222 int nevents = -1, 222 223 int firstpixel = 0, 223 int npixel = -1,224 int pixelSetSize = 150,224 int npixel = 1, 225 int pixelSetSize = 150, 225 226 int maxPulseOrder = 6, 226 227 //---------------{stacking parameters}--------------- … … 241 242 float risingEdgeMinSlope = 0.5, 242 243 //---------------{graphical options}--------------- 243 bool select_pulses= false,244 bool select_pulses = false, 244 245 bool ProduceGraphic = false, 245 246 bool spikeDebug = false, … … 258 259 259 260 // Amplitude below which pulses will be discarted 260 float minPulseAmplitude = 0.3*(GainMean -BSLMean);261 float minPulseAmplitude = 0.3*(GainMean)+BSLMean; 261 262 // Amplitude above which pulses will be discarted 262 float maxPulseAmplitude = 2*(GainMean-BSLMean)*maxPulseOrder;263 float maxPulseAmplitude = (maxPulseOrder+1)*(GainMean)+BSLMean; 263 264 // pulses within this distance to timeline edge be discarted 264 265 int timeLineEdgeWidth = 2; … … 298 299 //fill vector of fits files to read 299 300 cout << "generating file list:" << endl; 300 if(nRuns < fitsFileNames.size() && nRuns != -1)301 if(nRuns < (int)fitsFileNames.size() && nRuns != -1) 301 302 { 302 303 fitsFileNames.resize( nRuns); … … 729 730 // first Argument 1 means ... *rising* edge 730 731 // second Argument 1 means ... seagRCh with stepsize 1 ... 10 is okay as well 731 vector<Region>* pZXings = zerosearch( gVcfd2 , 1 , 8 );732 vector<Region>* pZXings = zerosearch( gVcfd2 , 1 , 8, verbosityLevel); 732 733 // pZXings means "zero cross ings" 733 734 734 int init_reg_size = pZXings->size();735 int curr_reg_size = initial_region_size;735 float init_reg_size = pZXings->size(); 736 float curr_reg_size = init_reg_size; 736 737 int step = 0; 737 pixel[pixelID]->hDiscartedPulses->Fill(step, init_reg_size - curr_reg_size); 738 739 pixel[pixelID]->hDiscartedPulses->Fill(step, 1 - curr_reg_size/init_reg_size); 738 740 739 741 //enlare the search window 740 742 curr_reg_size = EnlargeRegion(*pZXings, 10, 10); 741 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);743 pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 742 744 743 745 // find the the max position of a peak 744 746 curr_reg_size = findAbsMaxInRegions(*pZXings, gVslide); 745 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 746 747 pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 748 749 // curr_reg_size = calcCFDPositions(*pZXings, gVcfd2); 750 // pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 751 752 753 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 747 754 //do a small after pulse analysis, fill in delayed pulses 748 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 755 749 756 vector<Region>::iterator reg_it = pZXings->begin(); 750 757 int first_pos = pZXings->begin()->maxPos; 751 758 while( reg_it != pZXings->end() ) 752 759 { 753 float minimum = 0.0;754 for (int sl = reg_it->maxPos; sl < 1; i--)760 //float minimum = 0.0; 761 for (int sl = reg_it->maxPos; sl < 1; sl--) 755 762 { 756 763 if (gVcfd2[sl] > 0 && gVcfd2[sl-2] <= 0 && gVcfd2[sl-4] < 0) 757 764 { 758 minimum = gVcfd2[sl-2];765 //minimum = gVcfd2[sl-2]; 759 766 break; 760 767 } 761 768 } 762 763 769 pixel[pixelID]->hAfterPulses->Fill( 764 770 reg_it->maxPos - first_pos, 765 reg_it->maxVal - minimum771 reg_it->maxVal// - minimum 766 772 ); 773 reg_it++; 767 774 } 768 775 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 770 777 // remove peaks below 1 p.e. 771 778 curr_reg_size = removeMaximaBelow( *pZXings, minPulseAmplitude); 772 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 773 774 // remove peaks above that are larger tha the largest amplitude to be studied 775 curr_reg_size = removeMaximaAbove( *pZXings, maxPulseAmplitude); 776 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 777 778 // remove pulses at the pipeline fringes 779 curr_reg_size = removeRegionWithMaxOnEdge( *pZXings, timeLineEdgeWidth); 780 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 781 782 // remove "Afterpulses" from pulse list 783 curr_reg_size = removeRegionOnFallingEdge( *pZXings, FallingEdgeWidth); 784 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 779 pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 785 780 786 781 // Calculate the position (sample) of a pulses half maximum 787 782 curr_reg_size = findTimeOfHalfMaxLeft(*pZXings, gVslide, gBSLMean, beginRisingEdge, endRisingEdge, verbosityLevel ); 788 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 789 790 //sometimes pulses where found with a very flat slope, DISCARD them 791 curr_reg_size = removeRegionWithToFlatSlope(*pZXings, risingEdgeMinSlope); 792 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 793 if (verbosityLevel > 2) cout << "...done" << endl; 783 pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 784 794 785 795 786 // Fill arrival times into histograms … … 800 791 pixel[pixelID]->hEdgePos->Fill( it->halfRisingEdgePos); 801 792 pixel[pixelID]->hEdgeSlope->Fill( it->slopeOfRisingEdge); 793 pixel[pixelID]->hMaxEdgeSlope->Fill( it->maxSlope); 802 794 pixel[pixelID]->hIntercept->Fill( it->interceptRisingEdge); 803 pixel[pixelID]->hEdgeLength->Fill( it-> lengthOfRisingEdge);795 pixel[pixelID]->hEdgeLength->Fill( it->distanceEdgeToMax); 804 796 pixel[pixelID]->hMaxAmpl->Fill( it->maxVal); 805 797 ++it; 806 798 } 799 800 // remove pulses at the pipeline fringes 801 curr_reg_size = removeRegionWithMaxOnEdge( *pZXings, timeLineEdgeWidth); 802 pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 803 804 //sometimes pulses where found with a very flat slope, DISCARD them 805 curr_reg_size = removeRegionWithToFlatSlope(*pZXings, risingEdgeMinSlope); 806 pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 807 if (verbosityLevel > 2) cout << "...done" << endl; 808 809 // remove peaks above that are larger tha the largest amplitude to be studied 810 curr_reg_size = removeMaximaAbove( *pZXings, maxPulseAmplitude); 811 pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 812 813 814 // remove "Afterpulses" from pulse list 815 curr_reg_size = removeRegionOnFallingEdge( *pZXings, FallingEdgeWidth); 816 pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size); 817 818 807 819 808 820 //----------------------------------------------------------------------------- … … 1237 1249 if (pos > reg->maxPos + 1) 1238 1250 { 1251 last_pos = pos; 1239 1252 // check if the current slice is close to the end of the overlay window 1240 1253 if ( pos+5 >= Right )
Note:
See TracChangeset
for help on using the changeset viewer.