Ignore:
Timestamp:
01/18/09 14:45:10 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcorsika
Files:
3 edited

Legend:

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

    r9212 r9229  
    1818!   Author(s): Thomas Bretz 11/2008 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: Software Development, 2008
     20!   Copyright: Software Development, 2000-2009
    2121!
    2222!
     
    109109    fMomentumZ = -f[8];
    110110
     111    // FIXME: Correct for direction of magnetic field!
    111112    fZd        = f[9];
    112113    fAz        = TMath::Pi()-f[10];
     
    124125    fX =  f[117];
    125126    fY = -f[97];
    126 /*
    127     if (fEvtNumber==1)
    128     {
    129         header.fZdMin = f[79];
    130         header.fZdMax = f[80];
    131         header.fAzMin = 180-f[81];
    132         header.fAzMax = 180-f[82];
    133127
    134         header.fViewConeInnerAngle = f[151];
    135         header.fViewConeOuterAngle = f[152];
    136 
    137         header.Print();
    138     }
    139  */
    140128    fin.seekg(1088-273*4, ios::cur);
    141129
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.h

    r9186 r9229  
    4343    void Print(Option_t * = NULL) const;
    4444
     45    UInt_t GetEvtNumber() const { return fEvtNumber; }
     46    UInt_t GetParticleID() const { return fParticleID; }
     47
    4548    TVector3 GetMomentum() const { return TVector3(fMomentumX, fMomentumY, fMomentumZ); }
    4649    TVector2 GetImpactPos() const { return TVector2(fX, fY); }
     
    5558    Float_t GetY() const { return fY; }
    5659
     60    Double_t GetImpact() const { return TMath::Hypot(fX, fY); }
     61
    5762    Int_t  ReadEvt(istream& fin);    // read in event header block
    5863    Bool_t ReadEvtEnd(istream& fin); // read in event end block
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.cc

    r9224 r9229  
    1919               Qi Zhe,      06/2007 <mailto:qizhe@astro.uni-wuerzburg.de>
    2020
    21 !   Copyright: MAGIC Software Development, 2000-2004
     21!   Copyright: Software Development, 2000-2009
    2222!
    2323!
     
    2929//
    3030// Root storage container for the RUN HEADER information
    31 //
    32 //
    33 //  RAW DATA FORMAT VERSION
    34 //  =======================
    35 //
    36 //  Format Version 8:
    37 //  -----------------
    38 //   + fNumBytesPerSample;
    39 //   + fFreqSampling;
    40 //   + fNumSignificantBits;
    41 //   * changes in MRawCrateHeader
    42 //
    43 //  Format Version 7:
    44 //  -----------------
    45 //   - unused
    46 //
    47 //  Format Version 6:
    48 //  -----------------
    49 //   + added CameraVersion
    50 //   + added TelescopeNumber
    51 //   + added ObservationMode
    52 //   + added dummies for TelescopeRa/Dec
    53 //
    54 //  Format Version 5:
    55 //  -----------------
    56 //   - now the sub millisecond information of the time is valid and decoded
    57 //     which enhances the precision from 51.2us to 200ns
    58 //
    59 //  Format Version 4:
    60 //  -----------------
    61 //   - added support for pixels with negative IDs
    62 //
    63 //  Format Version 3:
    64 //  -----------------
    65 //   - ???
    66 //
    67 //  Format Version 2:
    68 //  -----------------
    69 //   - removed mjd from data
    70 //   - added start time
    71 //   - added stop  time
    72 //
    73 //
    74 //  MCorsikaRunHeader CLASS VERSION
    75 //  ===========================
    76 //
    77 //  Format Version 6:
    78 //  -----------------
    79 //   - added fNumBytesPerSample;
    80 //   - added fFreqSampling;
    81 //   - added fNumSignificantBits;
    82 //
    83 //  Class Version 5:
    84 //  -----------------
    85 //   - for compatibility with newer camera versions
    86 //
    87 //  Class Version 4:
    88 //  -----------------
    89 //   - added fCameraVersion
    90 //   - added fTelescopeNumber
    91 //   - changed length of fProjectName to 101
    92 //   - changed length of fSourceName  to 81
    93 //
    94 //  Class Version 3:
    95 //  ----------------
    96 //   - enhanced SourceName and ProjectName by one character, because
    97 //     without telling us the guranteed trailing \0-character has
    98 //     skipped
    99 //
    100 //  Class Version 2:
    101 //  ----------------
    102 //   - removed fMJD, fYear, fMonth, fDay
    103 //   - added fRunStart
    104 //   - added fRunStop
    105 //
    106 //  Class Version 1:
    107 //  ----------------
    108 //   - first implementation
    10931//
    11032////////////////////////////////////////////////////////////////////////////
     
    12850//
    12951MCorsikaRunHeader::MCorsikaRunHeader(const char *name, const char *title)
    130     : fNumObsLevel(0),
    131     fZdMin(0), fZdMax(-1), fAzMin(0), fAzMax(0),
    132 fViewConeInnerAngle(0), fViewConeOuterAngle(-1)
     52    : fNumObsLevel(0), fZdMin(0), fZdMax(-1), fAzMin(0), fAzMax(0),
     53    fViewConeInnerAngle(0), fViewConeOuterAngle(-1)
    13354{
    13455    fName  = name  ? name  : "MCorsikaRunHeader";
     
    17192
    17293    // -------------------- Read first event header -------------------
     94
     95    // FIXME: Add sanity checks!
    17396
    17497    // f[76] Cherenkov flag:
     
    177100    //        bit(3) : CEFFIC option compiled in
    178101    //        bit(4) : ATMEXT option compiled in
    179     //        bit(5) : ATMEXT option used with refaction enabled
     102    //        bit(5) : ATMEXT option used with refraction enabled
    180103    //        bit(6) : VOLUMEDET option compiled in
    181104    //        bit(7) : CURVED option compiled in
    182105    //        bit(9) : SLATN option compiled in
    183106    //        11-21  : table number for externam athmosphere (but<1024)
    184     // f[78] Curved athmosphere? (0=flat, 1=curved)
    185 
    186     // f[80] lower edge of theta in °
    187     // f[81] upper edge of theta in °
    188     // f[82] lower edge of phi   in °
    189     // f[83] upper edge of phi   in °
    190     // f[84] cherenkov bunch size
    191 
    192     // f[93] flag for additinal muon information of particle output file
    193 
    194     // f[95] Cherenkov bandwidth lower end in nm
    195     // f[96] Cherenkov bandwidth upper end in nm
    196 
    197     // f[97] Numbr i of uses of each cherenkov event
     107    //
     108    // f[78]  Curved athmosphere? (0=flat, 1=curved)
     109    // f[84]  cherenkov bunch size
     110    // f[93]  flag for additinal muon information of particle output file
    198111    // f[145] Muon multiple scattering flag
    199     // f[152] !! inner angle of view cone (°)
    200     // f[153] !! outer angle of view cone (°)
    201112    // f[156] altitude of horizontal shower axis
    202113
     
    216127    fin.seekg(-274*4, ios::cur);
    217128
    218     const Int_t n = TMath::Nint(g[96]);
     129    const Int_t n = TMath::Nint(g[96]);  // Numbr i of uses of each cherenkov event
    219130    if (n!=1)
    220131    {
     
    225136    //fImpactMax = g[86];
    226137
    227     fZdMin = g[79];
    228     fZdMax = g[80];
    229     fAzMin = 180-g[81];
    230     fAzMax = 180-g[82];
    231 
    232     fWavelengthMin = g[95];
    233     fWavelengthMax = g[96];
    234 
    235     fViewConeInnerAngle = g[151];
    236     fViewConeOuterAngle = g[152];
     138    fZdMin = g[79];                // lower edge of theta in °
     139    fZdMax = g[80];                // upper edge of theta in °
     140    fAzMin = 180-g[81];            // lower edge of phi   in °
     141    fAzMax = 180-g[82];            // upper edge of phi   in °
     142    // FIXME: Correct for direction of magnetic field!
     143
     144    fWavelengthMin = g[95];        // Cherenkov bandwidth lower end in nm
     145    fWavelengthMax = g[96];        // Cherenkov bandwidth upper end in nm
     146
     147    fViewConeInnerAngle = g[151];  // inner angle of view cone (°)
     148    fViewConeOuterAngle = g[152];  // outer angle of view cone (°)
    237149
    238150    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.