Skip to content

Commit

Permalink
Make data mabers const
Browse files Browse the repository at this point in the history
  • Loading branch information
niclaurenti committed Apr 17, 2024
1 parent 6ecc3c6 commit 4964260
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
6 changes: 3 additions & 3 deletions inc/adani/CoefficientFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class CoefficientFunction {
char GetChannel() const { return 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
const int order_; // order = 1, 2, or 3
const char kind_; // kind_ = '2' for F2 and 'L' for FL
const char channel_; // channel_ = 'g' for Cg and 'q' for Cq
};

#endif
2 changes: 1 addition & 1 deletion inc/adani/HighEnergyCoefficientFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AbstractHighEnergyCoefficientFunction : public CoefficientFunction {
bool GetNLL() const { return NLL_; };

private:
bool NLL_;
const bool NLL_;

//==========================================================================================//
// Color factors O(as^3)
Expand Down
5 changes: 1 addition & 4 deletions src/CoefficientFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,19 @@ using std::endl;

CoefficientFunction::CoefficientFunction(
const int &order, const char &kind, const char &channel
) {
) : order_(order), kind_(kind), channel_(channel) {

// check order
if (order < 1 || order > 3) {
cout << "Error: order must be 1, 2 or 3. Got: " << order << endl;
exit(-1);
}
order_ = order;

// check kind
if (kind != '2' && kind != 'L') {
cout << "Error: kind must be 2 or L. Got: " << kind << endl;
exit(-1);
}
kind_ = kind;

// check channel
if (channel != 'g' && channel != 'q') {
Expand All @@ -35,7 +33,6 @@ CoefficientFunction::CoefficientFunction(
<< endl;
exit(-1);
}
channel_ = channel;
}

//==========================================================================================//
Expand Down
5 changes: 1 addition & 4 deletions src/HighEnergyCoefficientFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ using std::endl;
AbstractHighEnergyCoefficientFunction::AbstractHighEnergyCoefficientFunction(
const int &order, const char &kind, const char &channel, const bool &NLL
)
: CoefficientFunction(order, kind, channel) {

NLL_ = NLL;
}
: CoefficientFunction(order, kind, channel), NLL_(NLL) {};

//==========================================================================================//
// HighEnergyCoefficientFunction: constructor
Expand Down

0 comments on commit 4964260

Please sign in to comment.