Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 5, 2024
1 parent 024bb50 commit a0128bb
Showing 1 changed file with 37 additions and 36 deletions.
73 changes: 37 additions & 36 deletions src/TRestTrack2DAnalysisProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ TRestEvent* TRestTrack2DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
SetObservableValue("Map_XZ_YZ_GaussSigmaXYBalance", XZ_YZ_GaussSigmaXYBalance);
SetObservableValue("Map_XZ_YZ_GaussSigmaZBalance", XZ_YZ_GaussSigmaZBalance);


// --- Max track observables --- //
int energiesX0FirstKey = -1; // Declare Keys outside to avoid error when accessing "energiesX[0].first"...
int energiesX0FirstKey =
-1; // Declare Keys outside to avoid error when accessing "energiesX[0].first"...
int energiesX0SecondKey = -1;
int energiesY0FirstKey = -1;
int energiesY0SecondKey = -1;
Expand Down Expand Up @@ -464,9 +464,9 @@ TRestEvent* TRestTrack2DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {

SetObservableValue("MaxTrack_XZ_YZ_Energy", energiesX[0].second + energiesY[0].second);
SetObservableValue("MaxTrack_XZ_YZ_MaxTrackEnergyPercentage",
(energiesX[0].second + energiesY[0].second) / fTrackEvent->GetEnergy());
(energiesX[0].second + energiesY[0].second) / fTrackEvent->GetEnergy());
SetObservableValue("MaxTrack_XZ_YZ_EnergyBalanceXY", (energiesX[0].second - energiesY[0].second) /
(energiesX[0].second + energiesY[0].second));
(energiesX[0].second + energiesY[0].second));

} else {
std::cerr << "Error: energiesX or energiesY is empty. Some observables will not be set." << std::endl;
Expand All @@ -478,7 +478,8 @@ TRestEvent* TRestTrack2DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
SetObservableValue("MaxTrack_XZ_YZ_GaussSigmaZBalance", XZ_YZ_GaussSigmaZBalance[0]);

// --- Second max track observables --- //
int energiesX1FirstKey = -1; // Declare Keys outside to avoid error when accessing "energiesX[1].first"...
int energiesX1FirstKey =
-1; // Declare Keys outside to avoid error when accessing "energiesX[1].first"...
int energiesX1SecondKey = -1;
int energiesY1FirstKey = -1;
int energiesY1SecondKey = -1;
Expand Down Expand Up @@ -519,38 +520,38 @@ TRestEvent* TRestTrack2DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
} else {
std::cerr << "Error: energiesY is empty. Some observables will not be set." << std::endl;
}
/*
SetObservableValue("SecondMaxTrack_XZ_YZ_SigmaXYBalance", XZ_YZ_SigmaXYBalance[1]);
SetObservableValue("SecondMaxTrack_XZ_YZ_SigmaZBalance", XZ_YZ_SigmaZBalance[1]);
SetObservableValue("SecondMaxTrack_XZ_YZ_GaussSigmaXYBalance", XZ_YZ_GaussSigmaXYBalance[1]);
SetObservableValue("SecondMaxTrack_XZ_YZ_GaussSigmaZBalance", XZ_YZ_GaussSigmaZBalance[1]);
if (fTrackEvent->GetNumberOfTracks() > 1) {
SetObservableValue("SecondMaxTrack_XZ_YZ_Energy", energiesX[1].second + energiesY[1].second);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyPercentage",
(energiesX[1].second + energiesY[1].second) / fTrackEvent->GetEnergy());
SetObservableValue(
"SecondMaxTrack_XZ_YZ_EnergyBalanceXY",
(energiesX[1].second - energiesY[1].second) / (energiesX[1].second + energiesY[1].second));
} else {
SetObservableValue("SecondMaxTrack_XZ_YZ_Energy", 0);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyPercentage", 0);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyBalanceXY", 0);
}
/*
SetObservableValue("SecondMaxTrack_XZ_YZ_SigmaXYBalance", XZ_YZ_SigmaXYBalance[1]);
SetObservableValue("SecondMaxTrack_XZ_YZ_SigmaZBalance", XZ_YZ_SigmaZBalance[1]);
SetObservableValue("SecondMaxTrack_XZ_YZ_GaussSigmaXYBalance", XZ_YZ_GaussSigmaXYBalance[1]);
SetObservableValue("SecondMaxTrack_XZ_YZ_GaussSigmaZBalance", XZ_YZ_GaussSigmaZBalance[1]);
if (fTrackEvent->GetNumberOfTracks() > 1) {
SetObservableValue("SecondMaxTrack_XZ_YZ_Energy", energiesX[1].second + energiesY[1].second);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyPercentage",
(energiesX[1].second + energiesY[1].second) / fTrackEvent->GetEnergy());
SetObservableValue(
"SecondMaxTrack_XZ_YZ_EnergyBalanceXY",
(energiesX[1].second - energiesY[1].second) / (energiesX[1].second + energiesY[1].second));
} else {
SetObservableValue("SecondMaxTrack_XZ_YZ_Energy", 0);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyPercentage", 0);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyBalanceXY", 0);
}
// --- Distance obsevables between first two tracks --- //
SetObservableValue("XZ_FirstSecondTracksDistanceXZ", XZ_FirstSecondTracksDistanceXZ);
SetObservableValue("YZ_FirstSecondTracksDistanceYZ", YZ_FirstSecondTracksDistanceYZ);
SetObservableValue("XZ_YZ_FirstSecondTracksDistanceSum",
TMath::Sqrt(XZ_FirstSecondTracksDistanceXZ * XZ_FirstSecondTracksDistanceXZ +
YZ_FirstSecondTracksDistanceYZ * YZ_FirstSecondTracksDistanceYZ));
// --- Observables merging max tracks XZ and YZ --- //
SetObservableValue("MaxTrack_XZ_YZ_SigmaZ", MaxTrack_XZ_YZ_SigmaZ);
SetObservableValue("MaxTrack_XZ_YZ_GaussSigmaZ", MaxTrack_XZ_YZ_GaussSigmaZ);
SetObservableValue("MaxTrack_XZ_YZ_SkewXY", MaxTrack_XZ_YZ_SkewXY);
SetObservableValue("MaxTrack_XZ_YZ_SkewZ", MaxTrack_XZ_YZ_SkewZ);
*/
// --- Distance obsevables between first two tracks --- //
SetObservableValue("XZ_FirstSecondTracksDistanceXZ", XZ_FirstSecondTracksDistanceXZ);
SetObservableValue("YZ_FirstSecondTracksDistanceYZ", YZ_FirstSecondTracksDistanceYZ);
SetObservableValue("XZ_YZ_FirstSecondTracksDistanceSum",
TMath::Sqrt(XZ_FirstSecondTracksDistanceXZ * XZ_FirstSecondTracksDistanceXZ +
YZ_FirstSecondTracksDistanceYZ * YZ_FirstSecondTracksDistanceYZ));
// --- Observables merging max tracks XZ and YZ --- //
SetObservableValue("MaxTrack_XZ_YZ_SigmaZ", MaxTrack_XZ_YZ_SigmaZ);
SetObservableValue("MaxTrack_XZ_YZ_GaussSigmaZ", MaxTrack_XZ_YZ_GaussSigmaZ);
SetObservableValue("MaxTrack_XZ_YZ_SkewXY", MaxTrack_XZ_YZ_SkewXY);
SetObservableValue("MaxTrack_XZ_YZ_SkewZ", MaxTrack_XZ_YZ_SkewZ);
*/
return fTrackEvent;
}

Expand Down

0 comments on commit a0128bb

Please sign in to comment.