Skip to content

Commit

Permalink
Fix indentation of class
Browse files Browse the repository at this point in the history
  • Loading branch information
niclaurenti committed Mar 20, 2024
1 parent 70fc47f commit f32810c
Show file tree
Hide file tree
Showing 14 changed files with 1,138 additions and 1,091 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Language: Cpp
AccessModifierOffset: -2
AccessModifierOffset: 0
AlignAfterOpenBracket: BlockIndent ####
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Expand Down Expand Up @@ -117,7 +117,7 @@ IncludeCategories:
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentAccessModifiers: true
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: Indent
Expand Down
167 changes: 85 additions & 82 deletions inc/adani/ApproximateCoefficientFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
//------------------------------------------------------------------------------------------//

struct approximation_parameters {
double A;
double B;
double C;
double D;
double A;
double B;
double C;
double D;
};

//==========================================================================================//
Expand All @@ -39,76 +39,78 @@ struct approximation_parameters {
//------------------------------------------------------------------------------------------//

struct variation_parameters {
double var;
double fact;
double var;
double fact;
};

//==========================================================================================//
// struct klmv_params: parameters for klmv approximation
//------------------------------------------------------------------------------------------//

struct klmv_params {
double gamma;
double C;
double log_coeff;
double log_pow;
double const_coeff;
double gamma;
double C;
double log_coeff;
double log_pow;
double const_coeff;
};

//==========================================================================================//
// class AbstractApproximate
//------------------------------------------------------------------------------------------//

class AbstractApproximate : public CoefficientFunction {
public:
AbstractApproximate(
const int &order, const char &kind, const char &channel,
const double &abserr = 1e-3, const double &relerr = 1e-3,
const int &dim = 1000, const int &method_flag = 1,
const int &MCcalls = 25000
);
~AbstractApproximate();

double MuIndependentTerms(double x, double m2Q2, int nf) const override;

Value fxBand(double x, double m2Q2, double m2mu2, int nf) const override;
double MuDependentTerms(
double x, double m2Q2, double m2mu2, int nf
) const override;

private:
ExactCoefficientFunction *muterms_;
public:
AbstractApproximate(
const int &order, const char &kind, const char &channel,
const double &abserr = 1e-3, const double &relerr = 1e-3,
const int &dim = 1000, const int &method_flag = 1,
const int &MCcalls = 25000
);
~AbstractApproximate();

double MuIndependentTerms(double x, double m2Q2, int nf) const override;

Value
fxBand(double x, double m2Q2, double m2mu2, int nf) const override;
double MuDependentTerms(
double x, double m2Q2, double m2mu2, int nf
) const override;

private:
ExactCoefficientFunction *muterms_;
};

//==========================================================================================//
// class ApproximateCoefficientFunction
//------------------------------------------------------------------------------------------//

class ApproximateCoefficientFunction : public AbstractApproximate {
public:
ApproximateCoefficientFunction(
const int &order, const char &kind, const char &channel,
const bool &NLL = true, const bool &exact_highscale = false,
const bool &revised_approx_highscale = true,
const double &abserr = 1e-3, const double &relerr = 1e-3,
const int &dim = 1000, const int &method_flag = 1,
const int &MCcalls = 25000
);
~ApproximateCoefficientFunction() override;

Value MuIndependentTermsBand(double x, double m2Q2, int nf) const override;

private:
ThresholdCoefficientFunction *threshold_;
AsymptoticCoefficientFunction *asymptotic_;

struct approximation_parameters approximation_;
struct variation_parameters variation_;

double Approximation(
double x, double m2Q2, double asy, double thresh, double A, double B,
double C, double D
) const;
public:
ApproximateCoefficientFunction(
const int &order, const char &kind, const char &channel,
const bool &NLL = true, const bool &exact_highscale = false,
const bool &revised_approx_highscale = true,
const double &abserr = 1e-3, const double &relerr = 1e-3,
const int &dim = 1000, const int &method_flag = 1,
const int &MCcalls = 25000
);
~ApproximateCoefficientFunction() override;

Value
MuIndependentTermsBand(double x, double m2Q2, int nf) const override;

private:
ThresholdCoefficientFunction *threshold_;
AsymptoticCoefficientFunction *asymptotic_;

struct approximation_parameters approximation_;
struct variation_parameters variation_;

double Approximation(
double x, double m2Q2, double asy, double thresh, double A,
double B, double C, double D
) const;
};

//==========================================================================================//
Expand All @@ -117,35 +119,36 @@ class ApproximateCoefficientFunction : public AbstractApproximate {
//------------------------------------------------------------------------------------------//

class ApproximateCoefficientFunctionKLMV : public AbstractApproximate {
public:
ApproximateCoefficientFunctionKLMV(
const int &order, const char &kind, const char &channel,
const bool &revised_approx_highscale = true,
const double &abserr = 1e-3, const double &relerr = 1e-3,
const int &dim = 1000, const int &method_flag = 1,
const int &MCcalls = 25000
);
~ApproximateCoefficientFunctionKLMV() override;

Value MuIndependentTermsBand(double x, double m2Q2, int nf) const override;

private:
ThresholdCoefficientFunction *threshold_;
HighScaleCoefficientFunction *highscale_;
HighEnergyCoefficientFunction *highenergy_;

struct klmv_params params_A_;
struct klmv_params params_B_;

double ApproximationA(
double x, double m2Q2, double he_ll, double he_nll, double hs,
double thr, double thr_const, double gamma, double C
) const;
double ApproximationB(
double x, double m2Q2, double he_ll, double he_nll, double hs,
double thr, double thr_const, double delta, double D
) const;
Value ApproximateNLL(double x, double m2Q2) const;
public:
ApproximateCoefficientFunctionKLMV(
const int &order, const char &kind, const char &channel,
const bool &revised_approx_highscale = true,
const double &abserr = 1e-3, const double &relerr = 1e-3,
const int &dim = 1000, const int &method_flag = 1,
const int &MCcalls = 25000
);
~ApproximateCoefficientFunctionKLMV() override;

Value
MuIndependentTermsBand(double x, double m2Q2, int nf) const override;

private:
ThresholdCoefficientFunction *threshold_;
HighScaleCoefficientFunction *highscale_;
HighEnergyCoefficientFunction *highenergy_;

struct klmv_params params_A_;
struct klmv_params params_B_;

double ApproximationA(
double x, double m2Q2, double he_ll, double he_nll, double hs,
double thr, double thr_const, double gamma, double C
) const;
double ApproximationB(
double x, double m2Q2, double he_ll, double he_nll, double hs,
double thr, double thr_const, double delta, double D
) const;
Value ApproximateNLL(double x, double m2Q2) const;
};

// //==========================================================================================//
Expand Down
37 changes: 19 additions & 18 deletions inc/adani/AsymptoticCoefficientFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,25 @@

class AsymptoticCoefficientFunction
: public AbstractHighEnergyCoefficientFunction {
public:
AsymptoticCoefficientFunction(
const int &order, const char &kind, const char &channel,
const bool &NLL = true, const bool &exact_highscale = false,
const bool &revised_approx_highscale = true
);
~AsymptoticCoefficientFunction();

double fx(double x, double m2Q2, double m2mu2, int nf) const override;
// double MuIndependentTerms(double x, double m2Q2, int nf) const override ;
// double MuDependentTerms(double x, double m2Q2, double m2mu2, int nf)
// const override ;

Value fxBand(double x, double m2Q2, double m2mu2, int nf) const override;

private:
HighScaleCoefficientFunction *highscale_;
PowerTermsCoefficientFunction *powerterms_;
public:
AsymptoticCoefficientFunction(
const int &order, const char &kind, const char &channel,
const bool &NLL = true, const bool &exact_highscale = false,
const bool &revised_approx_highscale = true
);
~AsymptoticCoefficientFunction();

double fx(double x, double m2Q2, double m2mu2, int nf) const override;
// double MuIndependentTerms(double x, double m2Q2, int nf) const
// override ; double MuDependentTerms(double x, double m2Q2, double
// m2mu2, int nf) const override ;

Value
fxBand(double x, double m2Q2, double m2mu2, int nf) const override;

private:
HighScaleCoefficientFunction *highscale_;
PowerTermsCoefficientFunction *powerterms_;
};

#endif
60 changes: 31 additions & 29 deletions inc/adani/CoefficientFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,42 @@

class CoefficientFunction {

public:
CoefficientFunction(
const int &order, const char &kind, const char &channel
);
CoefficientFunction(CoefficientFunction *coeff)
: CoefficientFunction(
coeff->GetOrder(), coeff->GetKind(), coeff->GetChannel()
){};
public:
CoefficientFunction(
const int &order, const char &kind, const char &channel
);
CoefficientFunction(CoefficientFunction *coeff)
: CoefficientFunction(
coeff->GetOrder(), coeff->GetKind(), coeff->GetChannel()
){};

virtual ~CoefficientFunction() = 0;
virtual ~CoefficientFunction() = 0;

virtual double MuIndependentTerms(double x, double m2Q2, int nf) const;
virtual double fx(double x, double m2Q2, double m2mu2, int nf) const;
virtual double
MuDependentTerms(double x, double m2Q2, double m2mu2, int nf) const;
virtual Value fxBand(double x, double m2Q2, double m2mu2, int nf) const = 0;
virtual Value MuIndependentTermsBand(double x, double m2Q2, int nf) const;
virtual Value
MuDependentTermsBand(double x, double m2Q2, double m2mu2, int nf) const;
virtual double MuIndependentTerms(double x, double m2Q2, int nf) const;
virtual double fx(double x, double m2Q2, double m2mu2, int nf) const;
virtual double
MuDependentTerms(double x, double m2Q2, double m2mu2, int nf) const;
virtual Value
fxBand(double x, double m2Q2, double m2mu2, int nf) const = 0;
virtual Value
MuIndependentTermsBand(double x, double m2Q2, int nf) const;
virtual Value
MuDependentTermsBand(double x, double m2Q2, double m2mu2, int nf) const;

// get methods
int GetOrder() const { return order_; };
char GetKind() const { return kind_; };
char GetChannel() const { return channel_; };
// get methods
int GetOrder() const { return order_; };
char GetKind() const { return kind_; };
char GetChannel() const { return channel_; };

// set methods
void SetOrder(const int &order);
void SetKind(const char &kind);
void SetChannel(const char &channel);
// set methods
void SetOrder(const int &order);
void SetKind(const char &kind);
void SetChannel(const char &channel);

private:
int order_; // order = 1, 2, or 3
char kind_; // kind_ = '2' for F2 and 'L' for FL
char channel_; // channel_ = 'g' for Cg and 'q' for Cq
private:
int order_; // order = 1, 2, or 3
char kind_; // kind_ = '2' for F2 and 'L' for FL
char channel_; // channel_ = 'g' for Cg and 'q' for Cq
};

#endif
Loading

0 comments on commit f32810c

Please sign in to comment.