Skip to content

Commit

Permalink
Merge pull request #611 from gianipez/lsqsumBug
Browse files Browse the repository at this point in the history
WIP: Lsqsum class clean up + added check on the number of point used to evaluate the chi2 in CalPatRec
  • Loading branch information
kutschke authored Oct 7, 2021
2 parents a4dca1e + e5e5447 commit 1c776c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
10 changes: 5 additions & 5 deletions CalPatRec/src/CalHelixFinderAlg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1278,9 +1278,9 @@ namespace mu2e {
// gianipez: procedure for aligning the phi vector
//-----------------------------------------------------------------------------
::LsqSums4 szphi;
int count(0);
float chi2min, deltaPhi, dphi_max(0);

int count(0), minNFitHits(5);
float chi2min, deltaPhi, dphi_max(0);
HitInfo_t iworst;//(-1,-1);

const char banner[200] = "doLinearFitPhiZ";
Expand Down Expand Up @@ -1340,7 +1340,7 @@ namespace mu2e {
}

//update the dfdz and phi0 if...
if ( (count>=5) && //FIXME!
if ( (count>=minNFitHits) && //FIXME!
(faceHitChi2 < 2.) &&
( (fabs(phiZInfo.dfdz - Helix._szphi.dfdz()) < 8.e-4) ) &&// || //require that the new value of dfdz is
//close to the starting one. update dfdz only if:
Expand All @@ -1362,7 +1362,7 @@ namespace mu2e {
//-----------------------------------------------------------------------------
// perform a cleanup in RZ
//-----------------------------------------------------------------------------
if ( DoCleanUp == 1){
if ( (DoCleanUp == 1) && (Helix._szphi.qn()>=minNFitHits)){
if ( Helix._szphi.chi2DofLine() > _chi2zphiMax) {
NEXT_ITERATION:;
//reset the coordinates of the worst hit
Expand Down
5 changes: 1 addition & 4 deletions Mu2eUtilities/inc/LsqSums2.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
class LsqSums2 {

protected:
double _qn, sw, sx, sy, sx2, sxy, sy2, sx3, sx2y, sxy2, sy3, sx4, sx3y, sx2y2, sxy3, sy4;
double xmean, ymean, x2mean, xymean, y2mean, x3mean, x2ymean, xy2mean, y3mean;
double x4mean, x3ymean, x2y2mean, xy3mean, y4mean;

double _qn, sw, sx, sy, sx2, sxy, sy2;
double fX0, fY0; // offsets, need to be defined in the very beginning, by default - 0


Expand Down
2 changes: 0 additions & 2 deletions Mu2eUtilities/inc/LsqSums4.hh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class LsqSums4 {

protected:
double _qn, sw, sx, sy, sx2, sxy, sy2, sx3, sx2y, sxy2, sy3, sx4, sx3y, sx2y2, sxy3, sy4;
double xmean, ymean, x2mean, xymean, y2mean, x3mean, x2ymean, xy2mean, y3mean;
double x4mean, x3ymean, x2y2mean, xy3mean, y4mean;

double fX0, fY0; // offsets, need to be defined in the very beginning, by default - 0

Expand Down

0 comments on commit 1c776c0

Please sign in to comment.