Skip to content

Commit 5cd91ca

Browse files
committed
* set the return type of Poisson, depending on the Geant4 version [rtj]
1 parent 95a53ec commit 5cd91ca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/G4TRandom.hh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <TRandom.h>
1616
#include <Randomize.hh>
17+
#include <G4Version.hh>
1718

1819
class G4TRandom : public TRandom {
1920
public:
@@ -27,7 +28,11 @@ class G4TRandom : public TRandom {
2728
virtual UInt_t GetSeed() const;
2829
virtual UInt_t Integer(UInt_t imax);
2930
virtual Double_t Landau(Double_t mean=0, Double_t sigma=1);
31+
#if G4VERSION_NUMBER >= 1070
3032
virtual ULong64_t Poisson(Double_t mean);
33+
#else
34+
virtual Int_t Poisson(Double_t mean);
35+
#endif
3136
virtual Double_t PoissonD(Double_t mean);
3237
virtual void Rannor(Float_t &a, Float_t &b);
3338
virtual void Rannor(Double_t &a, Double_t &b);
@@ -79,7 +84,11 @@ inline Double_t G4TRandom::Landau(Double_t mean, Double_t sigma) {
7984
return CLHEP::RandLandau::shoot() * sigma + mean;
8085
}
8186

87+
#if G4VERSION_NUMBER >= 1070
8288
inline ULong64_t G4TRandom::Poisson(Double_t mean) {
89+
#else
90+
inline Int_t G4TRandom::Poisson(Double_t mean) {
91+
#endif
8392
return CLHEP::RandPoisson::shoot(mean);
8493
}
8594

0 commit comments

Comments
 (0)