Skip to content

Commit

Permalink
have fitcentroid correctly set position to be invalid when charge = 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesJieranShen committed Dec 10, 2024
1 parent 6ec3fd4 commit 288fedd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/fit/src/FitCentroidProc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ Processor::Result FitCentroidProc::Event(DS::Root *ds, DS::EV *ev) {
centroid += Qpow * pmtpos;
}

centroid *= 1.0 / totalQ;
DS::FitResult *fit = new DS::FitResult("FitCentroid");
fit->SetPosition(centroid);
fit->SetEnablePosition(true);
if (totalQ) {
centroid *= 1.0 / totalQ;
fit->SetPosition(centroid);
} else {
fit->SetValidPosition(false);
}
ev->AddFitResult(fit);

return Processor::OK;
Expand Down

0 comments on commit 288fedd

Please sign in to comment.