ROBAST logo
// Author: Akira Okumura <mailto:oxon@mac.com>
/******************************************************************************
 * Copyright (C) 2006-, Akira Okumura                                         *
 * All rights reserved.                                                       *
 *****************************************************************************/

#ifndef A_CORSIKA_IACT_EVENT_HEADER_H
#define A_CORSIKA_IACT_EVENT_HEADER_H

#include "TDatime.h"

////////////////////////////////////////////////////////////////////////////////
//
// ACorsikaIACTEventHeader
//
// A calss providing getters for CORSIKA IACT evenet headers.
//
////////////////////////////////////////////////////////////////////////////////

class ACorsikaIACTEventHeader {
 private:
  static const Int_t kMaxArrays;

  Float_t fEventHeader[273];
  Int_t fNumberOfArrays;
  Double_t fTimeOffset;
  Double_t fXOffset[20];
  Double_t fYOffset[20];

 public:
  ACorsikaIACTEventHeader(Float_t* eventHeader = 0);
  virtual ~ACorsikaIACTEventHeader();

  // Read CORSIKA_GUIDE69xx.pdf (table 8) for the detail
  Int_t GetEventNumber() const { return (Int_t)fEventHeader[1]; }
  Int_t GetParticleID() const { return (Int_t)fEventHeader[2]; }
  Float_t GetTotalEnergy() const { return fEventHeader[3]; }
  Float_t GetStartingAltitude() const { return fEventHeader[4]; }
  Int_t GetNumberOfFirstTarget() const { return (Int_t)fEventHeader[5]; }
  Float_t GetZCoordinateOfFirstInteraction() const { return fEventHeader[6]; }
  Float_t GetPxMomentum() const { return fEventHeader[7]; }
  Float_t GetPyMomentum() const { return fEventHeader[8]; }
  Float_t GetPzMomentum() const { return fEventHeader[9]; }
  Float_t GetZenithAngle() const { return fEventHeader[10]; }
  Float_t GetAzimuthAngle() const { return fEventHeader[11]; }
  Int_t GetNumberOfDifferentRandomNumberSequences() const {
    return (Int_t)fEventHeader[12];
  }
  Int_t GetNumberOfRandomCalls(Int_t i) const;
  Int_t GetRunNumber() const { return (Int_t)fEventHeader[43]; }
  TDatime GetDateOfBeginRun() const;
  Float_t GetVersionOfProgram() const { return fEventHeader[45]; }
  Int_t GetNumberOfObservationLevels() const { return (Int_t)fEventHeader[46]; }
  Float_t GetHeightOfLevel(Int_t i) const;
  Float_t GetSlopeOfEnergySpectrum() const { return fEventHeader[57]; }
  Float_t GetLowerLimitOfEnergyRange() const { return fEventHeader[58]; }
  Float_t GetUpperLimitOfEnergyRange() const { return fEventHeader[59]; }
  Float_t GetKineticEnergyCutoffForHadrons() const { return fEventHeader[60]; }
  Float_t GetKineticEnergyCutoffForMuons() const { return fEventHeader[61]; }
  Float_t GetKineticEnergyCutoffForElectrons() const {
    return fEventHeader[62];
  }
  Float_t GetEnergyCutoffForPhotons() const { return fEventHeader[63]; }
  Int_t GetNFLAIN() const { return (Int_t)fEventHeader[64]; }
  Int_t GetNFLDIF() const { return (Int_t)fEventHeader[65]; }
  Int_t GetNFLPI0() const { return (Int_t)fEventHeader[66]; }
  Int_t GetNFLPIF() const { return (Int_t)fEventHeader[67]; }
  Int_t GetNFLCHE() const { return (Int_t)fEventHeader[68]; }
  Int_t GetNFRAGM() const { return (Int_t)fEventHeader[69]; }
  Float_t GetXComponentOfEarthMagneticField() const { return fEventHeader[70]; }
  Float_t GetZComponentOfEarthMagneticField() const { return fEventHeader[71]; }
  Int_t GetFlagForEGS4Treatment() const { return (Int_t)fEventHeader[72]; }
  Int_t GetFlagForNKGTreatment() const { return (Int_t)fEventHeader[73]; }
  Int_t GetLowEnergyHadronModelFlag() const { return (Int_t)fEventHeader[74]; }
  Int_t GetHighEnergyHadronModelFlag() const { return (Int_t)fEventHeader[75]; }
  Int_t GetCherenkovFlag() const { return (Int_t)fEventHeader[76]; }
  Int_t GetNeutrinoFlag() const { return (Int_t)fEventHeader[77]; }
  Int_t GetCurvedFlag() const { return (Int_t)fEventHeader[78]; }
  Int_t GetComputerFlag() const { return (Int_t)fEventHeader[79]; }
  Float_t GetLowerEdgeOfThetaInterval() const { return fEventHeader[80]; }
  Float_t GetUpperEdgeOfThetaInterval() const { return fEventHeader[81]; }
  Float_t GetLowerEdgeOfPhiInterval() const { return fEventHeader[82]; }
  Float_t GetUpperEdgeOfPhiInterval() const { return fEventHeader[82]; }
  Int_t GetCherenkovBunchSize() const { return (Int_t)fEventHeader[84]; }
  Int_t GetNumberOfCherenkovDetectorsInX() const {
    return (Int_t)fEventHeader[85];
  }
  Int_t GetNumberOfCherenkovDetectorsInY() const {
    return (Int_t)fEventHeader[86];
  }
  Int_t GetGridSpacingOfCherenkovDetectorsInX() const {
    return (Int_t)fEventHeader[87];
  }
  Int_t GetGridSpacingOfCherenkovDetectorsInY() const {
    return (Int_t)fEventHeader[88];
  }
  Int_t GetLengthOfEachCherenkovDetectorInX() const {
    return (Int_t)fEventHeader[89];
  }
  Int_t GetLengthOfEachCherenkovDetectorInY() const {
    return (Int_t)fEventHeader[90];
  }
  // Skip [91]
  Float_t GetAngleBetweenArrayXDirectionAndMagneticNorth() const {
    return fEventHeader[92];
  }
  Int_t GetAdditionalMuonInformationFlag() const {
    return (Int_t)fEventHeader[93];
  }
  Float_t GetStepLengthFactorForMultipleScattering() const {
    return fEventHeader[94];
  }
  Float_t GetCherenkovBandwidthLowerEnd() const { return fEventHeader[95]; }
  Float_t GetCherenkovBandwidthUpperEnd() const { return fEventHeader[96]; }
  Int_t GetNumberOfUsesOfEachCherenkovEvent() const {
    return (Int_t)fEventHeader[97];
  }
  Float_t GetXCoordinateOfCoreLocationForScatteredEvent(Int_t i) const;
  Float_t GetYCoordinateOfCoreLocationForScatteredEvent(Int_t i) const;
  Int_t GetSIBYLLInteractionFlag() const { return (Int_t)fEventHeader[138]; }
  Int_t GetSIBYLLCrossSectionFlag() const { return (Int_t)fEventHeader[139]; }
  Int_t GetQGSJETInteractionFlag() const { return (Int_t)fEventHeader[140]; }
  Int_t GetQGSJETCrossSectionFlag() const { return (Int_t)fEventHeader[141]; }
  Int_t GetDPMJETInteractionFlag() const { return (Int_t)fEventHeader[142]; }
  Int_t GetDPMJETCrossSectionFlag() const { return (Int_t)fEventHeader[143]; }
  Int_t GetVENUS_NEXUSCrossSectionFlag() const {
    return (Int_t)fEventHeader[144];
  }
  Int_t GetMuonMultipleScatteringFlag() const {
    return (Int_t)fEventHeader[145];
  }
  Float_t GetNKGRadialDistributionRange() const { return fEventHeader[146]; }
  Float_t GetEFRCTHNEnergyFractionOfThinningLevelHadronic() const {
    return fEventHeader[147];
  }
  Float_t GetEFRCTHN_THINRATEnergyFractionOfThinningLevelElectromagnetic()
      const {
    return fEventHeader[148];
  }
  Float_t GetActualWeightLimitWMAXForThinningHadronic() const {
    return fEventHeader[149];
  }
  Float_t GetActualWeightLimitWMAX_WEITRATForThinningElectromagnetic() const {
    return fEventHeader[150];
  }
  Float_t GetMaxRadiusForRadialThinning() const { return fEventHeader[151]; }
  Float_t GetInnerAngleOfViewingCone() const { return fEventHeader[152]; }
  Float_t GetOuterAngleOfViewingCone() const { return fEventHeader[153]; }
  Float_t GetTransitionEnergyHighEnergyLowEnergyModel() const {
    return fEventHeader[154];
  }
  // Skip 155-167

  Int_t GetNumberOfArrays() const { return fNumberOfArrays; }
  Double_t GetTimeOffset() const { return fTimeOffset; }
  Double_t GetXOffset(Int_t i) const;
  Double_t GetYOffset(Int_t i) const;

  void SetMultipleUseHeader(Int_t numberOfArrays, Double_t timeOffset,
                            Double_t* xOffset, Double_t* yOffset);

  ClassDef(ACorsikaIACTEventHeader, 1)
};

#endif  // A_CORSIKA_IACT_EVENT_HEADER_H
 ACorsikaIACTEventHeader.h:1
 ACorsikaIACTEventHeader.h:2
 ACorsikaIACTEventHeader.h:3
 ACorsikaIACTEventHeader.h:4
 ACorsikaIACTEventHeader.h:5
 ACorsikaIACTEventHeader.h:6
 ACorsikaIACTEventHeader.h:7
 ACorsikaIACTEventHeader.h:8
 ACorsikaIACTEventHeader.h:9
 ACorsikaIACTEventHeader.h:10
 ACorsikaIACTEventHeader.h:11
 ACorsikaIACTEventHeader.h:12
 ACorsikaIACTEventHeader.h:13
 ACorsikaIACTEventHeader.h:14
 ACorsikaIACTEventHeader.h:15
 ACorsikaIACTEventHeader.h:16
 ACorsikaIACTEventHeader.h:17
 ACorsikaIACTEventHeader.h:18
 ACorsikaIACTEventHeader.h:19
 ACorsikaIACTEventHeader.h:20
 ACorsikaIACTEventHeader.h:21
 ACorsikaIACTEventHeader.h:22
 ACorsikaIACTEventHeader.h:23
 ACorsikaIACTEventHeader.h:24
 ACorsikaIACTEventHeader.h:25
 ACorsikaIACTEventHeader.h:26
 ACorsikaIACTEventHeader.h:27
 ACorsikaIACTEventHeader.h:28
 ACorsikaIACTEventHeader.h:29
 ACorsikaIACTEventHeader.h:30
 ACorsikaIACTEventHeader.h:31
 ACorsikaIACTEventHeader.h:32
 ACorsikaIACTEventHeader.h:33
 ACorsikaIACTEventHeader.h:34
 ACorsikaIACTEventHeader.h:35
 ACorsikaIACTEventHeader.h:36
 ACorsikaIACTEventHeader.h:37
 ACorsikaIACTEventHeader.h:38
 ACorsikaIACTEventHeader.h:39
 ACorsikaIACTEventHeader.h:40
 ACorsikaIACTEventHeader.h:41
 ACorsikaIACTEventHeader.h:42
 ACorsikaIACTEventHeader.h:43
 ACorsikaIACTEventHeader.h:44
 ACorsikaIACTEventHeader.h:45
 ACorsikaIACTEventHeader.h:46
 ACorsikaIACTEventHeader.h:47
 ACorsikaIACTEventHeader.h:48
 ACorsikaIACTEventHeader.h:49
 ACorsikaIACTEventHeader.h:50
 ACorsikaIACTEventHeader.h:51
 ACorsikaIACTEventHeader.h:52
 ACorsikaIACTEventHeader.h:53
 ACorsikaIACTEventHeader.h:54
 ACorsikaIACTEventHeader.h:55
 ACorsikaIACTEventHeader.h:56
 ACorsikaIACTEventHeader.h:57
 ACorsikaIACTEventHeader.h:58
 ACorsikaIACTEventHeader.h:59
 ACorsikaIACTEventHeader.h:60
 ACorsikaIACTEventHeader.h:61
 ACorsikaIACTEventHeader.h:62
 ACorsikaIACTEventHeader.h:63
 ACorsikaIACTEventHeader.h:64
 ACorsikaIACTEventHeader.h:65
 ACorsikaIACTEventHeader.h:66
 ACorsikaIACTEventHeader.h:67
 ACorsikaIACTEventHeader.h:68
 ACorsikaIACTEventHeader.h:69
 ACorsikaIACTEventHeader.h:70
 ACorsikaIACTEventHeader.h:71
 ACorsikaIACTEventHeader.h:72
 ACorsikaIACTEventHeader.h:73
 ACorsikaIACTEventHeader.h:74
 ACorsikaIACTEventHeader.h:75
 ACorsikaIACTEventHeader.h:76
 ACorsikaIACTEventHeader.h:77
 ACorsikaIACTEventHeader.h:78
 ACorsikaIACTEventHeader.h:79
 ACorsikaIACTEventHeader.h:80
 ACorsikaIACTEventHeader.h:81
 ACorsikaIACTEventHeader.h:82
 ACorsikaIACTEventHeader.h:83
 ACorsikaIACTEventHeader.h:84
 ACorsikaIACTEventHeader.h:85
 ACorsikaIACTEventHeader.h:86
 ACorsikaIACTEventHeader.h:87
 ACorsikaIACTEventHeader.h:88
 ACorsikaIACTEventHeader.h:89
 ACorsikaIACTEventHeader.h:90
 ACorsikaIACTEventHeader.h:91
 ACorsikaIACTEventHeader.h:92
 ACorsikaIACTEventHeader.h:93
 ACorsikaIACTEventHeader.h:94
 ACorsikaIACTEventHeader.h:95
 ACorsikaIACTEventHeader.h:96
 ACorsikaIACTEventHeader.h:97
 ACorsikaIACTEventHeader.h:98
 ACorsikaIACTEventHeader.h:99
 ACorsikaIACTEventHeader.h:100
 ACorsikaIACTEventHeader.h:101
 ACorsikaIACTEventHeader.h:102
 ACorsikaIACTEventHeader.h:103
 ACorsikaIACTEventHeader.h:104
 ACorsikaIACTEventHeader.h:105
 ACorsikaIACTEventHeader.h:106
 ACorsikaIACTEventHeader.h:107
 ACorsikaIACTEventHeader.h:108
 ACorsikaIACTEventHeader.h:109
 ACorsikaIACTEventHeader.h:110
 ACorsikaIACTEventHeader.h:111
 ACorsikaIACTEventHeader.h:112
 ACorsikaIACTEventHeader.h:113
 ACorsikaIACTEventHeader.h:114
 ACorsikaIACTEventHeader.h:115
 ACorsikaIACTEventHeader.h:116
 ACorsikaIACTEventHeader.h:117
 ACorsikaIACTEventHeader.h:118
 ACorsikaIACTEventHeader.h:119
 ACorsikaIACTEventHeader.h:120
 ACorsikaIACTEventHeader.h:121
 ACorsikaIACTEventHeader.h:122
 ACorsikaIACTEventHeader.h:123
 ACorsikaIACTEventHeader.h:124
 ACorsikaIACTEventHeader.h:125
 ACorsikaIACTEventHeader.h:126
 ACorsikaIACTEventHeader.h:127
 ACorsikaIACTEventHeader.h:128
 ACorsikaIACTEventHeader.h:129
 ACorsikaIACTEventHeader.h:130
 ACorsikaIACTEventHeader.h:131
 ACorsikaIACTEventHeader.h:132
 ACorsikaIACTEventHeader.h:133
 ACorsikaIACTEventHeader.h:134
 ACorsikaIACTEventHeader.h:135
 ACorsikaIACTEventHeader.h:136
 ACorsikaIACTEventHeader.h:137
 ACorsikaIACTEventHeader.h:138
 ACorsikaIACTEventHeader.h:139
 ACorsikaIACTEventHeader.h:140
 ACorsikaIACTEventHeader.h:141
 ACorsikaIACTEventHeader.h:142
 ACorsikaIACTEventHeader.h:143
 ACorsikaIACTEventHeader.h:144
 ACorsikaIACTEventHeader.h:145
 ACorsikaIACTEventHeader.h:146
 ACorsikaIACTEventHeader.h:147
 ACorsikaIACTEventHeader.h:148
 ACorsikaIACTEventHeader.h:149
 ACorsikaIACTEventHeader.h:150
 ACorsikaIACTEventHeader.h:151
 ACorsikaIACTEventHeader.h:152
 ACorsikaIACTEventHeader.h:153
 ACorsikaIACTEventHeader.h:154
 ACorsikaIACTEventHeader.h:155
 ACorsikaIACTEventHeader.h:156
 ACorsikaIACTEventHeader.h:157
 ACorsikaIACTEventHeader.h:158
 ACorsikaIACTEventHeader.h:159
 ACorsikaIACTEventHeader.h:160
 ACorsikaIACTEventHeader.h:161
 ACorsikaIACTEventHeader.h:162
 ACorsikaIACTEventHeader.h:163
 ACorsikaIACTEventHeader.h:164
 ACorsikaIACTEventHeader.h:165