Skip to content

Commit

Permalink
Merge pull request #16 from sawenzel/swenzel/patch
Browse files Browse the repository at this point in the history
TGenEpEmv1: Return bool to indicate init success
  • Loading branch information
sawenzel authored Jun 6, 2023
2 parents 4f84681 + da8895c commit 53ec5c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions TEPEMGEN/TGenEpEmv1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ TGenEpEmv1::~TGenEpEmv1()
}

//____________________________________________________________
void TGenEpEmv1::Init()
bool TGenEpEmv1::Init()
{
// Initialisation:
// 1) define a generator
Expand All @@ -124,9 +124,10 @@ void TGenEpEmv1::Init()
double err = 0;
fXSection = CalcXSection(fXSectionEps,fMinXSTest,fMaxXSTest,err);
if (fXSection<=0 || err/fXSection>fXSectionEps) {
abort();
return false;
}
fXSectionEps = err/fXSection;
return true;
}

//____________________________________________________________
Expand Down
6 changes: 3 additions & 3 deletions TEPEMGEN/TGenEpEmv1.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class TGenEpEmv1 : public TEpEmGen {

public:
TGenEpEmv1();
virtual ~TGenEpEmv1();
~TGenEpEmv1() override;

virtual void GenerateEvent();
virtual void Init();
void GenerateEvent() override; // interface of TGenerator
bool Init(); // init function; returns true if successful; false otherwise
void SetDebug(Int_t debug) {fDebug=debug;}
void SetYRange(Double_t min, Double_t max) {fYMin = min; fYMax = max;};
void SetPtRange(Double_t min, Double_t max) {fPtMin = min; fPtMax = max;};
Expand Down

0 comments on commit 53ec5c4

Please sign in to comment.