Changeset 9347


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9345 r9347  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2009/02/18 Thomas Bretz
     21
     22   * datacenter/scripts/runcorsika:
     23     - added a comment
     24
     25   * mbase/MParList.cc:
     26     - when adding a TCollectionn only add MParContainers
     27
     28   * mcorsika/MCorsikaRunHeader.[h,cc]:
     29     - added reading of Atmospheric coefficients
     30     - added reading of Cherenkov Flag
     31     - added corsika's Earth Radius
     32
     33   * melectronics/MDigitalSignal.[h,cc]:
     34     - added and initialized an index to allow to "connect"
     35       the digital signal to a channel
     36
     37   * mjtrain/MJTrainSeparation.cc:
     38     - replaced kGreen by kBlue
     39
     40   * mmain/MEventDisplay.cc:
     41     - added a type==3 which is for ceres-reflector files
     42
     43   * mmain/Makefile:
     44     - added -I../mcorsika
     45     - added -I../msim
     46     - added -I../msimcamera
     47
     48   * msim/MHPhotonEvent.[h,cc]:
     49     - set the binning more automatically from the run-headers
     50       where possible
     51     - added RadEnv
     52     - added Clear function for external access
     53
     54   * msim/MSimAbsorption.cc:
     55     - addec const-qualifier for photon
     56
     57   * msimcamera/MSimGeomCam.cc:
     58     - allow usage also without pulse and pulse position (for display)
     59
     60   * msimcamera/MSimSignalCam.cc:
     61     - allow usage also without TriggerPos
     62     - added a check whether MSignalCam was correctly initialized
     63
     64
     65
    2066 2009/02/16 Thomas Bretz
    2167
     
    4490     - now read the ganymed.rc and write it to the output
    4591
     92   * mhflux/MHEffectiveOnTime.h:
     93     - increased class version by 1
     94
     95   * mhflux/MHAlpha.cc:
     96     - removed erronornously comittet SetSumw2
     97     - don't output the numbe rof excess events vs time
     98
    4699
    47100
     
    71124   * mfileio/MWriteRootFile.cc:
    72125     - don't output title if empty
    73 
    74    * mhflux/MHAlpha.cc:
    75      - removed erronornously comittet SetSumw2
    76      - don't output the numbe rof excess events vs time
    77126
    78127   * mhflux/MHEffectiveOnTime.[h,cc]:
  • trunk/MagicSoft/Mars/NEWS

    r9345 r9347  
    3636
    3737   * The display now also displays the trigger pattern
     38
     39   * The display can now display ceres reflector (_R_) files
    3840
    3941 ;ceres
  • trunk/MagicSoft/Mars/datacenter/scripts/runcorsika

    r9343 r9347  
    6868   # positive if array x-direction points to the west
    6969   echo "ARRANG -7.0"
    70    # Atmosphere
     70   # Atmosphere (model, true/false for atmospheric refraction of cer-photons)
     71   # Atmosphere read from atmprof11.dat
     72   # My current understanding is that only refraction (bending of light
     73   # but no absorption of photons is taken into account) setting T.
    7174   echo "ATMOSPHERE 11 T"
    7275   # Other parameters
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r9345 r9347  
    261261    while ((cont=Next()))
    262262    {
    263         if (!dynamic_cast<MParContainer*>(cont))
    264             continue;
    265 
    266         cont->SetBit(kMustCleanup);
    267         AddToList(cont);
     263        MParContainer *par = dynamic_cast<MParContainer*>(cont);
     264        if (par)
     265            AddToList(par);
    268266    }
    269267}
  • 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);
  • trunk/MagicSoft/Mars/melectronics/MDigitalSignal.cc

    r9243 r9347  
    4646// signals.
    4747//
    48 MDigitalSignal::MDigitalSignal(const MDigitalSignal &ttl1, const MDigitalSignal &ttl2)
     48MDigitalSignal::MDigitalSignal(const MDigitalSignal &ttl1, const MDigitalSignal &ttl2) : fIndex(-1)
    4949{
    5050    const Double_t new0 = TMath::Max(ttl1.fStart,              ttl2.fStart);
  • trunk/MagicSoft/Mars/melectronics/MDigitalSignal.h

    r9242 r9347  
    1313    Double_t fLength;
    1414
     15    Int_t fIndex;
     16
    1517public:
    16     MDigitalSignal(Double_t start=0, Double_t len=1e12/*FLT_MAX*/) : fStart(start), fLength(len)
     18    MDigitalSignal(Double_t start=0, Double_t len=1e12/*FLT_MAX*/) : fStart(start), fLength(len), fIndex(-1)
    1719    {
    1820    }
    1921
    20     MDigitalSignal(const MDigitalSignal &ttl) : TObject(ttl), fStart(ttl.fStart), fLength(ttl.fLength)
     22    MDigitalSignal(const MDigitalSignal &ttl) : TObject(ttl), fStart(ttl.fStart), fLength(ttl.fLength), fIndex(ttl.fIndex)
    2123    {
    2224    }
    2325
    2426    MDigitalSignal(const MDigitalSignal &ttl1, const MDigitalSignal &ttl2);
     27
     28    // Setter
     29    void SetIndex(Int_t idx=-1) { fIndex=idx; }
    2530
    2631    // Getter
     
    3035    Double_t GetEnd() const    { return fStart+fLength; }
    3136    Double_t GetLength() const { return fLength; }
     37
     38    Int_t GetIndex() const { return fIndex; }
     39    Bool_t IsConnected() const { return fIndex>=0; }
    3240
    3341    // TObject
  • trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc

    r8957 r9347  
    9898
    9999    h.SetMarkerColor(kRed);
    100     g.SetMarkerColor(kGreen);
     100    g.SetMarkerColor(kBlue);
    101101
    102102    TH2D res1(g);
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r9328 r9347  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.69 2009-02-12 20:05:06 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.70 2009-02-18 12:06:39 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    9292#include "MContinue.h"                 // MContinue
    9393#include "MTriggerPatternDecode.h"     // MTriggerPatternDecode
     94#include "MSimSignalCam.h"             // MSimSignalCam
     95#include "MSimGeomCam.h"               // MSimGeomCam
    9496//#include "MMcTriggerLvl2Calc.h"        // MMcTriggerLvl2Calc
    9597
     
    112114#include "MCalibrationChargeCam.h"     // MCalibrationChargeCam
    113115#include "MMuonSearchPar.h"            // MMuonCalibPar
     116#include "MHPhotonEvent.h"             // MHPhotonEvent
    114117//#include "MMcTriggerLvl2.h"            // MMcTriggerLvl2
    115118
     
    180183        return 2;
    181184
     185    if (t->FindBranch("MPhotonEvent."))
     186        return 3;
     187
    182188    return -2;
    183189}
     
    197203    case  1: gLog << all << "Calibrated Data File detected..." << endl; break;
    198204    case  2: gLog << all << "Raw Data File detected..." << endl; break;
     205    case  3: gLog << all << "Ceres reflector file detected..." << endl; break;
    199206    case -2: gLog << err << "File type unknown... abort." << endl; return;
    200207    case -1: gLog << err << "Tree " << tname << " not found... abort." << endl; return;
     
    237244    tlist->AddToList(read);
    238245
     246    MGeomApply *apl = new MGeomApply;
     247    tlist->AddToList(apl);
     248
     249    if (type==3)
     250    {
     251        MHPhotonEvent *phevt = new MHPhotonEvent;
     252        phevt->PermanentReset();
     253        plist->AddToList(phevt);
     254
     255        MFillH *fillh = new MFillH(phevt, "MPhotonEvent");
     256        fillh->SetNameTab("Detector");
     257        tlist->AddToList(fillh);
     258
     259        MSimGeomCam *simgeom = new MSimGeomCam;
     260        tlist->AddToList(simgeom);
     261
     262        MSimSignalCam *sim = new MSimSignalCam;
     263        tlist->AddToList(sim);
     264    }
     265
    239266    MContinue *mcevts = new MContinue("MRawEvtData.GetNumPixels==0", "ContEmpty");
    240267    if (type==2)
     
    247274    contevt->SetInverted();
    248275    tlist->AddToList(contevt);
    249 
    250     MGeomApply *apl = new MGeomApply;
    251     tlist->AddToList(apl);
    252276
    253277    MTriggerPatternDecode *decode = new MTriggerPatternDecode;
     
    297321    plist->AddToList(evt10);
    298322
    299     MExtractTimeAndChargeDigitalFilter *digf = new MExtractTimeAndChargeDigitalFilter;
    300     digf->SetNameWeightsFile("msignal/cosmics_weights46.dat");
    301 
    302     MTaskEnv *taskenv1=new MTaskEnv("ExtractSignal");
    303     taskenv1->SetDefault(digf);
    304     taskenv1->SetOwner();
    305 
    306     MSignalCalc     *nanal   = new MSignalCalc;
    307323    MFillH          *fill01  = new MFillH(evt01, "MSignalCam", "MFillH01");
    308324    MImgCleanStd    *clean   = new MImgCleanStd;
     
    317333    MFillH          *fill10  = new MFillH(evt10, "MSignalCam",    "MFillH10");
    318334
     335    MExtractTimeAndChargeDigitalFilter *digf = new MExtractTimeAndChargeDigitalFilter;
     336    digf->SetNameWeightsFile("msignal/cosmics_weights46.dat");
     337
     338    MTaskEnv *taskenv1=new MTaskEnv("ExtractSignal");
     339    taskenv1->SetDefault(digf);
     340    taskenv1->SetOwner();
     341
     342    MSignalCalc     *nanal   = new MSignalCalc;
     343
    319344    MBadPixelsCalc  *bcalc   = new MBadPixelsCalc;
    320345    MBadPixelsTreat *btreat  = new MBadPixelsTreat;
     
    379404    if (type==2)
    380405        tlist->AddToList(fill03);
    381     tlist->AddToList(fill04);
     406    if (type!=3)
     407        tlist->AddToList(fill04);
    382408    tlist->AddToList(fill06a);
    383409    tlist->AddToList(fill06b);
     
    393419        //tlist->AddToList(fill09);
    394420    }
    395     if (type==1)
     421    if (type==1 || type==3)
    396422    {
    397423        MFillH *fill08 = new MFillH(evt08, "MSignalCam", "MFillH8");
     
    662688    *fLog << all;
    663689    fLog->Separator(MString::Format("Entry %d", reader->GetNumEntry()+1));
     690
    664691    ((MHillas*)     plist->FindObject("MHillas"))->Print(*geom);
    665692    ((MHillasExt*)  plist->FindObject("MHillasExt"))->Print(*geom);
     
    716743    };
    717744
     745    const Int_t ismc = plist->FindObject("MHPhotonEvent") ? 1 : 0;
    718746
    719747    for (int i=1; i<7; i++)
    720748    {
    721         TCanvas *c = GetCanvas(i);
     749        TCanvas *c = GetCanvas(i+ismc);
     750        if (!c)
     751            continue;
     752
    722753        c->cd(1);
    723754
  • trunk/MagicSoft/Mars/mmain/Makefile

    r9328 r9347  
    2424           -I../mdata -I../msignal -I../mcalib -I../mbadpixels            \
    2525           -I../mpointing -I../mpedestal -I../mmuon -I../mfilter -I../mjobs \
    26            -I../mtrigger
     26           -I../mtrigger -I../mcorsika -I../msimcamera -I../msim
    2727
    2828SRCFILES = MBrowser.cc \
  • trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc

    r9328 r9347  
    115115    fHistWL.SetName("Spectrum");
    116116    fHistWL.SetTitle("Wavelength distribution");
    117     fHistWL.SetXTitle("\\lamba [nm]");
     117    fHistWL.SetXTitle("\\lambda [nm]");
    118118    fHistWL.SetYTitle("Counts");
    119119    fHistWL.SetDirectory(NULL);
     
    124124    fHistH.SetYTitle("Counts");
    125125    fHistH.SetDirectory(NULL);
    126 
    127     // FIXME: Get this information from the corsika run-header
    128     MBinning(70, 275, 625).Apply(fHistWL);
    129     MBinning(100, 0, 25).Apply(fHistH);
    130126}
    131127
     
    169165// --------------------------------------------------------------------------
    170166//
     167// Find good limits for a binning num x [-max;max]
     168// and apply it to fHistXY and fHistT.
     169//
     170void MHPhotonEvent::SetBinningXY(Int_t num, Double_t max)
     171{
     172    Double_t min = -max;
     173
     174    MH::FindGoodLimits(num, num, min, max, kFALSE);
     175
     176    MBinning binsd, binsa, binsz;
     177    binsd.SetEdges(num, min, max);
     178
     179    SetBinning(&fHistXY, &binsd, &binsd);
     180    SetBinning(&fHistT,  &binsd, &binsd);
     181}
     182
     183// --------------------------------------------------------------------------
     184//
    171185// Search for MRflEvtData, MRflEvtHeader and MGeomCam
    172186//
     
    175189    Double_t xmax =  -1;
    176190    Int_t    num  = 100;
     191
     192    const Int_t f = fPermanentReset ? 2 : 1;
     193    MBinning(100/f, 0, 25).Apply(fHistH);
     194    MBinning(70, 275, 625).Apply(fHistWL);
    177195
    178196    switch (fType)
     
    182200        // case0: Take a value defined by the user
    183201    case 1:
    184         {
    185             MCorsikaRunHeader *h = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");
    186             if (!h)
    187             {
    188                 *fLog << err << "MCorsikaRunHeader not found... aborting." << endl;
    189                 return kFALSE;
    190             }
    191             xmax = 25000;//h->GetImpactMax()*1.25; // Estimate scattering in the atmosphere
    192             break;
    193         }
     202        xmax = 25000;
     203        break;
    194204    case 2:
    195205        {
     
    222232    }
    223233
    224     Double_t xmin = -xmax;
     234    SetBinningXY(num, xmax);
     235
     236    return kTRUE;
     237}
     238
     239// --------------------------------------------------------------------------
     240//
     241// ReInit overwrites the binning of the Wavelength histogram
     242// by the wavlenegth band from MCorsikaRunHeader.
     243// The bin-width is 5nm (fPermanentReset==kTRUE) or 10nm (kFALSE).
     244//
     245Bool_t MHPhotonEvent::ReInit(MParList *pList)
     246{
     247    MCorsikaRunHeader *h = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");
     248    if (!h)
     249    {
     250        *fLog << err << "MCorsikaRunHeader not found... aborting." << endl;
     251        return kFALSE;
     252    }
     253
     254    /*
     255    // What is the size of the light pool onm the ground?
     256    if (fType==1)
     257        SetBinningXY(100, h->GetImpactMax());
     258    */
     259
     260    const Int_t f = fPermanentReset ? 2 : 1;
     261
     262    Double_t xmin = h->GetWavelengthMin();
     263    Double_t xmax = h->GetWavelengthMax();
     264    Int_t    num  = TMath::CeilNint((xmax-xmin)/(5*f));
    225265
    226266    MH::FindGoodLimits(num, num, xmin, xmax, kFALSE);
    227267
    228     MBinning binsd, binsa, binsz;
    229     binsd.SetEdges(num, xmin, xmax);
    230 
    231     SetBinning(&fHistXY, &binsd, &binsd);
    232     SetBinning(&fHistT,  &binsd, &binsd);
     268    MBinning(abs(num), xmin, xmax).Apply(fHistWL);
    233269
    234270    return kTRUE;
     
    250286    // Check if we want to use this class as a single event display
    251287    if (fPermanentReset && evt->GetNumPhotons()>0)
    252     {
    253         fHistXY.Reset();
    254         fHistUV.Reset();
    255         fHistT.Reset();
    256     }
     288        Clear();
    257289
    258290    // Get number of photons
     
    365397    fHistH.Draw();
    366398}
     399
     400// --------------------------------------------------------------------------
     401//
     402// PermanentReset: Off
     403//
     404Int_t MHPhotonEvent::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     405{
     406    Bool_t rc = kFALSE;
     407    if (IsEnvDefined(env, prefix, "PermanentReset", print))
     408    {
     409        rc = kTRUE;
     410        fPermanentReset = GetEnvValue(env, prefix, "PermanentReset", fPermanentReset);
     411    }
     412
     413    return rc;
     414}
  • trunk/MagicSoft/Mars/msim/MHPhotonEvent.h

    r9308 r9347  
    2828    Bool_t     fPermanentReset;
    2929
     30    // MHPhotonEvent
    3031    void Init(const char *name, const char *title);
     32    void SetBinningXY(Int_t num, Double_t max);
    3133
     34    // MParContainer
     35    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     36
     37    // MH
    3238    Bool_t SetupFill(const MParList *pList);
     39    Bool_t ReInit(MParList *pList);
    3340    Int_t  Fill(const MParContainer *par, const Stat_t weight=1);
    3441    //Bool_t Finalize();
    3542
    3643public:
    37     MHPhotonEvent(Double_t max=0, const char *name=0, const char *title=0);
    38     MHPhotonEvent(Int_t type,    const char *name=0, const char *title=0);
     44    MHPhotonEvent(Double_t max, const char *name=0, const char *title=0);
     45    MHPhotonEvent(Int_t type=3, const char *name=0, const char *title=0);
    3946
     47    void PermanentReset(Bool_t b=kTRUE) { fPermanentReset=b; }
     48
     49    // TObject
    4050    void Draw(Option_t *o="");
    4151    void Paint(Option_t *o="");
     52
     53    void Clear(Option_t *o="")
     54    {
     55        fHistXY.Reset();
     56        fHistUV.Reset();
     57        fHistT.Reset();
     58        fHistWL.Reset();
     59        fHistH.Reset();
     60    }
    4261
    4362    ClassDef(MHPhotonEvent, 2) // Histogram to display the information of MPhotonEvents
  • trunk/MagicSoft/Mars/msim/MSimAbsorption.cc

    r9328 r9347  
    296296    {
    297297        // Get i-th photon from the list
    298         MPhotonData &ph = (*fEvt)[i];
     298        const MPhotonData &ph = (*fEvt)[i];
    299299
    300300        // Depending on fUseTheta get the incident angle of the wavelength
  • trunk/MagicSoft/Mars/msimcamera/MSimGeomCam.cc

    r9342 r9347  
    3737//   MPhotonEvent
    3838//   fNameGeomCam [MGeomCam]
    39 //   IntendedTrigPos [MParameterD]
    4039//   MRawRunHeader
     40//   [IntendedPulsePos [MParameterD]]
     41//   [MPulseShape]
    4142//
    4243//  Output Containers:
     
    103104
    104105    fPulse = (MPulseShape*)pList->FindObject("MPulseShape");
     106/*
    105107    if (!fPulse)
    106108    {
     
    108110        return kFALSE;
    109111    }
    110 
     112 */
    111113    fPulsePos = (MParameterD*)pList->FindObject("IntendedPulsePos", "MParameterD");
     114/*
    112115    if (!fPulsePos)
    113116    {
     
    115118        return kFALSE;
    116119    }
    117 
     120*/
    118121    fHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    119122    if (!fHeader)
     
    168171
    169172    // ------ FIXME: Move somewhere else? MSimCalibrationSignal ------
    170 
     173/*
    171174    if (!fEvt->IsSorted())
    172175    {
    173         *fLog << err << "ERROR - MPhotonEvent must be sorted!" << endl;
     176        *fLog << err << "ERROR - MSimGeomCam: MPhotonEvent must be sorted!" << endl;
    174177        return kERROR;
    175178    }
    176 
     179 */
    177180    const Float_t freq = fHeader->GetFreqSampling()/1000.;
    178181
     
    185188
    186189    // Length (ns), Pulse position (Units ns)
    187     const Float_t pp   = fPulsePos->GetVal();
    188     const Float_t pw   = fPulse->GetPulseWidth();
     190    const Float_t pp   = fPulsePos ? fPulsePos->GetVal()     : 0;
     191    const Float_t pw   = fPulse    ? fPulse->GetPulseWidth() : 0;
    189192
    190193    fStat->SetTimeMedDev(fEvt->GetTimeMedianDev());
  • trunk/MagicSoft/Mars/msimcamera/MSimSignalCam.cc

    r9274 r9347  
    3535//   MPhotonEvent
    3636//   MPhotonStatistics
     37//   [TriggerPos [MParameterD]]
    3738//
    3839//  Output Containers:
     
    9091
    9192    fTrigger = (MParameterD*)pList->FindObject("TriggerPos", "MParameterD");
     93/*
    9294    if (!fTrigger)
    9395    {
     
    9597        return kFALSE;
    9698    }
    97 
     99*/
    98100    fSignal = (MSignalCam*)pList->FindCreateObj("MSignalCam");
    99101    if (!fSignal)
     
    111113{
    112114    const UInt_t npix = fSignal->GetNumPixels();
     115
     116    if (npix==0)
     117    {
     118        *fLog << err << "ERROR - MSignalCam has 0 entries. Presumably MGeomApply::ReInit not done." << endl;
     119        return kFALSE;
     120    }
    113121
    114122    if (fCont.GetSize()!=npix)
     
    163171    // What about events with trigger<0?
    164172    const Float_t trig  = fTrigger && fTrigger->GetVal()>=0 ? fTrigger->GetVal()  : 0;
    165     const Float_t first = fStat->GetTimeFirst()+trig /*+50+40*/;
     173    const Float_t first = fStat->GetTimeFirst()+trig;
    166174
    167175    // Loop over all pixels and set signal and arrival time.
Note: See TracChangeset for help on using the changeset viewer.