Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
tvami committed Aug 27, 2024
1 parent bd2a037 commit 1de8fe3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Ecal/src/Ecal/EcalVetoProcessor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,6 @@ void EcalVetoProcessor::produce(framework::Event &event) {
if (trackingHitList.size() < 3) break;
hitNums[1] = jHit;
for (int kHit = jHit + 1; kHit < nHitsInRegion; kHit++) {
unsigned int numZeros = 0;
hitNums[2] = kHit;
for (int hInd = 0; hInd < 3; hInd++) {
// hmean = geometric mean, subtract off from hits to improve SVD
Expand All @@ -1030,18 +1029,17 @@ void EcalVetoProcessor::produce(framework::Event &event) {
}
for (int hInd = 0; hInd < 3; hInd++) {
for (int lInd = 0; lInd < 3; lInd++) {
auto matrixValue =
hdt(hInd, lInd) =
trackingHitList[hitNums[hInd]].pos(lInd) - hmean(lInd);
hdt(hInd, lInd) = matrixValue;
if (matrixValue == 0) numZeros++;
}
}

// Perform "linreg" on selected points
// Calculate the determinant of the matrix
double determinant = hdt(0,0)*(hdt(1,1)*hdt(2,2)-hdt(1,2)*hdt(2,1))
-hdt(0,1)*(hdt(1,0)*hdt(2,2)-hdt(1,2)*hdt(2,0))
+hdt(0,2)*(hdt(1,0)*hdt(2,1)-hdt(1,1)*hdt(2,0));
double determinant =
hdt(0, 0) * (hdt(1, 1) * hdt(2, 2) - hdt(1, 2) * hdt(2, 1)) -
hdt(0, 1) * (hdt(1, 0) * hdt(2, 2) - hdt(1, 2) * hdt(2, 0)) +
hdt(0, 2) * (hdt(1, 0) * hdt(2, 1) - hdt(1, 1) * hdt(2, 0));
// Exit early if the matrix is singular (i.e. det = 0)
if (determinant == 0) continue;
// Perform matrix decomposition with SVD
Expand Down Expand Up @@ -1091,8 +1089,8 @@ void EcalVetoProcessor::produce(framework::Event &event) {
trackLen++;
}
}
} // end loop on hits in the region
} // end 2nd loop on hits in the region
} // end loop on hits in the region
} // end 2nd loop on hits in the region

// Ordinarily, additional hits in line w/ track would be added here.
// However, this doesn't affect the results of the simple veto. Exclude all
Expand All @@ -1104,7 +1102,7 @@ void EcalVetoProcessor::produce(framework::Event &event) {
}
iHit--;
}
} // end loop on all hits
} // end loop on all hits

ldmx_log(debug) << " MIP tracking completed; found " << nStraightTracks_
<< " straight tracks and " << nLinregTracks_
Expand Down

0 comments on commit 1de8fe3

Please sign in to comment.