Changeset 18540 for trunk/Mars


Ignore:
Timestamp:
08/24/16 18:02:52 (8 years ago)
Author:
tbretz
Message:
Added some code to read the compact bunch format in the eventio files.
Location:
trunk/Mars/msim
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/msim/MPhotonData.cc

    r18459 r18540  
    264264// --------------------------------------------------------------------------
    265265//
     266// Set the data member according to the 8 shorts read from a eventio-file.
     267// This function MUST reset all data-members, no matter whether these are
     268// contained in the input stream.
     269//
     270// Currently we exchange x and y and set y=-y to convert Corsikas coordinate
     271// system into our own.
     272//
     273Int_t MPhotonData::FillEventIO(Short_t f[8])
     274{
     275    // From 5.5 compact_bunch:
     276    // https://www.mpi-hd.mpg.de/hfm/~bernlohr/iact-atmo/iact_refman.pdf
     277
     278    // photons in this bunch f[6]/100.
     279
     280    fPosY             = -f[0]/10.;              // ypos relative to telescope [cm]
     281    fPosX             =  f[1]/10.;              // xpos relative to telescope [cm]
     282    fCosV             = -f[2]/30000.;           // cos to y
     283    fCosU             =  f[3]/30000.;           // cos to x
     284
     285    fTime             =  f[4]/10.;              // a relative arival time [ns]
     286    fProductionHeight =  pow(10, f[5]/1000.);   // altitude of emission a.s.l. [cm]
     287    fWavelength       =  f[7];                  // wavelength [nm]: 0 undetermined, <0 already in p.e.
     288
     289    // Now reset all data members which are not in the stream
     290    fPrimary    = MMcEvtBasic::kUNDEFINED;
     291    fTag        = -1;
     292    fWeight     =  1;
     293
     294    return 1;
     295}
     296
     297// --------------------------------------------------------------------------
     298//
    266299// Set the data member according to the 8 floats read from a eventio-file.
    267300// This function MUST reset all data-members, no matter whether these are
     
    278311        return 0;
    279312
    280     f[6] = n-1;
    281 
    282313    fPosX             =  f[1];              // xpos relative to telescope [cm]
    283314    fPosY             = -f[0];              // ypos relative to telescope [cm]
    284315    fCosU             =  f[3];              // cos to x
    285316    fCosV             = -f[2];              // cos to y
    286     fTime             =  f[4];              // a relative arival time [ns]
    287     fProductionHeight =  f[5];              // altitude of emission [cm]
    288     fWavelength       =  TMath::Nint(f[7]); // so far always zeor = unspec. [nm]
     317    //fTime             =  f[4];              // a relative arival time [ns]
     318    //fProductionHeight =  f[5];              // altitude of emission [cm]
     319    //fWavelength       =  TMath::Nint(f[7]); // so far always zeor = unspec. [nm]
    289320
    290321    // Now reset all data members which are not in the stream
     
    293324    fWeight     =  1;
    294325
    295     return n;
     326    return n-1;
    296327}
    297328
  • trunk/Mars/msim/MPhotonData.h

    r18449 r18540  
    1616#ifndef ROOT_TQuaternion
    1717#include <math.h>
    18 #define sqrt ::sqrt
     18//#define sqrt ::sqrt
    1919#include <TQuaternion.h>
    20 #undef sqrt
     20//#undef sqrt
    2121#endif
    2222
     
    132132
    133133    Int_t FillCorsika(Float_t f[7], Int_t i);
    134     Int_t FillEventIO(Float_t f[7]);
     134    Int_t FillEventIO(Short_t f[8]);
     135    Int_t FillEventIO(Float_t f[8]);
    135136    Int_t FillRfl(Float_t f[8]);
    136137
Note: See TracChangeset for help on using the changeset viewer.