SdSimpleSim.h
Go to the documentation of this file.
1 
9 #ifndef _SdSimpleSimKG_SdSimpleSim_h_
10 #define _SdSimpleSimKG_SdSimpleSim_h_
11 
12 
13 namespace utl {
14  class RandomEngine;
15  class TimeStamp;
16 }
17 
18 
19 
20 #include <fwk/VModule.h>
21 #include <utl/Vector.h>
22 #include <utl/TabulatedFunction.h>
23 #include <evt/ShowerSimData.h>
24 
25 #include <map>
26 
27 class TTree;
28 class TProfile;
29 
30 namespace sevt {
31  class SEvent;
32  class Station;
33  class StationRecData;
34 }
35 
36 namespace atm {
37  class ProfileResult;
38 }
39 
40 namespace SdSimpleSimKG {
41 
53  class SdSimpleSim : public fwk::VModule {
54 
55  struct FitParam {
56  FitParam() : p0(0), p1(0) { }
57  FitParam(double a, double b) : p0(a), p1(b) { }
58  double p0;
59  double p1;
60  };
61 
62  public:
63  SdSimpleSim();
64 
68 
69  private:
71  const utl::Point& core,
72  const utl::Vector& axis);
73 
75  //const utl::Point& core,
76  //const utl::Vector& axis);
77  double cosTheta,
78  double XobsVert);
79 
80  double SampleEnergy (double Emin,
81  double Emax,
82  double Age);
83 
84  bool Noise (sevt::SEvent& sevent,
85  const utl::TimeStamp& T0,
86  int TankID,
87  double TimeOffset, double TimeWindow);
88 
89  bool IsNoise (double TimeWindow);
90 
91  double GenerateNoiseStation (sevt::Station& tank,
92  const utl::TimeStamp& T0,
93  double TimeOffset,
94  double TimeWindow);
95 
96  double NKG (double N, double Rm, double R, double s);
97 
98  double CalculateTankSignal (double CoreDistance,
99  double TankRadius, double TankHeight, double Zenith,
100  double Age, double Rm,
101  double Ne, double Ng, double Nmu,
102  bool fluctuations=true);
103 
104  double TankIntersection (double r,
105  double phi,
106  double z,
107  double theta,
108  double TankRadius);
109 
110  double LTP (double r,
111  double theta,
112  double energy);
113 
114  double T1TriggerProbability (double signal, double S1000, double theta);
115 
116  double GetCDASTriggerTimeWindow(const utl::TimeStamp& time);
117 
118  double NerlingF1 (double E,
119  double a1);
120 
121  double NerlingF2 (double E,
122  double a2,
123  double s);
124 
125  // parameters for nerling model
126  static const double fNerlingA1a;
127  static const double fNerlingA1b;
128  static const double fNerlingA2a;
129  static const double fNerlingA2b;
130 
131  FitParam FitDecay (const utl::TabulatedFunction& prof, bool dEdX=false);
133  std::map <evt::ShowerSimData::ProfileType, FitParam> fProfileExtrapolation;
135 
136  private:
139 
142 
143  int fSdId;
144 
145  double fMuonRScale;
146  double fEMAgeFactor;
147  double fLateralCut;
148 
149  bool fNoise;
151 
152  int fNSample;
153 
154  // number of particles
155  int fNMuons;
156  int fNGammas;
158 
159  // VEM of particles
160  double fSMuons;
161  double fSGammas;
162  double fSElectrons;
163 
165 
169 
170  // for debug root tree
171  TTree *fStatTree;
172  TProfile *fLorenzo_vs_X;
173  TProfile *fdNdX;
174  TProfile *fCharged;
175  TProfile *fMuon;
176  TProfile *fElectron;
177  TProfile *fGamma;
178  TProfile *fdEdX;
179 
180  TProfile *fLorenzo;
181  TProfile *fdNdz;
182  TProfile *fCharged_vs_z;
183  TProfile *fMuon_vs_z;
184  TProfile *fElectron_vs_z;
185  TProfile *fGamma_vs_z;
186  TProfile *fdEdX_vs_z;
187 
188  REGISTER_MODULE ("SdSimpleSimKG", SdSimpleSim);
189  };
190 
191 
192 } // SdSimpleSimKG
193 
194 
195 #endif // _SdSimpleSimKG_SdSimpleSim_h_
196 
197 // Configure (x)emacs for this file ...
198 // Local Variables:
199 // mode:c++
200 // compile-command: "make -C ..
201 // End:
Point object.
Definition: Point.h:32
utl::TabulatedFunction CalculateLogZdist(const utl::TabulatedFunction &MuonProfile, double cosTheta, double XobsVert)
double SampleEnergy(double Emin, double Emax, double Age)
Interface class to access to the SD part of an event.
Definition: SEvent.h:39
FitParam FitDecay(const utl::TabulatedFunction &prof, bool dEdX=false)
Class to hold collection (x,y) points and provide interpolation between them.
static const double fNerlingA1b
Definition: SdSimpleSim.h:127
REGISTER_MODULE("SdSimpleSimKG", SdSimpleSim)
double T1TriggerProbability(double signal, double S1000, double theta)
bool Noise(sevt::SEvent &sevent, const utl::TimeStamp &T0, int TankID, double TimeOffset, double TimeWindow)
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Definition: SdSimpleSim.cc:201
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
double CalculateTankSignal(double CoreDistance, double TankRadius, double TankHeight, double Zenith, double Age, double Rm, double Ne, double Ng, double Nmu, bool fluctuations=true)
double TankIntersection(double r, double phi, double z, double theta, double TankRadius)
static const double fNerlingA2a
Definition: SdSimpleSim.h:128
class to hold data at Station level
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
Definition: SdSimpleSim.cc:102
A super-simple-and-fast SD-event-generator. See GAP2008-061 for details.
Definition: SdSimpleSim.h:53
double GenerateNoiseStation(sevt::Station &tank, const utl::TimeStamp &T0, double TimeOffset, double TimeWindow)
constexpr double s
Definition: AugerUnits.h:163
Wraps the random number engine used to generate distributions.
Definition: RandomEngine.h:27
Class describing the Atmospheric profile.
Definition: ProfileResult.h:25
double NerlingF2(double E, double a2, double s)
utl::RandomEngine & fRandomEngine
for CLHEP random nubers
Definition: SdSimpleSim.h:138
Module interface.
Definition: VModule.h:53
double LTP(double r, double theta, double energy)
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
static const double fNerlingA2b
Definition: SdSimpleSim.h:129
std::map< evt::ShowerSimData::ProfileType, FitParam > fProfileExtrapolation
Definition: SdSimpleSim.h:133
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Vector object.
Definition: Vector.h:30
static const double fNerlingA1a
Definition: SdSimpleSim.h:126
double NerlingF1(double E, double a1)
bool IsNoise(double TimeWindow)
FitParam FitAtmosphere(const atm::ProfileResult &prof)
double NKG(double N, double Rm, double R, double s)
Definition: XbArray.h:7
double GetCDASTriggerTimeWindow(const utl::TimeStamp &time)
utl::TabulatedFunction GetLogZdist(const utl::TabulatedFunction &prof, const utl::Point &core, const utl::Vector &axis)

, generated on Tue Sep 26 2023.