Skip to content

Commit

Permalink
Merge pull request #45 from rest-for-physics/jporron-Tracks2D-Tracks3…
Browse files Browse the repository at this point in the history
…D-Issues

Work on Tracks2D and 3D - Comment checkpoint
  • Loading branch information
JPorron authored Jul 31, 2024
2 parents ba87193 + b0ae3e8 commit 8c56396
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 103 deletions.
169 changes: 107 additions & 62 deletions src/TRestTrack2DAnalysisProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -415,82 +415,127 @@ TRestEvent* TRestTrack2DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
SetObservableValue("Map_XZ_YZ_GaussSigmaZBalance", XZ_YZ_GaussSigmaZBalance);

// --- Max track observables --- //
SetObservableValue("MaxTrack_XZ_NHitsX", XZ_NHitsX[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_EnergyX", XZ_EnergyX[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_SigmaX", XZ_SigmaX[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_SigmaZ", XZ_SigmaZ[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_GaussSigmaX", XZ_GaussSigmaX[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_GaussSigmaZ", XZ_GaussSigmaZ[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_LengthX", XZ_LengthX[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_VolumeX", XZ_VolumeX[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_MeanX", XZ_MeanX[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_MeanZ", XZ_MeanZ[energiesX[0].first]);
SetObservableValue("MaxTrack_XZ_SkewZ", XZ_SkewZ[energiesX[0].first]);

SetObservableValue("MaxTrack_YZ_NHitsY", YZ_NHitsY[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_EnergyY", YZ_EnergyY[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_SigmaY", YZ_SigmaY[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_SigmaZ", YZ_SigmaZ[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_GaussSigmaY", YZ_GaussSigmaY[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_GaussSigmaZ", YZ_GaussSigmaZ[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_LengthY", YZ_LengthY[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_VolumeY", YZ_VolumeY[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_MeanY", YZ_MeanY[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_MeanZ", YZ_MeanZ[energiesY[0].first]);
SetObservableValue("MaxTrack_YZ_SkewZ", YZ_SkewZ[energiesY[0].first]);

// 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"...

SetObservableValue("MaxTrack_XZ_NHitsX", XZ_NHitsX[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_EnergyX", XZ_EnergyX[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_SigmaX", XZ_SigmaX[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_SigmaZ", XZ_SigmaZ[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_GaussSigmaX", XZ_GaussSigmaX[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_GaussSigmaZ", XZ_GaussSigmaZ[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_LengthX", XZ_LengthX[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_VolumeX", XZ_VolumeX[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_MeanX", XZ_MeanX[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_MeanZ", XZ_MeanZ[energiesX0FirstKey]);
SetObservableValue("MaxTrack_XZ_SkewZ", XZ_SkewZ[energiesX0FirstKey]);
} else {
std::cerr << "Error: energiesX is empty. The observables are set to 0." << std::endl;
}

if (!energiesY.empty()) {
int energiesY0FirstKey = energiesY[0].first;

SetObservableValue("MaxTrack_YZ_NHitsY", YZ_NHitsY[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_EnergyY", YZ_EnergyY[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_SigmaY", YZ_SigmaY[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_SigmaZ", YZ_SigmaZ[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_GaussSigmaY", YZ_GaussSigmaY[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_GaussSigmaZ", YZ_GaussSigmaZ[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_LengthY", YZ_LengthY[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_VolumeY", YZ_VolumeY[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_MeanY", YZ_MeanY[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_MeanZ", YZ_MeanZ[energiesY0FirstKey]);
SetObservableValue("MaxTrack_YZ_SkewZ", YZ_SkewZ[energiesY0FirstKey]);
} else {
std::cerr << "Error: energiesY is empty. The observables are set to 0." << std::endl;
}

if (!energiesX.empty() & !energiesY.empty()) {
Double_t energiesX0SecondKey = energiesX[0].second;
Double_t energiesY0SecondKey = energiesY[0].second;

SetObservableValue("MaxTrack_XZ_YZ_Energy", energiesX0SecondKey + energiesY0SecondKey);
SetObservableValue("MaxTrack_XZ_YZ_MaxTrackEnergyPercentage",
(energiesX0SecondKey + energiesY0SecondKey) / fTrackEvent->GetEnergy());
SetObservableValue("MaxTrack_XZ_YZ_EnergyBalanceXY", (energiesX0SecondKey - energiesY0SecondKey) /
(energiesX0SecondKey + energiesY0SecondKey));

} else {
std::cerr << "Error: energiesX or energiesY is empty. The observables are set to 0." << std::endl;
}

SetObservableValue("MaxTrack_XZ_YZ_SigmaXYBalance", XZ_YZ_SigmaXYBalance[0]);
SetObservableValue("MaxTrack_XZ_YZ_SigmaZBalance", XZ_YZ_SigmaZBalance[0]);
SetObservableValue("MaxTrack_XZ_YZ_GaussSigmaXYBalance", XZ_YZ_GaussSigmaXYBalance[0]);
SetObservableValue("MaxTrack_XZ_YZ_GaussSigmaZBalance", XZ_YZ_GaussSigmaZBalance[0]);

SetObservableValue("MaxTrack_XZ_YZ_Energy", energiesX[0].second + energiesY[0].second);
SetObservableValue("MaxTrack_XZ_YZ_MaxTrackEnergyPercentage",
(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));

// --- Second max track observables --- //
SetObservableValue("SecondMaxTrack_XZ_NHitsX", XZ_NHitsX[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_EnergyX", XZ_EnergyX[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_SigmaX", XZ_SigmaX[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_SigmaZ", XZ_SigmaZ[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_GaussSigmaX", XZ_GaussSigmaX[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_GaussSigmaZ", XZ_GaussSigmaZ[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_LengthX", XZ_LengthX[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_VolumeX", XZ_VolumeX[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_MeanX", XZ_MeanX[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_MeanZ", XZ_MeanZ[energiesX[1].first]);
SetObservableValue("SecondMaxTrack_XZ_SkewZ", XZ_SkewZ[energiesX[1].first]);

SetObservableValue("SecondMaxTrack_YZ_NHitsY", YZ_NHitsY[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_EnergyY", YZ_EnergyY[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_SigmaY", YZ_SigmaY[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_SigmaZ", YZ_SigmaZ[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_GaussSigmaY", YZ_GaussSigmaY[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_GaussSigmaZ", YZ_GaussSigmaZ[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_LengthY", YZ_LengthY[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_VolumeY", YZ_VolumeY[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_MeanY", YZ_MeanY[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_MeanZ", YZ_MeanZ[energiesY[1].first]);
SetObservableValue("SecondMaxTrack_YZ_SkewZ", YZ_SkewZ[energiesY[1].first]);

// 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"...

SetObservableValue("SecondMaxTrack_XZ_NHitsX", XZ_NHitsX[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_EnergyX", XZ_EnergyX[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_SigmaX", XZ_SigmaX[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_SigmaZ", XZ_SigmaZ[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_GaussSigmaX", XZ_GaussSigmaX[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_GaussSigmaZ", XZ_GaussSigmaZ[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_LengthX", XZ_LengthX[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_VolumeX", XZ_VolumeX[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_MeanX", XZ_MeanX[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_MeanZ", XZ_MeanZ[energiesX1FirstKey]);
SetObservableValue("SecondMaxTrack_XZ_SkewZ", XZ_SkewZ[energiesX1FirstKey]);
} else {
std::cerr << "Error: energiesX is empty. The observables are set to 0." << std::endl;
}

if (!energiesY.empty()) {
int energiesY1FirstKey = energiesY[1].first;

SetObservableValue("SecondMaxTrack_YZ_NHitsY", YZ_NHitsY[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_EnergyY", YZ_EnergyY[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_SigmaY", YZ_SigmaY[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_SigmaZ", YZ_SigmaZ[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_GaussSigmaY", YZ_GaussSigmaY[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_GaussSigmaZ", YZ_GaussSigmaZ[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_LengthY", YZ_LengthY[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_VolumeY", YZ_VolumeY[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_MeanY", YZ_MeanY[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_MeanZ", YZ_MeanZ[energiesY1FirstKey]);
SetObservableValue("SecondMaxTrack_YZ_SkewZ", YZ_SkewZ[energiesY1FirstKey]);
} else {
std::cerr << "Error: energiesY is empty. The observables are set to 0." << 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));
if (!energiesX.empty() & !energiesY.empty()) {
Double_t energiesX1SecondKey = energiesX[1].second;
Double_t energiesY1SecondKey = energiesY[1].second;

if (fTrackEvent->GetNumberOfTracks() > 2) {
SetObservableValue("SecondMaxTrack_XZ_YZ_Energy", energiesX1SecondKey + energiesY1SecondKey);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyPercentage",
(energiesX1SecondKey + energiesY1SecondKey) / fTrackEvent->GetEnergy());
SetObservableValue(
"SecondMaxTrack_XZ_YZ_EnergyBalanceXY",
(energiesX1SecondKey - energiesY1SecondKey) / (energiesX1SecondKey + energiesY1SecondKey));
} else {
SetObservableValue("SecondMaxTrack_XZ_YZ_Energy", 0.0);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyPercentage", 0.0);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyBalanceXY", 0.0);
}
} else {
SetObservableValue("SecondMaxTrack_XZ_YZ_Energy", 0);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyPercentage", 0);
SetObservableValue("SecondMaxTrack_XZ_YZ_EnergyBalanceXY", 0);
std::cerr << "Error: energiesX or energiesY is empty. The observables are set to 0." << std::endl;
}

// --- Distance obsevables between first two tracks --- //
Expand Down
95 changes: 54 additions & 41 deletions src/TRestTrack3DAnalysisProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -241,48 +241,61 @@ TRestEvent* TRestTrack3DAnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
SetObservableValue("Map_XYZ_SkewXY", XYZ_SkewXY);
SetObservableValue("Map_XYZ_SkewZ", XYZ_SkewZ);

// --- Max track observables --- //
SetObservableValue("MaxTrack_XYZ_NHits", XYZ_NHits[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_Energy", XYZ_Energy[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_SigmaX", XYZ_SigmaX[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_SigmaY", XYZ_SigmaY[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_SigmaZ", XYZ_SigmaZ[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_GaussSigmaX", XYZ_GaussSigmaX[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_GaussSigmaY", XYZ_GaussSigmaY[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_GaussSigmaZ", XYZ_GaussSigmaZ[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_Length", XYZ_Length[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_Volume", XYZ_Volume[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_MeanX", XYZ_MeanX[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_MeanY", XYZ_MeanY[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_MeanZ", XYZ_MeanZ[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_SkewZ", XYZ_SkewXY[energies[0].first]);
SetObservableValue("MaxTrack_XYZ_SkewZ", XYZ_SkewZ[energies[0].first]);

SetObservableValue("MaxTrack_XYZ_MaxTrackEnergyPercentage",
(energies[0].second) / fTrackEvent->GetEnergy());

// --- Second max track observables --- //
SetObservableValue("SecondMaxTrack_XYZ_NHits", XYZ_NHits[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_Energy", XYZ_Energy[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_SigmaX", XYZ_SigmaX[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_SigmaY", XYZ_SigmaY[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_SigmaZ", XYZ_SigmaZ[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_GaussSigmaX", XYZ_GaussSigmaX[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_GaussSigmaY", XYZ_GaussSigmaY[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_GaussSigmaZ", XYZ_GaussSigmaZ[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_Length", XYZ_Length[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_Volume", XYZ_Volume[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_MeanX", XYZ_MeanX[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_MeanY", XYZ_MeanY[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_MeanZ", XYZ_MeanZ[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_SkewZ", XYZ_SkewXY[energies[1].first]);
SetObservableValue("SecondMaxTrack_XYZ_SkewZ", XYZ_SkewZ[energies[1].first]);

if (fTrackEvent->GetNumberOfTracks() > 1) {
SetObservableValue("SecondMaxTrack_XYZ_MaxTrackEnergyPercentage",
(energies[1].second) / fTrackEvent->GetEnergy());
// 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"...
Double_t energies0SecondKey = energies[0].second;

SetObservableValue("MaxTrack_XYZ_NHits", XYZ_NHits[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_Energy", XYZ_Energy[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_SigmaX", XYZ_SigmaX[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_SigmaY", XYZ_SigmaY[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_SigmaZ", XYZ_SigmaZ[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_GaussSigmaX", XYZ_GaussSigmaX[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_GaussSigmaY", XYZ_GaussSigmaY[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_GaussSigmaZ", XYZ_GaussSigmaZ[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_Length", XYZ_Length[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_Volume", XYZ_Volume[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_MeanX", XYZ_MeanX[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_MeanY", XYZ_MeanY[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_MeanZ", XYZ_MeanZ[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_SkewZ", XYZ_SkewXY[energies0FirstKey]);
SetObservableValue("MaxTrack_XYZ_SkewZ", XYZ_SkewZ[energies0FirstKey]);

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

// --- Second max track observables --- //
int energies1FirstKey = energies[1].first;

SetObservableValue("SecondMaxTrack_XYZ_NHits", XYZ_NHits[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_Energy", XYZ_Energy[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_SigmaX", XYZ_SigmaX[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_SigmaY", XYZ_SigmaY[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_SigmaZ", XYZ_SigmaZ[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_GaussSigmaX", XYZ_GaussSigmaX[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_GaussSigmaY", XYZ_GaussSigmaY[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_GaussSigmaZ", XYZ_GaussSigmaZ[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_Length", XYZ_Length[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_Volume", XYZ_Volume[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_MeanX", XYZ_MeanX[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_MeanY", XYZ_MeanY[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_MeanZ", XYZ_MeanZ[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_SkewZ", XYZ_SkewXY[energies1FirstKey]);
SetObservableValue("SecondMaxTrack_XYZ_SkewZ", XYZ_SkewZ[energies1FirstKey]);

Double_t energies1SecondKey = energies[1].second;

if (fTrackEvent->GetNumberOfTracks() > 2) {
SetObservableValue("SecondMaxTrack_XYZ_MaxTrackEnergyPercentage",
(energies1SecondKey) / fTrackEvent->GetEnergy());
} else {
SetObservableValue("SecondMaxTrack_XYZ_MaxTrackEnergyPercentage", 0.0);
}
} else {
SetObservableValue("SecondMaxTrack_XYZ_MaxTrackEnergyPercentage", 0);
std::cerr << "Error: energies is empty. Some observables will not be set." << std::endl;
}

// --- Distance obsevables between first two tracks --- //
Expand Down

0 comments on commit 8c56396

Please sign in to comment.