Skip to content

Commit

Permalink
Merge pull request #73 from rest-for-physics/jgalan_add_warning
Browse files Browse the repository at this point in the history
TRestAxionFieldPropagationProcess. Added SetWarning
  • Loading branch information
jgalan authored Jul 3, 2023
2 parents 34b68ec + 8ce34a7 commit d36acca
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/TRestAxionFieldPropagationProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ TRestEvent* TRestAxionFieldPropagationProcess::ProcessEvent(TRestEvent* evInput)
Double_t transmission = 1;
Double_t fieldAverage = 0;
if (trackBounds.size() == 2) {
RESTDebug << "-- Track bounds" << RESTendl;
RESTDebug << "X1:" << trackBounds[0].X() << " Y1: " << trackBounds[0].Y()
<< " Z1: " << trackBounds[0].Z() << RESTendl;
RESTDebug << "X2:" << trackBounds[1].X() << " Y2: " << trackBounds[1].Y()
<< " Z2: " << trackBounds[1].Z() << RESTendl;
std::vector<Double_t> bProfile = fMagneticField->GetTransversalComponentAlongPath(
trackBounds[0], trackBounds[1], fIntegrationStep);

Expand All @@ -214,8 +219,16 @@ TRestEvent* TRestAxionFieldPropagationProcess::ProcessEvent(TRestEvent* evInput)
Double_t GammaL = Gamma * lCoh * units("cm");
transmission = exp(-GammaL);
}
} else {
SetWarning("TRestAxionFieldPropagationProcess. Track does not cross the field volume!", false);
}

RESTDebug << " --- Process observables: " << RESTendl;
RESTDebug << "Field average: " << fieldAverage << " T" << RESTendl;
RESTDebug << "Probability: " << prob << " T" << RESTendl;
RESTDebug << "Coherence length: " << lCoh << " mm" << RESTendl;
RESTDebug << "Transmission: " << transmission << " mm" << RESTendl;

SetObservableValue("fieldAverage", fieldAverage);
SetObservableValue("probability", prob);
SetObservableValue("coherenceLength", lCoh);
Expand Down

0 comments on commit d36acca

Please sign in to comment.