LogXGaussSmearing.h
Go to the documentation of this file.
1 #ifndef _CachedXShowerRegeneratorAG_LogXGaussSmearing_h_
2 #define _CachedXShowerRegeneratorAG_LogXGaussSmearing_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 CachedXShowerRegeneratorAG {
15 
25  public:
26  LogXGaussSmearing(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
LogXGaussSmearing(const double width, utl::RandomEngine::RandomEngineType *const engine)
utl::RandomEngine::RandomEngineType *const fRandomEngine
CLHEP::HepRandomEngine RandomEngineType
Definition: RandomEngine.h:30

, generated on Tue Sep 26 2023.