CachedShowerRegeneratorOG/LogGaussSmearing.h
Go to the documentation of this file.
1 #ifndef _CachedShowerRegeneratorOG_LogGaussSmearing_h_
2 #define _CachedShowerRegeneratorOG_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 CachedShowerRegeneratorOG {
15 
26  public:
27  LogGaussSmearing(const double width, utl::RandomEngine::RandomEngineType* const engine)
28  : fWidth(width), fRandomEngine(engine) { }
29 
37  double
38  GetSmearedTime(const double planeFrontTime, const double particleTime)
39  const
40  {
41  if (particleTime > planeFrontTime) {
42  // particle is trailling the plane front, smear between the two
43  const double fact = exp(fWidth * CLHEP::RandGauss::shoot(fRandomEngine));
44  return planeFrontTime * (1 - fact) + particleTime * fact;
45  }
46  return particleTime;
47  }
48 
49  private:
50  const double fWidth;
52  };
53 
54 }
55 
56 
57 #endif
Regenerate thinned MC showers.
CLHEP::HepRandomEngine RandomEngineType
Definition: RandomEngine.h:30
LogGaussSmearing(const double width, utl::RandomEngine::RandomEngineType *const engine)

, generated on Tue Sep 26 2023.