5 #include <FairLogger.h> 
   19                                              Double_t py, Double_t pz, Double_t Ex, Double_t m, Double_t ener,
 
   20                                              Double_t eLoss, TString sata, TString sbta)
 
   21    : 
AtTPCIonGenerator(name, z, a, q, mult, px, py, pz, Ex, m, eLoss), fAta(nullptr), fBta(nullptr)
 
   25    TFile fileAta(sata, 
"READ");
 
   26    TFile fileBta(sbta, 
"READ");
 
   27    if (fileAta.IsZombie() || fileBta.IsZombie())
 
   28       LOG(error) << 
"AtTPCIonGenerator - ata and bta distribution files (S800) not found";
 
   30       fAta = std::unique_ptr<TH1F>(
dynamic_cast<TH1F *
>(fileAta.Get(
"h")));
 
   31       fBta = std::unique_ptr<TH1F>(
dynamic_cast<TH1F *
>(fileBta.Get(
"h1")));
 
   32       fAta->SetDirectory(
nullptr);
 
   33       fBta->SetDirectory(
nullptr);
 
   42                                              Double_t val5, Double_t val6, Double_t val7, Double_t val8, Double_t val9)
 
   60    Double_t x = 0., 
y = 0., xFocus = 0., yFocus = 0., Ax = 0., Ay = 0., BeamAx = 0., BeamAy = 0., BeamOx = 0.,
 
   62    Double_t ptot = sqrt(pow(
fPx0, 2) + pow(
fPy0, 2) + pow(
fPz0, 2));
 
   66       ptot = gRandom->Gaus(ptot, ptot * 
fMomAcc / 2.355);
 
   67    } 
while (ptot < ptot * (1. - 2. * 
fMomAcc) || ptot > ptot * (1. + 2. * 
fMomAcc));
 
   68    BeamAx = 
fBeamAx * TMath::DegToRad();
 
   69    BeamAy = 
fBeamAy * TMath::DegToRad();
 
   76    while (sqrt(pow((xFocus - 
fZFocus * tan(BeamAx)), 2) + pow((yFocus - 
fZFocus * tan(BeamAy)), 2)) > 
fRHole);
 
   78    if (
fAta != 
nullptr && 
fBta != 
nullptr) { 
 
   80          Ax = 
fAta->GetRandom() + 0.0019; 
 
   84          Ay = 
fBta->GetRandom();
 
   89       while (sqrt(pow(x, 2) + pow(
y, 2)) > 
fRHole);
 
   94          Ax = atan((xFocus - x) / 
fZFocus);
 
   96       } 
while (sqrt(pow(x, 2) + pow(
y, 2)) > 
fRHole ||
 
   97                sqrt(pow(tan(Ax - BeamAx), 2) + pow(tan(Ay - BeamAy), 2)) > fabs(tan(
fDiv)));
 
  106    fPz = ptot / sqrt(1. + pow(tan(Ax), 2) + pow(tan(Ay), 2));