Read data from the output of CORSIKA. More...
#include "io/CorsikaShowerFile.h"
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... | |
CorsikaShowerFileParticleIterator * | GetCorsikaShowerFileParticleIterator () 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::Branch * | fBranch = 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) |
Friends | |
class | REASFile |
class | REASH5File |
Read data from the output of CORSIKA.
Definition at line 37 of file CorsikaShowerFile.h.
|
private |
Definition at line 61 of file CorsikaShowerFile.h.
|
private |
Definition at line 60 of file CorsikaShowerFile.h.
|
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 |
||
) |
Definition at line 169 of file CorsikaShowerFile.cc.
References ERROR, utl::Branch::Get(), utl::Branch::GetChild(), utl::Branch::GetData(), UnivRecNS::high, INFO, UnivRecNS::low, and WARNING.
|
virtual |
Definition at line 163 of file CorsikaShowerFile.cc.
|
overridevirtual |
Implements io::VEventFile.
Definition at line 822 of file CorsikaShowerFile.cc.
Referenced by io::REASFile::Close(), io::REASH5File::Close(), io::REASFile::Read(), and io::REASH5File::Read().
|
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().
|
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.
|
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.
|
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.
|
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.
|
inlineinherited |
Definition at line 54 of file VEventFile.h.
References io::VEventFile::fFilename.
Referenced by io::EventFile::GetFilename().
|
overridevirtual |
|
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().
|
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().
|
overridevirtual |
Implements io::VEventFile.
Definition at line 246 of file CorsikaShowerFile.cc.
References io::eRead, ERROR, io::eSuccess, exists, utl::Branch::Get(), utl::Branch::GetAttributes(), utl::Branch::GetChild(), utl::Branch::GetFirstChild(), utl::Branch::GetName(), utl::Branch::GetNextSibling(), INFO, and WARNING.
|
overridevirtual |
read current event advance cursor by 1
Implements io::VEventFile.
Definition at line 1035 of file CorsikaShowerFile.cc.
References io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::AsEventHeader(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::AsEventTrailer(), utl::cm2, io::Corsika::CorsikaAzimuthToAuger(), io::eEOF, io::eFail, ERROR, io::eSuccess, FATAL, file, io::Corsika::EventHeader::fWMaxEM, utl::g, evt::ShowerSimData::GetGroundCherenkov(), evt::ShowerSimData::GetGroundParticles(), io::Corsika::RawFile::GetNextBlock(), io::Corsika::RawFile::GetNextBlockUnthinned(), evt::VGaisserHillasParameter::GetNMax(), evt::VGaisserHillasParameter::GetXMax(), evt::GaisserHillas6Parameter::GetXZero(), evt::ShowerSimData::HasGHParameters(), evt::ShowerSimData::HasGroundCherenkov(), evt::ShowerSimData::HasGroundParticles(), evt::Event::HasSimShower(), INFO, io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::IsEventHeader(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::IsEventTrailer(), io::Corsika::RawFile::IsOpen(), evt::ShowerSimData::MakeGHParameters(), evt::ShowerSimData::MakeGroundCherenkov(), evt::ShowerSimData::MakeGroundParticles(), io::Corsika::RawFile::SeekTo(), utl::ShowerParticleList::SetFileInterface(), and WARNING.
Referenced by io::REASFile::Read(), and io::REASH5File::Read().
|
private |
Definition at line 1544 of file CorsikaShowerFile.cc.
References RdGeoCeLDFFitter::a, RdGeoCeLDFFitter::b, RdGeoCeLDFFitter::c, utl::cm2, io::Contains(), utl::deg, cevt::StationConstants::eElectron, io::eEOF, cevt::StationConstants::eMuon, utl::EnergyDeposit(), cevt::StationConstants::ePhoton, ERROR, io::eSuccess, evt::VGaisserHillasParameter::Eval(), io::GHFit::Profile::fEnergyDeposit, io::FixedColumnWidthSplit(), io::GHFit::Profile::fSlantDepth, utl::g, evt::ShowerSimData::GetGHParameters(), utl::GeV, io::GHFit::GH4ParamFitFunctiondEdxGH(), io::GHFit::gProfile, evt::ShowerSimData::HasdEdX(), evt::ShowerSimData::HasGHParameters(), evt::ShowerSimData::HasLongitudinalProfile(), INFO, evt::ShowerSimData::MakedEdX(), evt::ShowerSimData::MakeGHParameters(), evt::ShowerSimData::MakeLongitudinalProfile(), utl::MeV, G4StationSimulatorOG::p, PeV, utl::TabulatedFunction::PushBack(), reverse(), utl::s, evt::GaisserHillas6Parameter::SetA(), evt::GaisserHillas6Parameter::SetB(), evt::GaisserHillas6Parameter::SetC(), evt::ShowerSimData::SetCalorimetricEnergy(), evt::VGaisserHillasParameter::SetChiSquare(), evt::ShowerSimData::SetElectromagneticEnergy(), evt::VGaisserHillasParameter::SetNMax(), evt::VGaisserHillasParameter::SetXMax(), evt::GaisserHillas6Parameter::SetXZero(), utl::String::Split(), and WARNING.
|
private |
Read steering file.
Definition at line 1345 of file CorsikaShowerFile.cc.
References utl::cm, io::Contains(), io::Corsika::CorsikaToPDG(), degree, utl::degree, ERROR, io::eSuccess, fwk::CoordinateSystemRegistry::Get(), utl::GeV, utl::micro, sqrt(), and galactic::tesla.
|
private |
Collect information about ground file.
Definition at line 691 of file CorsikaShowerFile.cc.
References io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::AsEventHeader(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::AsRunHeader(), io::eFail, ERROR, io::eSuccess, exists, io::Corsika::RawFile::GetNextBlock(), io::Corsika::RawFile::GetNextBlockUnthinned(), io::Corsika::RawFile::GetNextPosition(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::IsEventHeader(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::IsEventTrailer(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::IsRunHeader(), io::Corsika::BasicBlock< ParticleType, CherenkovType, nParticles, padding >::IsRunTrailer(), io::Corsika::RawFile::Open(), and io::Corsika::RawFile::SeekTo().
|
private |
Read longitudinal profile.
Definition at line 1526 of file CorsikaShowerFile.cc.
References io::Contains(), io::eFail, and io::eSuccess.
|
private |
Definition at line 1516 of file CorsikaShowerFile.cc.
References io::eFail, io::eSuccess, and exists.
|
private |
Definition at line 621 of file CorsikaShowerFile.cc.
References ERROR, io::Corsika::EventHeader::fArrayRotation, io::Corsika::EventHeader::fCerenkovBandwidthMax, io::Corsika::EventHeader::fCerenkovBandwidthMin, io::Corsika::EventHeader::fCerenkovOutputFlag, io::Corsika::EventHeader::fEventNumber, io::Corsika::EventHeader::fFlagCerenkov, INFO, io::Corsika::CherenkovFlags::IsCEFFIC(), io::Corsika::CherenkovFlags::IsCHERENKOV(), io::Corsika::CherenkovFlags::IsCURVED(), io::Corsika::CherenkovFlags::IsSLANT(), utl::nanometer, and utl::radian.
|
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.
|
inline |
Definition at line 52 of file CorsikaShowerFile.h.
References fMagneticDeclination.
Referenced by io::REASFile::Read(), and io::REASH5File::Read().
|
inline |
Definition at line 54 of file CorsikaShowerFile.h.
References fReadLongFile.
|
private |
Definition at line 535 of file CorsikaShowerFile.cc.
References utl::cm, utl::cm2, utl::delr, utl::endc, utl::endr, ERROR, io::Corsika::RunHeader::fConstAATM, io::Corsika::RunHeader::fConstBATM, io::Corsika::RunHeader::fConstCATM, io::Corsika::RunHeader::fConstHLAY, io::Corsika::RunHeader::fRunNumber, io::Corsika::RunHeader::fVersion, utl::g, utl::hline(), det::if(), INFO, km, tab, and WARNING.
|
inline |
Definition at line 53 of file CorsikaShowerFile.h.
References fUseRealisticMagneticDeclination.
|
overridevirtual |
|
friend |
Definition at line 136 of file CorsikaShowerFile.h.
|
friend |
Definition at line 137 of file CorsikaShowerFile.h.
|
private |
Definition at line 127 of file CorsikaShowerFile.h.
|
protectedinherited |
Definition at line 72 of file VEventFile.h.
|
private |
Definition at line 122 of file CorsikaShowerFile.h.
|
private |
Definition at line 121 of file CorsikaShowerFile.h.
|
private |
Definition at line 93 of file CorsikaShowerFile.h.
|
private |
Definition at line 130 of file CorsikaShowerFile.h.
|
private |
Definition at line 115 of file CorsikaShowerFile.h.
|
private |
Definition at line 113 of file CorsikaShowerFile.h.
|
protectedinherited |
Definition at line 74 of file VEventFile.h.
Referenced by io::VEventFile::GetFilename(), io::FDasEventFile::Open(), io::AiresShowerFile::Open(), io::VROOTFile::OpenROOTFile(), io::AiresShowerFile::Read(), io::VROOTFile::VROOTFile(), and io::FDasEventFile::Write().
|
private |
Definition at line 120 of file CorsikaShowerFile.h.
|
private |
Definition at line 112 of file CorsikaShowerFile.h.
|
private |
Definition at line 118 of file CorsikaShowerFile.h.
|
private |
Definition at line 117 of file CorsikaShowerFile.h.
|
private |
Definition at line 105 of file CorsikaShowerFile.h.
|
private |
Definition at line 99 of file CorsikaShowerFile.h.
|
private |
Definition at line 124 of file CorsikaShowerFile.h.
Referenced by SetMagneticFieldDeclination().
Definition at line 75 of file VEventFile.h.
Referenced by io::VROOTFile::Close(), io::OfflineROOTFile::GetEventBranch(), io::FDasEventFile::Open(), io::VROOTFile::OpenROOTFile(), io::IoAugerEventFile::Write(), and io::FDasEventFile::Write().
|
private |
Definition at line 97 of file CorsikaShowerFile.h.
|
private |
Definition at line 91 of file CorsikaShowerFile.h.
|
private |
Definition at line 116 of file CorsikaShowerFile.h.
|
private |
Definition at line 90 of file CorsikaShowerFile.h.
|
private |
Definition at line 129 of file CorsikaShowerFile.h.
|
private |
Definition at line 111 of file CorsikaShowerFile.h.
|
private |
Definition at line 109 of file CorsikaShowerFile.h.
|
private |
Definition at line 110 of file CorsikaShowerFile.h.
|
private |
Definition at line 108 of file CorsikaShowerFile.h.
|
private |
Definition at line 92 of file CorsikaShowerFile.h.
|
private |
Definition at line 106 of file CorsikaShowerFile.h.
|
private |
Definition at line 100 of file CorsikaShowerFile.h.
Referenced by SetReadLongFile().
|
private |
Definition at line 103 of file CorsikaShowerFile.h.
|
private |
Definition at line 95 of file CorsikaShowerFile.h.
|
private |
Definition at line 114 of file CorsikaShowerFile.h.
|
private |
Definition at line 132 of file CorsikaShowerFile.h.
|
private |
Definition at line 134 of file CorsikaShowerFile.h.
|
private |
Definition at line 133 of file CorsikaShowerFile.h.
|
private |
Definition at line 102 of file CorsikaShowerFile.h.
|
private |
Definition at line 125 of file CorsikaShowerFile.h.
Referenced by UseRealisticMagneticDeclination().