Deprecated/UpgradeASCIITests/CachedShowerRegeneratorASCII/LogGaussSmearing.h
Go to the documentation of this file.
1 #ifndef _CachedShowerRegeneratorASCII_LogGaussSmearing_h_
2 #define _CachedShowerRegeneratorASCII_LogGaussSmearing_h_
3 
4 #include <CLHEP/Random/RandGauss.h>
5 
6 #include <utl/Point.h>
7 #include <utl/Vector.h>
8 #include <utl/CoordinateSystemPtr.h>
9 #include <utl/TimeStamp.h>
10 #include <utl/TimeInterval.h>
11 #include <utl/RandomEngine.h>
12 
13 
14 namespace CachedShowerRegeneratorASCII {
15 
25  public:
26  LogGaussSmearing(const double width, utl::RandomEngine::RandomEngineType* const engine)
27  : fWidth(width), fRandomEngine(engine) { }
28 
29  double
30  GetSmearedTime(const double planeFrontTime, const double particleTime)
31  const
32  {
33  if (particleTime > planeFrontTime) {
34  const double fact = exp(fWidth * CLHEP::RandGauss::shoot(fRandomEngine));
35  return planeFrontTime * (1 - fact) + particleTime * fact;
36  }
37  return particleTime;
38  }
39 
40  private:
41  const double fWidth;
43  };
44 
45 }
46 
47 
48 #endif
LogGaussSmearing(const double width, utl::RandomEngine::RandomEngineType *const engine)
CLHEP::HepRandomEngine RandomEngineType
Definition: RandomEngine.h:30

, generated on Tue Sep 26 2023.