9 #include <utl/AugerUnits.h>
10 #include <utl/CoordinateSystem.h>
11 #include <fwk/CoordinateSystemRegistry.h>
12 #include <fwk/CentralConfig.h>
13 #include <utl/ErrorLogger.h>
14 #include <utl/MultiTabulatedFunction.h>
15 #include <utl/Particle.h>
16 #include <utl/Point.h>
17 #include <utl/TabulatedFunction.h>
18 #include <utl/TabulatedFunctionErrors.h>
19 #include <utl/TimeStamp.h>
20 #include <utl/Vector.h>
21 #include <det/Detector.h>
23 #include <evt/Event.h>
24 #include <evt/ShowerSimData.h>
25 #include <evt/ShowerRecData.h>
26 #include <evt/ShowerFRecData.h>
27 #include <evt/ShowerSRecData.h>
28 #include <evt/DefaultShowerGeometryProducer.h>
30 #include <evt/ShowerUnivRecData.h>
32 #include <evt/GaisserHillas4Parameter.h>
34 #include <evt/LaserData.h>
36 #include <tst/Verify.h>
37 #include <cppunit/extensions/HelperMacros.h>
38 #include <boost/tuple/tuple.hpp>
40 #include <boost/tuple/tuple_io.hpp>
61 fIsOwnerOfEvent =
true;
79 fIsOwnerOfEvent =
false;
106 if (!fEvent->HasRecShower())
107 fEvent->MakeRecShower();
111 SetShowerRecDataValues(theRecShower);
112 CheckShowerRecDataValues(theRecShower);
131 for (
int i = 0; i < 10; ++i) {
145 if (!theSRecShower.
HasLDF())
147 theSRecShower.
GetLDF() = ldf;
149 theSRecShower.
SetBeta(1.0, 0.1);
164 theUnivRecShower.SetNmu(1., .1);
165 theUnivRecShower.SetXmax(800*
g/
cm2, 50*
g/
cm2);
166 theUnivRecShower.SetXmaxMu(400*
g/
cm2, 50*
g/
cm2);
233 CPPUNIT_ASSERT(theSRecShower.HasLDF());
237 for (
unsigned int i = 0; i < 10; ++i)
238 CPPUNIT_ASSERT(Verify<CloseTo>(ldf.GetYErr(i), double(i)));
240 CPPUNIT_ASSERT(Verify<CloseTo>(theSRecShower.GetBeta(), 1.0));
241 CPPUNIT_ASSERT(Verify<CloseTo>(theSRecShower.GetBetaError(), 0.1));
242 CPPUNIT_ASSERT(Verify<CloseTo>(theSRecShower.GetCurvature(), 1.0));
243 CPPUNIT_ASSERT(Verify<CloseTo>(theSRecShower.GetCurvatureError(), 0.1));
244 CPPUNIT_ASSERT(Verify<Equal>(theSRecShower.GetShowerSizeType(), ShowerSRecData::eS1000));
245 CPPUNIT_ASSERT(Verify<CloseTo>(theSRecShower.GetShowerSize(), 1.0));
246 CPPUNIT_ASSERT(Verify<CloseTo>(theSRecShower.GetShowerSizeError(), 0.1));
253 CPPUNIT_ASSERT(Verify<CloseTo>(theUnivRecShower.GetEnergy(), 10*
exaelectronvolt));
254 CPPUNIT_ASSERT(Verify<CloseTo>(theUnivRecShower.GetEnergyError(), 1*
exaelectronvolt));
255 CPPUNIT_ASSERT(Verify<CloseTo>(theUnivRecShower.GetNmu(), 1.));
256 CPPUNIT_ASSERT(Verify<CloseTo>(theUnivRecShower.GetNmuError(), .1));
257 CPPUNIT_ASSERT(Verify<CloseTo>(theUnivRecShower.GetXmax(), 800*
g/
cm2));
258 CPPUNIT_ASSERT(Verify<CloseTo>(theUnivRecShower.GetXmaxError(), 50*
g/
cm2));
259 CPPUNIT_ASSERT(Verify<CloseTo>(theUnivRecShower.GetXmaxMu(), 400*
g/
cm2));
260 CPPUNIT_ASSERT(Verify<CloseTo>(theUnivRecShower.GetXmaxMuError(), 50*
g/
cm2));
268 CPPUNIT_ASSERT(theFRecShower.HasLongitudinalProfile());
272 for (
int i = 0; i < 10; ++i)
273 CPPUNIT_ASSERT(Verify<CloseTo>(lp.GetYErr(i), double(i)));
275 CPPUNIT_ASSERT(theFRecShower.HasFluorescencePhotons());
277 theFRecShower.GetFluorescencePhotons();
279 for (
int i = 0; i < 10; i++)
280 CPPUNIT_ASSERT(Verify<CloseTo>(lp.GetYErr(i), double(i)));
282 CPPUNIT_ASSERT(theFRecShower.HasCherenkovPhotons());
286 for (
int i = 0; i < 10; i++)
287 CPPUNIT_ASSERT(Verify<CloseTo>(cp[i].Y(),
double(i)));
291 CPPUNIT_ASSERT(theFRecShower.HasGHParameters());
298 CPPUNIT_ASSERT(Verify<CloseTo>(gh4->
GetXMax(), 700.0*
g/
cm2));
300 CPPUNIT_ASSERT(Verify<CloseTo>(gh4->
GetXZero(), 10.0*
g/
cm2));
302 CPPUNIT_ASSERT(Verify<CloseTo>(gh4->
GetLambda(), 60.0*
g/
cm2));
304 CPPUNIT_ASSERT(Verify<CloseTo>(gh4->
GetNMax(), 1.0e8));
305 CPPUNIT_ASSERT(Verify<CloseTo>(gh4->
GetNMaxError(), 1.0e7));
306 CPPUNIT_ASSERT(Verify<CloseTo>(gh4->
GetChiSquare(), 0.1));
307 CPPUNIT_ASSERT(Verify<CloseTo>(
int(gh4->
GetNdof()), 1));
310 CPPUNIT_ASSERT(Verify<CloseTo>(laser.GetLaserWavelength(),
312 CPPUNIT_ASSERT(laser.IsPolarized());
313 CPPUNIT_ASSERT(Verify<CloseTo>(laser.
314 GetPolarizationVector().
316 boost::make_tuple(1.,0.,0.)));
324 const double rotatedCS = 90*
degree;
327 SetShowerSimDataValues(theSimData);
328 CheckShowerSimDataValues(theSimData, rotatedCS);
340 theSimData.
MakeGeometry(
Point(0*
m, 0*
m, 0*
m, det::Detector::GetInstance().GetSiteCoordinateSystem()));
351 SetShowerSimDataValues(theSimData);
352 CheckShowerSimDataValues(theSimData);
367 const Point position(1000*
m, 876*
m, 0*
m, det::Detector::GetInstance().GetSiteCoordinateSystem());
371 for (
int i = 0; i < 10; ++i)
374 for (
int i = 0; i < 10; ++i)
413 const double rotatedCS)
418 const Point position(1000*
m, 876*
m, 0*
m, det::Detector::GetInstance().GetSiteCoordinateSystem());
422 CPPUNIT_ASSERT(Verify<CloseTo>(position.GetCoordinates(cs),
423 boost::make_tuple(0., 0., 0.)));
427 CPPUNIT_ASSERT(Verify<CloseTo>(position.GetCoordinates(scs),
428 boost::make_tuple(0., 0., 0.)));
430 const double zenith = (-theSimShower.
GetDirection()).GetTheta(lcs);
431 const double azimuth = (-theSimShower.
GetDirection()).GetPhi(lcs);
433 const Vector v(1, zenith, azimuth, lcs, Vector::kSpherical);
434 CPPUNIT_ASSERT(Verify<CloseTo>(v.GetSphericalCoordinates(lcs),
435 boost::make_tuple(1., zenith, azimuth)));
436 CPPUNIT_ASSERT(Verify<CloseTo>(v.GetCoordinates(scs),
437 boost::make_tuple(0., 0., 1.)));
439 const Vector u(1, azimuth+90*
deg, 0, lcs, Vector::kCylindrical);
440 CPPUNIT_ASSERT(Verify<CloseTo>(u.GetCoordinates(scs),
441 boost::make_tuple(0., 1., 0.)));
450 const double zenith = (-theSimShower.
GetDirection()).GetTheta(lcs);
451 const double azimuth = (-theSimShower.
GetDirection()).GetPhi(lcs);
453 CPPUNIT_ASSERT(Verify<CloseTo>(azimuth/
deg, 23.0+rotatedCS/
deg));
454 CPPUNIT_ASSERT(Verify<CloseTo>(zenith/
deg, 10.0));
462 for (
int i = 0; i < 10; ++i)
463 CPPUNIT_ASSERT(Verify<CloseTo>(lp[i].Y(),
double(i)));
469 for (
int i = 0; i < 10; ++i)
470 CPPUNIT_ASSERT(Verify<CloseTo>(fp[i].Y(),
double(i)));
476 for (
int i = 0; i < 10; ++i)
477 CPPUNIT_ASSERT(Verify<CloseTo>(cp[i].Y(),
double(i)));
479 CPPUNIT_ASSERT(Verify<Equal>(theSimShower.
HasdEdX(),
true));
483 for (
int i = 0; i < 10; ++i)
484 CPPUNIT_ASSERT(Verify<CloseTo>(dedx[i].Y(),
double(i)));
488 CPPUNIT_ASSERT(Verify<Equal>(laser.
IsPolarized(),
true));
489 CPPUNIT_ASSERT(Verify<CloseTo>(
491 boost::make_tuple(1.,0.,0.))
495 CPPUNIT_ASSERT(Verify<Equal>(theSimShower.
GetShowerRunId(), string(
"showerName")));
void SetLaserWavelength(const double laserwavelength)
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger coordinate system associated to the shower core position.
void SetPolarizationStatus(const bool PolarizationStatus)
void SetCurvature(const double curvature, const double error)
gaussian curvature = 1 / Rc
void CheckShowerRecDataValues(const evt::ShowerRecData &theRecShower)
LaserData & GetLaserData()
Get the laser data.
bool HasUnivRecShower() const
const utl::TabulatedFunction & GetdEdX() const
Get the energy deposit of the shower.
void SetShowerSize(const double value, const double error)
bool HasLaserData() const
Check initialization of the LaserData.
ShowerFRecData & GetFRecShower()
void SetBeta(const double beta, const double error)
double GetLaserWavelength() const
Interface class to access to the SD Reconstruction of a Shower (universality)
double GetMinRadiusCut() const
Get the minimum radius from shower axis for which there are valid particles in the shower...
Interface class to access to the SD Reconstruction of a Shower.
bool HasFluorescencePhotons() const
void MakeLaserData()
Make the LaserData.
Interface class to access Shower Reconstructed parameters.
const utl::TabulatedFunctionErrors & GetLDF() const
void MakeLongitudinalProfile()
void SetAxis(const utl::Vector &axis)
Class to hold collection (x,y) points and provide interpolation between them.
bool HasCherenkovPhotons(const int wavelength) const
utl::TabulatedFunction & GetCherenkovPhotons()
retrieve number of Cerenkov photons versus depth
void SetMaxRadiusCut(const double maxR)
void MakeFluorescencePhotons()
const utl::TabulatedFunction & GetFluorescencePhotons(const int wavelength) const
Get the fluorescence photons generated along the shower axis.
bool HasFluorescencePhotons(const int wavelength) const
unsigned int GetNdof() const
void SetXMax(const double xMax, const double error)
void SetGroundParticleCoordinateSystemAzimuth(const double azimuth)
Set the azimuth angle of the shower. Angle in x-y plane wrt. to the x axis (0 is from east)...
void SetShapeParameter(const gh::EShapeParameter par, const double value, const double error)
Setters.
const utl::Vector & GetPolarizationVector() const
void MakedEdX(const utl::TabulatedFunction &dEdX)
Make the energy deposit of the shower.
constexpr double exaelectronvolt
ShowerSRecData & GetSRecShower()
void SetShowerSimDataValues(evt::ShowerSimData &theSimShower)
double GetXMaxError() const
void SetPolarizationVector(const utl::Vector &polarizationvector)
void testShowerSimDataNoGeometry()
void MakeCherenkovPhotons()
constexpr double nanometer
const CoordinateSystemPtr testCoordinateSystem
Interface class to access Shower Simulated parameters.
ShowerUnivRecData & GetUnivRecShower()
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
const utl::TabulatedFunction & GetCherenkovPhotons(const int wavelength) const
Get the Cherenkov photon production along the shower axis.
int GetShowerNumber() const
Get the number of the shower in the file.
void MakeLongitudinalProfile(const utl::TabulatedFunction &lp, const ProfileType type=eCharged)
Make the longitudinal charge profile of the shower.
const utl::Vector & GetDirection() const
Get the direction of the shower axis. This is the true direction of shower movement.
bool HasLongitudinalProfile() const
void SetEnergy(const double energy, const double error)
bool HasFRecShower() const
double GetMaxRadiusCut() const
Get the maximum radius cut used during shower generation.
ShowerSimData & GetSimShower()
void SetEnergy(const double theEnergy)
Set the energy of the shower primary particle.
double GetEnergy() const
Get the energy of the shower primary particle.
double GetXZeroError() const
void SetChiSquare(const double chi, const unsigned int ndof)
double GetNMaxError() const
void CheckShowerSimDataValues(const evt::ShowerSimData &theSimShower, const double rotatedCS=0)
void SetNMax(const double nMax, const double error, const bool isEnergyDeposit=false)
bool HasdEdX() const
Check initialization of the energy deposit.
bool HasCherenkovPhotons() const
bool HasGHParameters() const
Data structure for Laser simulation and reconstruction.
void AddCherenkovPhotons(const utl::TabulatedFunction &cp, const int wavelength)
void SetPrimaryParticle(const int type)
Set the type of the shower primary particle.
utl::TabulatedFunctionErrors & GetLongitudinalProfile()
retrieve longitudinal profile information (size vs depth)
void SetGroundParticleCoordinateSystemZenith(const double zenith)
Set the zenith angle of the shower. Room angle between z-axis and direction from where the shower is ...
utl::TabulatedFunctionErrors & GetFluorescencePhotons()
retrieve number of fluorescence photons versus depth
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
std::string GetShowerRunId() const
Get the run id for the shower.
void MakeGeometry(const utl::Point &pointOnShowerAxis)
initialize the shower geometry. Pos is a point on the shower axis, but not necessarily the core ...
void SetShowerNumber(const int sid)
Interface class for access to the Gaisser-Hillas parameters.
void AddFluorescencePhotons(const utl::TabulatedFunction &fp, const int wavelength)
void SetMinRadiusCut(const double minR)
Set the minimum radius cut.
void MakeSimShower(const evt::VShowerGeometryProducer &p)
Interface class to access to Fluorescence reconstruction of a Shower.
void SetCorePosition(const utl::Point &core)
void SetShowerSizeType(const ShowerSizeType type)
bool HasLaserData() const
void testShowerSimDataRotated()
void SetEnergy(const double energy, const double error)
Gaisser Hillas with 4 parameters.
void SetShowerRunId(const std::string srid)
void MakeGHParameters(const VGaisserHillasParameter &gh)
bool HasSRecShower() const
LaserData & GetLaserData()
void SetShowerRecDataValues(evt::ShowerRecData &theRecShower)
double GetChiSquare() const
double GetLambdaError() const
bool HasLongitudinalProfile(const ProfileType type=eCharged) const
Check initialization of the longitudinal profile.
utl::CoordinateSystemPtr GetShowerCoordinateSystem() const
const utl::TabulatedFunction & GetLongitudinalProfile(const ProfileType type=eCharged) const
Get the longitudinal charge profile of the shower.