@@ -79,11 +79,11 @@ namespace hit {
7979 const std::vector<int > fLongMaxHitsVec ; // /<Maximum number hits on a really long pulse train
8080 const std::vector<int > fLongPulseWidthVec ; // /<Sets width of hits used to describe long pulses
8181
82- const size_t fMaxMultiHit ; // /<maximum hits for multi fit
82+ const std::vector< size_t > fMaxMultiHit ; // /<maximum hits for multi fit
8383 const int fAreaMethod ; // /<Type of area calculation
8484 const std::vector<double >
8585 fAreaNormsVec ; // /<factors for converting area to same units as peak height
86- const double fChi2NDF ; // /maximum Chisquared / NDF allowed for a hit to be saved
86+ const std::vector< double > fChi2NDF ; // /maximum Chisquared / NDF allowed for a hit to be saved
8787
8888 const std::vector<float > fPulseHeightCuts ;
8989 const std::vector<float > fPulseWidthCuts ;
@@ -116,10 +116,10 @@ namespace hit {
116116 , fLongMaxHitsVec (pset.get<std::vector<int >>(" LongMaxHits" , std::vector<int >() = {25 , 25 , 25 }))
117117 , fLongPulseWidthVec (
118118 pset.get<std::vector<int >>(" LongPulseWidth" , std::vector<int >() = {16 , 16 , 16 }))
119- , fMaxMultiHit (pset.get<int >( " MaxMultiHit " ))
119+ , fMaxMultiHit (pset.get<std::vector< size_t >>( " MaxMultiHitPerPlane " , std::vector< size_t >() = { 5 , 5 , 5 } ))
120120 , fAreaMethod (pset.get<int >(" AreaMethod" ))
121121 , fAreaNormsVec (FillOutHitParameterVector(pset.get<std::vector<double >>(" AreaNorms" )))
122- , fChi2NDF (pset.get<double >( " Chi2NDF " ))
122+ , fChi2NDF (pset.get<std::vector< double >>( " Chi2NDFPerPlane " , std::vector< double >() = { 500.0 , 500.0 , 500.0 } ))
123123 , fPulseHeightCuts (
124124 pset.get<std::vector<float >>(" PulseHeightCuts" , std::vector<float >() = {3.0 , 3.0 , 3.0 }))
125125 , fPulseWidthCuts (
@@ -365,13 +365,13 @@ namespace hit {
365365 // #######################################################
366366 // ### If # requested Gaussians is too large then punt ###
367367 // #######################################################
368- if (mergedCands.size () <= fMaxMultiHit ) {
368+ if (mergedCands.size () <= fMaxMultiHit . at (plane) ) {
369369 fPeakFitterTool ->findPeakParameters (
370370 range.data (), mergedCands, peakParamsVec, chi2PerNDF, NDF);
371371
372372 // If the chi2 is infinite then there is a real problem so we bail
373373 if (!(chi2PerNDF < std::numeric_limits<double >::infinity ())) {
374- chi2PerNDF = 2 . * fChi2NDF ;
374+ chi2PerNDF = 2 . * fChi2NDF . at (plane) ;
375375 NDF = 2 ;
376376 }
377377
@@ -384,7 +384,7 @@ namespace hit {
384384 // ### depend on the fhicl parameter fLongPulseWidth ###
385385 // ### Also do this if chi^2 is too large ###
386386 // #######################################################
387- if (mergedCands.size () > fMaxMultiHit || nGausForFit * chi2PerNDF > fChi2NDF ) {
387+ if (mergedCands.size () > fMaxMultiHit . at (plane) || nGausForFit * chi2PerNDF > fChi2NDF . at (plane) ) {
388388 int longPulseWidth = fLongPulseWidthVec .at (plane);
389389 int nHitsThisPulse = (endT - startT) / longPulseWidth;
390390
@@ -401,7 +401,7 @@ namespace hit {
401401 peakParamsVec.clear ();
402402 nGausForFit = nHitsThisPulse;
403403 NDF = 1 .;
404- chi2PerNDF = chi2PerNDF > fChi2NDF ? chi2PerNDF : -1 .;
404+ chi2PerNDF = chi2PerNDF > fChi2NDF . at (plane) ? chi2PerNDF : -1 .;
405405
406406 for (int hitIdx = 0 ; hitIdx < nHitsThisPulse; hitIdx++) {
407407 // This hit parameters
0 commit comments