CorsikaShowerFileParticleIterator.h
Go to the documentation of this file.
1 
10 #ifndef _io_CorsikaShowerFileParticleIterator_h_
11 #define _io_CorsikaShowerFileParticleIterator_h_
12 
13 #include <utl/VShowerFileParticleIterator.h>
14 #include <io/RawCorsikaFile.h>
15 #include <io/CorsikaBlock.h>
16 #include <io/CorsikaUtilities.h>
17 #include <utl/Particle.h>
18 #include <utl/CoordinateSystemPtr.h>
19 #include <utl/Validated.h>
20 
21 
22 namespace utl {
23  class Particle;
24 }
25 
26 namespace io {
27 
28  namespace Corsika {
29  class RawFile;
30  }
31 
32  class CorsikaShowerFile;
33 
34 
46 
47  public:
49 
50  // The following two constructors do exactly the same for different block types.
51  // It cannot be a template because of a bug in gcc:
52  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9050
54  const io::Corsika::EventHeader& header,
55  const Corsika::AtmosphereParameters& params,
56  const double timeOffset,
57  const PositionType& startPosition,
58  const unsigned int observationLevel,
59  const bool isThinned,
60  const double wmaxEM,
61  const bool CERFIL = false,
62  const double CERwlMin = 0,
63  const double CERwlMax = 0);
64 
66 
68  virtual void Rewind();
69 
70  private:
74 
76  double GetHeightAtDepth(const double depth) const;
78  double GetDepthAtHeight(const double h) const;
79 
80  utl::Particle::Source GetEMParticleSource(const float wt, const short int gen) const;
81 
84  const double fTimeOffset;
86  const double fVersion;
87 
88  const unsigned int fObservationLevel;
89 
91  unsigned int fParticleInBlock = 0;
92  bool fIteratorValid = false;
93 
97 
98  const bool fIsThinned;
99  const double fWMaxEM;
100  const bool fCERFIL;
101  const double fMCERFI;
102  const double fWlLowerLimit;
103  const double fWlUpperLimit;
104  const bool fCurvedObsLevel;
105  const bool fCurved;
106  const double fObsLevelHeight;
107  bool fBlockBufferValid = false;
108 
109  // This is to handle Corsika's history option.
113 
114  };
115 
116 }
117 
118 
119 #endif
double GetHeightAtDepth(const double depth) const
Return height at the vertical atmospheric depth, according to the parameters stored in the file...
virtual utl::Particle * GetOneParticle(const utl::CoordinateSystemPtr &cs)
Member function to fetch the next particle.
struct with particle data
Definition: CorsikaBlock.h:369
Describes a particle for Simulation.
Definition: Particle.h:26
event header struct for Corsika files
Definition: CorsikaBlock.h:182
Raw disk file.
Interface class for accessing a list of particles from a shower file.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
virtual void Rewind()
Rewind the particle list in the shower file to the beginning.
const io::Corsika::ParticleData * GetOneParticleRecord()
Low level reader of individual Corsika particles.
const io::Corsika::ParticleDataUnthinned * GetOneParticleRecordUnthinned()
Implementation of the VShowerFileParticleIterator for an Corsika generated shower file...
double GetDepthAtHeight(const double h) const
Return vertical atmospheric depth at the height, according to the parameters stored in the file...
utl::Particle::Source GetEMParticleSource(const float wt, const short int gen) const
unsigned long int PositionType
CorsikaShowerFileParticleIterator(Corsika::RawFile &rawFile, const io::Corsika::EventHeader &header, const Corsika::AtmosphereParameters &params, const double timeOffset, const PositionType &startPosition, const unsigned int observationLevel, const bool isThinned, const double wmaxEM, const bool CERFIL=false, const double CERwlMin=0, const double CERwlMax=0)

, generated on Tue Sep 26 2023.