Changeset 9270 for trunk


Ignore:
Timestamp:
01/26/09 11:59:12 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc

    r7804 r9270  
    141141}
    142142
     143// --------------------------------------------------------------------------
     144//
     145// This resets the calculation whenever a new file is opened.
     146//
    143147Bool_t MEventRateCalc::ReInit(MParList *pList)
    144148{
  • trunk/MagicSoft/Mars/mbase/MParEnv.cc

    r9269 r9270  
    165165        rc = kTRUE;
    166166        TString cls = GetEnvValue(env, prefix, "Class", "");
    167         cont = GetNewObject(fName, cls);
     167        cont = GetNewObject(cls, fClassName);
    168168    }
    169169
  • trunk/MagicSoft/Mars/melectronics/MAnalogChannels.cc

    r9243 r9270  
    134134// Return the number of channels.
    135135//
    136 Int_t MAnalogChannels::GetNumChannels() const
     136UInt_t MAnalogChannels::GetNumChannels() const
    137137{
    138138    return fArray ? fArray->GetEntriesFast() : 0;
     
    143143// Return the number of samples per channel
    144144//
    145 Int_t MAnalogChannels::GetNumSamples() const
     145UInt_t MAnalogChannels::GetNumSamples() const
    146146{
    147147    return operator()(0) ? operator()(0)->GetSize() : 0;
  • trunk/MagicSoft/Mars/melectronics/MAnalogChannels.h

    r9242 r9270  
    2929    void Init(UInt_t n, UInt_t len);
    3030
     31    void InitNumChannels(UInt_t n) { Init(n, GetNumSamples());  }
     32    void InitLenChannels(UInt_t l) { Init(GetNumChannels(), l); }
     33
    3134    MAnalogSignal &operator[](UInt_t i);
    3235    MAnalogSignal *operator()(UInt_t i);
     
    3538    const MAnalogSignal *operator()(UInt_t i) const;
    3639
    37     Int_t GetNumChannels() const;
    38     Int_t GetNumSamples() const;
     40    UInt_t GetNumChannels() const;
     41    UInt_t GetNumSamples() const;
    3942
    4043    void SetValidRange(Int_t min, Int_t max) { fValidRangeMin=min; fValidRangeMax=max; }
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r9229 r9270  
    11511151//  Init a camera
    11521152//
    1153 void MRawRunHeader::InitCamera(UShort_t type)
     1153void MRawRunHeader::InitCamera(UShort_t type, UShort_t pix)
    11541154{
    11551155    switch (type)
     
    11631163        fNumPixInCrate = 703;
    11641164        break;
     1165    case (UShort_t)-1:
     1166        fNumCrates     =   1;
     1167        fNumPixInCrate = pix;
     1168        break;
    11651169    }
    11661170
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.h

    r9261 r9270  
    100100*/
    101101    void InitFadcType(UShort_t type);
    102     void InitCamera(UShort_t type);
     102    void InitCamera(UShort_t type, UShort_t pix=0);
     103    void InitPixels(UShort_t pix) { InitCamera((UShort_t)-1, pix); }
    103104    void SetRunInfo(UShort_t type, UShort_t tel, UInt_t run, UInt_t file=0);
    104105    void SetSourceInfo(const char src[80], char epoch='J', UShort_t date=2000);
  • trunk/MagicSoft/Mars/msimcamera/MSimReadout.cc

    r9256 r9270  
    3333//
    3434//  Input Containers:
     35//   MGeomCam
    3536//   MAnalogChannels
    3637//   TriggerPos [MParameterD]
     
    5354#include "MParameters.h"
    5455
     56#include "MGeomCam.h"
     57
    5558#include "MRawRunHeader.h"
    5659#include "MRawEvtHeader.h"
     
    104107    }
    105108
    106 
    107109    fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    108110    if (!fRunHeader)
     
    112114    }
    113115
    114     // -----------------------------------------------------------------------
    115 
    116116    fData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
    117117    if (!fData)
    118118        return kFALSE;
     119
     120    return kTRUE;
     121}
     122
     123Bool_t MSimReadout::ReInit(MParList *plist)
     124{
     125    MGeomCam *cam = (MGeomCam*)plist->FindObject("MGeomCam");
     126    if (!cam)
     127    {
     128        *fLog << err << "MGeomCam not found... aborting." << endl;
     129        return kFALSE;
     130    }
     131
     132    fRunHeader->InitPixels(cam->GetNumPixels());
    119133
    120134    fData->InitRead(fRunHeader);
     
    134148    if (fData->GetNumLoGainSamples()>0)
    135149    {
    136         *fLog << err << "ERROR - Lo-gains not implemented yet." << endl;
     150        *fLog << err << "ERROR - MSimReadout: Lo-gains not implemented yet." << endl;
    137151        return kERROR;
    138152    }
     
    141155    const UInt_t npix = fData->GetNumPixels();
    142156
    143     // Sanity check
    144     if (fData->GetNumPixels()!=fCamera->GetNumChannels())
    145     {
    146         *fLog << err << "ERROR - Number of analog channels doen't match number of pixels." << endl;
     157    if (npix!=fCamera->GetNumChannels())
     158    {
     159        *fLog << err;
     160        *fLog << "ERROR - Number of analog channels " << fCamera->GetNumChannels();
     161        *fLog << " doesn't match number of pixels " << fData->GetNumPixels() << endl;
    147162        return kERROR;
    148163    }
     
    150165    if (fTrigger->GetVal()<0)
    151166    {
    152         *fLog << err << "ERROR - MSimReadout executed for an event which has no trigger." << endl;
     167        *fLog << err << "ERROR - MSimReadout: MSimReadout executed for an event which has no trigger." << endl;
    153168        return kERROR;
    154169    }
  • trunk/MagicSoft/Mars/msimcamera/MSimReadout.h

    r9256 r9270  
    2323
    2424    // MTask
    25     Int_t PreProcess(MParList *pList);
    26     Int_t Process();
     25    Int_t  PreProcess(MParList *pList);
     26    Int_t  Process();
     27    Bool_t ReInit(MParList *pList);
    2728
    2829public:
Note: See TracChangeset for help on using the changeset viewer.