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 Dec 5, 2023
1 parent 8fe6b59 commit bfb20f3
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/TRestAxionField.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -422,24 +422,26 @@ double TRestAxionField::GammaTransmissionFWHM(Double_t ma, Double_t Ea, Double_t
<< "MPFR libraries not linked to REST libraries. Try adding -DREST_MPFR=ON to your REST compilation"
<< RESTendl;
RESTWarning << "TRestAxionField::GammaTransmissionFWHM will return 0" << RESTendl;
std::vector<double> uno={0};
std::vector<double> dos={0};
return std::make_pair(uno,dos);
std::vector<double> uno = {0};
std::vector<double> dos = {0};
return std::make_pair(uno, dos);
#else
if(!fBufferGas){
double ma_start=ma;
if (!fBufferGas) {
double ma_start = ma;
for (int i = 0; i < n; i++) {
if (GammaTransmissionProbability(Bmag, Lcoh, Ea, ma_start) > GammaTransmissionProbability(Bmag, Lcoh, Ea, ma)/2) {
if (GammaTransmissionProbability(Bmag, Lcoh, Ea, ma_start) >
GammaTransmissionProbability(Bmag, Lcoh, Ea, ma) / 2) {
ma_start += step;
} else {
break;
}

}
RESTWarning << "No buffer gas defined, assuming vacuum an the resulting point is the m_a where P_ag=Pagmax/2 " << RESTendl;
RESTWarning << "No buffer gas defined, assuming vacuum an the resulting point is the m_a where "
"P_ag=Pagmax/2 "
<< RESTendl;
return ma_start;
} else {
Double_t photonMass;
Double_t photonMass;
photonMass = fBufferGas->GetPhotonMass(Ea);
double center_plus = 0;
double center_minus = 0;
Expand All @@ -451,7 +453,7 @@ double TRestAxionField::GammaTransmissionFWHM(Double_t ma, Double_t Ea, Double_t
} else {
center_plus = center;
center = photonMass;
break;
break;
}
}
for (int i = 0; i < n; i++) {
Expand All @@ -465,10 +467,11 @@ double TRestAxionField::GammaTransmissionFWHM(Double_t ma, Double_t Ea, Double_t
}
if (center_minus <= 0) {
center_minus = photonMass;
cout << "WARNING: The left value for the condition P_a = P_amax/2 is zero or negative, redifinning it to P_amax. "
<< endl;
cout << "WARNING: The left value for the condition P_a = P_amax/2 is zero or negative, "
"redifinning it to P_amax. "
<< endl;
}
return center_plus - center_minus;
return center_plus - center_minus;
}
#endif
}
Expand All @@ -490,9 +493,9 @@ std::pair<std::vector<double>, std::vector<double>> TRestAxionField::GetMassDens
<< "MPFR libraries not linked to REST libraries. Try adding -DREST_MPFR=ON to your REST compilation"
<< RESTendl;
RESTWarning << "TRestAxionField::GetMassDensityScanning will return 0" << RESTendl;
std::vector<double> uno={0};
std::vector<double> dos={0};
return std::make_pair(uno,dos);
std::vector<double> uno = {0};
std::vector<double> dos = {0};
return std::make_pair(uno, dos);
#else
std::vector<double> photonMass;
std::vector<double> density;
Expand Down

0 comments on commit bfb20f3

Please sign in to comment.