List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends
io::CorsikaShowerFile Class Reference

Read data from the output of CORSIKA. More...

#include "io/CorsikaShowerFile.h"

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

Public Member Functions

void Close () override
 
 CorsikaShowerFile ()
 
 CorsikaShowerFile (const std::string &fileName, const Mode mode=eRead, utl::Branch *const b=nullptr)
 
Status FindEvent (const unsigned int eventId) override
 seek Event id set cursor there More...
 
CorsikaShowerFileParticleIteratorGetCorsikaShowerFileParticleIterator () const
 Get CorsikaShowerFileParticleIterator for testing. More...
 
const std::string & GetFilename () const
 
int GetNEvents () override
 
Status GotoPosition (const unsigned int position) override
 goto by position in the file More...
 
void Open (const std::string &fileName, const Mode mode=eRead, utl::Branch *const b=nullptr) override
 
Status Read (evt::Event &event) override
 read current event advance cursor by 1 More...
 
void SetMagneticFieldDeclination (const double d)
 
void SetReadLongFile (const bool f)
 
void UseRealisticMagneticDeclination (const bool v)
 
void Write (const evt::Event &event) override
 
virtual ~CorsikaShowerFile ()
 

Protected Member Functions

int DefaultOpen (const std::string &filename, const Mode mode=eRead)
 
int DefaultWrite (evt::Event &event)
 

Protected Attributes

utl::BranchfBranch = nullptr
 
std::string fFilename
 
Mode fMode = eRead
 

Private Types

typedef std::map< unsigned int,
unsigned int > 
IdToPositionMap
 
typedef std::vector
< Corsika::RawFile::PositionType
PositionVector
 

Private Member Functions

double GetDensityVsHeight (const double height) const
 Return the air density as a function of height, according to the parameters stored in the file. Uses Auger units. More...
 
double GetDepthVsHeight (const double h) const
 Return vertical atmospheric depth as a function of height, according to the parameters stored in the file. Uses Auger units. More...
 
double GetSlantDepthCurved (const double hObs, const double theta, const double h) const
 Return slant atmospheric depth as a function of height, according to the parameters stored in the file. Uses Auger units. More...
 
Status ReadProfile (evt::ShowerSimData &shower, const double zenith)
 
Status ReadSteerFile (evt::Event &event)
 Read steering file. More...
 
Status ScanGroundFile (const std::string &name, Corsika::RawFile &raw, PositionVector &posEVTH, PositionVector &posEVTE, const bool first, const bool noException=false)
 Collect information about ground file. More...
 
Status ScanLongFile (const std::string &name)
 Read longitudinal profile. More...
 
Status ScanSteerFile (const std::string &name)
 
void SetEventHeader (const bool first, const unsigned int eventsSoFar, const Corsika::EventHeader &eh)
 
void SetHeaderTrailer (evt::Event &event, double &timeShift, evt::GaisserHillas6Parameter &gh, bool &haveGH, double &zenith, const Corsika::EventHeader &header, const Corsika::EventTrailer &trailer)
 
void SetRunHeader (const bool first, const Corsika::RunHeader &header)
 

Private Attributes

Corsika::AtmosphereParameters fAtmPars
 
double fCherenkovBandwidthMax = 0
 
double fCherenkovBandwidthMin = 0
 
std::map< utl::AttributeMap,
io::Corsika::RawFile
fCherenkovFile
 
std::map< utl::AttributeMap,
CorsikaShowerFileParticleIterator * > 
fCherenkovIterator
 
double fCoordinateRotation = 0
 
unsigned int fCurrentPosition = 0
 
bool fHasCherenkov = false
 
IdToPositionMap fIdToPosition
 
bool fIsSlant = true
 
bool fIsThinned = true
 
std::string fListFile
 
std::string fLongFile
 
double fMagneticDeclination = -4.233*utl::degree
 
std::vector< int > fMultiCoreSelection
 
unsigned int fNumberOfEvents = 0
 
unsigned int fObservationLevel = 1
 
bool fOpenedAnything = false
 
CorsikaShowerFileParticleIteratorfParticleIterator = nullptr
 
std::map< utl::AttributeMap,
PositionVector
fPositionOfCherenkovEventTrailer
 
PositionVector fPositionOfEventTrailer
 
std::map< utl::AttributeMap,
PositionVector
fPositionToCherenkovRaw
 
PositionVector fPositionToRaw
 
io::Corsika::RawFile fRawFile
 
bool fReadListFile = false
 
bool fReadLongFile = false
 
bool fReadSteerFile = false
 
std::string fRefCoordinateSystemName = "PampaAmarilla"
 
int fRunNumber = 0
 
std::vector< double > fShowerEnergy
 
std::vector< double > fShowerPhi
 
std::vector< double > fShowerTheta
 
std::string fSteerFile
 
bool fUseRealisticMagneticDeclination = false
 

Friends

class REASFile
 
class REASH5File
 

Detailed Description

Read data from the output of CORSIKA.

Author
Troy Porter, Lukas Nellen
Date
07 Jul 2003, 29 Jan 2004

Definition at line 37 of file CorsikaShowerFile.h.

Member Typedef Documentation

typedef std::map<unsigned int, unsigned int> io::CorsikaShowerFile::IdToPositionMap
private

Definition at line 61 of file CorsikaShowerFile.h.

Definition at line 60 of file CorsikaShowerFile.h.

Constructor & Destructor Documentation

io::CorsikaShowerFile::CorsikaShowerFile ( )
inline

Definition at line 40 of file CorsikaShowerFile.h.

io::CorsikaShowerFile::CorsikaShowerFile ( const std::string &  fileName,
const Mode  mode = eRead,
utl::Branch *const  b = nullptr 
)
io::CorsikaShowerFile::~CorsikaShowerFile ( )
virtual

Definition at line 163 of file CorsikaShowerFile.cc.

Member Function Documentation

void io::CorsikaShowerFile::Close ( )
overridevirtual
int VEventFile::DefaultOpen ( const std::string &  filename,
const Mode  mode = eRead 
)
protectedinherited

Checks that file exists Intended to be called in the Write method of derived classes

Definition at line 31 of file VEventFile.cc.

Referenced by io::VROOTFile::Open(), io::AiresShowerFile::Open(), io::VEventFile::VEventFile(), and io::VROOTFile::VROOTFile().

int VEventFile::DefaultWrite ( evt::Event event)
protectedinherited

Checks that we are open for write Intended to be called in the Write method of derived classes

Definition at line 15 of file VEventFile.cc.

References io::eRead, and FATAL.

Status io::CorsikaShowerFile::FindEvent ( const unsigned int  eventId)
overridevirtual

seek Event id set cursor there

Implements io::VEventFile.

Definition at line 2041 of file CorsikaShowerFile.cc.

References io::eFail.

CorsikaShowerFileParticleIterator * io::CorsikaShowerFile::GetCorsikaShowerFileParticleIterator ( ) const

Get CorsikaShowerFileParticleIterator for testing.

Definition at line 2073 of file CorsikaShowerFile.cc.

double io::CorsikaShowerFile::GetDensityVsHeight ( const double  height) const
private

Return the air density as a function of height, according to the parameters stored in the file. Uses Auger units.

Definition at line 2081 of file CorsikaShowerFile.cc.

double io::CorsikaShowerFile::GetDepthVsHeight ( const double  h) const
private

Return vertical atmospheric depth as a function of height, according to the parameters stored in the file. Uses Auger units.

Definition at line 2094 of file CorsikaShowerFile.cc.

const std::string& io::VEventFile::GetFilename ( ) const
inlineinherited

Definition at line 54 of file VEventFile.h.

References io::VEventFile::fFilename.

Referenced by io::EventFile::GetFilename().

int io::CorsikaShowerFile::GetNEvents ( )
overridevirtual

Implements io::VEventFile.

Definition at line 2061 of file CorsikaShowerFile.cc.

References ERROR.

double io::CorsikaShowerFile::GetSlantDepthCurved ( const double  hObs,
const double  theta,
const double  h 
) const
private

Return slant atmospheric depth as a function of height, according to the parameters stored in the file. Uses Auger units.

Definition at line 2117 of file CorsikaShowerFile.cc.

References utl::cm2, utl::g, io::Corsika::kEarthRadius, utl::Sqr(), and sqrt().

Status io::CorsikaShowerFile::GotoPosition ( const unsigned int  position)
overridevirtual

goto by position in the file

Implements io::VEventFile.

Definition at line 2051 of file CorsikaShowerFile.cc.

References io::eFail, and io::eSuccess.

Referenced by io::REASFile::Read(), and io::REASH5File::Read().

void io::CorsikaShowerFile::Open ( const std::string &  fileName,
const Mode  mode = eRead,
utl::Branch *const  b = nullptr 
)
overridevirtual
Status io::CorsikaShowerFile::Read ( evt::Event event)
overridevirtual
Status io::CorsikaShowerFile::ReadProfile ( evt::ShowerSimData shower,
const double  zenith 
)
private
Status io::CorsikaShowerFile::ReadSteerFile ( evt::Event event)
private
Status io::CorsikaShowerFile::ScanGroundFile ( const std::string &  name,
Corsika::RawFile raw,
PositionVector posEVTH,
PositionVector posEVTE,
const bool  first,
const bool  noException = false 
)
private
Status io::CorsikaShowerFile::ScanLongFile ( const std::string &  name)
private

Read longitudinal profile.

Definition at line 1526 of file CorsikaShowerFile.cc.

References io::Contains(), io::eFail, and io::eSuccess.

Status io::CorsikaShowerFile::ScanSteerFile ( const std::string &  name)
private

Definition at line 1516 of file CorsikaShowerFile.cc.

References io::eFail, io::eSuccess, and exists.

void io::CorsikaShowerFile::SetEventHeader ( const bool  first,
const unsigned int  eventsSoFar,
const Corsika::EventHeader eh 
)
private
void io::CorsikaShowerFile::SetHeaderTrailer ( evt::Event event,
double &  timeShift,
evt::GaisserHillas6Parameter gh,
bool &  haveGH,
double &  zenith,
const Corsika::EventHeader header,
const Corsika::EventTrailer trailer 
)
private

Definition at line 836 of file CorsikaShowerFile.cc.

References RdGeoCeLDFFitter::a, RdGeoCeLDFFitter::b, RdGeoCeLDFFitter::c, utl::cm, utl::cm2, io::Corsika::CorsikaToPDG(), utl::ObjectFactory< ObjPtrType, IdentType, CreatType, FactoryErrorPolicy >::Create(), utl::deg, degree, cevt::StationConstants::eElectron, cevt::StationConstants::eMuon, galactic::eV, io::Corsika::EventHeader::fBx, io::Corsika::EventHeader::fBz, io::Corsika::EventHeader::fCerenkovBandwidthMax, io::Corsika::EventHeader::fCerenkovBandwidthMin, io::Corsika::EventTrailer::fChi2, io::Corsika::EventHeader::fCoreX, io::Corsika::EventHeader::fCoreY, io::Corsika::EventHeader::fCurvedObsLevel, io::Corsika::EventHeader::fCutoffElectrons, io::Corsika::EventHeader::fCutoffMuons, io::GHFit::Profile::fElectronCutoff, io::Corsika::EventHeader::fEnergy, io::Corsika::EventHeader::fEventNumber, io::Corsika::EventHeader::fFlagCurved, io::Corsika::EventTrailer::fLongitudinalPar, io::Corsika::EventTrailer::fMuons, io::Corsika::EventHeader::fObservationHeight, io::Corsika::EventHeader::fObservationLevels, io::Corsika::EventHeader::fParticleId, io::Corsika::EventHeader::fPhi, io::Corsika::EventHeader::fRMaxThinning, io::Corsika::EventHeader::fRunNumber, io::Corsika::EventHeader::fTheta, io::Corsika::EventHeader::fUsesOfCerenkovEvent, io::Corsika::EventHeader::fVersion, io::Corsika::EventHeader::fWMaxEM, io::Corsika::EventHeader::fWMaxHadronic, io::Corsika::EventHeader::fZFirst, utl::g, fwk::CoordinateSystemRegistry::Get(), utl::UTMPoint::GetHeight(), utl::GeV, io::GHFit::gProfile, io::Corsika::hAtmBoundary, INFO, km, utl::kSpeedOfLight, utl::m, utl::micro, utl::nanometer, ns, utl::radian, evt::GaisserHillas6Parameter::SetA(), evt::GaisserHillas6Parameter::SetB(), evt::GaisserHillas6Parameter::SetC(), evt::VGaisserHillasParameter::SetChiSquare(), evt::VGaisserHillasParameter::SetNMax(), evt::VGaisserHillasParameter::SetXMax(), evt::GaisserHillas6Parameter::SetXZero(), utl::Sqr(), sqrt(), galactic::tesla, and WARNING.

void io::CorsikaShowerFile::SetMagneticFieldDeclination ( const double  d)
inline

Definition at line 52 of file CorsikaShowerFile.h.

References fMagneticDeclination.

Referenced by io::REASFile::Read(), and io::REASH5File::Read().

void io::CorsikaShowerFile::SetReadLongFile ( const bool  f)
inline

Definition at line 54 of file CorsikaShowerFile.h.

References fReadLongFile.

void io::CorsikaShowerFile::SetRunHeader ( const bool  first,
const Corsika::RunHeader header 
)
private
void io::CorsikaShowerFile::UseRealisticMagneticDeclination ( const bool  v)
inline

Definition at line 53 of file CorsikaShowerFile.h.

References fUseRealisticMagneticDeclination.

void io::CorsikaShowerFile::Write ( const evt::Event event)
overridevirtual

Implements io::VEventFile.

Definition at line 2032 of file CorsikaShowerFile.cc.

References ERROR.

Friends And Related Function Documentation

friend class REASFile
friend

Definition at line 136 of file CorsikaShowerFile.h.

friend class REASH5File
friend

Definition at line 137 of file CorsikaShowerFile.h.

Member Data Documentation

Corsika::AtmosphereParameters io::CorsikaShowerFile::fAtmPars
private

Definition at line 127 of file CorsikaShowerFile.h.

utl::Branch* io::VEventFile::fBranch = nullptr
protectedinherited

Definition at line 72 of file VEventFile.h.

double io::CorsikaShowerFile::fCherenkovBandwidthMax = 0
private

Definition at line 122 of file CorsikaShowerFile.h.

double io::CorsikaShowerFile::fCherenkovBandwidthMin = 0
private

Definition at line 121 of file CorsikaShowerFile.h.

std::map<utl::AttributeMap, io::Corsika::RawFile> io::CorsikaShowerFile::fCherenkovFile
private

Definition at line 93 of file CorsikaShowerFile.h.

std::map<utl::AttributeMap, CorsikaShowerFileParticleIterator*> io::CorsikaShowerFile::fCherenkovIterator
private

Definition at line 130 of file CorsikaShowerFile.h.

double io::CorsikaShowerFile::fCoordinateRotation = 0
private

Definition at line 115 of file CorsikaShowerFile.h.

unsigned int io::CorsikaShowerFile::fCurrentPosition = 0
private

Definition at line 113 of file CorsikaShowerFile.h.

std::string io::VEventFile::fFilename
protectedinherited
bool io::CorsikaShowerFile::fHasCherenkov = false
private

Definition at line 120 of file CorsikaShowerFile.h.

IdToPositionMap io::CorsikaShowerFile::fIdToPosition
private

Definition at line 112 of file CorsikaShowerFile.h.

bool io::CorsikaShowerFile::fIsSlant = true
private

Definition at line 118 of file CorsikaShowerFile.h.

bool io::CorsikaShowerFile::fIsThinned = true
private

Definition at line 117 of file CorsikaShowerFile.h.

std::string io::CorsikaShowerFile::fListFile
private

Definition at line 105 of file CorsikaShowerFile.h.

std::string io::CorsikaShowerFile::fLongFile
private

Definition at line 99 of file CorsikaShowerFile.h.

double io::CorsikaShowerFile::fMagneticDeclination = -4.233*utl::degree
private

Definition at line 124 of file CorsikaShowerFile.h.

Referenced by SetMagneticFieldDeclination().

Mode io::VEventFile::fMode = eRead
protectedinherited
std::vector<int> io::CorsikaShowerFile::fMultiCoreSelection
private

Definition at line 97 of file CorsikaShowerFile.h.

unsigned int io::CorsikaShowerFile::fNumberOfEvents = 0
private

Definition at line 91 of file CorsikaShowerFile.h.

unsigned int io::CorsikaShowerFile::fObservationLevel = 1
private

Definition at line 116 of file CorsikaShowerFile.h.

bool io::CorsikaShowerFile::fOpenedAnything = false
private

Definition at line 90 of file CorsikaShowerFile.h.

CorsikaShowerFileParticleIterator* io::CorsikaShowerFile::fParticleIterator = nullptr
private

Definition at line 129 of file CorsikaShowerFile.h.

std::map<utl::AttributeMap, PositionVector> io::CorsikaShowerFile::fPositionOfCherenkovEventTrailer
private

Definition at line 111 of file CorsikaShowerFile.h.

PositionVector io::CorsikaShowerFile::fPositionOfEventTrailer
private

Definition at line 109 of file CorsikaShowerFile.h.

std::map<utl::AttributeMap, PositionVector> io::CorsikaShowerFile::fPositionToCherenkovRaw
private

Definition at line 110 of file CorsikaShowerFile.h.

PositionVector io::CorsikaShowerFile::fPositionToRaw
private

Definition at line 108 of file CorsikaShowerFile.h.

io::Corsika::RawFile io::CorsikaShowerFile::fRawFile
private

Definition at line 92 of file CorsikaShowerFile.h.

bool io::CorsikaShowerFile::fReadListFile = false
private

Definition at line 106 of file CorsikaShowerFile.h.

bool io::CorsikaShowerFile::fReadLongFile = false
private

Definition at line 100 of file CorsikaShowerFile.h.

Referenced by SetReadLongFile().

bool io::CorsikaShowerFile::fReadSteerFile = false
private

Definition at line 103 of file CorsikaShowerFile.h.

std::string io::CorsikaShowerFile::fRefCoordinateSystemName = "PampaAmarilla"
private

Definition at line 95 of file CorsikaShowerFile.h.

int io::CorsikaShowerFile::fRunNumber = 0
private

Definition at line 114 of file CorsikaShowerFile.h.

std::vector<double> io::CorsikaShowerFile::fShowerEnergy
private

Definition at line 132 of file CorsikaShowerFile.h.

std::vector<double> io::CorsikaShowerFile::fShowerPhi
private

Definition at line 134 of file CorsikaShowerFile.h.

std::vector<double> io::CorsikaShowerFile::fShowerTheta
private

Definition at line 133 of file CorsikaShowerFile.h.

std::string io::CorsikaShowerFile::fSteerFile
private

Definition at line 102 of file CorsikaShowerFile.h.

bool io::CorsikaShowerFile::fUseRealisticMagneticDeclination = false
private

Definition at line 125 of file CorsikaShowerFile.h.

Referenced by UseRealisticMagneticDeclination().


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

, generated on Tue Sep 26 2023.