Main Page
Class Categories
Classes
Namespaces
File List
File Members
exper-sw
cosmosw
AugerSW
Offline
source
main
Utilities
Particles
testShowerFileParticleIterator.cc
Go to the documentation of this file.
1
11
#include <
Particles/testShowerFileParticleIterator.h
>
12
#include <utl/Particle.h>
13
#include <utl/AugerException.h>
14
15
using namespace
utl;
16
17
21
testShowerFileParticleIterator::~testShowerFileParticleIterator
()
22
{
23
pParticleV::iterator cur = fParticles.begin();
24
pParticleV::iterator end = fParticles.end();
25
while
(cur != end) {
26
delete
*cur;
27
++cur;
28
}
29
}
30
31
35
void
36
testShowerFileParticleIterator::AddParticle
(
const
Particle
&
p
)
37
{
38
fParticles.push_back(
new
Particle
(p));
39
fIteratorValid =
false
;
40
}
41
42
46
void
47
testShowerFileParticleIterator::Rewind
()
48
{
49
fCurrentParticle = fParticles.begin();
50
fSkipped = 0;
51
fIteratorValid =
true
;
52
}
53
54
58
Particle
*
59
testShowerFileParticleIterator::GetOneParticle
(
const
utl::CoordinateSystemPtr
&
/*cs*/
)
60
{
61
if
(!fIteratorValid) {
62
throw
IOFailureException
(
"testShowerParticleFileIterator not valid"
);
63
}
64
65
while
(fSkipped < fSkipAtBeginning && fCurrentParticle != fParticles.end()) {
66
++fCurrentParticle;
67
++fSkipped;
68
}
69
70
if
(fCurrentParticle == fParticles.end()) {
71
fIteratorValid =
false
;
72
return
0;
73
}
else
{
74
return
*fCurrentParticle++;
75
}
76
}
77
78
// Configure (x)emacs for this file ...
79
// Local Variables:
80
// mode:c++
81
// compile-command: "make -C .. -k run-testParticleTests"
82
// End:
testShowerFileParticleIterator::~testShowerFileParticleIterator
virtual ~testShowerFileParticleIterator()
Definition:
testShowerFileParticleIterator.cc:21
G4StationSimulatorOG::p
p
Definition:
G4StationConstruction.cc:106
utl::Particle
Describes a particle for Simulation.
Definition:
Particle.h:26
utl::IOFailureException
Base class to report exceptions in IO.
Definition:
AugerException.h:76
utl::CoordinateSystemPtr
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Definition:
CoordinateSystemPtr.h:9
testShowerFileParticleIterator::Rewind
virtual void Rewind()
Rewind the particle list in the shower file to the beginning.
Definition:
testShowerFileParticleIterator.cc:47
testShowerFileParticleIterator::GetOneParticle
virtual utl::Particle * GetOneParticle(const utl::CoordinateSystemPtr &cs)
Member function to fetch the next particle.
Definition:
testShowerFileParticleIterator.cc:59
testShowerFileParticleIterator::AddParticle
void AddParticle(const utl::Particle &p)
Definition:
testShowerFileParticleIterator.cc:36
testShowerFileParticleIterator.h
, generated on Tue Sep 26 2023.