|
|
Go to the documentation of this file. 1 #ifndef TotemRPProtonTransportParametrization_LHC_OPTICS_APPROXIMATOR_H
2 #define TotemRPProtonTransportParametrization_LHC_OPTICS_APPROXIMATOR_H
37 double nominal_beam_momentum);
43 void Train(TTree *inp_tree,
46 int max_degree_x = 10,
47 int max_degree_tx = 10,
48 int max_degree_y = 10,
49 int max_degree_ty = 10,
50 bool common_terms =
false,
51 double *prec =
nullptr);
52 void Test(TTree *inp_tree,
68 bool check_apertures =
false,
69 bool invert_beam_coord_sytems =
true)
const;
72 bool check_apertures =
false,
73 bool invert_beam_coord_sytems =
true)
const;
82 bool check_apertures =
false,
83 bool invert_beam_coord_sytems =
true)
const;
86 double in_momentum[3],
88 double out_momentum[3],
90 double z2_z1_dist)
const;
93 bool CheckInputRange(
const double *
in,
bool invert_beam_coord_sytems =
true)
const;
99 const std::vector<std::string> &input_vars);
114 double d_mad_x = 10
e-6,
115 double d_mad_thx = 10
e-6);
130 double d_mad_y = 10
e-6,
131 double d_mad_thy = 10
e-6);
133 double GetDx(
double mad_init_x,
138 double d_mad_xi = 0.001);
139 double GetDxds(
double mad_init_x,
144 double d_mad_xi = 0.001);
204 TH2D *err_inp_cor_hists[4][5],
205 TH2D *err_out_cor_hists[4][5],
224 bool CheckAperture(
const double *
in,
bool invert_beam_coord_sytems =
true)
const;
232 #endif //TotemRPProtonTransportParametrization_LHC_OPTICS_APPROXIMATOR_H
std::vector< std::string > coord_names
pointers to polynomials
const LHCOpticsApproximator & operator=(const LHCOpticsApproximator &org)
void FillErrorDataCorHistograms(double errors[4], double var[5], TH2D *err_cor_hists[4][5])
void FillErrorHistograms(double errors[4], TH1D *err_hists[4])
std::vector< LHCApertureApproximator > apertures_
apertures on the way
std::vector< TMultiDimFet * > out_polynomials
void DeleteErrorHists(TH1D *err_hists[4])
double GetDx(double mad_init_x, double mad_init_thx, double mad_init_y, double mad_init_thy, double mad_init_xi, double d_mad_xi=0.001)
void PrintCoordinateOpticalFunctions(TMultiDimFet ¶metrization, const std::string &coord_name, const std::vector< std::string > &input_vars)
double nominal_beam_energy_
GeV.
void AllocateErrorInputCorHists(TH2D *err_inp_cor_hists[4][5])
void WriteHistograms(TH1D *err_hists[4], TH2D *err_inp_cor_hists[4][5], TH2D *err_out_cor_hists[4][5], TFile *f_out, std::string base_out_dir)
TMultiDimFet x_parametrisation
polynomial approximation for x
void Test(TTree *inp_tree, TFile *f_out, std::string data_prefix=std::string("def"), std::string base_out_dir=std::string(""))
void Train(TTree *inp_tree, std::string data_prefix=std::string("def"), polynomials_selection mode=PREDEFINED, int max_degree_x=10, int max_degree_tx=10, int max_degree_y=10, int max_degree_ty=10, bool common_terms=false, double *prec=nullptr)
void GetLineariasedTransportMatrixX(double mad_init_x, double mad_init_thx, double mad_init_y, double mad_init_thy, double mad_init_xi, TMatrixD &tr_matrix, double d_mad_x=10e-6, double d_mad_thx=10e-6)
returns linearised transport matrix for x projection | dx_out/dx_in dx_out/dthx_in | | dthx_out/dx_in...
TMultiDimFet y_parametrisation
polynomial approximation for y
TMultiDimFet theta_x_parametrisation
polynomial approximation for theta_x
bool trained_
trained polynomials
parametrization
specify parametrization (see SWGuidePATKinematicResolutions for more details)
friend class ProtonTransportFunctionsESSource
void AllocateErrorHists(TH1D *err_hists[4])
double s_begin_
begin of transport along the reference orbit
void PrintOpticalFunctions()
bool Transport2D(const double *in, double *out, bool check_apertures=false, bool invert_beam_coord_sytems=true) const
LHCApertureApproximator()
bool Transport(const double *in, double *out, bool check_apertures=false, bool invert_beam_coord_sytems=true) const
double nominal_beam_momentum_
GeV/c.
double s_end_
end of transport along the reference orbit
void TestAperture(TTree *in_tree, TTree *out_tree)
x, theta_x, y, theta_y, ksi, mad_accepted, parametriz_accepted
double ParameterOutOfRangePenalty(double par_m[], bool invert_beam_coord_sytems=true) const
double GetDxds(double mad_init_x, double mad_init_thx, double mad_init_y, double mad_init_thy, double mad_init_xi, double d_mad_xi=0.001)
Class finds the parametrisation of MADX proton transport and transports the protons according to it 5...
bool CheckAperture(const double *in, bool invert_beam_coord_sytems=true) const
TMultiDimFet theta_y_parametrisation
polynomial approximation for theta_y
DecomposeProduct< arg, typename Div::arg > D
void AddRectEllipseAperture(const LHCOpticsApproximator &in, double rect_x, double rect_y, double r_el_x, double r_el_y)
void InitializeApproximators(polynomials_selection mode, int max_degree_x, int max_degree_tx, int max_degree_y, int max_degree_ty, bool common_terms)
void GetLineariasedTransportMatrixY(double mad_init_x, double mad_init_thx, double mad_init_y, double mad_init_thy, double mad_init_xi, TMatrixD &tr_matrix, double d_mad_y=10e-6, double d_mad_thy=10e-6)
returns linearised transport matrix for y projection | dy_out/dy_in dy_out/dthy_in | | dthy_out/dy_in...
beam_type GetBeamType() const
void AllocateErrorOutputCorHists(TH2D *err_out_cor_hists[4][5])
bool Transport_m_GeV(double in_pos[3], double in_momentum[3], double out_pos[3], double out_momentum[3], bool check_apertures, double z2_z1_dist) const
pos, momentum: x,y,z; pos in m, momentum in GeV/c
void GetLinearApproximation(double atPoint[], double &Cx, double &Lx, double &vx, double &Cy, double &Ly, double &vy, double &D, double ep=1E-5)
void SetDefaultAproximatorSettings(TMultiDimFet &approximator, VariableType var_type, int max_degree)
bool CheckInputRange(const double *in, bool invert_beam_coord_sytems=true) const
void DeleteErrorCorHistograms(TH2D *err_cor_hists[4][5])
void SetTermsManually(TMultiDimFet &approximator, VariableType variable, int max_degree, bool common_terms)