CEvent/StationSimData.cc
Go to the documentation of this file.
1 #include <cevt/StationSimData.h>
2 // #include <cevt/StationTriggerData.h>
3 // #include <cevt/StationGPSData.h>
4 #include <utl/Particle.h>
5 #include <utl/ShadowPtr.h>
6 #include <sstream>
7 #include <utl/ErrorLogger.h>
8 
9 using namespace utl;
10 using namespace cevt;
11 using namespace std;
12 
13 
14 StationSimData::StationSimData() :
15  fNumberOfMuons(0),
16  fNumberOfElectrons(0),
17  fNumberOfElectronsFromMuons(0),
18  fNumberOfElectronsFromPhotons(0)
19 {
20 }
21 
22 
24 {
25 }
26 
27 
28 void
30 {
31  fParticles.push_back(ParticlePtr(new Particle(particle)));
32  if (particle.GetType() == utl::Particle::eMuon || particle.GetType() == utl::Particle::eAntiMuon )
34 
35  if (particle.GetType() == utl::Particle::eElectron || particle.GetType() == utl::Particle::ePositron ) {
37 
38  if (particle.HasParent()) {
39  if (particle.GetParent().GetType() == utl::Particle::eMuon ||
42 
43  if (particle.GetParent().GetType() == utl::Particle::ePhoton)
45  }
46  }
47 }
48 
49 
50 void
52 {
53  fParticles.clear();
54 }
55 
56 
57 void
59 {
60  fInjectedParticles.push_back(ParticlePtr(new Particle(particle)));
61 }
62 
63 
64 void
66 {
67  fInjectedParticles.clear();
68 }
69 
70 
71 // CBT
72 // void
73 // StationSimData::MakeTriggerAndGPSData(const TimeStamp& lsTime)
74 // {
75 // if (HasTriggerData(lsTime)) {
76 // WARNING("Trigger and GPS data already present!");
77 // return;
78 // }
79 
80 // TriggerGPSPair tg;
81 // tg.first = new StationTriggerData;
82 // tg.second = new StationGPSData;
83 // fTriggerAndGPSData.insert(make_pair(lsTime, tg));
84 // fTriggerTimes.push_back(lsTime);
85 // }
86 
87 
88 // StationGPSData&
89 // StationSimData::GetGPSData(const TimeStamp& lsTime)
90 // {
91 // if (!HasTriggerData(lsTime)) {
92 // ostringstream err;
93 // err << "Tried to get unavailable GPS data at time " << lsTime;
94 // ERROR(err);
95 // throw NonExistentComponentException(err.str());
96 // }
97 
98 // TriggerGPSPair& tg = fTriggerAndGPSData.find(lsTime)->second;
99 // return *tg.second;
100 // }
101 
102 
103 // const StationGPSData&
104 // StationSimData::GetGPSData(const TimeStamp& lsTime)
105 // const
106 // {
107 // if (!HasTriggerData(lsTime)) {
108 // ostringstream err;
109 // err << "Tried to get unavailable GPS data at time " << lsTime;
110 // ERROR(err);
111 // throw NonExistentComponentException(err.str());
112 // }
113 
114 // const TriggerGPSPair& tg = fTriggerAndGPSData.find(lsTime)->second;
115 // return *tg.second;
116 // }
117 
118 
119 // StationTriggerData&
120 // StationSimData::GetTriggerData(const TimeStamp& lsTime)
121 // {
122 // if (!HasTriggerData(lsTime)) {
123 // ostringstream err;
124 // err << "Tried to get unavailable trigger data at time " << lsTime;
125 // ERROR(err);
126 // throw NonExistentComponentException(err.str());
127 // }
128 
129 // TriggerGPSPair& tg = fTriggerAndGPSData.find(lsTime)->second;
130 // return *tg.first;
131 // }
132 
133 
134 // const StationTriggerData&
135 // StationSimData::GetTriggerData(const TimeStamp& lsTime)
136 // const
137 // {
138 // if (!HasTriggerData(lsTime)) {
139 // ostringstream err;
140 // err << "Tried to get unavailable trigger data at time " << lsTime;
141 // ERROR(err);
142 // throw NonExistentComponentException(err.str());
143 // }
144 
145 // const TriggerGPSPair& tg = fTriggerAndGPSData.find(lsTime)->second;
146 // return *tg.first;
147 // }
148 
149 
150 // bool
151 // StationSimData::HasTriggerData(const TimeStamp& lsTime)
152 // const
153 // {
154 // const ConstTriggerTimeIterator end = fTriggerTimes.end();
155 // return find(fTriggerTimes.begin(), end, lsTime) != end;
156 // }
157 
158 
159 // bool
160 // StationSimData::HasGPSData(const TimeStamp& lsTime)
161 // const
162 // {
163 // const ConstTriggerTimeIterator end = fTriggerTimes.end();
164 // return find(fTriggerTimes.begin(), end, lsTime) != end;
165 // }
166 
167 
168 // End CBT
169 
170 // Configure (x)emacs for this file ...
171 // Local Variables:
172 // mode: c++
173 // compile-command: "cd ../cmt; make -k"
174 // End:
void AddInjectedParticle(const utl::Particle &particle)
Add a simulated particle to the station.
InternalParticleVector fParticles
void AddParticle(const utl::Particle &particle)
Add a simulated particle to the station.
Describes a particle for Simulation.
Definition: Particle.h:26
unsigned int fNumberOfElectronsFromMuons
Particle & GetParent()
Definition: Particle.h:148
unsigned int fNumberOfElectronsFromPhotons
InternalParticleVector fInjectedParticles
utl::ShadowPtr< utl::Particle, utl::NoDereferenceCheck > ParticlePtr
void ClearParticleList()
Clear the station&#39;s particle list.
bool HasParent() const
Definition: Particle.h:147
void ClearInjectedParticleList()
Clear the station&#39;s particle list.
struct particle_info particle[80]
int GetType() const
Definition: Particle.h:101

, generated on Tue Sep 26 2023.