Changeset 15121 for fact/tools/rootmacros/PulseTemplates
- Timestamp:
- 03/19/13 09:34:32 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FPulseOverlay_filelist.C
r15118 r15121 225 225 int maxPulseOrder = 6, 226 226 //---------------{stacking parameters}--------------- 227 TString histoOptions = "SRM ",227 TString histoOptions = "SRMTILDAP", 228 228 int AmplWindowWidth = 8, //Width of Window for selection of pulses to histograms 229 229 float GainMean = 12, … … 731 731 vector<Region>* pZXings = zerosearch( gVcfd2 , 1 , 8); 732 732 // pZXings means "zero cross ings" 733 EnlargeRegion(*pZXings, 10, 10); 734 findAbsMaxInRegions(*pZXings, gVslide); 735 removeMaximaBelow( *pZXings, minPulseAmplitude); 736 removeMaximaAbove( *pZXings, maxPulseAmplitude); 737 removeRegionWithMaxOnEdge( *pZXings, timeLineEdgeWidth); 738 removeRegionOnFallingEdge( *pZXings, FallingEdgeWidth); 733 734 int init_reg_size = pZXings->size(); 735 int curr_reg_size = initial_region_size; 736 int step = 0; 737 pixel[pixelID]->hDiscartedPulses->Fill(step, init_reg_size - curr_reg_size); 738 739 //enlare the search window 740 curr_reg_size = EnlargeRegion(*pZXings, 10, 10); 741 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 742 743 // find the the max position of a peak 744 curr_reg_size = findAbsMaxInRegions(*pZXings, gVslide); 745 pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size); 746 747 //do a small after pulse analysis, fill in delayed pulses 748 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 749 vector<Region>::iterator reg_it = pZXings->begin(); 750 int first_pos = pZXings->begin()->maxPos; 751 while( reg_it != pZXings->end() ) 752 { 753 float minimum = 0.0; 754 for (int sl = reg_it->maxPos; sl < 1; i--) 755 { 756 if (gVcfd2[sl] > 0 && gVcfd2[sl-2] <= 0 && gVcfd2[sl-4] < 0) 757 { 758 minimum = gVcfd2[sl-2]; 759 break; 760 } 761 } 762 763 pixel[pixelID]->hAfterPulses->Fill( 764 reg_it->maxPos - first_pos, 765 reg_it->maxVal - minimum 766 ); 767 } 768 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 769 770 // remove peaks below 1 p.e. 771 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); 785 739 786 // Calculate the position (sample) of a pulses half maximum 740 findTimeOfHalfMaxLeft(*pZXings, gVslide, gBSLMean, beginRisingEdge, endRisingEdge, verbosityLevel ); 741 //sometimes pulses where found with a very flat slope, DISMISS them 742 removeRegionWithToFlatSlope(*pZXings, risingEdgeMinSlope); 787 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); 743 793 if (verbosityLevel > 2) cout << "...done" << endl; 794 795 // Fill arrival times into histograms 796 vector<Region>::iterator it = pZXings->begin(); 797 while( it != pZXings->end() ) 798 { 799 pixel[pixelID]->hMaxPos->Fill( it->maxPos); 800 pixel[pixelID]->hEdgePos->Fill( it->halfRisingEdgePos); 801 pixel[pixelID]->hEdgeSlope->Fill( it->slopeOfRisingEdge); 802 pixel[pixelID]->hIntercept->Fill( it->interceptRisingEdge); 803 pixel[pixelID]->hEdgeLength->Fill( it->lengthOfRisingEdge); 804 pixel[pixelID]->hMaxAmpl->Fill( it->maxVal); 805 ++it; 806 } 744 807 745 808 //----------------------------------------------------------------------------- … … 1145 1208 for ( int pos = Left; pos < Right; pos++) 1146 1209 { 1147 if (pos > reg->maxPos + 2)1210 if (pos > reg->maxPos + 1) 1148 1211 { 1149 1212 if ( pos+5 >= Right ) … … 1156 1219 } 1157 1220 slope_of_follow = (gVcorr[pos+5] - gVcorr[pos+1])/5; 1158 1159 1221 if (slope_of_follow > 1) 1160 1222 { … … 1165 1227 CurrentPixel->hMaxProfile[order_of_pulse]->Fill( pos - (reg->maxPos), gVcorr[pos]) ; 1166 1228 } 1229 1167 1230 //Histograms for Edge Overlay 1231 int last_pos = 0; 1232 bool ap_cutoff = false; 1233 slope_of_follow = 0.0; 1234 1168 1235 for ( int pos = EdgeLeft; pos < EdgeRight; pos++) 1169 1236 { 1170 if (pos > reg->maxPos + 2)1237 if (pos > reg->maxPos + 1) 1171 1238 { 1172 1239 // check if the current slice is close to the end of the overlay window 1173 1240 if ( pos+5 >= Right ) 1174 1241 { 1242 ap_cutoff = false; 1175 1243 break; 1176 1244 } … … 1180 1248 if (gVcorr[pos+1] > average_of_max) 1181 1249 { 1250 ap_cutoff = true; 1182 1251 break; 1183 1252 } … … 1187 1256 if (slope_of_follow > 1) 1188 1257 { 1258 ap_cutoff = true; 1189 1259 break; 1190 1260 } … … 1200 1270 CurrentPixel->hEdgeOverlay[order_of_pulse]->Fill( pos - (reg->halfRisingEdgePos), gVcorr[pos]) ; 1201 1271 CurrentPixel->hEdgeProfile[order_of_pulse]->Fill( pos - (reg->halfRisingEdgePos), gVcorr[pos]) ; 1272 } 1273 1274 CurrentPixel->hPulseLength->Fill(last_pos - (reg->halfRisingEdgePos)); 1275 if (ap_cutoff) 1276 { 1277 CurrentPixel->hPulseLengthAPcutoff->Fill(last_pos - (reg->halfRisingEdgePos)); 1278 } 1279 else 1280 { 1281 CurrentPixel->hPulseLengthTLcutoff->Fill(last_pos - (reg->halfRisingEdgePos)); 1202 1282 } 1203 1283
Note:
See TracChangeset
for help on using the changeset viewer.