RadioSimulation.cc
Go to the documentation of this file.
1 #include <evt/RadioSimulation.h>
2 #include <utl/Vector.h>
3 #include <det/Detector.h>
4 #include <utl/LameShadowPtr_imp.h>
5 
6 using namespace evt;
7 using namespace std;
8 
9 
11 
12 
15  const
16 {
17  if (!fLocalCoordinateSystem.IsValid()) {
18  throw utl::AugerException("Local coordinate system was not set!");
19  }
20  return fLocalCoordinateSystem.Get();
21 }
22 
23 
24 void
25 RadioSimulation::SetCoreCoordinates(const double x, const double y, const double z)
26 {
27  const utl::CoordinateSystemPtr& cs = det::Detector::GetInstance().GetReferenceCoordinateSystem();
28  fCorePosition = utl::Point(x, y, z, cs);
29  fLocalCoordinateSystem = fwk::LocalCoordinateSystem::Create(fCorePosition.Get());
30 }
31 
32 
33 void
35 {
36  fCorePosition = core;
37  fLocalCoordinateSystem = fwk::LocalCoordinateSystem::Create(core);
38 }
39 
40 
43  const
44 {
45  if (!fCorePosition.IsValid()) {
46  throw utl::AugerException("Core position was not set!");
47  }
48  return fCorePosition.Get();
49 }
50 
51 
52 bool
54 {
55  if (fSimRadioPulseVector.empty())
56  return false;
57  else {
58  fPulseIter = fSimRadioPulseVector.begin();
59  return true;
60  }
61 }
62 
63 
64 const SimRadioPulse&
66 {
67  // if fPulseIter has never been initialized, initialize it now
68  if (!fPulseIter.IsValid())
69  fPulseIter = fSimRadioPulseVector.begin();
70 
71  // if no more elements in vector, return illegal simpulse and ok=false
72  if (fPulseIter.Get() == fSimRadioPulseVector.end()) {
73  ok = false;
74  fPulseIter.SetValid(false);
75  return *fPulseIter.Get();
76  }
77  // otherwise increment iterator for next call and return the current element
78  ok = true;
79  const SimRadioPulse& srp = *fPulseIter.Get()++;
80 
81  return srp;
82 }
83 
84 
85 //const SimRadioPulse&
86 //RadioSimulation::GetSimRadioPulse()
87 //{
88 // const SimRadioPulse& srp = *fPulseIter.Get();
89 // srp.SetLocalCoordinateSystem(GetLocalCoordinateSystem());
90 // return srp;
91 //}
92 
93 
94 const SimRadioPulse&
96 {
97  const SimRadioPulse& srp = fSimRadioPulseVector.at(index);
98 
99  return srp;
100 }
101 
void SetCorePosition(const utl::Point &core)
Set the core position of the RadioSimulation using an utl::Point.
#define LAMESHADOWPTR_INST(_T_...)
Point object.
Definition: Point.h:32
Base class for all exceptions used in the auger offline code.
const SimRadioPulse & GetSimPulseByIndex(const int index)
Data structure for simulated Radio pulses.
Definition: SimRadioPulse.h:29
Data structure for a radio simulation (including several SimRadioPulses)
bool ok(bool okay)
Definition: testlib.cc:89
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
utl::Point GetCorePosition() const
Get the core position of the RadioSimulation as a utl::Point.
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
get local coordinate system anchored at the core position
void SetCoreCoordinates(const double x, const double y, const double z)
Set the core position coordinates of the RadioSimulation.
const SimRadioPulse & GetNextSimRadioPulse(bool &ok)
bool GoToFirstSimRadioPulse()
Jump to the first SimRadioPulse, returns false if the vector is empty.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.

, generated on Tue Sep 26 2023.