ShowerSimData.cc
Go to the documentation of this file.
1 #include <evt/ShowerSimData.h>
2 #include <evt/LaserData.h>
3 #include <evt/RadioSimulation.h>
4 #include <fwk/LocalCoordinateSystem.h>
5 #include <utl/ParticlePropertiesFactory.h>
6 #include <utl/ErrorLogger.h>
7 
8 #include <utl/LameShadowPtr_imp.h>
10 
11 using namespace utl;
12 using namespace evt;
13 using namespace std;
14 
15 
16 namespace evt {
17 
29  void
30  ShowerSimData::SetGroundParticleCoordinateSystemZenith(const double zenith)
31  {
32  if (HasGeometry()) {
33  ERROR("ShowerSimData Geometry already exists - Not replacing zenith");
34  throw AugerException("ShowerSimData Geometry already exists - Not replacing zenith.");
35  }
36  fGroundParticleCoordinateSystemZenith = zenith;
37  }
38 
39 
40  void
41  ShowerSimData::SetGroundParticleCoordinateSystemAzimuth(const double azimuth)
42  {
43  if (HasGeometry()) {
44  ERROR("ShowerSimData Geometry already exists - Not replacing azimuth");
45  throw AugerException("ShowerSimData Geometry already exists - Not replacing azimuth.");
46  }
47  fGroundParticleCoordinateSystemAzimuth = azimuth;
48  }
49 
50 
51  const utl::Point&
52  ShowerSimData::GetPosition()
53  const
54  {
55  if (!fCachedPosition) {
56  fCachedPosition = new utl::Point(0, 0, 0, GetGroundParticleCoordinateSystem());
57  }
58  return *fCachedPosition;
59  }
60 
61 
62  const utl::Vector&
63  ShowerSimData::GetDirection()
64  const
65  {
66  if (!fCachedDirection)
67  fCachedDirection = new utl::Vector(0, 0, -1, GetShowerCoordinateSystem());
68  return *fCachedDirection;
69  }
70 
71 
82  void
83  ShowerSimData::MakeGeometry(const utl::Point& anyPointOnShowerAxis)
84  {
85  if (HasGeometry()) {
86  ERROR("ShowerSimData Geometry already exists - Not replacing");
87  throw AugerException("ShowerSimData Geometry already exists - Not replacing.");
88  }
89 
90  if (!fShowerGeometryProducer) {
91  ERROR("ShowerGeometryProducer does not exists. You need to define one in the EventIO");
92  throw AugerException("ShowerGeometryProducer does not exists. You need to define one in the EventIO");
93  }
94 
95  fParticleCS = fShowerGeometryProducer->MakeGroundParticleCoordinateSystem(anyPointOnShowerAxis);
96 
97  fShowerCS =
99  fGroundParticleCoordinateSystemZenith,
100  CoordinateSystem::RotationZ(fGroundParticleCoordinateSystemAzimuth, fParticleCS)
101  );
102 
103  fLocalCS = fwk::LocalCoordinateSystem::Create(GetPosition());
104  }
105 
106 
107  void
108  ShowerSimData::CheckGeometry()
109  const
110  {
111  if (!HasGeometry())
112  throw utl::AugerException("Geometry not defined!");
113  }
114 
115 
116  void
117  ShowerSimData::MakeGroundParticles()
118  {
119  if (fGroundParticles)
120  ERROR("ShowerSimData already has GroundParticles - not replacing");
121  else
122  fGroundParticles = new utl::ShowerParticleList;
123  }
124 
125 
126  void
127  ShowerSimData::MakeGroundCherenkov(const utl::AttributeMap& am)
128  {
129  if (fGroundCherenkov.count(am) && fGroundCherenkov[am])
130  ERROR("ShowerSimData already has GroundCherenkov - not replacing");
131  else
132  fGroundCherenkov[am] = new utl::ShowerParticleList;
133  }
134 
135 
136  void
137  ShowerSimData::SetPrimaryParticle(const int type)
138  {
139  fPrimaryProperties = utl::ParticlePropertiesFactory::Create(type);
140  }
141 
142 
143  void
144  ShowerSimData::MakeGHParameters(const VGaisserHillasParameter& gHParameters)
145  {
146  if (fGHParameters)
147  ERROR("Sim Shower GHParameters already exists - Not replacing");
148  else
149  fGHParameters = gHParameters.Clone();
150  }
151 
152 
153  void
154  ShowerSimData::MakeAtmosphereParameters(const AtmosphereParameters& param)
155  {
156  if (fAtmosphereParameters)
157  ERROR("Sim Shower AtmosphereParameters already exists - Not replacing");
158  else
159  fAtmosphereParameters = new AtmosphereParameters(param);
160  }
161 
162 
163  void
164  ShowerSimData::MakeTimeStamp(const TimeStamp& ts)
165  {
166  if (fTimeStamp)
167  ERROR("Sim Shower TimeStamp already exists - Not replacing");
168  else
169  fTimeStamp = new TimeStamp(ts);
170  }
171 
172 
173  double
174  ShowerSimData::GetEnergyCutoff(const ProfileType type)
175  const
176  {
177  switch (type) {
178  case eMuon:
179  return fEnergyCutoffMuon;
180  case eElectron:
181  return fEnergyCutoff;
182  default:
183  return -1;
184  }
185  }
186 
187 
188  void
189  ShowerSimData::SetEnergyCutoff(const double energy,
190  const ProfileType type)
191  {
192  switch (type) {
193  case eMuon:
194  fEnergyCutoffMuon = energy;
195  break;
196  case eElectron:
197  fEnergyCutoff = energy;
198  break;
199  default:
200  break;
201  }
202  }
203 
204 
205  void
206  ShowerSimData::MakeLaserData()
207  {
208  if (!fLaserData)
209  fLaserData = new LaserData();
210  else
211  ERROR("LaserData already exists - Not replacing");
212  }
213 
214 
215  void
216  ShowerSimData::MakeRadioSimulation()
217  {
218  if (!fRadioSimulation)
219  fRadioSimulation = new RadioSimulation();
220  else
221  ERROR("RadioSimulation already exists - Not replacing");
222  }
223 
224 
225  void
226  ShowerSimData::AddSimCore(const utl::Point& pos)
227  {
228  fSimCores.push_back(pos);
229  }
230 
231 }
#define LAMESHADOWPTR_INST(_T_...)
Point object.
Definition: Point.h:32
Base class for all exceptions used in the auger offline code.
std::map< std::string, std::string > AttributeMap
Definition: Branch.h:24
Data structure for a radio simulation (including several SimRadioPulses)
CoordinateSystemPtr GetShowerCoordinateSystem(const double theta, const double phi, const Point &core)
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
Interface class to access Shower Simulated parameters.
Definition: ShowerSimData.h:49
static Policy::type RotationY(const double angle, const CoordinateSystemPtr &theCS)
Construct from rotation about Y axis.
static Policy::type RotationZ(const double angle, const CoordinateSystemPtr &theCS)
Construct from rotation about Z axis.
Data structure for Laser simulation and reconstruction.
Definition: LaserData.h:29
virtual VGaisserHillasParameter * Clone() const =0
Interface class for access to the Gaisser-Hillas parameters.
Vector object.
Definition: Vector.h:30
Interface class for accessing a list of particles from a shower file.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165
Class to hold the standard parameters used to specify an atmospheric profile.
static ObjectPtrType Create(const IdentifierType &id)
Create an object (0-argument constructor)

, generated on Tue Sep 26 2023.