Skip to content

Commit f70049b

Browse files
Merge pull request #74 from rest-for-physics/konrad_fixGaussObservables
TRestDetectorGitsGaussAnalysisProcess: added exceptions for failed fits
2 parents ba2ab4d + 72b89f3 commit f70049b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: src/TRestDetectorHitsGaussAnalysisProcess.cxx

+7-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ TRestEvent* TRestDetectorHitsGaussAnalysisProcess::ProcessEvent(TRestEvent* inpu
164164
Double_t gausSigmaX = fOutputHitsEvent->GetGaussSigmaX();
165165
Double_t gausSigmaY = fOutputHitsEvent->GetGaussSigmaY();
166166
Double_t gausSigmaZ = fOutputHitsEvent->GetGaussSigmaZ();
167-
Double_t xy2SigmaGaus = (gausSigmaX * gausSigmaX) + (gausSigmaY * gausSigmaY);
167+
Double_t xy2SigmaGaus = (gausSigmaX == -1. || gausSigmaY == -1.)
168+
? -1.
169+
: (gausSigmaX * gausSigmaX) + (gausSigmaY * gausSigmaY);
170+
Double_t xySigmaBalanceGaus = (gausSigmaX == -1. || gausSigmaY == -1.)
171+
? -1.
172+
: (gausSigmaX - gausSigmaY) / (gausSigmaX + gausSigmaY);
168173

169174
if (hits->GetNumberOfHits() > 30 && xy2SigmaGaus < 0.05)
170175
RESTDebug << string("Event ID: ") << to_string(fInputHitsEvent->GetID()) << string("||") << RESTendl;
@@ -173,7 +178,7 @@ TRestEvent* TRestDetectorHitsGaussAnalysisProcess::ProcessEvent(TRestEvent* inpu
173178
SetObservableValue("ySigmaGaus", gausSigmaY);
174179
SetObservableValue("zSigmaGaus", gausSigmaZ);
175180
SetObservableValue("xy2SigmaGaus", xy2SigmaGaus);
176-
SetObservableValue("xySigmaBalanceGaus", (gausSigmaX - gausSigmaY) / (gausSigmaX + gausSigmaY));
181+
SetObservableValue("xySigmaBalanceGaus", xySigmaBalanceGaus);
177182

178183
// We transform here fHitsEvent if necessary
179184

0 commit comments

Comments
 (0)