List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
io::CorsikaShowerFileParticleIterator Class Reference

Implementation of the VShowerFileParticleIterator for an Corsika generated shower file. More...

#include <CorsikaShowerFileParticleIterator.h>

Inheritance diagram for io::CorsikaShowerFileParticleIterator:
Inheritance graph
[legend]

Public Types

typedef
io::Corsika::RawFile::PositionType 
PositionType
 

Public Member Functions

 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)
 
virtual utl::ParticleGetOneParticle (const utl::CoordinateSystemPtr &cs)
 Member function to fetch the next particle. More...
 
virtual void Rewind ()
 Rewind the particle list in the shower file to the beginning. More...
 
virtual ~CorsikaShowerFileParticleIterator ()
 

Private Member Functions

double GetDepthAtHeight (const double h) const
 Return vertical atmospheric depth at the height, according to the parameters stored in the file. Uses Auger units. More...
 
utl::Particle::Source GetEMParticleSource (const float wt, const short int gen) const
 
double GetHeightAtDepth (const double depth) const
 Return height at the vertical atmospheric depth, according to the parameters stored in the file. Uses Auger units. More...
 
const io::Corsika::ParticleDataGetOneParticleRecord ()
 Low level reader of individual Corsika particles. More...
 
const
io::Corsika::ParticleDataUnthinned
GetOneParticleRecordUnthinned ()
 

Private Attributes

const Corsika::AtmosphereParameters fAtmPars
 
bool fBlockBufferValid = false
 
const bool fCERFIL
 
io::Corsika::Block fCurrentBlock
 
io::Corsika::BlockUnthinned fCurrentBlockUnthinned
 
utl::Particle fCurrentParticle
 
PositionType fCurrentPosition
 
const bool fCurved
 
const bool fCurvedObsLevel
 
utl::Validated< utl::ParticlefGrandParent
 
const bool fIsThinned
 
bool fIteratorValid = false
 
const double fMCERFI
 
const unsigned int fObservationLevel
 
const double fObsLevelHeight
 
utl::Validated< utl::ParticlefParent
 
unsigned int fParticleInBlock = 0
 
utl::Validated< utl::PointfProductionPoint
 
Corsika::RawFilefRawFile
 
const PositionType fStartPosition
 
const double fTimeOffset
 
const double fVersion
 
const double fWlLowerLimit
 
const double fWlUpperLimit
 
const double fWMaxEM
 

Detailed Description

Implementation of the VShowerFileParticleIterator for an Corsika generated shower file.

Author
Troy Porter
Lukas Nellen
Date
22 May 2003

Definition at line 45 of file CorsikaShowerFileParticleIterator.h.

Member Typedef Documentation

Definition at line 48 of file CorsikaShowerFileParticleIterator.h.

Constructor & Destructor Documentation

CorsikaShowerFileParticleIterator::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 
)
virtual io::CorsikaShowerFileParticleIterator::~CorsikaShowerFileParticleIterator ( )
inlinevirtual

Definition at line 65 of file CorsikaShowerFileParticleIterator.h.

Member Function Documentation

double CorsikaShowerFileParticleIterator::GetDepthAtHeight ( const double  h) const
private

Return vertical atmospheric depth at the height, according to the parameters stored in the file. Uses Auger units.

Definition at line 656 of file CorsikaShowerFileParticleIterator.cc.

References io::Corsika::AtmosphereParameters::fAATM, fAtmPars, io::Corsika::AtmosphereParameters::fBATM, io::Corsika::AtmosphereParameters::fCATM, and io::Corsika::AtmosphereParameters::fHLAY.

Referenced by GetOneParticle().

Particle::Source CorsikaShowerFileParticleIterator::GetEMParticleSource ( const float  wt,
const short int  gen 
) const
private

Definition at line 114 of file CorsikaShowerFileParticleIterator.cc.

References fIsThinned, fVersion, and fWMaxEM.

Referenced by GetOneParticle().

double CorsikaShowerFileParticleIterator::GetHeightAtDepth ( const double  depth) const
private

Return height at the vertical atmospheric depth, according to the parameters stored in the file. Uses Auger units.

Definition at line 638 of file CorsikaShowerFileParticleIterator.cc.

References io::Corsika::AtmosphereParameters::fAATM, fAtmPars, io::Corsika::AtmosphereParameters::fBATM, io::Corsika::AtmosphereParameters::fCATM, and io::Corsika::AtmosphereParameters::fZLAY.

Referenced by GetOneParticle().

Particle * CorsikaShowerFileParticleIterator::GetOneParticle ( const utl::CoordinateSystemPtr cs)
virtual

Member function to fetch the next particle.

This method has to return a pointer to the current particle in the shower file. Then it steps the cursor in the shower file forward. This corresponds to the way a typical interface library for Aires or CORSIKA provides access to the particles on the ground.

If no more particles are available, return a null pointer.

Call Rewind() before calling this function. This puts the underlying library into a defined state.

It is the responsibility of the concrete implementation to react appropriately to illegal calls to GetOneParticle()

utl::kSpeedOfLight

Implements utl::VShowerFileParticleIterator.

Definition at line 135 of file CorsikaShowerFileParticleIterator.cc.

References utl::abs(), utl::cm, utl::cm2, io::Corsika::CorsikaToPDG(), fwk::RandomEngineRegistry::eDetector, cevt::StationConstants::eElectron, cevt::StationConstants::ePhoton, utl::Particle::ePhoton, fwk::CoordinateSystemRegistry::eUndefined, fCERFIL, fCurrentParticle, fCurved, fCurvedObsLevel, io::Corsika::ParticleDataUnthinned::fDescription, io::Corsika::CherenkovDataUnthinned::fDistance, fGrandParent, fIsThinned, fMCERFI, fObservationLevel, fObsLevelHeight, fParent, io::Corsika::CherenkovDataUnthinned::fPhotonsInBunch, fProductionPoint, io::Corsika::ParticleDataUnthinned::fPx, io::Corsika::ParticleDataUnthinned::fPy, io::Corsika::ParticleDataUnthinned::fPz, io::Corsika::CherenkovDataUnthinned::fT, fTimeOffset, io::Corsika::ParticleDataUnthinned::fTorZ, io::Corsika::CherenkovDataUnthinned::fU, io::Corsika::CherenkovDataUnthinned::fV, fVersion, io::Corsika::CherenkovData::fWavelength, io::Corsika::ParticleData::fWeight, fWlLowerLimit, fWlUpperLimit, io::Corsika::ParticleDataUnthinned::fX, io::Corsika::CherenkovDataUnthinned::fX, io::Corsika::ParticleDataUnthinned::fY, io::Corsika::CherenkovDataUnthinned::fY, utl::g, utl::Validated< T >::Get(), utl::BasicVector< HepVector >::GetCosTheta(), GetDepthAtHeight(), GetEMParticleSource(), utl::RandomEngine::GetEngine(), GetHeightAtDepth(), utl::Vector::GetMag(), GetOneParticleRecord(), GetOneParticleRecordUnthinned(), utl::Particle::GetParent(), utl::Particle::GetPosition(), utl::GeV, det::if(), utl::Validated< T >::IsValid(), io::Corsika::kEarthRadius, utl::kPlanck, utl::kSpeedOfLight, utl::nanometer, ns, utl::Particle::SetParent(), utl::Particle::SetProductionPoint(), utl::Validated< T >::SetValid(), utl::Sqr(), sqrt(), and WARNING.

const Corsika::ParticleData * CorsikaShowerFileParticleIterator::GetOneParticleRecord ( )
private

Low level reader of individual Corsika particles.

Get one Corsika particle record from current event.

Returns a pointer to the current corsika particle data sub-block. It doesn't check for the type of sub-block. It is the responsibility of the caller to ignore unwanted records, e.g. particle unkown to the client.

Returns null pointer when reading beyond the end of the particle records. This should only happen when the event-trailer is reached.

Note
This is coded for the ground particle information only.
The current implementation cannot deal with logitudinal particle records in the data stream.

Definition at line 563 of file CorsikaShowerFileParticleIterator.cc.

References io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::AsParticleBlock(), ERROR, fBlockBufferValid, fCurrentBlock, fCurrentPosition, fIteratorValid, fParticleInBlock, fRawFile, io::Corsika::RawFile::GetNextBlock(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::IsControl(), io::Corsika::kParticlesInBlock, and io::Corsika::RawFile::SeekTo().

Referenced by GetOneParticle().

const Corsika::ParticleDataUnthinned * CorsikaShowerFileParticleIterator::GetOneParticleRecordUnthinned ( )
private
void CorsikaShowerFileParticleIterator::Rewind ( )
virtual

Rewind the particle list in the shower file to the beginning.

After a call to this function, calls to GetOneParticle() start returning particles starting from the first particle recorded for the shower.

Implements utl::VShowerFileParticleIterator.

Definition at line 104 of file CorsikaShowerFileParticleIterator.cc.

References fBlockBufferValid, fCurrentPosition, fIteratorValid, fParticleInBlock, and fStartPosition.

Member Data Documentation

const Corsika::AtmosphereParameters io::CorsikaShowerFileParticleIterator::fAtmPars
private

Definition at line 83 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetDepthAtHeight(), and GetHeightAtDepth().

bool io::CorsikaShowerFileParticleIterator::fBlockBufferValid = false
private
const bool io::CorsikaShowerFileParticleIterator::fCERFIL
private

Definition at line 100 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

io::Corsika::Block io::CorsikaShowerFileParticleIterator::fCurrentBlock
private

Definition at line 95 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticleRecord().

io::Corsika::BlockUnthinned io::CorsikaShowerFileParticleIterator::fCurrentBlockUnthinned
private

Definition at line 96 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticleRecordUnthinned().

utl::Particle io::CorsikaShowerFileParticleIterator::fCurrentParticle
private

Definition at line 94 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

PositionType io::CorsikaShowerFileParticleIterator::fCurrentPosition
private
const bool io::CorsikaShowerFileParticleIterator::fCurved
private

Definition at line 105 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

const bool io::CorsikaShowerFileParticleIterator::fCurvedObsLevel
private

Definition at line 104 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

utl::Validated<utl::Particle> io::CorsikaShowerFileParticleIterator::fGrandParent
private
const bool io::CorsikaShowerFileParticleIterator::fIsThinned
private

Definition at line 98 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetEMParticleSource(), and GetOneParticle().

bool io::CorsikaShowerFileParticleIterator::fIteratorValid = false
private
const double io::CorsikaShowerFileParticleIterator::fMCERFI
private

Definition at line 101 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

const unsigned int io::CorsikaShowerFileParticleIterator::fObservationLevel
private

Definition at line 88 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

const double io::CorsikaShowerFileParticleIterator::fObsLevelHeight
private

Definition at line 106 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

utl::Validated<utl::Particle> io::CorsikaShowerFileParticleIterator::fParent
private
unsigned int io::CorsikaShowerFileParticleIterator::fParticleInBlock = 0
private
utl::Validated<utl::Point> io::CorsikaShowerFileParticleIterator::fProductionPoint
private

Definition at line 110 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

Corsika::RawFile& io::CorsikaShowerFileParticleIterator::fRawFile
private
const PositionType io::CorsikaShowerFileParticleIterator::fStartPosition
private

Definition at line 85 of file CorsikaShowerFileParticleIterator.h.

Referenced by Rewind().

const double io::CorsikaShowerFileParticleIterator::fTimeOffset
private

Definition at line 84 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

const double io::CorsikaShowerFileParticleIterator::fVersion
private

Definition at line 86 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetEMParticleSource(), and GetOneParticle().

const double io::CorsikaShowerFileParticleIterator::fWlLowerLimit
private

Definition at line 102 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

const double io::CorsikaShowerFileParticleIterator::fWlUpperLimit
private

Definition at line 103 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetOneParticle().

const double io::CorsikaShowerFileParticleIterator::fWMaxEM
private

Definition at line 99 of file CorsikaShowerFileParticleIterator.h.

Referenced by GetEMParticleSource().


The documentation for this class was generated from the following files:

, generated on Tue Sep 26 2023.