Changeset 5557


Ignore:
Timestamp:
12/03/04 20:11:31 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/callisto.cc

    r5387 r5557  
    280280    {
    281281        //
    282         // Calculate pedestal for calibration
    283         //
    284         MJPedestal job1(Form("MJPedestalC #%d", seq.GetSequence()));
     282        // Calculate pedestal for pedestal-calculation and calibration
     283        //
     284        MJPedestal job1(Form("MJPedestalC1 #%d", seq.GetSequence()));
     285        job1.SetNoStorage();
    285286        job1.SetSequence(seq);
    286287        job1.SetEnv(kConfig);
     
    305306
    306307        //
    307         // Do calibration
    308         //
    309         MJCalibration job2(Form("MJCalibration #%d", seq.GetSequence()));
     308        // Calculate pedestal and pedestal resolution
     309        //
     310        MJPedestal job2(Form("MJPedestalC2 #%d", seq.GetSequence()));
     311        job2.SetNoStorage();
    310312        job2.SetSequence(seq);
    311313        job2.SetEnv(kConfig);
    312314        job2.SetEnvDebug(kDebugEnv);
    313315        job2.SetDisplay(d);;
     316        job2.SetOverwrite(kOverwrite);
     317        job2.SetPathData(kInpathD);
     318        // job1.SetPathOut(kOutpathC); // not yet needed
     319        // job1.SetPathIn(kInpathC);   // not yet needed
     320
     321        job2.SetExtractorResolution();
     322        job2.SetExtractor(job1.GetExtractor());
     323        job2.SetPedestals(job1.GetPedestalCam());
    314324        job2.SetBadPixels(job1.GetBadPixels());
    315         job2.SetOverwrite(kOverwrite);
    316         job2.SetPathOut(kOutpathC);
    317         job2.SetPathData(kInpathD);
     325
     326        if (!job2.ProcessFile())
     327        {
     328            gLog << err << "Calculation of pedestal resolution failed." << endl << endl;
     329            return -1;
     330        }
     331
     332        if (!job2.GetDisplay())
     333        {
     334            gLog << warn << "Display closed by user... execution aborted." << endl << endl;
     335            return 1;
     336        }
     337
     338        //
     339        // Do calibration
     340        //
     341        MJCalibration job3(Form("MJCalibration #%d", seq.GetSequence()));
     342        job3.SetSequence(seq);
     343        job3.SetEnv(kConfig);
     344        job3.SetEnvDebug(kDebugEnv);
     345        job3.SetDisplay(d);;
     346        job3.SetOverwrite(kOverwrite);
     347        job3.SetPathOut(kOutpathC);
     348        job3.SetPathData(kInpathD);
    318349        // job2.SetPathIn(kInpathC); // not yet needed
    319350
    320         if (!job2.ProcessFile(job1.GetPedestalCam()))
     351        job3.SetBadPixels(job2.GetBadPixels());
     352        job3.SetExtractor(job2.GetExtractor());
     353        job3.SetExtractorCam(job2.GetPedestalCam());
     354
     355        if (!job3.ProcessFile(job1.GetPedestalCam()))
    321356        {
    322357            gLog << err << "Calculation of calibration failed." << endl << endl;
     
    324359        }
    325360
    326         if (!job2.GetDisplay())
     361        if (!job3.GetDisplay())
    327362        {
    328363            gLog << warn << "Display closed by user... execution aborted." << endl << endl;
     
    338373        // Calculate starting pedestal for data extraction
    339374        //
    340         MJPedestal job1(Form("MJPedestalY #%d", seq.GetSequence()));
     375        MJPedestal job1(Form("MJPedestalY1 #%d", seq.GetSequence()));
     376        job1.SetNoStorage();
    341377        job1.SetSequence(seq);
    342378        job1.SetEnv(kConfig);
    343379        job1.SetEnvDebug(kDebugEnv);
    344380        job1.SetDisplay(d);;
     381        job1.SetOverwrite(kOverwrite);
     382        job1.SetPathData(kInpathD);
    345383        job1.SetPathIn(kInpathY);
    346384        //job1.SetPathOut(kOutpathY);   // not yet needed
    347         job1.SetPathData(kInpathD);
    348         job1.SetOverwrite(kOverwrite);
     385        job1.SetUseData();
    349386
    350387        if (!job1.ProcessFile())
     
    360397        }
    361398
     399        //
     400        // Calculate pedestal and pedestal resolution
     401        //
     402        MJPedestal job2(Form("MJPedestalY2 #%d", seq.GetSequence()));
     403        job2.SetNoStorage();
     404        job2.SetSequence(seq);
     405        job2.SetEnv(kConfig);
     406        job2.SetEnvDebug(kDebugEnv);
     407        job2.SetDisplay(d);;
     408        job2.SetOverwrite(kOverwrite);
     409        job2.SetPathData(kInpathD);
     410        // job1.SetPathOut(kOutpathC); // not yet needed
     411        // job1.SetPathIn(kInpathC);   // not yet needed
     412
     413        job2.SetUseData();
     414        job2.SetExtractorResolution();
     415        job2.SetExtractor(job1.GetExtractor());
     416        job2.SetPedestals(job1.GetPedestalCam());
     417        job2.SetBadPixels(job1.GetBadPixels());
     418
     419        if (!job2.ProcessFile())
     420        {
     421            gLog << err << "Calculation of pedestal resolution failed." << endl << endl;
     422            return -1;
     423        }
     424
     425        if (!job2.GetDisplay())
     426        {
     427            gLog << warn << "Display closed by user... execution aborted." << endl << endl;
     428            return 1;
     429        }
     430/*
    362431        //
    363432        // Extract signal and calibrate it
     
    381450            gLog << warn << "Display closed by user... execution aborted." << endl << endl;
    382451            return 1;
    383         }
     452        }*/
    384453    }
    385454
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r4889 r5557  
    194194const char *MParContainer::GetDescriptor() const
    195195{
     196    return GetDescriptor(*this);
     197}
     198
     199// --------------------------------------------------------------------------
     200//
     201// Returns the name of the object. If the name of the object is not the
     202// class name it returns the object name and in []-brackets the class name.
     203//
     204const char *MParContainer::GetDescriptor(const TObject &o)
     205{
    196206    //
    197207    // Because it returns a (const char*) we cannot return a casted
     
    200210    //
    201211    MString desc;
    202     desc.Print("%s [%s]", fName.Data(), ClassName());
    203     return fName==ClassName() ? ClassName() : desc.Data();
     212    desc.Print("%s [%s]", o.GetName(), o.ClassName());
     213    return (TString)o.GetName()==o.ClassName() ? o.ClassName() : desc.Data();
    204214}
    205215
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r4889 r5557  
    7373        ;
    7474    virtual void        FillBuffer(char *&buffer);
     75
     76    static const char *GetDescriptor(const TObject &o);
    7577
    7678    virtual const char   *GetDescriptor() const;
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r5498 r5557  
    17331733    const Int_t n = list.Write(name, kSingleKey);
    17341734
    1735     *fLog << inf << "MStatusDisplay: " << n << " keys written to file as key " << name << "." << endl;
     1735    //*fLog << inf << "MStatusDisplay: " << n << " keys written to file as key " << name << "." << endl;
    17361736
    17371737    return n;
  • trunk/MagicSoft/Mars/mbase/MTaskEnv.h

    r4732 r5557  
    2424    Int_t  PostProcess();
    2525
    26     Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
    2726    Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const;
    2827
     
    3837    MTask *GetTask() { return fTask; }
    3938
     39    Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
     40
    4041    ClassDef(MTaskEnv, 0) // Task which can be setup from an environment file
    4142};
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r5553 r5557  
    760760  }
    761761
     762  *fLog << all << "--1--" << fGeom << " " << fPedestals << endl;
     763
    762764  for (UInt_t aidx=0; aidx<fGeom->GetNumAreas(); aidx++)
    763765    {
     
    766768      MCalibrationChargePix &pix = (MCalibrationChargePix&)chargecam->GetAverageArea(aidx);
    767769
     770      *fLog << "1: " << aidx << " " << &ped << " " << &pix << endl;
    768771      FinalizePedestals(ped,pix,aidx);
     772      *fLog << "2: " << aidx << endl;
    769773      FinalizeCharges(pix,
    770774                      fIntensCam ? fIntensCam->GetAverageBadArea(aidx) : fCam->GetAverageBadArea(aidx),
    771                       "area id");
    772     }
     775                      "area idx");
     776      *fLog << "3: " << aidx << endl;
     777    }
     778  *fLog << all << "--2--" << fGeom << " " << fPedestals << endl;
    773779 
    774780  *fLog << endl;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r5480 r5557  
    631631// arr[1]: Error (rms) of averaged conversion factors (default: 0.)
    632632//
    633 // ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
    634 //
    635 TArrayF *MCalibrationChargeCam::GetAveragedConvFADC2PhotPerArea  ( const MGeomCam &geom, const MCalibrationQECam &qecam,
     633TArrayF MCalibrationChargeCam::GetAveragedConvFADC2PhotPerArea  ( const MGeomCam &geom, const MCalibrationQECam &qecam,
    636634                                           const UInt_t ai,  MBadPixelsCam *bad)
    637635{
     
    667665    }
    668666
    669   TArrayF *arr = new TArrayF(2);
    670   arr->AddAt(nr   ? mean/nr : -1.,0);
    671   arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
     667  TArrayF arr(2);
     668  arr[0] = nr   ? mean/nr : -1;
     669  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
    672670
    673671  return arr;
     
    687685// arr[1]: Error (rms) of averaged conversion factors (default: 0.)
    688686//
    689 // ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
    690 //
    691 TArrayF *MCalibrationChargeCam::GetAveragedConvFADC2PhotPerSector( const MGeomCam &geom, const MCalibrationQECam &qecam,
     687TArrayF MCalibrationChargeCam::GetAveragedConvFADC2PhotPerSector( const MGeomCam &geom, const MCalibrationQECam &qecam,
    692688                                             const UInt_t sec, MBadPixelsCam *bad)
    693689{
     
    722718    }
    723719
    724   TArrayF *arr = new TArrayF(2);
    725   arr->AddAt(nr   ? mean/nr : -1.,0);
    726   arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
    727 
     720  TArrayF arr(2);
     721  arr[0] = nr   ? mean/nr : -1;
     722  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
    728723  return arr;
    729724
     
    741736// arr[1]: Error (rms) of averaged mean arrival times (default: 0.)
    742737//
    743 // ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
    744 //
    745 TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerArea  ( const MGeomCam &geom,
    746                                            const UInt_t ai,  MBadPixelsCam *bad)
     738TArrayF MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerArea(const MGeomCam &geom,
     739                                                                 const UInt_t ai,  MBadPixelsCam *bad)
    747740{
    748741
     
    772765    }
    773766
    774   TArrayF *arr = new TArrayF(2);
    775   arr->AddAt(nr   ? mean/nr : -1.,0);
    776   arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
    777 
     767  TArrayF arr(2);
     768  arr[0] = nr   ? mean/nr : -1;
     769  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
    778770  return arr;
    779771}
     
    791783// arr[1]: Error (rms) of averaged mean arrival times (default: 0.)
    792784//
    793 // ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
    794 //
    795 TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerSector( const MGeomCam &geom,
    796                                              const UInt_t sec, MBadPixelsCam *bad)
     785TArrayF MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerSector(const MGeomCam &geom,
     786                                                                   const UInt_t sec, MBadPixelsCam *bad)
    797787{
    798788  const Int_t np = GetSize();
     
    821811    }
    822812
    823   TArrayF *arr = new TArrayF(2);
    824   arr->AddAt(nr   ? mean/nr : -1.,0);
    825   arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
    826 
     813  TArrayF arr(2);
     814  arr[0] = nr   ? mean/nr : -1;
     815  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
    827816  return arr;
    828817
     
    840829// arr[1]: Error (rms) of averaged arrival time RMSs (default: 0.)
    841830//
    842 // ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
    843 //
    844 TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerArea  ( const MGeomCam &geom,
    845                                            const UInt_t ai,  MBadPixelsCam *bad)
     831TArrayF MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerArea  ( const MGeomCam &geom,
     832                                                                   const UInt_t ai,  MBadPixelsCam *bad)
    846833{
    847834
     
    871858    }
    872859
    873   TArrayF *arr = new TArrayF(2);
    874   arr->AddAt(nr   ? mean/nr : -1.,0);
    875   arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
    876 
     860  TArrayF arr(2);
     861  arr[0] = nr   ? mean/nr : -1;
     862  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
    877863  return arr;
    878864}
     
    890876// arr[1]: Error (rms) of averaged arrival time RMSs (default: 0.)
    891877//
    892 // ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
    893 //
    894 TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerSector( const MGeomCam &geom, const UInt_t sec, MBadPixelsCam *bad)
     878TArrayF MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerSector( const MGeomCam &geom, const UInt_t sec, MBadPixelsCam *bad)
    895879{
    896880  const Int_t np = GetSize();
     
    918902    }
    919903
    920   TArrayF *arr = new TArrayF(2);
    921   arr->AddAt(nr   ? mean/nr : -1.,0);
    922   arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
     904  TArrayF arr(2);
     905  arr[0] = nr   ? mean/nr : -1;
     906  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
    923907
    924908  return arr;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h

    r5047 r5557  
    4444  Bool_t  IsFFactorMethodValid            () const;
    4545
    46   TArrayF *GetAveragedConvFADC2PhotPerArea    ( const MGeomCam &geom, const MCalibrationQECam &qecam,
    47                                                 const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
    48   TArrayF *GetAveragedConvFADC2PhotPerSector  ( const MGeomCam &geom, const MCalibrationQECam &qecam,
    49                                                 const UInt_t sec=0, MBadPixelsCam *bad=NULL); 
    50   TArrayF *GetAveragedArrivalTimeMeanPerArea  ( const MGeomCam &geom,
    51                                                 const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
    52   TArrayF *GetAveragedArrivalTimeMeanPerSector( const MGeomCam &geom,
    53                                                 const UInt_t sec=0, MBadPixelsCam *bad=NULL); 
    54   TArrayF *GetAveragedArrivalTimeRmsPerArea   ( const MGeomCam &geom,
    55                                                 const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
    56   TArrayF *GetAveragedArrivalTimeRmsPerSector ( const MGeomCam &geom,
    57                                                 const UInt_t sec=0, MBadPixelsCam *bad=NULL); 
     46  TArrayF GetAveragedConvFADC2PhotPerArea    (const MGeomCam &geom, const MCalibrationQECam &qecam,
     47                                              const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
     48  TArrayF GetAveragedConvFADC2PhotPerSector  (const MGeomCam &geom, const MCalibrationQECam &qecam,
     49                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL);
     50  TArrayF GetAveragedArrivalTimeMeanPerArea  (const MGeomCam &geom,
     51                                              const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
     52  TArrayF GetAveragedArrivalTimeMeanPerSector(const MGeomCam &geom,
     53                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL);
     54  TArrayF GetAveragedArrivalTimeRmsPerArea   (const MGeomCam &geom,
     55                                              const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
     56  TArrayF GetAveragedArrivalTimeRmsPerSector (const MGeomCam &geom,
     57                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL);
    5858 
    5959  // Prints
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r5431 r5557  
    560560        return kFALSE;
    561561    }
    562     *fLog << all << "Name of MPedPhotCam container = " << fNamePedPhotCam
    563           << endl;
    564562
    565563    fTime = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));
     
    662660        break;
    663661    }
    664     *fLog << " cleaning initialized with level " << fCleanLvl1 << " and " << fCleanLvl2;
     662    *fLog << " cleaning" << endl;
     663    *fLog << "initialized with level " << fCleanLvl1 << " and " << fCleanLvl2;
    665664    *fLog << " (CleanRings=" << fCleanRings << ")" << endl;
     665
     666    *fLog << "Name of MPedPhotCam container used: ";
     667    *fLog << (fPed?((MParContainer*)fPed)->GetName():(const char*)fNamePedPhotCam) << endl;
    666668}
    667669
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r5531 r5557  
    16891689    //
    16901690    if (fExtractor->InheritsFrom("MExtractTimeAndCharge"))
    1691       {
     1691    {
    16921692        SetTimeAndCharge();
    16931693        if (fExtractorCam.GetSize() == pedcam.GetSize())
    1694           {
    1695             plist.AddToList(&fExtractorCam);
    1696             calcalc.SetNamePedestalCam(fExtractorCam.GetName());
    1697           }
     1694            calcalc.SetPedestals(&fExtractorCam);
    16981695        else
    1699           *fLog << warn << "Used Extractor derives from MExtractTimeAndCharge, "
    1700                 << "but no MExtractorCam has been handed over! " << endl;
    1701       }
    1702    
     1696        {
     1697            *fLog << warn;
     1698            *fLog << "Used Extractor derives from MExtractTimeAndCharge, " << endl;
     1699            *fLog << "but MExtractorCam size " << fExtractorCam.GetSize() << " ";
     1700            *fLog << "mismatch pedcam size " << pedcam.GetSize() << "! " << endl;
     1701        }
     1702    }
     1703
    17031704    MTaskEnv taskenv("ExtractSignal");
    17041705    taskenv.SetDefault(fExtractor);
     
    19651966Bool_t MJCalibration::WriteResult(TObject *geom)
    19661967{
    1967 
    1968   if (fPathOut.IsNull())
    1969     return kTRUE;
    1970  
    1971   const TString oname(GetOutputFile());
    1972  
    1973   *fLog << inf << "Writing to file: " << oname << endl;
    1974 
    1975   TFile file(oname, "UPDATE", "File created by MJCalibration", 9);
    1976   if (!file.IsOpen())
    1977     {
    1978       *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
    1979       return kFALSE;
    1980     }
    1981  
    1982   *fLog << inf << " - MStatusDisplay..." << flush;
    1983   if (fDisplay && fDisplay->Write()<=0)
    1984     {
    1985       *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
    1986       return kFALSE;
    1987     }
    1988   *fLog << inf << "ok." << endl;
    1989  
    1990   TObjArray cont;
    1991   if (IsIntensity())
    1992     {
    1993       cont.Add(&fIntensBadCam);
    1994       cont.Add(&fIntensCalibCam);
    1995       cont.Add(&fIntensQECam);
    1996       cont.Add(&fIntensBlindCam);
    1997     }
    1998   else
    1999     {
    2000       cont.Add(&fBadPixels);
    2001       cont.Add(&fCalibrationCam);
    2002       cont.Add(&fQECam);
    2003       cont.Add(&fCalibrationBlindCam);
    2004     }
    2005   cont.Add(&fCalibrationPINDiode);
    2006   if (IsRelTimes())
    2007     cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam);
    2008  
    2009   if (!geom)
    2010     *fLog << warn << " - WARNING - MGeomCam... not found!" << endl;
    2011   else
    2012     cont.Add(geom);
    2013  
    2014   return WriteContainer(cont);
     1968    if (fPathOut.IsNull())
     1969        return kTRUE;
     1970
     1971    const TString oname(GetOutputFile());
     1972
     1973    *fLog << inf << "Writing to file: " << oname << endl;
     1974
     1975    TFile file(oname, "UPDATE", "File created by MJCalibration", 9);
     1976    if (!file.IsOpen())
     1977    {
     1978        *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
     1979        return kFALSE;
     1980    }
     1981
     1982    TObjArray cont;
     1983    if (fDisplay)
     1984        cont.Add(fDisplay);
     1985
     1986    if (IsIntensity())
     1987    {
     1988        cont.Add(&fIntensBadCam);
     1989        cont.Add(&fIntensCalibCam);
     1990        cont.Add(&fIntensQECam);
     1991        cont.Add(&fIntensBlindCam);
     1992    }
     1993    else
     1994    {
     1995        cont.Add(&fBadPixels);
     1996        cont.Add(&fCalibrationCam);
     1997        cont.Add(&fQECam);
     1998        cont.Add(&fCalibrationBlindCam);
     1999    }
     2000    cont.Add(&fCalibrationPINDiode);
     2001
     2002    if (IsRelTimes())
     2003        cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam);
     2004
     2005    if (!geom)
     2006        *fLog << warn << " - WARNING - MGeomCam... not found!" << endl;
     2007    else
     2008        cont.Add(geom);
     2009
     2010    return WriteContainer(cont);
    20152011}
    20162012
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r5537 r5557  
    3131#include "MJPedestal.h"
    3232
    33 #include "MLog.h"
    34 #include "MLogManip.h"
    35 
    36 #include "MTaskEnv.h"
    37 #include "MSequence.h"
    38 #include "MRunIter.h"
    39 #include "MParList.h"
    40 #include "MTaskList.h"
    41 #include "MEvtLoop.h"
    42 #include "MExtractor.h"
    43 
    44 #include "MStatusDisplay.h"
    45 
    46 #include "MGeomCam.h"
    47 #include "MHCamera.h"
    48 #include "MPedestalCam.h"
    49 #include "MPedestalPix.h"
    50 #include "MBadPixelsCam.h"
    51 
    52 #include "MCalibrationPedCam.h"
    53 #include "MCalibrationPix.h"
    54 #include "MHPedestalCam.h"
    55 #include "MHPedestalPix.h"
    56 #include "MFillH.h"
    57 
    58 
    59 #include "MReadMarsFile.h"
    60 #include "MRawFileRead.h"
    61 #include "MGeomApply.h"
    62 #include "MBadPixelsMerge.h"
    63 #include "MPedCalcPedRun.h"
    64 #include "MPedCalcFromLoGain.h"
    65 
     33// root classes
    6634#include <TF1.h>
    6735#include <TEnv.h>
     
    7543#include <TPad.h>
    7644
     45// mars core
     46#include "MLog.h"
     47#include "MLogManip.h"
     48
     49#include "MTaskEnv.h"
     50#include "MSequence.h"
     51#include "MRunIter.h"
     52#include "MParList.h"
     53#include "MTaskList.h"
     54#include "MEvtLoop.h"
     55
     56#include "MStatusDisplay.h"
     57
     58// Other basic classes
     59#include "MExtractor.h"
     60
     61// parameter containers
     62#include "MGeomCam.h"
     63#include "MHCamera.h"
     64#include "MPedestalCam.h"
     65#include "MPedestalPix.h"
     66#include "MBadPixelsCam.h"
     67
     68#include "MCalibrationPedCam.h"
     69#include "MCalibrationPix.h"
     70#include "MHPedestalCam.h"
     71#include "MHPedestalPix.h"
     72
     73// tasks
     74#include "MReadMarsFile.h"
     75#include "MRawFileRead.h"
     76#include "MGeomApply.h"
     77#include "MBadPixelsMerge.h"
     78#include "MFillH.h"
     79#include "MPedCalcPedRun.h"
     80#include "MPedCalcFromLoGain.h"
     81
    7782ClassImp(MJPedestal);
    7883
     
    9499const Float_t  MJPedestal::fgRefPedRmsGalacticOuter      = 4.2;
    95100
    96 const TString  MJPedestal::fgNameExtractorCam = "ExtractorResolution";
    97101// --------------------------------------------------------------------------
    98102//
     
    106110// - fStorage to Normal Storage
    107111// - fExtractorResolution to kFALSE
    108 // - fNameExtractorCam to "ExtractorResolution"
    109112//
    110113MJPedestal::MJPedestal(const char *name, const char *title)
     
    119122    SetPathIn("");
    120123    SetExtractorResolution(kFALSE);
    121     SetNameExtractorCam();
     124}
     125
     126MJPedestal::~MJPedestal()
     127{
     128    if (fExtractor)
     129        delete fExtractor;
    122130}
    123131
     
    323331      }
    324332
    325     disp0.SetYTitle("Pedestal [counts/slice]");
    326     disp1.SetYTitle("RMS [counts/slice]");
    327     disp2.SetYTitle("Hist. Mean  [counts/slice]");
    328     disp3.SetYTitle("Hist. Sigma [counts/slice]");
    329     disp4.SetYTitle("Calc. Mean  [counts/slice]");
    330     disp5.SetYTitle("Calc. RMS   [counts/slice]");
    331     disp6.SetYTitle("Diff. Mean  [counts/slice]");
    332     disp7.SetYTitle("Diff. RMS   [counts/slice]");
    333     disp8.SetYTitle("Diff. Mean  [counts/slice]");
    334     disp9.SetYTitle("Abs. Diff. RMS   [counts/slice]");
    335     disp10.SetYTitle("Rel. Diff. RMS  [1]");
     333    disp0.SetYTitle("P [cts/slice]");
     334    disp1.SetYTitle("P_{rms} [cts/slice]");
     335    disp2.SetYTitle("Hist. Mean  [cts/slice]");
     336    disp3.SetYTitle("Hist. Sigma [cts/slice]");
     337    disp4.SetYTitle("Calc. Mean  [cts/slice]");
     338    disp5.SetYTitle("Calc. RMS   [cts/slice]");
     339    disp6.SetYTitle("Diff. Mean  [cts/slice]");
     340    disp7.SetYTitle("Diff. RMS   [cts/slice]");
     341    disp8.SetYTitle("Diff. Mean  [cts/slice]");
     342    disp9.SetYTitle("Abs.Diff.RMS [cts/slice]");
     343    disp10.SetYTitle("Rel.Diff.RMS [1]");
    336344
    337345    //
     
    381389      {
    382390
    383         TCanvas &c3 = fDisplay->AddTab(fExtractorResolution ? "Extr.Res." : "Pedestals");
     391        TCanvas &c3 = fDisplay->AddTab(fExtractorResolution ? "PedExtrd" : "Ped");
    384392        c3.Divide(2,3);
    385393       
     
    538546      {
    539547           
    540         TCanvas &c3 = fDisplay->AddTab("Extr.Res.");
     548        TCanvas &c3 = fDisplay->AddTab("PedExtrd");
    541549        c3.Divide(2,3);
    542550       
     
    544552        disp1.CamDraw(c3, 2, 2, 6);
    545553       
    546         TCanvas &c13 = fDisplay->AddTab("Diff.(Extr.-Pedestal)");
     554        TCanvas &c13 = fDisplay->AddTab("PedDiff");
    547555        c13.Divide(2,3);
    548556       
     
    672680*/
    673681
     682void MJPedestal::SetExtractor(MExtractor* ext)
     683{
     684    if (fExtractor)
     685        delete fExtractor;
     686    fExtractor = ext ? (MExtractor*)ext->Clone() : NULL;
     687}
     688
    674689// --------------------------------------------------------------------------
    675690//
     
    690705Bool_t MJPedestal::CheckEnvLocal()
    691706{
    692 
    693   SetDataCheck(GetEnv("DataCheck", fDataCheck));
    694  
    695   if (HasEnv("DataCheckDisplay"))
    696     fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay;
    697  
    698   if (HasEnv("UseData"))
    699     fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun;
    700  
    701   if (HasEnv("UseHists"))
    702     if (GetEnv("UseHists",kFALSE))
    703       fExtractType = kUseHists;
    704 
    705   SetExtractorResolution(GetEnv("ExtractorResolution", fExtractorResolution));
    706   SetNameExtractorCam(GetEnv("NameExtractorCam", fNameExtractorCam));
    707  
    708   SetNoStorage(GetEnv("DisableOutput", IsNoStorage()));
    709  
    710   return kTRUE;
     707    SetDataCheck(GetEnv("DataCheck", fDataCheck));
     708
     709    if (HasEnv("DataCheckDisplay"))
     710        fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay;
     711
     712    if (HasEnv("UseData"))
     713        fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun;
     714
     715    if (HasEnv("UseHists"))
     716        if (GetEnv("UseHists",kFALSE))
     717            fExtractType = kUseHists;
     718
     719    SetExtractorResolution(GetEnv("ExtractorResolution", fExtractorResolution));
     720
     721    SetNoStorage(GetEnv("DisableOutput", IsNoStorage()));
     722
     723    MTaskEnv tenv;
     724    tenv.SetDefault(fExtractor);
     725
     726    if (tenv.ReadEnv(*GetEnv(), GetEnvPrefix()+".ExtractSignal", GetEnvDebug())==kERROR)
     727        return kFALSE;
     728
     729    if (fExtractor==tenv.GetTask())
     730        return kTRUE;
     731
     732    if (!tenv.GetTask()->InheritsFrom(MExtractor::Class()))
     733    {
     734        *fLog << err << "ERROR: ExtractSignal from resource file doesn't inherit from MExtractor.... abort." << endl;
     735        return kFALSE;
     736    }
     737
     738    SetExtractor((MExtractor*)tenv.GetTask());
     739    return kTRUE;
    711740}
    712741
     
    738767    }
    739768
    740     if (fDisplay && fDisplay->Write()<=0)
    741     {
    742         *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
    743         return kFALSE;
    744     }
    745 
    746     if (fPedestalCamOut.Write()<=0)
    747     {
    748         *fLog << err << "Unable to write MPedestalCam to " << oname << endl;
    749         return kFALSE;
    750     }
    751 
    752     if (fBadPixels.Write()<=0)
    753     {
    754         *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;
    755         return kFALSE;
    756     }
    757 
    758     return kTRUE;
     769    TObjArray cont;
     770
     771    if (fDisplay)
     772        cont.Add(fDisplay);
     773
     774    cont.Add(&fPedestalCamOut);
     775    cont.Add(&fBadPixels);
     776
     777    return WriteContainer(cont);
    759778}
    760779
     
    763782    if (!ReadPedestalCam())
    764783        return ProcessFile();
     784
     785    return kTRUE;
     786}
     787
     788Bool_t MJPedestal::SetupExtractor(MParList &plist, MExtractPedestal &extped)
     789{
     790    if (!fExtractor)
     791        return kTRUE;
     792
     793    if (!fExtractorResolution || !fExtractor->InheritsFrom("MExtractTimeAndCharge"))
     794        return kFALSE;
     795
     796    extped.SetPedestalsIn(&fPedestalCamIn);
     797    extped.SetExtractor((MExtractTimeAndCharge*)fExtractor);
    765798
    766799    return kTRUE;
     
    849882    plist.AddToList(&fBadPixels);
    850883   
    851     MGeomApply      geomapl;
     884    MGeomApply geomapl;
    852885    MBadPixelsMerge merge(&fBadPixels);
    853886
    854     MPedCalcPedRun     pedcalc;
     887    MPedCalcPedRun pedcalc;
    855888    pedcalc.SetPedestalUpdate(kFALSE);
     889
    856890    MPedCalcFromLoGain pedlogain;
    857891    pedlogain.SetPedestalUpdate(kFALSE);
    858892
    859     MHPedestalCam      hpedcam;
     893    MHPedestalCam hpedcam;
    860894    hpedcam.SetRenorm(kTRUE);
    861895   
    862     MFillH fillped(&hpedcam, "MExtractedSignalCam");
     896    MFillH fillped(&hpedcam, "MExtractedSignalCam", "FillPedestalCam");
    863897    fillped.SetBit(MFillH::kDoNotDisplay);
    864898
     
    873907
    874908        *fLog << all;
    875         *fLog << underline << "Signal Extractor found in calibration file" << endl;
     909        *fLog << underline << "Signal Extractor found in calibration file:" << endl;
    876910        fExtractor->Print();
    877911        *fLog << endl;
     
    882916    {
    883917    case kUseData:
    884       taskenv.SetDefault(&pedlogain);
    885       tlist.AddToList(&taskenv);
    886       if (!fExtractor)
     918        taskenv.SetDefault(&pedlogain);
     919        tlist.AddToList(&taskenv);
     920
     921        if (!SetupExtractor(plist, pedlogain))
     922            pedlogain.SetExtractWindow(15, (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
    887923        break;
    888       if (fExtractorResolution && fExtractor->InheritsFrom("MExtractTimeAndCharge"))
     924
     925    case kUsePedRun:
     926        taskenv.SetDefault(&pedcalc);
     927        tlist.AddToList(&taskenv);
     928
     929        if (!SetupExtractor(plist, pedcalc))
     930            pedcalc.SetExtractWindow(fExtractor->GetHiGainFirst(), TMath::Nint(fExtractor->GetNumHiGainSamples()));
     931        break;
     932
     933    case kUseHists:
     934        if (!fExtractor)
    889935        {
    890           plist.AddToList(&fPedestalCamIn);
    891           fPedestalCamOut.SetName(fNameExtractorCam.Data());
    892           pedlogain.SetNamePedestalCamOut(fNameExtractorCam.Data());
    893           pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor);
     936            *fLog << err << GetDescriptor() << " - ERROR: ";
     937            *fLog << "Extraction Type is kUseHists, but no extractor was set" << endl;
     938            return kFALSE;
    894939        }
    895       else
    896         pedlogain.SetExtractWindow(15, (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
    897       break;
    898 
    899     case kUsePedRun:
    900       taskenv.SetDefault(&pedcalc);
    901       tlist.AddToList(&taskenv);
    902       if (!fExtractor)
     940
     941        tlist.AddToList(fExtractor);
     942        tlist.AddToList(&fillped);
    903943        break;
    904       if (fExtractorResolution && fExtractor->InheritsFrom("MExtractTimeAndCharge"))
    905         {
    906           plist.AddToList(&fPedestalCamIn);
    907           fPedestalCamOut.SetName(fNameExtractorCam.Data());
    908           pedcalc.SetNamePedestalCamOut(fNameExtractorCam.Data());
    909           pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor);
    910         }
    911       else
    912         pedcalc.SetExtractWindow(fExtractor->GetHiGainFirst(),TMath::Nint(fExtractor->GetNumHiGainSamples()));
    913       break;
    914      
    915     case kUseHists:
    916       if (!fExtractor)
    917         {
    918           *fLog << err << GetDescriptor();
    919           *fLog << ": Extraction Type kUseExtractor is chosen, but no extractor has been handed over"
    920                 << endl;
    921           return kFALSE;
    922         }
    923      
    924       plist.AddToList(&hpedcam);
    925       tlist.AddToList(fExtractor);
    926       tlist.AddToList(&fillped);
    927 
    928       break;
     944    }
     945
     946    if (!fPathIn.IsNull())
     947    {
     948        delete fExtractor;
     949        fExtractor = 0;
    929950    }
    930951
     
    933954    // means that the each "sliding" of the sliding window is not applied
    934955    //
    935     if (fExtractorResolution && !fExtractor->IsNoiseCalculation())
    936       {
    937         *fLog << warn << GetDescriptor();
    938         *fLog <<": Extraction type is kUseExtractor, but extractor has kNoiseCalculation not set... set."
    939               << endl;
    940         fExtractor->SetNoiseCalculation();
    941       }
    942    
    943     if (!fPathIn.IsNull())
    944     {
    945       delete fExtractor;
    946       fExtractor = 0;
    947     }
     956    if (fExtractor)
     957        fExtractor->SetNoiseCalculation(fExtractorResolution);
    948958
    949959    //
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.h

    r5514 r5557  
    1818class TH1D;
    1919class MExtractor;
     20class MExtractPedestal;
    2021class MEvtLoop;
    2122
     
    2324{
    2425private:
     26    static const Double_t fgPedestalMin;                 //! Minimum Axis value for pedestal datacheck display
     27    static const Double_t fgPedestalMax;                 //! Maximum Axis value for pedestal datacheck display
     28    static const Double_t fgPedRmsMin;                   //! Minimum Axis value for ped. RMS datacheck display
     29    static const Double_t fgPedRmsMax;                   //! Maximum Axis value for ped. RMS datacheck display
    2530
    26   static const Double_t fgPedestalMin;                 //! Minimum Axis value for pedestal datacheck display
    27   static const Double_t fgPedestalMax;                 //! Maximum Axis value for pedestal datacheck display
    28   static const Double_t fgPedRmsMin;                   //! Minimum Axis value for ped. RMS datacheck display
    29   static const Double_t fgPedRmsMax;                   //! Maximum Axis value for ped. RMS datacheck display
    30  
    31   static const Float_t  fgRefPedClosedLids;            //! Reference line pedestal for closed lids run
    32   static const Float_t  fgRefPedExtraGalactic;         //! Reference line pedestal for extragalactic source
    33   static const Float_t  fgRefPedGalactic;              //! Reference line pedestal for galactic source     
    34  
    35   static const Float_t  fgRefPedRmsClosedLidsInner;    //! Ref. line ped. RMS for closed lids run - inner pixels     
    36   static const Float_t  fgRefPedRmsExtraGalacticInner; //! Ref. line ped. RMS for extragalactic source - inner pixels
    37   static const Float_t  fgRefPedRmsGalacticInner;      //! Ref. line ped. RMS for galactic source - inner pixels     
    38  
    39   static const Float_t  fgRefPedRmsClosedLidsOuter;    //! Ref. line ped. RMS for closed lids run - outer pixels     
    40   static const Float_t  fgRefPedRmsExtraGalacticOuter; //! Ref. line ped. RMS for extragalactic source - outer pixels
    41   static const Float_t  fgRefPedRmsGalacticOuter;      //! Ref. line ped. RMS for galactic source - outer pixels     
    42    
    43   static const TString  fgNameExtractorCam;            //! "ExtractorResolution"
     31    static const Float_t  fgRefPedClosedLids;            //! Reference line pedestal for closed lids run
     32    static const Float_t  fgRefPedExtraGalactic;         //! Reference line pedestal for extragalactic source
     33    static const Float_t  fgRefPedGalactic;              //! Reference line pedestal for galactic source
    4434
    45   MRunIter   *fRuns;                                   // Used pedestal runs
    46   MExtractor *fExtractor;                              // Signal extractor, used to find the nr. of used FADC slices
    47  
    48   MPedestalCam  fPedestalCamIn;                        // Handed over pedestal results
    49   MPedestalCam  fPedestalCamOut;                       // Created pedestal results
    50   MBadPixelsCam fBadPixels;                            // Bad Pixels
     35    static const Float_t  fgRefPedRmsClosedLidsInner;    //! Ref. line ped. RMS for closed lids run - inner pixels
     36    static const Float_t  fgRefPedRmsExtraGalacticInner; //! Ref. line ped. RMS for extragalactic source - inner pixels
     37    static const Float_t  fgRefPedRmsGalacticInner;      //! Ref. line ped. RMS for galactic source - inner pixels
    5138
    52   TString fNameExtractorCam;                           // Name of the outgoing MPedestalCam if fExtractorResolution
    53  
    54   enum Display_t {kDataCheckDisplay, kNormalDisplay};  // Possible Display types
    55   Display_t fDisplayType;                              // Chosen Display type   
    56  
    57   enum Storage_t { kNoStorage };                       // Possible flags for the storage of results
    58   Byte_t fStorage;                                     // Bit-field for chosen storage type
    59    
    60   Bool_t fDataCheck;                                   // Flag if the data check is run on raw data
     39    static const Float_t  fgRefPedRmsClosedLidsOuter;    //! Ref. line ped. RMS for closed lids run - outer pixels
     40    static const Float_t  fgRefPedRmsExtraGalacticOuter; //! Ref. line ped. RMS for extragalactic source - outer pixels
     41    static const Float_t  fgRefPedRmsGalacticOuter;      //! Ref. line ped. RMS for galactic source - outer pixels
    6142
    62   enum Extract_t {kUseData, kUsePedRun, kUseHists };   // Possible flags for the extraction of the pedestal
    63   Extract_t fExtractType;                              // Chosen extractor type
     43    MRunIter   *fRuns;                                   // Used pedestal runs
     44    MExtractor *fExtractor;                              // Signal extractor, used to find the nr. of used FADC slices
    6445
    65   Bool_t fExtractorResolution;                         // Flag if the extractor is used to calculate the pedestals
    66  
    67   MExtractor *ReadCalibration() const;
    68   Bool_t ReadPedestalCam();
    69   Bool_t WriteResult();
    70   //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
     46    MPedestalCam  fPedestalCamIn;                        // Handed over pedestal results
     47    MPedestalCam  fPedestalCamOut;                       // Created pedestal results
     48    MBadPixelsCam fBadPixels;                            // Bad Pixels
    7149
    72   void   DisplayResult(MParList &plist);
    73   void   DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
    74   void   DisplayOutliers(TH1D *hist) const;
    75   void   FixDataCheckHist(TH1D *hist) const;
    76  
    77   Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
    78  
    79   Bool_t CheckEnvLocal();
    80    
     50    enum Display_t {kDataCheckDisplay, kNormalDisplay};  // Possible Display types
     51    Display_t fDisplayType;                              // Chosen Display type
     52
     53    enum Storage_t { kNoStorage };                       // Possible flags for the storage of results
     54    Byte_t fStorage;                                     // Bit-field for chosen storage type
     55
     56    Bool_t fDataCheck;                                   // Flag if the data check is run on raw data
     57
     58    enum Extract_t {kUseData, kUsePedRun, kUseHists };   // Possible flags for the extraction of the pedestal
     59    Extract_t fExtractType;                              // Chosen extractor type
     60
     61    Bool_t fExtractorResolution;                         // Flag if the extractor is used to calculate the pedestals
     62
     63    MExtractor *ReadCalibration() const;
     64    Bool_t ReadPedestalCam();
     65    Bool_t WriteResult();
     66    //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
     67
     68    Bool_t SetupExtractor(MParList &plist, MExtractPedestal &extped);
     69
     70    void   DisplayResult(MParList &plist);
     71    void   DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
     72    void   DisplayOutliers(TH1D *hist) const;
     73    void   FixDataCheckHist(TH1D *hist) const;
     74
     75    Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
     76
     77    Bool_t CheckEnvLocal();
     78
    8179public:
     80    MJPedestal(const char *name=NULL, const char *title=NULL);
     81    ~MJPedestal();
    8282
    83   MJPedestal(const char *name=NULL, const char *title=NULL);
     83    MPedestalCam &GetPedestalCam()            { return fPedestalCamOut; }
     84    const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
    8485
    85   MPedestalCam &GetPedestalCam()            { return fPedestalCamOut; }
    86   const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
    87  
    88   const char*  GetNameExtractorCam()  const { return fNameExtractorCam.Data(); }
    89   const char*  GetOutputFile()        const;
     86    const char*  GetOutputFile() const;
    9087
    91   const Bool_t IsDataCheck()          const { return fDataCheck; }
    92   const Bool_t IsUseData()            const { return fExtractType == kUseData; }
    93  
    94   Bool_t Process    ();
    95   Bool_t ProcessFile();
    96  
    97   void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
    98   void SetPedestals(const MPedestalCam  &ped) { ped.Copy(fPedestalCamIn); } 
    99   void SetExtractor(MExtractor* ext)          { fExtractor = ext;     }
    100   void SetInput(MRunIter  *iter)              { fRuns      = iter;    }
    101   void SetUseData()                           { fExtractType = kUseData;   }
    102   void SetUseHists()                          { fExtractType = kUseHists;  }
    103   void SetUsePedRun()                         { fExtractType = kUsePedRun; }
    104   void SetDataCheck(const Bool_t b=kTRUE)     { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); }
    105   void SetDataCheckDisplay()                  { fDisplayType = kDataCheckDisplay; }
    106   void SetNormalDisplay()                     { fDisplayType = kNormalDisplay;    }
    107   void SetExtractorResolution(const Bool_t b=kTRUE) { fExtractorResolution = b;  }
    108   void SetNameExtractorCam( const char* name= fgNameExtractorCam.Data())  { fNameExtractorCam = name;  }
    109  
    110  
    111   // Storage
    112   void SetNoStorage(const Bool_t b)           { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }
    113   void SetNormalStorage()                     { CLRBIT(fStorage, kNoStorage); }
    114  
    115   ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
     88    const Bool_t IsDataCheck() const { return fDataCheck; }
     89    const Bool_t IsUseData() const { return fExtractType == kUseData; }
     90
     91    Bool_t Process    ();
     92    Bool_t ProcessFile();
     93
     94    void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
     95    void SetPedestals(const MPedestalCam  &ped) { ped.Copy(fPedestalCamIn); }
     96    void SetExtractor(MExtractor* ext);
     97    void SetInput(MRunIter  *iter)              { fRuns      = iter;    }
     98    void SetUseData()                           { fExtractType = kUseData;   }
     99    void SetUseHists()                          { fExtractType = kUseHists;  }
     100    void SetUsePedRun()                         { fExtractType = kUsePedRun; }
     101    void SetDataCheck(const Bool_t b=kTRUE)     { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); }
     102    void SetDataCheckDisplay()                  { fDisplayType = kDataCheckDisplay; }
     103    void SetNormalDisplay()                     { fDisplayType = kNormalDisplay;    }
     104    void SetExtractorResolution(const Bool_t b=kTRUE) { fExtractorResolution = b;  }
     105
     106    MExtractor *GetExtractor() const { return fExtractor; }
     107
     108    // Storage
     109    void SetNoStorage(const Bool_t b=kTRUE)     { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }
     110    void SetNormalStorage()                     { CLRBIT(fStorage, kNoStorage); }
     111
     112    ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
    116113};
    117114
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r5158 r5557  
    181181    }
    182182
    183     MIter Next(&list);
    184     MParContainer *o=0;
     183    TIter Next(&list);
     184    TObject *o=0;
    185185    while ((o=Next()))
    186186    {
    187         *fLog << inf << " - Writing " << o->GetDescriptor() << "..." << flush;
     187        *fLog << inf << " - Writing " << MParContainer::GetDescriptor(*o) << "..." << flush;
    188188        if (o->Write(o->GetName())<=0)
    189189        {
    190             *fLog << err << dbginf << "ERROR - Writing " << o->GetDescriptor() << " to file " << gFile->GetName() << endl;
     190            *fLog << err << dbginf << "ERROR - Writing " << MParContainer::GetDescriptor(*o) << " to file " << gFile->GetName() << endl;
    191191            return kFALSE;
    192192        }
  • trunk/MagicSoft/Mars/mjobs/MJob.h

    r5030 r5557  
    1414    void FixPath(TString &path) const;
    1515
    16     TEnv     *fEnv;           // Resource file
    17     TString   fEnvPrefix;     // Prefix for resources
    18     Bool_t    fEnvDebug;      // Debug setup of resources
     16    const TEnv *fEnv;         // Resource file
     17    TString     fEnvPrefix;   // Prefix for resources
     18    Bool_t      fEnvDebug;    // Debug setup of resources
    1919
    2020protected:
     
    2828
    2929    MSequence fSequence;      // Sequence
     30
     31    const TEnv *GetEnv() const { return fEnv; }
     32    const TString &GetEnvPrefix() const { return fEnvPrefix; }
     33    Bool_t GetEnvDebug() const { return fEnvDebug; }
    3034
    3135    Int_t       GetEnv(const char *name, Int_t dflt) const;
Note: See TracChangeset for help on using the changeset viewer.