Skip to content

Commit

Permalink
ciao
Browse files Browse the repository at this point in the history
  • Loading branch information
niclaurenti committed Mar 12, 2024
1 parent 6f48276 commit 564e6c7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
20 changes: 14 additions & 6 deletions inc/adani/SplittingFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,24 @@
#ifndef Split
#define Split

class Function {
class AbstractSplittingFunction {
public:
AbstractSplittingFunction() {mult_factor_ = 1.;} ;
~AbstractSplittingFunction() {};

virtual double Regular(const double x, const int nf) const = 0;
virtual double Singular(const double x, const int nf) const = 0;
virtual double Local(const int nf) const = 0;
virtual double SingularIntegrated(const double x, const int nf) const = 0;

double GetMultFact() const {return mult_factor_;};
double GetMultFact() const {return mult_factor_;};
void SetMultFact(const double& mult_factor) {mult_factor_ = mult_factor;};

private:
double mult_factor_;
};

class SplittingFunction : public Function{
class SplittingFunction : public AbstractSplittingFunction{
public:
SplittingFunction(const int& order, const char& entry1, const char& entry2) ;
~SplittingFunction() {} ;
Expand All @@ -40,7 +44,8 @@ class SplittingFunction : public Function{
double Local(const int nf) const ;
double SingularIntegrated(const double x, const int nf) const;

// SplittingFunction operator+(const SplittingFunction& splitfunc) const;
SplittingFunction operator*(const double& rhs) const;
friend SplittingFunction operator*(const double& lhs, const SplittingFunction& rhs);

// get methods
double GetOrder() const {return order_ ;} ;
Expand Down Expand Up @@ -104,6 +109,9 @@ class ConvolutedSplittingFunctions : public SplittingFunction {
double Local(const int nf) const {return 0.;} ;
double SingularIntegrated(const double x, const int nf) const {return 0.;};

ConvolutedSplittingFunctions operator*(const double& rhs) const;
friend ConvolutedSplittingFunctions operator*(const double& lhs, const ConvolutedSplittingFunctions& rhs);

private:
char entry3_;

Expand All @@ -122,12 +130,12 @@ class ConvolutedSplittingFunctions : public SplittingFunction {
double Pgq0_x_Pqg0(const double x, const int nf) const ;
};

class Delta : Function {
class Delta : AbstractSplittingFunction {
public:
double Regular(const double x, const int nf) const {return 0.;};
double Singular(const double x, const int nf) const {return 0.;};
double Local(const int nf) const {return 1.;};
double SingularIntegrated(const double x, const int nf) const {return 0.;};
}
};

#endif
27 changes: 26 additions & 1 deletion src/SplittingFunctions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@
using std::cout;
using std::endl;

SplittingFunction::SplittingFunction(const int& order, const char& entry1, const char& entry2) {
SplittingFunction SplittingFunction::operator*(const double& rhs) const {
SplittingFunction res(order_, entry1_, entry2_);
res.SetMultFact(GetMultFact() * rhs);
return res;
}

SplittingFunction operator*(const double& lhs, const SplittingFunction& rhs){
SplittingFunction res(rhs.order_, res.entry1_, res.entry2_);
res.SetMultFact(rhs.GetMultFact() * lhs);
return res;
}

SplittingFunction::SplittingFunction(const int& order, const char& entry1, const char& entry2) : AbstractSplittingFunction(){

// check order
if (order != 0 && order !=1) {
Expand Down Expand Up @@ -35,6 +47,7 @@ SplittingFunction::SplittingFunction(const int& order, const char& entry1, const
cout << "Error: Pq" << entry2_ << " is not implemented at O(as)!" << endl ;
exit(-1);
}

}

double SplittingFunction::Regular(const double x, const int nf) const {
Expand Down Expand Up @@ -105,6 +118,18 @@ double ConvolutedSplittingFunctions::Regular(const double x, const int nf) const

}

ConvolutedSplittingFunctions ConvolutedSplittingFunctions::operator*(const double& rhs) const {
ConvolutedSplittingFunctions res(GetOrder(), GetEntry1(), GetEntry2(), entry3_);
res.SetMultFact(GetMultFact() * rhs);
return res;
}

ConvolutedSplittingFunctions operator*(const double& lhs, const ConvolutedSplittingFunctions& rhs){
ConvolutedSplittingFunctions res(rhs.GetOrder(), res.GetEntry1(), res.GetEntry2(), res.entry3_);
res.SetMultFact(rhs.GetMultFact() * lhs);
return res;
}

//==========================================================================================//
// Gluon-quark splitting functions O(alpha_s) without color factors
//
Expand Down

0 comments on commit 564e6c7

Please sign in to comment.