Changeset 5030 for trunk/MagicSoft


Ignore:
Timestamp:
09/15/04 14:53:06 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5029 r5030  
    2020                                                 -*-*- END OF LINE -*-*-
    2121
     22 2004/09/15: Thomas Bretz
     23
     24   * callisto.rc:
     25     - added new line for intensity calibration
     26     - fixed MJPedestalY.ExtractPedestal.PedestalUpdate (should be 'no')
     27     
     28   * mbase/MEvtLoop.cc:
     29     - changed such that returning kCONTINUE in MTaskList::Process
     30     is allowed
     31
     32   * mbase/MTaskList.cc:
     33     - changed to return kCONTINUE if Task returned kCONTINUE
     34
     35   * mcalib/MCalibrate.cc, mcalib/MCalibrationChargeCalc.cc:
     36     - cosmetics to output
     37
     38   * mcalib/MCalibrateData.[h,cc]:
     39     - added an output/skip in case more than 90% of all pixels have
     40       been skipped
     41
     42   * mjobs/MJCalibrateSignal.[h,cc]:
     43     - fixed to read the MJCalibration output
     44     - simplified reading container
     45
     46   * mjobs/MJCalibration.[h,cc]:
     47     - simplified writing container
     48
     49   * mjobs/MJob.[h,cc]:
     50     - added WriteContainer
     51     - added ReadContainer
     52
     53   * mpedestal/MPedCalcFromLoGain.cc:
     54     - initialize default number of dump events (500)
     55     - log status of task in PreProcess
     56
     57
     58
    2259 2004/09/15: Markus Gaug
    2360 
    2461   * mjobs/MJCalibration.cc
    25      - data chekc plot for the rel. time calibration
     62     - data check plot for the rel. time calibration
    2663
    2764   * mhcalib/MHCalibrationCam.cc
     
    3168   * mhcalib/MHCalibrationChargeCam.cc
    3269     - simply calls to IntensityCam somewhat
     70
    3371
    3472
     
    4078       Sorry!
    4179
     80
     81
    4282 2004/09/14: Antonio Stamerra
    4383
     
    5191     - added readIPR
    5292               
     93
     94
    5395
    5496 2004/09/14: Markus Gaug
     
    83125
    84126   * mhbase/MH.cc
    85      - took out the search for histogram with the same name in
    86        ProjectARray. Always create new histogram whihc has to be
    87        deleted afterwards.
    88127     - removed an infinite loop created some hours before.
    89 
    90128
    91129   * mhcalib/MHGausEvents.[h,cc]
     
    95133   * mhcalib/MHCalibrationPix.[h,cc]
    96134     - take out fEventFrequency
     135
    97136
    98137
  • trunk/MagicSoft/Mars/callisto.rc

    r4768 r5030  
    5050# Switch on relative time calibration
    5151MJCalibration.RelTimeCalibration: Yes
     52# Switch on intensity calibration
     53#MJCalibration.IntensityCalibration: Yes
    5254# Set color to be used
    5355#MJCalibration.Color:
     
    172174
    173175MJPedestalY.ExtractPedestal: MPedCalcFromLoGain
    174 MJPedestalY.ExtractPedestal.PedestalUpdate:   yes
    175 MJPedestalY.ExtractPedestal.NumEventsDump:   500
     176MJPedestalY.ExtractPedestal.PedestalUpdate:   no
    176177
    177178# -------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r4732 r5030  
    453453    UInt_t dummy   = maxcnt;
    454454
    455     Int_t rc = kTRUE;
     455    Int_t rc=kTRUE;
    456456    if (maxcnt==0)
    457457        // process first and increment if sucessfull
    458         while ((rc=fTaskList->Process())==kTRUE)
     458        while (1)
    459459        {
     460            rc=fTaskList->Process();
     461            if (rc!=kTRUE && rc!=kCONTINUE)
     462                break;
     463
    460464            numcnts++;
    461465            if (!ProcessGuiEvents(++dummy))
     
    464468    else
    465469        // check for number and break if unsuccessfull
    466         while (dummy-- && (rc=fTaskList->Process())==kTRUE)
     470        while (dummy--)
    467471        {
     472            rc=fTaskList->Process();
     473            if (rc!=kTRUE && rc!=kCONTINUE)
     474                break;
     475
    468476            numcnts++;
    469477            if (!ProcessGuiEvents(maxcnt - dummy))
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r4828 r5030  
    565565    // loop over all tasks for processing
    566566    //
    567     Bool_t rc = kTRUE;
     567    Int_t rc = kTRUE;
    568568    while ( (task=(MTask*)Next()) )
    569569    {
     
    610610            // something occured: skip the rest of the tasks for this event
    611611            //
    612             rc = kTRUE;
     612            rc = kCONTINUE;
    613613            break;
    614614
  • trunk/MagicSoft/Mars/mcalib/MCalibrate.cc

    r4934 r5030  
    163163  if(fCalibrationMode == kBlindPixel && !fQEs->IsBlindPixelMethodValid())
    164164    {
    165       *fLog << warn << GetDescriptor()
    166             << "Warning: Blind pixel calibration method not valid, switching to F-factor method" << endl;
     165      *fLog << warn << "WARNING - Blind pixel calibration method not valid, switching to F-factor method" << endl;
    167166      fCalibrationMode = kFfactor;
    168167    }
     
    170169  if(fCalibrationMode == kPinDiode && !fQEs->IsPINDiodeMethodValid())
    171170    {
    172       *fLog << warn << GetDescriptor()
    173             << "Warning: PIN diode calibration method not valid, switching to F-factor method" << endl;
     171      *fLog << warn << "WARNING - PIN diode calibration method not valid, switching to F-factor method" << endl;
    174172      fCalibrationMode = kFfactor;
    175173    }
     
    177175  if(fCalibrationMode == kCombined && !fQEs->IsCombinedMethodValid())
    178176    {
    179       *fLog << warn << GetDescriptor()
    180             << "Warning: Combined calibration method not valid, switching to F-factor method" << endl;
     177      *fLog << warn << "WARNING - Combined calibration method not valid, switching to F-factor method" << endl;
    181178      fCalibrationMode = kFfactor;
    182179    }
     
    201198      break;
    202199    case kPinDiode:
    203       *fLog << err << GetDescriptor()
    204                     << ": PIN Diode Calibration mode not yet available " << endl;
     200      *fLog << err << "PIN Diode Calibration mode not yet available " << endl;
    205201      return kFALSE;
    206202      break;
    207203    case kCombined:
    208       *fLog << err << GetDescriptor()
    209                     << ": Combined Calibration mode not yet available " << endl;
     204      *fLog << err << "Combined Calibration mode not yet available " << endl;
    210205      return kFALSE;
    211206      break;
    212207        case kFlatCharge:
    213       *fLog << warn << GetDescriptor()
    214                     << ": WARNING: Flat-fielding charges - only for Keiichi!!" << endl;
     208      *fLog << warn << "WARNING - Flat-fielding charges - only for Keiichi!!" << endl;
    215209      break;
    216210    case kDummy:
    217       *fLog << warn << GetDescriptor()
    218                     << ": WARNING: Dummy calibration, no calibration applied!!" << endl;
     211      *fLog << warn << "WARNING - Dummy calibration, no calibration applied!!" << endl;
    219212      break;
    220213    case kNone:
    221       *fLog << warn << GetDescriptor()
    222                     << ": WARNING: No calibration applied!!" << endl;
     214      *fLog << warn << "WARNING - No calibration applied!!" << endl;
    223215      break;
    224216    default:
    225       *fLog << warn << GetDescriptor()
    226             << ": WARNING: Calibration mode value ("
    227             <<fCalibrationMode<<") not known" << endl;
     217      *fLog << warn << "WARNING - Calibration mode value (" <<fCalibrationMode<<") not known" << endl;
    228218      return kFALSE;
    229219    }
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc

    r4766 r5030  
    356356        hiloconverr= pix.GetConversionHiLoErr();
    357357
    358         if (fBadPixels)
    359         {
    360             MBadPixelsPix &bad = (*fBadPixels)[pixidx];
    361             if (bad.IsUnsuitable())
    362                 return kFALSE;
    363         }
     358        if ((*fBadPixels)[pixidx].IsUnsuitable())
     359            return kFALSE;
    364360
    365361        calibConv    = pix.GetMeanConvFADC2Phe();
     
    367363        calibFFactor = pix.GetMeanFFactorFADC2Phot();
    368364
    369         MCalibrationQEPix &qe  = (MCalibrationQEPix&) (*fQEs)[pixidx];
     365        MCalibrationQEPix &qe = (MCalibrationQEPix&) (*fQEs)[pixidx];
    370366
    371367        switch(fCalibrationMode)
     
    439435}
    440436
    441 void MCalibrateData::Calibrate(Bool_t data, Bool_t pedestal) const
     437Int_t MCalibrateData::Calibrate(Bool_t data, Bool_t pedestal) const
    442438{
    443439    if (!data && !pedestal)
    444         return;
     440        return kTRUE;
    445441
    446442    const UInt_t  npix       = fSignals->GetSize();
     
    454450    Float_t calibFFactor;
    455451
     452    UInt_t skip = 0;
    456453    for (UInt_t pixidx=0; pixidx<npix; pixidx++)
    457454    {
    458455        if (!GetConversionFactor(pixidx, hiloconv, hiloconverr,
    459456                                 calibConv, calibConvErr, calibFFactor))
     457        {
     458            skip++;
    460459            continue;
     460        }
    461461
    462462        if (data)
     
    517517    }
    518518
     519    if (skip>npix*0.9)
     520    {
     521        *fLog << warn << "WARNING - GetConversionFactor has skipped more than 90% of the pixels... skip." << endl;
     522        return kCONTINUE;
     523    }
     524
    519525    if (pedestal)
    520526        fPedPhot->SetReadyToSave();
     
    525531        fCerPhotEvt->SetReadyToSave();
    526532    }
     533    return kTRUE;
    527534}
    528535
     
    546553     */
    547554
    548     Calibrate(fCalibrationMode!=kSkip, TestPedestalFlag(kEvent));
    549     return kTRUE;
     555    return Calibrate(fCalibrationMode!=kSkip, TestPedestalFlag(kEvent));
    550556}
    551557
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.h

    r4752 r5030  
    5353  TString  fNamePedPhotContainer;           // name of fPedPhot
    5454
    55   void Calibrate(Bool_t data, Bool_t pedestal) const;
     55  Int_t Calibrate(Bool_t data, Bool_t pedestal) const;
    5656 
    5757  Bool_t GetConversionFactor(UInt_t, Float_t &, Float_t &, Float_t &, Float_t &, Float_t &) const;
     
    9191  void   EnablePedestalType(PedestalType_t i)     { fPedestalFlag |=  i;      }
    9292  void   SetPedestalFlag(PedestalType_t i=kRun)   { fPedestalFlag  =  i;      }
    93   Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag & i; }
     93  Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag&i ? kTRUE : kFALSE; }
    9494 
    9595  void   SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; }
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r5024 r5030  
    466466        {
    467467          *fLog << endl;
    468           *fLog << warn << GetDescriptor()
    469                 << ": No MCalibrationBlindCam found... no Blind Pixel method! " << endl;
     468          *fLog << warn << "No MCalibrationBlindCam found... no Blind Pixel method! " << endl;
    470469          return kFALSE;
    471470        }
     
    492491    {
    493492      *fLog << endl;
    494       *fLog << warn << GetDescriptor()
    495             << ": MCalibrationChargePINDiode not found... no PIN Diode method! " << endl;
     493      *fLog << "MCalibrationChargePINDiode not found... no PIN Diode method! " << endl;
    496494    }
    497495 
  • trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc

    r5020 r5030  
    6666  fCams = new TObjArray;
    6767  fCams->SetOwner();
    68  
    69 }
    70 
     68}
    7169
    7270// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityRelTimeCam.cc

    r5020 r5030  
    5656  fName  = name  ? name  : "MCalibrationIntensityRelTimeCam";
    5757  fTitle = title ? title : "Results of the Intensity Calibration";
    58 
     58 
    5959  InitSize(1);
    6060}
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r4906 r5030  
    5454#include "MPedestalCam.h"
    5555#include "MBadPixelsCam.h"
     56
     57#include "MCalibrationChargePINDiode.h"
     58
    5659#include "MCalibrationQECam.h"
     60#include "MCalibrationBlindCam.h"
    5761#include "MCalibrationChargeCam.h"
    5862#include "MCalibrationRelTimeCam.h"
    59 
     63/*
     64#include "MCalibrationIntensityQECam.h"
     65#include "MCalibrationIntensityBlindCam.h"
     66#include "MCalibrationIntensityChargeCam.h"
     67#include "MCalibrationIntensityRelTimeCam.h"
     68*/
    6069#include "MReadReports.h"
    6170#include "MReadMarsFile.h"
     
    114123}
    115124
    116 Bool_t MJCalibrateSignal::ReadCalibration(MCalibrationCam &calcam,
    117                                           MCalibrationCam &qecam,
    118                                           MCalibrationCam &tmcam,
    119                                           MBadPixelsCam &badpix, MTask* &ext1, MTask* &ext2, TString &geom) const
     125Bool_t MJCalibrateSignal::ReadCalibration(TObjArray &l, MBadPixelsCam &cam, MTask* &ext1, MTask* &ext2, TString &geom) const
    120126{
    121127    const TString fname = Form("%s/calib%06d.root", fPathIn.Data(), fSequence.GetSequence());
    122128
     129    *fLog << inf << "Reading from file: " << fname << endl;
     130
    123131    TFile file(fname, "READ");
    124132    if (!file.IsOpen())
     
    128136    }
    129137
    130     if (calcam.Read("MCalibrationChargeCam")<=0)
    131     {
    132         *fLog << err << dbginf << "ERROR - Unable to read MCalibrationChargeCam from file " << fname << endl;
    133         return kFALSE;
    134     }
    135     if (qecam.Read("MCalibrationQECam")<=0)
    136     {
    137         *fLog << err << dbginf << "ERROR - Unable to read MCalibrationQECam from file " << fname << endl;
    138         return kFALSE;
    139     }
    140     if (tmcam.Read("MCalibrationRelTimeCam")<=0)
    141     {
    142         *fLog << err << dbginf << "ERROR - Unable to read MCalibrationRelTimeCam from file " << fname << endl;
    143         return kFALSE;
    144     }
    145     if (badpix.Read("MBadPixelsCam")<=0)
    146     {
    147         *fLog << err << dbginf << "ERROR - Unable to read MBadPixelsCam from file " << fname << endl;
    148         return kFALSE;
    149     }
    150 
    151138    TObject *o = file.Get("ExtractSignal");
    152139    if (o && !o->InheritsFrom(MExtractor::Class()))
     
    178165    geom = o ? o->ClassName() : "";
    179166
    180     return kTRUE;
     167    TObjArray cont(l);
     168    cont.Add(&cam);
     169    return ReadContainer(cont);
    181170}
    182171
     
    219208
    220209    // Read File
    221     MCalibrationChargeCam  calcam;
    222     MCalibrationQECam      qecam;
    223     MCalibrationRelTimeCam tmcam;
    224     MBadPixelsCam          badpix;
     210    /*
     211     MCalibrationIntensityChargeCam      calcam;
     212     MCalibrationIntensityQECam          qecam;
     213     MCalibrationIntensityBlindCam       bndcam;
     214     MCalibrationIntensityRelTimeCam     tmcam;
     215     */
     216    MCalibrationChargeCam      calcam;
     217    MCalibrationQECam          qecam;
     218    MCalibrationBlindCam       bndcam;
     219    MCalibrationChargePINDiode pind;
     220    MCalibrationRelTimeCam     tmcam;
     221    MBadPixelsCam              badpix;
    225222
    226223    MTask *extractor1=0;
     
    228225    TString geom;
    229226
    230     if (!ReadCalibration(calcam, qecam, tmcam, badpix, extractor1, extractor2, geom))
    231         return kFALSE;
     227    TObjArray calibcont;
     228    calibcont.Add(&calcam);
     229    calibcont.Add(&qecam);
     230    calibcont.Add(&bndcam);
     231    calibcont.Add(&pind);
     232    calibcont.Add(&tmcam);
     233
     234    if (!ReadCalibration(calibcont, badpix, extractor1, extractor2, geom))
     235        return kFALSE;
     236
     237    badpix.Print();
    232238
    233239    *fLog << all;
     
    261267    MParList plist;
    262268    plist.AddToList(this); // take care of fDisplay!
    263     plist.AddToList(&calcam);
    264     plist.AddToList(&qecam);     
    265     plist.AddToList(&tmcam);
    266269    plist.AddToList(&badcam);
    267270    plist.AddToList(&pedcam);
     271    plist.AddToList(&calibcont);
    268272
    269273    // Setup Tasklist
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h

    r4906 r5030  
    77
    88class TEnv;
     9class TList;
    910
    1011class MTask;
     
    1415class MPedestalCam;
    1516class MBadPixelsCam;
    16 class MCalibrationCam;
    17 class MCalibrationQECam;
    18 class MCalibrationRelTimeCam;
    19 class MCalibrationChargeCam;
    2017
    2118class MJCalibrateSignal : public MJob
     
    2320private:
    2421    Bool_t WriteResult();
    25     Bool_t ReadCalibration(MCalibrationCam &calcam,
    26                            MCalibrationCam &qecam, MCalibrationCam &tmcam,
    27                            MBadPixelsCam &badpix, MTask* &ext1, MTask* &ext2,
    28                            TString &geom) const;
     22    Bool_t ReadCalibration(TObjArray &o, MBadPixelsCam &bpix,
     23                           MTask* &ext1, MTask* &ext2, TString &geom) const;
    2924
    3025public:
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r5028 r5030  
    14531453
    14541454    SetRelTimeCalibration(GetEnv("RelTimeCalibration", IsRelTimes()));
     1455    SetIntensity(GetEnv("IntensityCalibration", IsIntensity()));
    14551456    SetDataCheck(GetEnv("Datacheck", IsDataCheck()));
    14561457    SetDebug(GetEnv("Debug", IsDebug()));
    1457     SetIntensity(GetEnv("Intensity", IsIntensity()));
    14581458
    14591459    SetUseBlindPixel(GetEnv("UseBlindPixel", IsUseBlindPixel()));
     
    14911491  if (run < gkSecondBlindPixelInstallation)
    14921492    {
    1493 
    14941493      MCalibrationBlindCamOneOldStyle blindresults;
    14951494      if (IsIntensity())
     
    15051504  else if (run < gkThirdBlindPixelInstallation)
    15061505    {
    1507 
    15081506      MCalibrationBlindCamTwoNewStyle blindresults;
    15091507
     
    20312029    *fLog << inf << "ok." << endl;
    20322030
     2031    TObjArray cont;
    20332032    if (IsIntensity())
    2034       {
    2035         *fLog << inf << " - MBadPixelsIntensityCam..." << flush;
    2036         if (fIntensBadCam.Write()<=0)
    2037           {
    2038             *fLog << err << "Unable to write MBadPixelsIntensityCam to " << oname << endl;
    2039             return kFALSE;
    2040           }
    2041         *fLog << inf << "ok." << endl;
    2042 
    2043         *fLog << inf << " - MCalibrationIntensityChargeCam..." << flush;
    2044         if (fIntensCalibCam.Write()<=0)
    2045           {
    2046             *fLog << err << "Unable to write MCalibrationIntensityChargeCam to " << oname << endl;
    2047             return kFALSE;
    2048           }
    2049         *fLog << inf << "ok." << endl;
    2050 
    2051         *fLog << inf << " - MCalibrationIntensityQECam..." << flush;
    2052         if (fIntensQECam.Write()<=0)
    2053           {
    2054             *fLog << err << "Unable to write MCalibrationIntensityQECam to " << oname << endl;
    2055             return kFALSE;
    2056           }
    2057         *fLog << inf << "ok." << endl;
    2058         *fLog << inf << " - MCalibrationIntensityBlindCam..." << flush;
    2059         if (fIntensBlindCam.Write()<=0)
    2060           {
    2061             *fLog << err << "Unable to write MCalibrationIntensityBlindCam to " << oname << endl;
    2062             return kFALSE;
    2063           }
    2064         *fLog << inf << "ok." << endl;
    2065       }
     2033    {
     2034        cont.Add(&fIntensBadCam);
     2035        cont.Add(&fIntensCalibCam);
     2036        cont.Add(&fIntensQECam);
     2037        cont.Add(&fIntensBlindCam);
     2038    }
    20662039    else
    2067       {
    2068         *fLog << inf << " - MCalibrationChargeCam..." << flush;
    2069         if (fCalibrationCam.Write()<=0)
    2070           {
    2071             *fLog << err << "Unable to write MCalibrationChargeCam to " << oname << endl;
    2072             return kFALSE;
    2073           }
    2074         *fLog << inf << "ok." << endl;
    2075 
    2076         *fLog << inf << " - MCalibrationQECam..." << flush;
    2077         if (fQECam.Write()<=0)
    2078           {
    2079             *fLog << err << "Unable to write MCalibrationQECam to " << oname << endl;
    2080             return kFALSE;
    2081           }
    2082         *fLog << inf << "ok." << endl;
    2083 
    2084         *fLog << inf << " - MCalibrationBlindCam..." << flush;
    2085         if (fCalibrationBlindCam.Write()<=0)
    2086           {
    2087             *fLog << err << "Unable to write MCalibrationBlindCam to " << oname << endl;
    2088             return kFALSE;
    2089           }
    2090         *fLog << inf << "ok." << endl;
    2091       }
    2092    
    2093     *fLog << inf << " - MCalibrationChargePINDiode..." << flush;
    2094     if (fCalibrationPINDiode.Write()<=0)
    2095       {
    2096         *fLog << err << "Unable to write MCalibrationChargePINDiode to " << oname << endl;
    2097         return kFALSE;
    2098     }
    2099     *fLog << inf << "ok." << endl;
    2100 
    2101     *fLog << inf << " - MBadPixelsCam..." << flush;
    2102     if (fBadPixels.Write()<=0)
    2103     {
    2104         *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;
    2105         return kFALSE;
    2106     }
    2107     *fLog << inf << "ok." << endl;
     2040    {
     2041        cont.Add(&fCalibrationCam);
     2042        cont.Add(&fQECam);
     2043        cont.Add(&fCalibrationBlindCam);
     2044    }
     2045    cont.Add(&fCalibrationPINDiode);
     2046    cont.Add(&fBadPixels);
     2047    if (IsRelTimes())
     2048          cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam);
    21082049
    21092050    if (!geom)
    2110         *fLog << warn << " - WARNING: MGeomCam... not found!" << endl;
    2111     {
    2112         *fLog << inf << " - MGeomCam..." << flush;
    2113         if (geom->Write()<=0)
    2114         {
    2115             *fLog << err << "Unable to write MGeomCam to " << oname << endl;
    2116             return kFALSE;
    2117         }
    2118         *fLog << inf << "ok." << endl;
    2119     }
    2120 
    2121     if (IsRelTimes())
    2122     {
    2123       if (IsIntensity())
    2124         {
    2125           *fLog << inf << " - MCalibrationIntensityRelTimeCam..." << flush;
    2126           if (fIntensRelTimeCam.Write()<=0)
    2127             {
    2128               *fLog << err << "Unable to write MCalibrationIntensityRelTimeCam to " << oname << endl;
    2129               return kFALSE;
    2130             }
    2131           *fLog << inf << "ok." << endl;
    2132         }
    2133       else
    2134         {
    2135           *fLog << inf << " - MCalibrationRelTimeCam..." << flush;
    2136           if (fRelTimeCam.Write()<=0)
    2137             {
    2138               *fLog << err << "Unable to write MCalibrationRelTimeCam to " << oname << endl;
    2139               return kFALSE;
    2140             }
    2141           *fLog << inf << "ok." << endl;
    2142         }
    2143      
    2144     }
     2051        *fLog << warn << " - WARNING - MGeomCam... not found!" << endl;
     2052    else
     2053        cont.Add(geom);
     2054
     2055    return WriteContainer(cont);
    21452056
    21462057    return kTRUE;
    2147 
    21482058}
    21492059
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r4760 r5030  
    3333
    3434#include <TEnv.h>
     35#include <TFile.h>
    3536#include <TSystem.h>
     37
     38#include "MIter.h"
    3639
    3740#include "MLog.h"
     
    169172    return loop.ReadEnv(*fEnv, fEnvPrefix, fEnvDebug) ? kTRUE : kFALSE;
    170173}
     174
     175Bool_t MJob::WriteContainer(TCollection &list) const
     176{
     177    if (!gFile)
     178    {
     179        *fLog << err << dbginf << "ERROR - No file open (gFile==0)" << endl;
     180        return kFALSE;
     181    }
     182
     183    MIter Next(&list);
     184    MParContainer *o=0;
     185    while ((o=Next()))
     186    {
     187        *fLog << inf << " - Writing " << o->GetDescriptor() << "..." << flush;
     188        if (o->Write()<=0)
     189        {
     190            *fLog << err << dbginf << "ERROR - Writing " << o->GetDescriptor() << " to file " << gFile->GetName() << endl;
     191            return kFALSE;
     192        }
     193        *fLog << "done." << endl;
     194    }
     195    return kTRUE;
     196}
     197
     198Bool_t MJob::ReadContainer(TCollection &list) const
     199{
     200    if (!gFile)
     201    {
     202        *fLog << err << dbginf << "ERROR - No file open (gFile==0)" << endl;
     203        return kFALSE;
     204    }
     205
     206    MIter Next(&list);
     207    MParContainer *o=0;
     208    while ((o=Next()))
     209    {
     210        *fLog << inf << " - Reading " << o->GetDescriptor() << "..." << flush;
     211        if (o->Read(o->GetName())<=0)
     212        {
     213            *fLog << err << dbginf << "ERROR - Writing " << o->GetDescriptor() << " to file " << gFile->GetName() << endl;
     214            return kFALSE;
     215        }
     216        *fLog << "done." << endl;
     217    }
     218    return kTRUE;
     219}
  • trunk/MagicSoft/Mars/mjobs/MJob.h

    r4760 r5030  
    3838    virtual Bool_t CheckEnvLocal() { return kTRUE; }
    3939
     40    Bool_t WriteContainer(TCollection &list) const;
     41    Bool_t ReadContainer(TCollection &list) const;
     42
    4043public:
    4144    MJob(const char *name=NULL, const char *title=NULL);
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc

    r4991 r5030  
    196196    SetMaxHiGainVar();
    197197    SetPedestalUpdate(kTRUE);
     198    SetNumEventsDump(500);
    198199
    199200    Clear();
     
    362363        fNumEventsDump=1000;
    363364    }
     365
     366    *fLog << inf << "Continous update switched " << (fPedestalUpdate?"on":"off");
     367    if (fPedestalUpdate)
     368        *fLog << " (dump each " << fNumEventsDump << " events)" << endl;
     369    *fLog << endl;
    364370
    365371    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.