ShowerPhotonGenerator.h
Go to the documentation of this file.
1 #ifndef _ShowerPhotonGeneratorOG_ShowerPhotonGenerator_h_
2 #define _ShowerPhotonGeneratorOG_ShowerPhotonGenerator_h_
3 
13 #include <fwk/VModule.h>
14 
15 #include <utl/CoordinateSystemPtr.h>
16 #include <utl/ShadowPtr.h>
17 #include <fevt/FdConstants.h>
18 
19 #include <map>
20 #include <vector>
21 #include <fstream>
22 
23 class TH1D;
24 class MultipleScatterer;
25 
26 namespace utl {
27  class Point;
28  class Vector;
29  class RandomEngine;
30  class VRandomSampler;
31  class RandomSamplerFromPDF;
32  class TabulatedFunction;
33 }
34 
35 namespace fdet {
36  class Telescope;
37 }
38 
39 namespace evt {
40  class Event;
41  class ShowerSimData;
42 }
43 
44 namespace atm {
45  class ProfileResult;
46 }
47 
48 namespace ShowerPhotonGeneratorOG {
49 
50  class RayTracer;
51 
52 
64 
72  enum ELDFMode {
73  eOff, // 1D shower
74  eNKG, // NKG lateral distribution
75  eGora, // Gora et al LDF
76  eCherenkov, // full Cherenkov emission calculation
77  eCherenkovAtAxis, // Cherenkov emission, for electrons at shower axis
78  eCherenkovCORSIKA // use full Cherenkov option of CORSIKA
79  };
80 
91  };
92 
93  public:
95 
99 
101  unsigned int GetMaxNRayTrace() const { return fMaxNRayTrace; }
103  void SetMaxNRayTrace(unsigned int nphotons) { fMaxNRayTrace = nphotons; }
104 
106  unsigned int GetMinNRayTrace() const { return fMinNRayTrace; }
108  void SetMinNRayTrace(unsigned int nphotons) { fMinNRayTrace = nphotons; }
109 
111  double GetExtraRayTraceFactor() const { return fExtraRayTraceFactor; }
113  void SetExtraRayTraceFactor(double factor) { fExtraRayTraceFactor = factor; }
114 
118  void SetUseOnlyReferenceWavelength(bool onlyRefWl)
119  { fUseOnlyReferenceWavelength = onlyRefWl; }
120 
124 
125  private:
126  unsigned int fMaxNRayTrace;
127  unsigned int fMinNRayTrace;
135 
138 
139 
141  const double s_age,
142  const double r_moliere);
144  const double s_age,
145  const double r_moliere);
146 
148  const utl::Point& core,
149  const utl::Vector& axis,
150  double distanceCoreToPointOnShower,
151  double Xmax,
152  double rMoliere,
153  double& emissionDistance,
154  utl::Point& pointOfEnission,
155  utl::Vector& directionOfEmission,
156  const utl::VRandomSampler& cherenkovProduction,
157  const atm::ProfileResult& depthProfile,
158  const atm::ProfileResult* slantDepthVsDistance,
159  const double absCosZenith,
160  const double coreZ,
161  const bool flatEarth,
162  const double atmDistanceMin,
163  const double atmDistanceMax);
164 
165  double NKGFunction(const double s, const double fMax);
166  double GoraFunction(const double s);
167 
168  void PlotLDF(const evt::ShowerSimData& simShower,
169  const utl::TabulatedFunction& cherenkovProductionBeam,
170  const double age);
171 
172  TH1D* ToCumu(TH1D* h, double total);
173 
174  REGISTER_MODULE("ShowerPhotonGeneratorOG", ShowerPhotonGenerator);
175 
176  };
177 
179  class ScopeGuard {
180  public:
181  ScopeGuard(std::map<int, utl::RandomSamplerFromPDF*>& theMap);
182  ~ScopeGuard();
183  private:
184  std::map<int, utl::RandomSamplerFromPDF*>& fMap;
185  };
186 }
187 
188 
189 #endif
190 
191 // Configure (x)emacs for this file ...
192 // Local Variables:
193 // mode: c++
194 // compile-command: "make -C .. -k"
195 // End:
unsigned int fMinNRayTrace
max no. of photons per bin
Point object.
Definition: Point.h:32
utl::Vector LateralDistributionNKG(const utl::CoordinateSystemPtr &shwCS, const double s_age, const double r_moliere)
Distribute points according to a NKG function.
unsigned int GetMaxNRayTrace() const
Get the max. no. of photons raytraced per time bin.
void SetMaxNRayTrace(unsigned int nphotons)
Set the max. no. of photons raytraced per time bin.
bool GetUseOnlyReferenceWavelength() const
Returns whether photons will be generated only at the reference wavelength.
REGISTER_MODULE("ShowerPhotonGeneratorOG", ShowerPhotonGenerator)
utl::Vector LateralDistributionGora(const utl::CoordinateSystemPtr &shwCS, const double s_age, const double r_moliere)
Distribute points according to a Gora function.
unsigned int fMaxNRayTrace
Returns int as implementation of an eNone equivalent.
Class to hold collection (x,y) points and provide interpolation between them.
void PlotLDF(const evt::ShowerSimData &simShower, const utl::TabulatedFunction &cherenkovProductionBeam, const double age)
void SetLightSourceSelection(const fevt::FdConstants::LightSource source)
utl::Vector LateralDistributionScatteredCherenkov(const utl::CoordinateSystemPtr &showerCX, const utl::Point &core, const utl::Vector &axis, double distanceCoreToPointOnShower, double Xmax, double rMoliere, double &emissionDistance, utl::Point &pointOfEnission, utl::Vector &directionOfEmission, const utl::VRandomSampler &cherenkovProduction, const atm::ProfileResult &depthProfile, const atm::ProfileResult *slantDepthVsDistance, const double absCosZenith, const double coreZ, const bool flatEarth, const double atmDistanceMin, const double atmDistanceMax)
Distribute points according to scattered Cherenkov emission.
EPhotonSource
The source that generated this photon.
utl::RandomEngine * fRandomEngine
This can be set in order to simulate photons for a single source ONLY (for FdLightCollectionEfficienc...
double fExtraRayTraceFactor
min no. of photons per bin
Interface class to access Shower Simulated parameters.
Definition: ShowerSimData.h:49
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
constexpr double s
Definition: AugerUnits.h:163
double GoraFunction(const double s)
returns random numbers drawn from Gora et al. LDF
LightSource
Possible light sources.
Definition: FdConstants.h:9
Wraps the random number engine used to generate distributions.
Definition: RandomEngine.h:27
Class describing the Atmospheric profile.
Definition: ProfileResult.h:25
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
void SetExtraRayTraceFactor(double factor)
Set the artificial scaling factor for the number of ray-traced photons.
unsigned int GetMinNRayTrace() const
Get the min. no. of photons raytraced per time bin.
Module interface.
Definition: VModule.h:53
ScopeGuard(std::map< int, utl::RandomSamplerFromPDF * > &theMap)
ELDFMode fFluorescenceLDF
Photons are generated at the reference wavelength only if this is set.
bool fUseOnlyReferenceWavelength
for doing more tracing to reduce fluctuations
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
void SetUseOnlyReferenceWavelength(bool onlyRefWl)
Set whether photons should be generated only at the reference wavelength (used by FdLightCollectionEf...
Vector object.
Definition: Vector.h:30
std::map< int, utl::RandomSamplerFromPDF * > & fMap
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Automatically frees memory on scope exit.
double NKGFunction(const double s, const double fMax)
returns random numbers drawn from
void SetMinNRayTrace(unsigned int nphotons)
Set the min. no. of photons raytraced per time bin.
Simulate photon injection into FD telescope.
Class to shoot random numbers given by a user-defined distribution function.
double GetExtraRayTraceFactor() const
Get the artificial scaling factor for the number of ray-traced photons.

, generated on Tue Sep 26 2023.