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

Legend:

Unmodified
Added
Removed
  • 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.