Implementation of the VShowerFileParticleIterator for an Corsika generated shower file. More...
#include <CorsikaShowerFileParticleIterator.h>
Public Types | |
typedef io::Corsika::RawFile::PositionType | PositionType |
Public Member Functions | |
CorsikaShowerFileParticleIterator (Corsika::RawFile &rawFile, const io::Corsika::EventHeader &header, const Corsika::AtmosphereParameters ¶ms, 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::Particle * | GetOneParticle (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::ParticleData * | GetOneParticleRecord () |
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::Particle > | fGrandParent |
const bool | fIsThinned |
bool | fIteratorValid = false |
const double | fMCERFI |
const unsigned int | fObservationLevel |
const double | fObsLevelHeight |
utl::Validated< utl::Particle > | fParent |
unsigned int | fParticleInBlock = 0 |
utl::Validated< utl::Point > | fProductionPoint |
Corsika::RawFile & | fRawFile |
const PositionType | fStartPosition |
const double | fTimeOffset |
const double | fVersion |
const double | fWlLowerLimit |
const double | fWlUpperLimit |
const double | fWMaxEM |
Implementation of the VShowerFileParticleIterator for an Corsika generated shower file.
Definition at line 45 of file CorsikaShowerFileParticleIterator.h.
Definition at line 48 of file CorsikaShowerFileParticleIterator.h.
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 |
||
) |
Definition at line 52 of file CorsikaShowerFileParticleIterator.cc.
References fGrandParent, fParent, and utl::Validated< T >::SetValid().
|
inlinevirtual |
Definition at line 65 of file CorsikaShowerFileParticleIterator.h.
|
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().
|
private |
Definition at line 114 of file CorsikaShowerFileParticleIterator.cc.
References fIsThinned, fVersion, and fWMaxEM.
Referenced by GetOneParticle().
|
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().
|
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()
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.
|
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.
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().
|
private |
Definition at line 601 of file CorsikaShowerFileParticleIterator.cc.
References io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::AsParticleBlock(), ERROR, fBlockBufferValid, fCurrentBlockUnthinned, fCurrentPosition, fIteratorValid, fParticleInBlock, fRawFile, io::Corsika::RawFile::GetNextBlockUnthinned(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::IsControl(), io::Corsika::kParticlesInBlock, and io::Corsika::RawFile::SeekTo().
Referenced by GetOneParticle().
|
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.
|
private |
Definition at line 83 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetDepthAtHeight(), and GetHeightAtDepth().
|
private |
Definition at line 107 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticleRecord(), GetOneParticleRecordUnthinned(), and Rewind().
|
private |
Definition at line 100 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 95 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticleRecord().
|
private |
Definition at line 96 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticleRecordUnthinned().
|
private |
Definition at line 94 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 90 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticleRecord(), GetOneParticleRecordUnthinned(), and Rewind().
|
private |
Definition at line 105 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 104 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 112 of file CorsikaShowerFileParticleIterator.h.
Referenced by CorsikaShowerFileParticleIterator(), and GetOneParticle().
|
private |
Definition at line 98 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetEMParticleSource(), and GetOneParticle().
|
private |
Definition at line 92 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticleRecord(), GetOneParticleRecordUnthinned(), and Rewind().
|
private |
Definition at line 101 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 88 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 106 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 111 of file CorsikaShowerFileParticleIterator.h.
Referenced by CorsikaShowerFileParticleIterator(), and GetOneParticle().
|
private |
Definition at line 91 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticleRecord(), GetOneParticleRecordUnthinned(), and Rewind().
|
private |
Definition at line 110 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 82 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticleRecord(), and GetOneParticleRecordUnthinned().
|
private |
Definition at line 85 of file CorsikaShowerFileParticleIterator.h.
Referenced by Rewind().
|
private |
Definition at line 84 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 86 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetEMParticleSource(), and GetOneParticle().
|
private |
Definition at line 102 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 103 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetOneParticle().
|
private |
Definition at line 99 of file CorsikaShowerFileParticleIterator.h.
Referenced by GetEMParticleSource().