12 #include <fwk/CentralConfig.h>
13 #include <fwk/CoordinateSystemRegistry.h>
14 #include <fwk/RandomEngineRegistry.h>
16 #include <evt/Event.h>
17 #include <evt/ShowerSimData.h>
19 #include <evt/LaserData.h>
21 #include <det/Detector.h>
23 #include <fdet/FDetector.h>
26 #include <atm/AttenuationResult.h>
27 #include <atm/ProfileResult.h>
28 #include <atm/ScatteringResult.h>
29 #include <atm/Atmosphere.h>
31 #include <utl/Reader.h>
32 #include <utl/ErrorLogger.h>
33 #include <utl/AugerUnits.h>
34 #include <utl/MathConstants.h>
35 #include <utl/PhysicalConstants.h>
36 #include <utl/Vector.h>
37 #include <utl/Point.h>
38 #include <utl/TabulatedFunction.h>
39 #include <utl/TabulatedFunctionErrors.h>
40 #include <utl/MultiTabulatedFunction.h>
41 #include <utl/ReferenceEllipsoid.h>
42 #include <utl/UTMPoint.h>
43 #include <utl/AugerCoordinateSystem.h>
44 #include <utl/Photon.h>
45 #include <utl/RandomEngine.h>
51 #include <CLHEP/Random/RandGauss.h>
53 using namespace LaserLightSimulatorNA;
54 using CLHEP::RandGauss;
69 fDoPoissonFluctuate(false),
91 &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
96 <<
" Maximum laser height: "
98 <<
" Poisson-fluctuate the photon count: "
100 <<
" GPS timing fluctuation: "
110 INFO(
"Calculating laser track");
113 ERROR (
"Event has no simulated shower.");
119 ERROR (
"Event has no simulated laser.");
129 info <<
" Laser energy = " <<
fEnergy / (1e-3*
joule) <<
" mJ;"
141 double gpsTimingOffset = 0;
146 info <<
"; Laser offset = " << gpsTimingOffset /
m;
153 AugerCoordinateSystem::Create(posLsr, wgs84, wgs84.
GetECEF());
157 posLsr = posLsr + gpsTimingOffset * vecLsr;
161 if (zenith > (0.5*
kPi)) {
162 zenith =
kPi - zenith;
163 INFO(
"UPGOING -> Inverting Zenith Angle for CosTheta Calculation");
165 double cosTheta = cos(zenith);
169 const double fluorLightBin = 50.*
ns;
173 const int nWaves = 1;
174 vector<double> distance;
175 vector<double> laserPhotons[nWaves];
184 (laserPhotons[0]).push_back(photons);
186 double distance_point = (height_point - zLaserGround) / cosTheta;
187 distance.push_back(distance_point);
190 info <<
" first point "
196 for (
int i=1; i<nPoints; i++){
197 utl::Point LsrPoint2 = LsrPoint + delta *vecLsr;
201 distance_point = (height_point-zLaserGround)/cosTheta;
202 distance.push_back(distance_point);
205 (laserPhotons[0]).push_back(photons);
207 LsrPoint = LsrPoint2;
210 for (
int iwl=0; iwl<nWaves; iwl++) {
211 vector<double> laserLight = laserPhotons[iwl];
233 const Atmosphere& atmos = Detector::GetInstance().GetAtmosphere();
245 const double att = rAtt[0].
Y() * mAtt[0].
Y();
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger coordinate system associated to the shower core position.
LaserData & GetLaserData()
Get the laser data.
Top of the interface to Atmosphere information.
std::vector< double > fLaserWavelength
utl::RandomEngine * fRandomEngine
bool HasLaserData() const
Check initialization of the LaserData.
constexpr double kPlanckSI
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
double GetLaserWavelength() const
atm::AttenuationResult EvaluateMieAttenuation(const utl::Point &xInit, const utl::Point &xFinal, const std::vector< double > &wLength) const
Report success to RunController.
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
utl::Point fLsrInitialPos
virtual ~LaserLightSimulator()
const utl::TabulatedFunctionErrors & GetTransmissionFactor() const
Transmission factor.
RandomEngineType & GetEngine()
constexpr double kSpeedOfLightSI
Class to hold collection (x,y) points and provide interpolation between them.
bool HasSimShower() const
bool HasFluorescencePhotons(const int wavelength) const
#define INFO(message)
Macro for logging informational messages.
double EvaluatePhotons(const double Nph, const utl::Point &p1, const utl::Point &p2) const
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
std::string GetVersionInfo(const VersionInfoType v) const
Retrieve different sorts of module version info.
constexpr double nanometer
Interface class to access Shower Simulated parameters.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
Reference ellipsoids for UTM transformations.
const utl::Vector & GetDirection() const
Get the direction of the shower axis. This is the true direction of shower movement.
constexpr double nanosecond
double abs(const SVector< n, T > &v)
const utl::Point & GetPosition() const
Get the position of the shower core.
atm::AttenuationResult EvaluateRayleighAttenuation(const utl::Point &xInit, const utl::Point &xFinal, const std::vector< double > &wLength) const
Compute Rayleigh attenuation between points.
Triple PointToLatitudeLongitudeHeight(const Point &thePoint) const
Convert Point to Lat/Long/Height.
ShowerSimData & GetSimShower()
double GetEnergy() const
Get the energy of the shower primary particle.
const CoordinateSystemPtr GetECEF() const
Get the ECEF.
void GetData(bool &b) const
Overloads of the GetData member template function.
Data structure for Laser simulation and reconstruction.
constexpr double kSpeedOfLight
ResultFlag
Flag returned by module methods to the RunController.
double fGpsTimingFluctuation
void AddFluorescencePhotons(const utl::TabulatedFunction &fp, const int wavelength)
Report failure to RunController, causing RunController to terminate execution.
Main configuration utility.
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
double Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
#define ERROR(message)
Macro for logging error messages.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
Class describing the Atmospheric attenuation.