/** Declaration file to open an Aires generated shower file on disc \author Troy Porter \date 22 May 2003 \version $Id$ */ #ifndef _io_AiresShowerFile_h_ #define _io_AiresShowerFile_h_ #include //#include #include #include namespace io { /** \class AiresShowerFile \brief Utility to open an Aires generated shower file on disc \author Troy Porter \date 22 May 2003 \version $Id$ \ingroup aires */ class AiresShowerFileParticleIterator; class AiresShowerFile : public VEventFile { public: AiresShowerFile(); AiresShowerFile(const std::string& filename, const Mode theMode = eRead); virtual ~AiresShowerFile(); void Open(const std::string& filename, const Mode theMode = eRead); void Close(); Status Read(evt::Event& event); void Write(const evt::Event& event); Status FindEvent(unsigned int n); Status GotoPosition(unsigned int n); int GetNEvents(); private: bool fIsOpen; AiresShowerFileParticleIterator *fParticleIterator; int fChannel, fVerbosity, fReturnCode; // Channel, Verbosity and file info int fInitLevel, fCodsys, fIrc; // Used for initialisation of AIRES int fSkipHeader, fLogBase; // Used when opening the AIRES file bool fAltType; // Indices into the AIRES data file // Particle record int fGroundParticleCodeIndex; int fLogRIndex, fLogEIndex; int fThetaIndex; int fUxIndex, fUyIndex; int fTimeIndex, fWeightIndex; // Header record int fPrimaryCodeIndex; int fShowerNumberIndex; int fPrimaryLogEIndex, fPrimaryZenithIndex, fPrimaryAzimuthIndex; int fPrimaryThinningIndex; int fFirstInteractionDepthIndex; int fInjectionAltitudeIndex; int fGlobalTimeShiftIndex; // Trailer record int fTotalParticlesInShowerIndex; int fNumberGroundParticlesIndex; int fLongFitReturnCodeIndex; int fShowerMaxIndex; int fTotalChargedParticlesIndex; // Data associated with the shower file header int fNumberDiffPrimaries; int fPrimaryEnergyDist; int fZenithDist, fAzimuthDist; int fNumObsLvls; int fAtmosphereModel; int fFirstShowerNumber; int fShowerPrimaryCode; double fMinPrimaryEnergy; double fMaxPrimaryEnergy; double fEnergyExponent; double fMinZenith; double fMaxZenith; double fMinAzimuth; double fMaxAzimuth; double fThinningParameter; double fInjectionAltitude; double fInjectionDepth; double fGroundAltitude; double fGroundDepth; double fSiteLatitude; double fSiteLongitude; double fShowerPrimaryWeight; double fGeomagneticFieldStrength; double fGeomagneticFieldInclination; double fGeomagneticFieldDeclination; double fMinRadiusCut; double fMaxRadiusCut; // Do not change the dimensions of these arrays! The AIRES manual claims // fIntData and fDoubleData (when passed to getcrorecord()) need to have // a dimension of 30, but this can cause a segmentation violation. Changing // the size to 99 appears to fix this problem. // TAP - 09/02/2006 moved fIntData and fDoubleData to be local to functions // that use them. This will easily enable the resolution of bug #242 as // well as cleanup of the code int fNumRecords[5];//, fIntData[99]; //double fDoubleData[99]; int fCurrentShowerNumber, fCurrentRecordNumber; std::string fChargeTableAppendix, fdEdXTableAppendix; std::string fGammaTableAppendix; std::string fElectronTableAppendix; std::string fMuonTableAppendix; typedef std::map > DataLocationsType; DataLocationsType fDataLocations; DataLocationsType::iterator fCurrentShowerLocation; // Private methods void Init(); void SetRecordIndices(); void SetRecordInformation(); friend class AiresShowerFileParticleIterator; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // End: