Skip to content

Commit

Permalink
* set the return type of Poisson, depending on the Geant4 version [rtj]
Browse files Browse the repository at this point in the history
  • Loading branch information
rjones30 committed Sep 25, 2024
1 parent 95a53ec commit 5cd91ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/G4TRandom.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <TRandom.h>
#include <Randomize.hh>
#include <G4Version.hh>

class G4TRandom : public TRandom {
public:
Expand All @@ -27,7 +28,11 @@ class G4TRandom : public TRandom {
virtual UInt_t GetSeed() const;
virtual UInt_t Integer(UInt_t imax);
virtual Double_t Landau(Double_t mean=0, Double_t sigma=1);
#if G4VERSION_NUMBER >= 1070
virtual ULong64_t Poisson(Double_t mean);
#else
virtual Int_t Poisson(Double_t mean);
#endif
virtual Double_t PoissonD(Double_t mean);
virtual void Rannor(Float_t &a, Float_t &b);
virtual void Rannor(Double_t &a, Double_t &b);
Expand Down Expand Up @@ -79,7 +84,11 @@ inline Double_t G4TRandom::Landau(Double_t mean, Double_t sigma) {
return CLHEP::RandLandau::shoot() * sigma + mean;
}

#if G4VERSION_NUMBER >= 1070
inline ULong64_t G4TRandom::Poisson(Double_t mean) {
#else
inline Int_t G4TRandom::Poisson(Double_t mean) {
#endif
return CLHEP::RandPoisson::shoot(mean);
}

Expand Down

0 comments on commit 5cd91ca

Please sign in to comment.