Changeset 9212 for trunk/MagicSoft


Ignore:
Timestamp:
01/06/09 13:07:00 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9211 r9212  
    2929     - added AddClipped
    3030
     31  * mbase/MMath.[h,cc]:
     32     - implemented ReSort
     33
     34   * mcorsika/MCorsikaEvtHeader.cc:
     35     - removed obsolete comments
     36
     37   * mcorsika/MCorsikaRead.cc:
     38     - cosmetics
     39
     40   * mcorsika/MCorsikaRunHeader.[h,cc]:
     41     - added comments about file contents
     42     - added fWavelengthMin/Max
     43
     44   * mextralgo/MExtralgoSpline.[h,cc]:
     45     - renamed SearchY to SearchYdn
     46     - fixed a problem in SearchYup (must be ++i instead of i++)
     47       (this is relatively unimportant because it was only used
     48        in the determination of the pulse width which we never
     49        really used)
     50     - added a sanity/range-check to SearchYup and SearchYdn
     51     - added a comment
     52     - changed the order of arguments in EvalDeriv1
     53     - changed the order of arguments in EvalDeriv2
     54     - accelerated EvalDeriv1 (one multiplication less)
     55     - added Deriv1 function
     56     - made SearchYup and SearchYdn public
     57
     58   * mjobs/MDataSet.cc:
     59     - removed an obsolete return statement
     60
     61   * mraw/MRawEvtData.[h,cc]:
     62     - changed pointer in AddPixel to reference
     63     - added a Set function
     64
     65   * mraw/MRawRunHeader.[h,cc]:
     66     - added a lot of fixes for wrong run numbers written by Arehucas
     67     - added a fix for strange file numbers written by Arehucas
     68     - added functions as monta carlo interface to set contents
     69
     70   * msignal/MSignalCam.cc:
     71     - defined a case 9
     72
    3173
    3274
  • trunk/MagicSoft/Mars/NEWS

    r9186 r9212  
    6161
    6262   * Now allows to merpp files newer than 2008/09/03.
     63
     64   * Added fixes for wrong (wrong or double) run- and file-numbers
     65     written by Arehucas. For deatils see MRawRunHeader::FixRunNumbers
    6366
    6467 ;callisto
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.cc

    r9186 r9212  
    140140    fin.seekg(1088-273*4, ios::cur);
    141141
    142     // f[76] Cherenkov flag:
    143     //        bit(1) : CERENKOV option compiled in
    144     //        bit(2) : IACT option compiled in
    145     //        bit(3) : CEFFIC option compiled in
    146     //        bit(4) : ATMEXT option compiled in
    147     //        bit(5) : ATMEXT option used with refaction enabled
    148     //        bit(6) : VOLUMEDET option compiled in
    149     //        bit(7) : CURVED option compiled in
    150     //        bit(9) : SLATN option compiled in
    151     //        11-21  : table number for externam athmosphere (but<1024)
    152     // f[78] Curved athmosphere? (0=flat, 1=curved)
    153 
    154     // f[80] lower edge of theta in °
    155     // f[81] upper edge of theta in °
    156     // f[82] lower edge of phi   in °
    157     // f[83] upper edge of phi   in °
    158     // f[84] cherenkov bunch size
    159 
    160     // f[93] flag for additinal muon information of particle output file
    161 
    162     // f[95] Cherenkov bandwidth lower end in nm
    163     // f[96] Cherenkov bandwidth upper end in nm
    164 
    165     // f[97] Numbr i of uses of each cherenkov event
    166     // f[145] Muon multiple scattering flag
    167     // f[152] !! inner angle of view cone (°)
    168     // f[153] !! outer angle of view cone (°)
    169     // f[156] altitude of horizontal shower axis
    170 
    171142    return !fin.eof();
    172143}
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRead.cc

    r9186 r9212  
    452452            return rc;
    453453    }
    454     return kTRUE; 
     454    return kTRUE;
    455455}
    456456
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.cc

    r9186 r9212  
    172172    // -------------------- Read first event header -------------------
    173173
     174    // f[76] Cherenkov flag:
     175    //        bit(1) : CERENKOV option compiled in
     176    //        bit(2) : IACT option compiled in
     177    //        bit(3) : CEFFIC option compiled in
     178    //        bit(4) : ATMEXT option compiled in
     179    //        bit(5) : ATMEXT option used with refaction enabled
     180    //        bit(6) : VOLUMEDET option compiled in
     181    //        bit(7) : CURVED option compiled in
     182    //        bit(9) : SLATN option compiled in
     183    //        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
     198    // f[145] Muon multiple scattering flag
     199    // f[152] !! inner angle of view cone (°)
     200    // f[153] !! outer angle of view cone (°)
     201    // f[156] altitude of horizontal shower axis
     202
    174203    char evth[4];
    175204    fin.read(evth, 4);
     
    200229    fAzMin = 180-g[81];
    201230    fAzMax = 180-g[82];
     231
     232    fWavelengthMin = g[95];
     233    fWavelengthMax = g[96];
    202234
    203235    fViewConeInnerAngle = g[151];
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h

    r9186 r9212  
    3333    Float_t  fAzMax;                     // [rad] Azimuth (north=0; west=90)
    3434
     35    Float_t fWavelengthMin;      // [nm] Wavelength bandwidth lo edge
     36    Float_t fWavelengthMax;      // [nm] Wavelength bandwidth up edge
     37
    3538    //Float_t  fImpactMax;              // [cm] Maximum simulated impact
    3639
     
    5053    Float_t GetAzMax() const { return fAzMax; }
    5154
     55    Float_t GetWavelengthMin() const { return fWavelengthMin; }
     56    Float_t GetWavelengthMax() const { return fWavelengthMax; }
     57
    5258    //Float_t GetImpactMax() const { return fImpactMax; }
    5359
  • trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.cc

    r8795 r9212  
    1818!   Author(s): Markus Gaug 09/2004 <mailto:markus@ifae.es>
    1919!
    20 !   Copyright: MAGIC Software Development, 2002-2007
     20!   Copyright: MAGIC Software Development, 2002-2008
    2121!
    2222!
     
    4747//   (Note that the variables fDer are not real first derivative coefficients.)
    4848//
     49//   Note, this spline is not optimized to be evaluated many many times, but
     50//   it is optimized to be initialized very fast with new values again and
     51//   again.
     52//
    4953//////////////////////////////////////////////////////////////////////////////
    5054#include "MExtralgoSpline.h"
     
    179183// at x, until x==0. If y is not found -2 is returned.
    180184//
    181 Double_t MExtralgoSpline::SearchY(Float_t x, Float_t y) const
     185Double_t MExtralgoSpline::SearchYdn(Float_t x, Float_t y) const
    182186{
    183187    if (x>=fNum-1)
     
    185189
    186190    Int_t i = TMath::FloorNint(x);
     191    if (i<0)
     192        return -2;
     193
    187194    Double_t rc = FindY(i, kTRUE, y, 0, x-i);
    188195    while (--i>=0 && rc<0)
     
    198205
    199206    Int_t i = TMath::FloorNint(x);
     207    if (i>fNum-2)
     208        return -2;
     209
    200210    Double_t rc = FindY(i, kFALSE, y, x-i, 1.);
    201     while (i++<fNum-1 && rc<0)
     211    while (++i<fNum-1 && rc<0)
    202212        rc = FindY(i, kFALSE, y);
    203213
     
    287297    // Search downwards for fHeight/2
    288298    // By doing also a search upwards we could extract the pulse width
    289     fTime      = SearchY(maxpos, h);
     299    fTime      = SearchYdn(maxpos, h);
    290300    fTimeDev   = 0;
    291301    if (width)
  • trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.h

    r8928 r9212  
    5858
    5959    // Evaluate first derivative of spline in the interval i with x=[0;1[
    60     inline Double_t EvalDeriv1(const Float_t x, const Int_t i) const
     60    inline Double_t EvalDeriv1(const Int_t i, const Float_t x) const
    6161    {
    6262        // x := [0; 1[
     
    6464        const Double_t difder = fDer2[i+1]-fDer2[i];
    6565
    66         return 3*difder*x*x + 6*fDer2[i]*x - 2*fDer2[i] - fDer2[i+1] + difval;
     66        //return 3*difder*x*x + 6*fDer2[i]*x - 2*fDer2[i] - fDer2[i+1] + difval;
     67        return 3*difder*x*x + (6*x - 2)*fDer2[i] - fDer2[i+1] + difval;
    6768    }
    6869
    6970    // Evaluate second derivative of spline in the interval i with x=[0;1[
    70     inline Double_t EvalDeriv2(const Float_t x, const Int_t i) const
     71    inline Double_t EvalDeriv2(const Int_t i, const Float_t x) const
    7172    {
    7273        // x := [0; 1[
     
    7576
    7677    Double_t FindY(Int_t i, Bool_t downwards, Double_t y=0, Double_t min=0, Double_t max=1) const;
    77     Double_t SearchY(Float_t maxpos, Float_t y) const;
    78     Double_t SearchYup(Float_t maxpos, Float_t y) const;
    7978
    8079    Int_t EvalDerivEq0(const Int_t i, Double_t &x1, Double_t &x2) const;
     
    141140
    142141    // Calculate the intgeral of the Eval-function in
    143     // bin i from a=[0;1[ to b=[0;1[
     142    // bin i from 0 <= a < b < 1
    144143    inline Double_t EvalInteg(Int_t i, Float_t a, Float_t b) const
    145144    {
     
    268267            return kFALSE;
    269268
    270         const Bool_t ismax1 = x1>=min && x1<max && EvalDeriv2(x1, i)<0;
    271         const Bool_t ismax2 = x2>=min && x2<max && EvalDeriv2(x2, i)<0;
     269        const Bool_t ismax1 = x1>=min && x1<max && EvalDeriv2(i, x1)<0;
     270        const Bool_t ismax2 = x2>=min && x2<max && EvalDeriv2(i, x2)<0;
    272271
    273272        if (!ismax1 && !ismax2)
     
    323322
    324323    Float_t EvalAt(const Float_t x) const;
     324    Float_t Deriv1(const Float_t x) const;
     325
     326    Double_t SearchYdn(Float_t maxpos, Float_t y) const;
     327    Double_t SearchYup(Float_t maxpos, Float_t y) const;
     328
     329    Double_t SearchYdn(Float_t y) const { return SearchYdn(fNum, y); }
     330    Double_t SearchYup(Float_t y) const { return SearchYup(0,    y); }
    325331};
    326332
     
    335341}
    336342
     343inline Float_t MExtralgoSpline::Deriv1(const Float_t x) const
     344{
     345    Int_t   i = TMath::FloorNint(x);
     346    Float_t f = x-i;
     347
     348    Align(i, f);
     349
     350    return EvalDeriv1(i, f);
     351}
     352
    337353#endif
  • trunk/MagicSoft/Mars/mjobs/MDataSet.cc

    r9186 r9212  
    473473}
    474474
    475 
    476475// --------------------------------------------------------------------------
    477476//
     
    578577        while ((seq=(MSequence*)NextOff()))
    579578            PrintFile(out, *seq);
    580 
    581         return;
    582579    }
    583580}
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r8938 r9212  
    9191#include "MArrayS.h"
    9292#include "MArrayB.h"
     93#include "MArrayI.h"
    9394#include "MGeomCam.h"
    9495
     
    396397//  The parameters are the pixelnumber and the FADC_SLICES values of ADCs
    397398//
    398 void MRawEvtData::AddPixel(UShort_t nOfPixel, TArrayC *data)
     399void MRawEvtData::AddPixel(UShort_t nOfPixel, const TArrayC &data)
    399400{
    400401    const Int_t n = fRunHeader->GetNumSamples();
    401     if (data->GetSize()!=n)
     402    if (data.GetSize()!=n)
    402403    {
    403404        *fLog << err << "RawEvtData::AddPixel: Error, number of samples in ";
    404         *fLog << "TArrayC " << data->GetSize() << " doesn't match current number " << n << endl;
     405        *fLog << "TArrayC " << data.GetSize() << " doesn't match current number " << n << endl;
    405406        return;
    406407    }
     
    424425    // add the new slices as last entries to array
    425426    //
    426     fHiGainFadcSamples->AddAt((Byte_t*)data->GetArray(), fHiGainFadcSamples->GetSize()-n, n);
    427 }
     427    fHiGainFadcSamples->AddAt((Byte_t*)data.GetArray(), fHiGainFadcSamples->GetSize()-n, n);
     428}
     429
     430// --------------------------------------------------------------------------
     431//
     432// Add the contents of the MArrayI to the fHiGainFadcSamples
     433// One Integer is added to one sample in the array.
     434//
     435void MRawEvtData::Set(const MArrayI &data)
     436{
     437    const UInt_t n = fRunHeader->GetNumSamples()*fConnectedPixels;
     438
     439    Byte_t *dest = fHiGainFadcSamples->GetArray();
     440
     441    UInt_t *src  = reinterpret_cast<UInt_t*>(data.GetArray());
     442    UInt_t *end  = reinterpret_cast<UInt_t*>(data.GetArray()) + n;
     443
     444    switch (fNumBytesPerSample)
     445    {
     446    case 1:
     447        {
     448            Byte_t *ptr = reinterpret_cast<Byte_t*>(dest);
     449            while (src<end)
     450                *ptr++ = *src++;
     451        }
     452        return;
     453
     454    case 2:
     455        {
     456            UShort_t *ptr = reinterpret_cast<UShort_t*>(dest);
     457            while (src<end)
     458                *ptr++ = *src++;
     459        }
     460        return;
     461
     462    case 4:
     463        memcpy(dest, data.GetArray(), n*4);
     464        return;
     465    }
     466}
     467
    428468/*
    429469void MRawEvtData::AddPixel(UShort_t nOfPixel, TArrayC *data, Bool_t lflag)
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.h

    r8938 r9212  
    1919class MArrayS;
    2020class MArrayB;
     21class MArrayI;
    2122
    2223class MRawEvtData : public MParContainer, public MCamEvent
     
    5152        case 1: return reinterpret_cast<const Byte_t*>(ptr)[n];
    5253        case 2: return reinterpret_cast<const UShort_t*>(ptr)[n];
    53         case 3: return reinterpret_cast<const UInt_t*>(ptr)[n];
     54        case 4: return reinterpret_cast<const UInt_t*>(ptr)[n];
    5455        }
    5556        return 0;
     
    7475
    7576    void ResetPixels(UShort_t npix, UShort_t maxid);
    76     void AddPixel(UShort_t nOfPixel, TArrayC *data);
     77    void AddPixel(UShort_t nOfPixel, const TArrayC &data);
     78    void Set(const MArrayI &data);
    7779
    7880    UShort_t GetNumHiGainSamples() const;
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r9180 r9212  
    181181    // the default. Do not mix files with and without a value if the
    182182    // files with the value do not match the default!
    183     fFormatVersion=0;
     183    fFormatVersion=11;
    184184    fSoftVersion=0;
    185185    fTelescopeNumber=1;
     
    351351    }
    352352    return kTRUE;
     353}
     354
     355void MRawRunHeader::FixRunNumbers()
     356{
     357    if (fFormatVersion<11 || fTelescopeNumber!=1)
     358        return;
     359
     360    // Map 1:1001349 to 47:1001395
     361    if (fRunNumber<48 &&
     362        fRunStart.GetMjd()>54674.5 && fRunStart.GetMjd()<56476.5)
     363    {
     364        fRunNumber += 1001348;
     365        *fLog << warn << "Format >V10: Wrong run number increased by 1001348 to " << fRunNumber << "." << endl;
     366    }
     367
     368    // Map 1001916:1001922 to 1002349:1002355
     369    if (fRunNumber>1001915 && fRunNumber<1001923 &&
     370        fRunStart.GetMjd()>54710.5 && fRunStart.GetMjd()<54711.5)
     371    {
     372        fRunNumber += 433;
     373        *fLog << warn << "Format >V10: Wrong run number increased by 434 to " << fRunNumber << "." << endl;
     374    }
     375
     376    // Map 10000342:1000343 to 10000351:1000351
     377    if (fRunNumber>10000342 && fRunNumber<10000352 &&
     378        fRunStart.GetMjd()>54254.5 && fRunStart.GetMjd()<54255.5)
     379    {
     380        fRunNumber -= 9000000;
     381        *fLog << warn << "Format >V10: Wrong run number decreased by 9000000 to " << fRunNumber << "." << endl;
     382    }
     383
     384    if (fRunNumber==1000382 &&
     385        fRunStart.GetMjd()>54256.5 && fRunStart.GetMjd()<54257.5 &&
     386        !strcmp(fSourceName, "GRB080605-2347"))
     387    {
     388        fFileNumber += 99;
     389        *fLog << warn << "Format >V10: Ambiguous file number increased by 99 to " << fFileNumber << "." << endl;
     390    }
    353391}
    354392
     
    492530Bool_t MRawRunHeader::Fixes()
    493531{
     532    FixRunNumbers();
     533
    494534    if (fFormatVersion>8 && fRunNumber>326152 && fTelescopeNumber==1)
    495535    {
     
    497537        fNumEventsRead--;
    498538        *fLog << inf << "Format >V8 and Run>M1:326152: Stored number of events decreased by 1." << endl;
    499     }
    500 
    501     if (fFormatVersion>10 && fRunNumber<48 &&
    502         fRunStart.GetMjd()>54674.5 && fRunStart.GetMjd()<56476.5)
    503     {
    504         fRunNumber += 1001348;
    505         *fLog << warn << "Format >V10: Wrong run number increased by 1001348 to " << fRunNumber << "." << endl;
    506539    }
    507540
     
    760793    return IsConsistent();
    761794}
    762 
     795/*
     796Bool_t MRawRunHeader::WriteEvt(ostream& out) const
     797{
     798    //
     799    // write one RUN HEADER from the input stream
     800    //
     801    const UInt_t n = fNumCrates*fNumPixInCrate;
     802
     803    const UShort_t magicnumber     = kMagicNumber;
     804    const UInt_t   formatversion   = 11;
     805    const UInt_t   headersizerun   = (97+n)*4; //???
     806
     807    // FIXME: Write fixed number (c0c0)
     808    out.write((char*)&magicnumber,   2);     // Total=2
     809    out.write((char*)&formatversion, 2);     // Total=4
     810    out.write((char*)&formatversion, 4);
     811    out.write((char*)&headersizerun, 4);
     812
     813    TArrayC h(headersizerun-12);
     814
     815    // ----- convert -----
     816    Byte_t  *Char  = reinterpret_cast<Byte_t* >(h.GetArray());
     817    UInt_t  *Int   = reinterpret_cast<UInt_t* >(h.GetArray());
     818    //const Float_t *Float = reinterpret_cast<Float_t*>(h.GetArray());
     819
     820    // ----- Start interpretation -----
     821
     822    Int[0] = 0; // fHeaderSizeEvt;
     823    Int[1] = 0; // fHeaderSizeCrate;
     824    Int[2] = 0; // fSoftVersion;
     825    Int[3] = fFadcType;
     826    Int[4] = fCameraVersion;
     827    Int[5] = fTelescopeNumber;
     828    Int[5] = fRunType;
     829    Int[6] = fRunNumber;
     830    Int[7] = fFileNumber;
     831
     832    memcpy(Char+ 36, fProjectName,    100);  // 25
     833    memcpy(Char+136, fSourceName,      80);  // 20
     834    memcpy(Char+216, fObservationMode, 60);  // 15
     835
     836    //F32       fSourceRA     = Float[69];
     837    //F32       fSourceDEC    = Float[70];
     838    //F32       fTelescopeRA  = Float[71];
     839    //F32       fTelescopeDEC = Float[72];
     840
     841    memcpy(Char+232, fSourceEpochChar, 4);
     842
     843    Int[74] = fSourceEpochDate;
     844    Int[75] = fNumCrates;
     845    Int[76] = fNumPixInCrate;
     846    Int[77] = fNumSamplesHiGain;
     847
     848    //fNumSamplesRemovedHead = Int[78];
     849    //fNumSamplesRemovedTail = Int[79];
     850
     851    Int[80] = fNumEvents;
     852    Int[81] = fNumEvents; //fNumEventsRead;
     853    Int[82] = fNumBytesPerSample;
     854    Int[83] = fSamplingFrequency;
     855    Int[84] = fFadcResolution;
     856
     857    fRunStart.GetBinary(Int+85);
     858    fRunStop.GetBinary(Int+91);
     859
     860    // ----- 388 bytes so far -----
     861
     862    //const UInt_t n = fNumCrates*fNumPixInCrate;
     863    //if (fHeaderSizeRun<(97+n)*4)
     864    //{
     865    //    *fLog << err << "ERROR - Event header too small to contain pix assignment." << endl;
     866    //    return kFALSE;
     867    //}
     868
     869    // ----- Pixel Assignment -----
     870    for (UInt_t i=0; i<n; i++)
     871        Int[97+i] = (*fPixAssignment)[i];
     872
     873    out.write(h.GetArray(), h.GetSize());
     874
     875    return out;
     876}
     877*/
    763878// --------------------------------------------------------------------------
    764879//
     
    9901105    return 0;
    9911106}
     1107
     1108// --------------------------------------------------------------------------
     1109//
     1110// Monte Carlo Interface
     1111//
     1112// This is a (prelimiary) way to setup an existing FADC system.
     1113//
     1114//  1: Siegen FADCs
     1115//  2: MUX FADCs
     1116//
     1117void MRawRunHeader::InitFadcType(UShort_t type)
     1118{
     1119    switch (type)
     1120    {
     1121    case 1:
     1122        fNumSamplesLoGain  =   15;
     1123        fNumSamplesHiGain  =   15;
     1124        fNumBytesPerSample =    1;    // number of bytes per sample
     1125        fSamplingFrequency =  300;    // Sampling Frequency [MHz]
     1126        fFadcResolution    =    8;    // number of significant bits
     1127        break;
     1128    case 2:
     1129        fNumSamplesLoGain  =    0;
     1130        fNumSamplesHiGain  =   50;
     1131        fNumBytesPerSample =    2;    // number of bytes per sample
     1132        fSamplingFrequency = 2000;    // Sampling Frequency [MHz]
     1133        fFadcResolution    =   12;    // number of significant bits
     1134        break;
     1135    }
     1136
     1137    fFadcType = type;
     1138}
     1139
     1140// --------------------------------------------------------------------------
     1141//
     1142// Monte Carlo Interface
     1143//
     1144//  Init a camera
     1145//
     1146void MRawRunHeader::InitCamera(UShort_t type)
     1147{
     1148    switch (type)
     1149    {
     1150    case 1:
     1151        fNumCrates     =   1;
     1152        fNumPixInCrate = 577;
     1153        break;
     1154    }
     1155
     1156    fCameraVersion = type;
     1157
     1158    const Int_t n = fNumCrates*fNumPixInCrate;
     1159
     1160    fPixAssignment->Set(n);
     1161
     1162    for (int i=0; i<n; i++)
     1163        (*fPixAssignment)[i] = i;
     1164}
     1165
     1166// --------------------------------------------------------------------------
     1167//
     1168// Monte Carlo Interface
     1169//
     1170//  Set run-type, telescope number, run-number and file-number
     1171//
     1172void MRawRunHeader::SetRunInfo(UShort_t type, UShort_t tel, UInt_t run, UInt_t file)
     1173{
     1174    fRunType         = type;
     1175    fTelescopeNumber = tel;
     1176    fRunNumber       = run;
     1177    fFileNumber      = file;
     1178}
     1179
     1180// --------------------------------------------------------------------------
     1181//
     1182// Monte Carlo Interface
     1183//
     1184//  Set source-name, epoch (default J) and date (default 2000)
     1185//
     1186void MRawRunHeader::SetSourceInfo(const char src[80], char epoch, UShort_t date)
     1187{
     1188    memcpy(fSourceName, src, 80);
     1189
     1190    fSourceEpochChar[0] = epoch;     // epoch char of the source
     1191    fSourceEpochChar[1] = 0;         // epoch char of the source
     1192
     1193    fSourceEpochDate = date;         // epoch date of the source
     1194}
     1195
     1196// --------------------------------------------------------------------------
     1197//
     1198// Monte Carlo Interface
     1199//
     1200//  Set run-start and -stop time
     1201//
     1202void MRawRunHeader::SetRunTime(const MTime &start, const MTime &end)
     1203{
     1204    fRunStart = start;
     1205    fRunStop  = end;
     1206}
     1207
     1208// --------------------------------------------------------------------------
     1209//
     1210// Monte Carlo Interface
     1211//
     1212//  Set project name and observation mode
     1213//
     1214void MRawRunHeader::SetObservation(const char mode[60], const char proj[100])
     1215{
     1216    memcpy(fProjectName,     proj, 100);
     1217    memcpy(fObservationMode, mode,  60);
     1218}
     1219
     1220// --------------------------------------------------------------------------
     1221//
     1222// Monte Carlo Interface
     1223//
     1224//  Set number of events in file.
     1225//
     1226void MRawRunHeader::SetNumEvents(UInt_t num)
     1227{
     1228    fNumEvents     = num;
     1229    fNumEventsRead = num;
     1230}
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.h

    r9180 r9212  
    7272
    7373    Bool_t SwapAssignment(Short_t id0, Short_t id1);
     74    void   FixRunNumbers();
    7475    Bool_t FixAssignment();
    7576    Bool_t Fixes();
     
    8384
    8485    // This is to be used in the MC chain only!
     86/*
    8587    void SetMagicNumber(UShort_t a)       { fMagicNumber=a; }
    8688    void SetFormatVersion(UShort_t a)     { fFormatVersion=a; }
     
    9698    void SetNumCrates(UShort_t a)         { fNumCrates=a; }
    9799    void SetNumPixInCrate(UShort_t a)     { fNumPixInCrate=a; }
    98     void SetRunTime(Float_t start, Float_t stop)
    99     { fRunStart.SetMjd(start); fRunStop.SetMjd(stop); }
     100*/
     101    void InitFadcType(UShort_t type);
     102    void InitCamera(UShort_t type);
     103    void SetRunInfo(UShort_t type, UShort_t tel, UInt_t run, UInt_t file=0);
     104    void SetSourceInfo(const char src[80], char epoch='J', UShort_t date=2000);
     105    void SetRunTime(const MTime &start, const MTime &end);
     106    void SetRunTimeMjd(Float_t start, Float_t stop) { fRunStart.SetMjd(start); fRunStop.SetMjd(stop); }
     107    void SetObservation(const char mode[60], const char proj[100]);
     108    void SetNumEvents(UInt_t num);
    100109
    101110    // This is to get the numbers...
     
    153162
    154163    Bool_t ReadEvt(istream& fin);
     164    //Bool_t WriteEvt(ostream& fout) const;
    155165
    156166    ClassDef(MRawRunHeader, 10) // storage container for general info
  • trunk/MagicSoft/Mars/msignal/MSignalCam.cc

    r8528 r9212  
    648648        */
    649649
     650    case 9:
    650651    default:
    651652        val = pix.GetNumPhotons()*ratio;
Note: See TracChangeset for help on using the changeset viewer.