Skip to content

Commit

Permalink
Merge pull request #122 from rest-for-physics/missing-observables
Browse files Browse the repository at this point in the history
Analysis Observables
  • Loading branch information
lobis authored Mar 7, 2024
2 parents b67ace2 + 379c169 commit c0571cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/TRestGeant4AnalysisProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,17 @@ TRestEvent* TRestGeant4AnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
Double_t zDirection = fOutputG4Event->GetPrimaryEventDirection(0).Z();
SetObservableValue("zDirectionPrimary", zDirection);

SetObservableValue("eventPrimaryParticleName", fOutputG4Event->GetPrimaryEventParticleName(0));
string subEventPrimaryParticleName;
if (fOutputG4Event->GetSubID() != 0) {
subEventPrimaryParticleName = fOutputG4Event->GetSubEventPrimaryEventParticleName();
}
SetObservableValue("subEventPrimaryParticleName", subEventPrimaryParticleName);

TVector3 v(xDirection, yDirection, zDirection);
SetObservableValue("thetaPrimary", v.Theta());
SetObservableValue("phiPrimary", v.Phi());
SetObservableValue("zenithYDegrees", TMath::ACos(-1 * yDirection) * TMath::RadToDeg());

Double_t energyPrimary = fOutputG4Event->GetPrimaryEventEnergy(0);
SetObservableValue("energyPrimary", energyPrimary);
Expand Down
7 changes: 3 additions & 4 deletions src/TRestGeant4QuenchingProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ void TRestGeant4QuenchingProcess::InitProcess() {
}
}

cout << "TRestGeant4QuenchingProcess initialized with volumes" << endl;
RESTDebug << "TRestGeant4QuenchingProcess initialized with volumes" << RESTendl;
for (const auto& volume : fVolumes) {
cout << " " << volume << endl;
RESTDebug << " " << volume << RESTendl;
}
}

Expand Down Expand Up @@ -244,9 +244,8 @@ void TRestGeant4QuenchingProcess::EndProcess() {}

void TRestGeant4QuenchingProcess::PrintMetadata() {
BeginPrintProcess();
cout << "Printing TRestGeant4QuenchingProcess user configuration" << endl;
for (auto const& volume : fVolumes) {
cout << "Volume: " << volume << endl;
RESTMetadata << "Volume: " << volume << RESTendl;
}
EndPrintProcess();
}
Expand Down

0 comments on commit c0571cb

Please sign in to comment.