From 5cd91ca60e29c1efacf9c9081186976c5ea78d42 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 25 Sep 2024 10:43:07 -0400 Subject: [PATCH] * set the return type of Poisson, depending on the Geant4 version [rtj] --- src/G4TRandom.hh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/G4TRandom.hh b/src/G4TRandom.hh index 90b2cfa..15e551e 100644 --- a/src/G4TRandom.hh +++ b/src/G4TRandom.hh @@ -14,6 +14,7 @@ #include #include +#include class G4TRandom : public TRandom { public: @@ -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); @@ -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); }