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 8, 2024
1 parent 41d27d1 commit 407dd20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/TRestTrack2DAnalysisProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ TRestEvent* TRestTrack2DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {

// Copy the MaxTrack keys immediately after checking the vector
if (!energiesX.empty()) {
int energiesX0FirstKey = energiesX[0].first; // Declare Keys outside to avoid error when accessing "energiesX[0].first"...
int energiesX0FirstKey =
energiesX[0].first; // Declare Keys outside to avoid error when accessing "energiesX[0].first"...

SetObservableValue("MaxTrack_XZ_NHitsX", XZ_NHitsX[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_EnergyX", XZ_EnergyX[energiesX0FirstKey]);
Expand Down Expand Up @@ -476,7 +477,8 @@ TRestEvent* TRestTrack2DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {

// Copy the SecondTrack keys immediately after checking the vector
if (!energiesX.empty()) {
int energiesX1FirstKey = energiesX[1].first; // Declare Keys outside to avoid error when accessing "energiesX[1].first"...
int energiesX1FirstKey =
energiesX[1].first; // Declare Keys outside to avoid error when accessing "energiesX[1].first"...

SetObservableValue("SecondMaxTrack_XZ_NHitsX", XZ_NHitsX[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_EnergyX", XZ_EnergyX[energiesX1FirstKey]);
Expand Down
8 changes: 4 additions & 4 deletions src/TRestTrack3DAnalysisProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ TRestEvent* TRestTrack3DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {

// Copy the MaxTrack keys immediately after checking the vector
if (!energies.empty()) {

// --- Max track observables --- //
int energies0FirstKey = energies[0].first; // Declare Keys outside to avoid error when accessing "energies[0].first"...
int energies0FirstKey =
energies[0].first; // Declare Keys outside to avoid error when accessing "energies[0].first"...
Double_t energies0SecondKey = energies[0].second;

SetObservableValue("MaxTrack_XYZ_NHits", XYZ_NHits[energies0FirstKey]);
Expand All @@ -265,7 +265,7 @@ TRestEvent* TRestTrack3DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
SetObservableValue("MaxTrack_XYZ_SkewZ", XYZ_SkewZ[energies0FirstKey]);

SetObservableValue("MaxTrack_XYZ_MaxTrackEnergyPercentage",
(energies0SecondKey) / fTrackEvent->GetEnergy());
(energies0SecondKey) / fTrackEvent->GetEnergy());

// --- Second max track observables --- //
int energies1FirstKey = energies[1].first;
Expand All @@ -290,7 +290,7 @@ TRestEvent* TRestTrack3DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {

if (fTrackEvent->GetNumberOfTracks() > 2) {
SetObservableValue("SecondMaxTrack_XYZ_MaxTrackEnergyPercentage",
(energies1SecondKey) / fTrackEvent->GetEnergy());
(energies1SecondKey) / fTrackEvent->GetEnergy());
} else {
SetObservableValue("SecondMaxTrack_XYZ_MaxTrackEnergyPercentage", 0.0);
}
Expand Down

0 comments on commit 407dd20

Please sign in to comment.