Ignore:
Timestamp:
02/18/09 12:07:41 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcorsika
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.cc

    r9336 r9347  
    3737//  + Float_t fMagneticFieldZ
    3838//  + Float_t fMagneticFieldAz
     39//  + Float_t fAtmosphericCoeffA[5]
     40//  + Float_t fAtmosphericCoeffB[5]
     41//  + Float_t fAtmosphericCoeffC[5]
     42//  + UInt_t  fCerenkovFlag
    3943//
    4044////////////////////////////////////////////////////////////////////////////
     
    5357
    5458using namespace std;
     59
     60const Double_t MCorsikaRunHeader::fgEarthRadius = 637131500; // [cm] Earth radius as defined in CORSIKA
    5561
    5662// --------------------------------------------------------------------------
     
    8187    }
    8288
    83     Float_t f[68];
    84     fin.read((char*)f, 68);
     89    Float_t f[272*4];
     90    fin.read((char*)f, 272*4);
    8591
    8692    fRunNumber = TMath::Nint(f[0]);
     
    105111    fEnergyMax      = f[16];
    106112
    107     fin.seekg(1020, ios::cur);     // skip the remaining data of this block
     113    // 0/10 not supported?
     114
     115    memcpy(fAtmosphericCoeffA, f+253, 5*4);
     116    memcpy(fAtmosphericCoeffB, f+258, 5*4);
     117    memcpy(fAtmosphericCoeffC, f+263, 5*4);
    108118
    109119    // -------------------- Read first event header -------------------
     
    157167    fMagneticFieldAz =  g[91];  // Azimuth angle of magnetic north expressed in telescope coordinates
    158168
     169    // WITH rounding: unbelievable!
     170    fCerenkovFlag = TMath::Nint(g[75]);
     171
    159172    fZdMin = g[79];                // lower edge of theta in °
    160173    fZdMax = g[80];                // upper edge of theta in °
     
    173186    fImpactMax = g[86];
    174187
    175     fWavelengthMin = g[95];        // Cherenkov bandwidth lower end in nm
    176     fWavelengthMax = g[96];        // Cherenkov bandwidth upper end in nm
     188    fWavelengthMin = g[94];        // Cherenkov bandwidth lower end in nm
     189    fWavelengthMax = g[95];        // Cherenkov bandwidth upper end in nm
    177190
    178191    fViewConeInnerAngle = g[151];  // inner angle of view cone (°)
     
    251264
    252265    *fLog << "Spectrum:      Slope=" << fSlopeSpectrum << "  (" << fEnergyMin << "GeV-" << fEnergyMax << "GeV)" <<  endl;
     266    *fLog << "Wavelength:    " << fWavelengthMin << "nm - " << fWavelengthMax << "nm" << endl;
    253267
    254268    if (fViewConeOuterAngle>0)
     
    269283        *fLog << endl;
    270284    }
    271 }
    272 
     285
     286    *fLog << "Atm.Coeff A:  ";
     287    for (int i=0; i<5; i++)
     288        *fLog << " " << fAtmosphericCoeffA[i];
     289    *fLog << endl;
     290    *fLog << "Atm.Coeff B:  ";
     291    for (int i=0; i<5; i++)
     292        *fLog << " " << fAtmosphericCoeffB[i];
     293    *fLog << endl;
     294    *fLog << "Atm.Coeff C:  ";
     295    for (int i=0; i<5; i++)
     296        *fLog << " " << fAtmosphericCoeffC[i];
     297    *fLog << endl;
     298}
     299
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h

    r9336 r9347  
    1414{
    1515    friend class MCorsikaEvtHeader;
     16public:
     17    enum CerenkovFlag_t
     18    {
     19        kCerenkov   = BIT(0),
     20        kIact       = BIT(1),
     21        kCeffic     = BIT(2),
     22        kAtmext     = BIT(3),
     23        kRefraction = BIT(4),
     24        kVolumedet  = BIT(5),
     25        kCurved     = BIT(6),
     26        kSlant      = BIT(8)
     27    };
    1628
    1729private:
     30    static const Double_t fgEarthRadius; // Take same Earth radius as in CORSIKA (cm)
     31
    1832    UInt_t  fRunNumber;               // Run number
    1933    UInt_t  fParticleID;              // Particle ID (see MMcEvtBasic or CORSIKA manual)
     
    4559    Float_t fViewConeInnerAngle;      // [deg]
    4660    Float_t fViewConeOuterAngle;      // [deg]
     61
     62    Float_t fAtmosphericCoeffA[5];    // [g/cm²] AATM (see Corsika Manual for details)
     63    Float_t fAtmosphericCoeffB[5];    // [g/cm²] BATM (see Corsika Manual for details)
     64    Float_t fAtmosphericCoeffC[5];    // [cm]    CATM (see Corsika Manual for details)
     65
     66    UInt_t fCerenkovFlag;
    4767
    4868public:
     
    80100    Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
    81101
     102    Float_t GetObsLevel(UInt_t i=0) const { return i>9 ? -1 : fObsLevel[i]; }
     103
     104    Bool_t Has(CerenkovFlag_t opt) { return fCerenkovFlag&opt ? 1 : 0; }
     105
     106    static Double_t EarthRadius() { return fgEarthRadius; }
     107
     108    // Preliminary!
     109    const Float_t *GetAtmosphericCoeffA() const { return fAtmosphericCoeffA; }
     110    const Float_t *GetAtmosphericCoeffB() const { return fAtmosphericCoeffB; }
     111    const Float_t *GetAtmosphericCoeffC() const { return fAtmosphericCoeffC; }
     112
     113    UInt_t GetNumAtmosphericModel() const { return (fCerenkovFlag>>10)&0x3ff; }
     114
    82115    // I/O
    83116    Bool_t ReadEvt(istream& fin);
Note: See TracChangeset for help on using the changeset viewer.