Ignore:
Timestamp:
04/27/05 16:46:24 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc

    r6906 r6979  
    9595// Default constructor.
    9696//
    97 // Sets fUseCosmicsFilter to kTRUE, fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL
     97// Sets fUseCosmicsFilter to kTRUE, fExtractor to NULL, fTimeExtractor to NULL
    9898// fDisplay to kNormalDisplay
    9999//
     
    210210const char* MJCalibTest::GetOutputFile() const
    211211{
    212     const TString name(GetOutputFileName());
    213     if (name.IsNull())
    214         return "";
    215 
    216     return Form("%s/%s", fPathOut.Data(), name.Data());
    217 }
    218 
    219 
    220 const char* MJCalibTest::GetOutputFileName() const
    221 {
    222 
    223   if (fSequence.IsValid())
    224     return Form("calib%08d.root", fSequence.GetSequence());
    225  
    226   if (!fRuns)
    227     return "";
    228  
    229   return Form("%s-F1.root", (const char*)fRuns->GetRunsAsFileName());
    230  
     212    return Form("%s/calib%08d.root", fPathOut.Data(), fSequence.GetSequence());
    231213}
    232214
     
    279261}
    280262
    281 Bool_t MJCalibTest::ProcessFile(MPedestalCam &pedcam)
     263Bool_t MJCalibTest::Process(MPedestalCam &pedcam)
    282264{
    283  
    284   if (!fSequence.IsValid())
    285     {
    286       if (!fRuns)
    287         {
    288             *fLog << err << "ERROR - Sequence invalid and no runs chosen!" << endl;
    289             return kFALSE;
    290         }
    291      
    292       if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
    293         {
    294           *fLog << err << "Number of files found doesn't match number of runs... abort."
    295                 << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl;
    296           return kFALSE;
    297         }
    298       *fLog << "Calibrate data from ";
    299       *fLog << "Runs " << fRuns->GetRunsAsString() << endl;
    300       *fLog << endl;
    301     }
    302  
     265    if (!fSequence.IsValid())
     266    {
     267          *fLog << err << "ERROR - Sequence invalid..." << endl;
     268          return kFALSE;
     269    }
     270
     271    *fLog << inf;
     272    fLog->Separator(GetDescriptor());
     273    *fLog << "Calculate calibration test from Sequence #";
     274    *fLog << fSequence.GetSequence() << endl << endl;
     275
    303276  CheckEnv();
    304277 
     
    307280 
    308281  *fLog << "Calibrate Calibration data from ";
    309   if (fSequence.IsValid())
    310     *fLog << "Sequence #" << fSequence.GetSequence() << endl;
    311   else
    312     *fLog << "Runs " << fRuns->GetRunsAsString() << endl;
     282  *fLog << "Sequence #" << fSequence.GetSequence() << endl;
    313283  *fLog << endl;
    314284 
     
    415385
    416386  if (IsUseRawData())
    417     rawread.AddFiles(fSequence.IsValid() ? iter : *fRuns);
     387    rawread.AddFiles(iter);
    418388  else
    419     static_cast<MRead&>(read).AddFiles(fSequence.IsValid() ? iter : *fRuns);
     389    static_cast<MRead&>(read).AddFiles(iter);
    420390
    421391  // Check for interleaved events
     
    475445  MCalibrationTestCalc  testcalc;
    476446
    477   if (!fSequence.IsValid())
    478     {
    479       testcalc.SetOutputPath(fPathOut);
    480       testcalc.SetOutputFile(Form("%s-TestCalibStat.txt",(const char*)fRuns->GetRunsAsFileName()));
    481     }
    482  
    483447  MHCamEvent evt0(0,"Signal", "Un-Calibrated Signal;;S [FADC cnts]" );
    484448  MHCamEvent evt1(0,"CalSig", "Cal. and Interp. Sig. by Pixel Size Ratio;;S [phe]");
  • trunk/MagicSoft/Mars/mjobs/MJCalibTest.h

    r6281 r6979  
    7474  void SetNormalDisplay()    { fDisplayType = kNormalDisplay;    }
    7575 
    76   Bool_t ProcessFile(MPedestalCam &pedcam);
     76  Bool_t Process(MPedestalCam &pedcam);
    7777 
    7878  ClassDef(MJCalibTest, 0) // Tool to calibrate and test the calibration run itself
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6977 r6979  
    149149}
    150150
    151 const char* MJCalibrateSignal::GetInputFile() const
    152 {
    153     const TString name(GetInputFileName());
    154     if (name.IsNull())
    155         return "";
    156 
    157     return Form("%s/%s", fPathIn.Data(), name.Data());
    158 }
    159 
    160 const char* MJCalibrateSignal::GetInputFileName() const
    161 {
    162 
    163   if (fSequence.IsValid())
    164     return Form("calib%08d.root", fSequence.GetSequence());
    165  
    166   //  if (!fCruns)
    167     return "";
    168  
    169   //  return Form("%s-F1.root", (const char*)fCruns->GetRunsAsFileName());
    170 }
    171 
    172151Bool_t MJCalibrateSignal::WriteResult(TObjArray &cont)
    173152{
     
    181160Bool_t MJCalibrateSignal::ReadCalibration(TObjArray &l, MBadPixelsCam &cam, MExtractor* &ext2, MExtractor* &ext3, TString &geom) const
    182161{
    183 
    184     const TString fname = GetInputFile();
     162    TString fname = Form("%s/calib%08d.root", fPathIn.Data(), fSequence.GetSequence());
    185163
    186164    *fLog << inf << "Reading from file: " << fname << endl;
     
    274252}
    275253
    276 Bool_t MJCalibrateSignal::ProcessFile(MPedestalCam &pedcamab, MPedestalCam &pedcambias,
    277                                       MPedestalCam &pedcamextr)
     254Bool_t MJCalibrateSignal::Process(MPedestalCam &pedcamab, MPedestalCam &pedcambias,
     255                                  MPedestalCam &pedcamextr)
    278256{
    279257    if (!fSequence.IsValid())
    280258    {
    281         if (!fRuns)
    282         {
    283           *fLog << err << "ERROR - Sequence invalid and no runs chosen!" << endl;
     259          *fLog << err << "ERROR - Sequence invalid..." << endl;
    284260          return kFALSE;
    285         }
    286 
    287         if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
    288         {
    289             *fLog << err << "Number of files found doesn't match number of runs... abort."
    290                 << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl;
    291             return kFALSE;
    292         }
    293         *fLog << "Calibrate data from ";
    294         *fLog << "Runs " << fRuns->GetRunsAsString() << endl;
    295         *fLog << endl;
    296     }
     261    }
     262
     263    *fLog << inf;
     264    fLog->Separator(GetDescriptor());
     265    *fLog << "Calculate calibrated data from Sequence #";
     266    *fLog << fSequence.GetSequence() << endl << endl;
     267
    297268
    298269    //if (!CheckEnv())
     
    303274    // --------------------------------------------------------------------------------
    304275
    305     *fLog << inf;
    306     fLog->Separator(GetDescriptor());
    307     *fLog << "Calculate calibrated data from runs ";
    308     *fLog << fSequence.GetName() << endl;
    309     *fLog << endl;
    310 
    311     // --------------------------------------------------------------------------------
    312 
    313276    MDirIter iter;
    314277    if (fSequence.IsValid())
    315       {
     278    {
    316279        const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, IsUseRawData());
    317280        const Int_t n1 = fSequence.GetNumDatRuns();
    318281        if (n0==0)
    319           {
     282        {
    320283            *fLog << err << "ERROR - No input files of sequence found!" << endl;
    321284            return kFALSE;
    322           }
     285        }
    323286        if (n0!=n1)
    324           {
     287        {
    325288            *fLog << err << "ERROR - Number of files found (" << n0 << ") doesn't match number of files in sequence (" << n1 << ")" << endl;
    326289            if (fLog->GetDebugLevel()>4)
     
    330293            }
    331294            return kFALSE;
    332           }
    333       }
    334    
     295        }
     296    }
     297
    335298    // Read File
    336299    MCalibrationIntensityChargeCam      ichcam;
     
    464427    case kIsUseRootData: read = &readreal; break;
    465428    }
    466     read->AddFiles(fSequence.IsValid() ? iter : *fRuns);
     429    read->AddFiles(iter);
    467430
    468431    const TString fname(Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()));
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h

    r6838 r6979  
    3434    Bool_t ReadExtractorCosmics(MExtractor* &ext1) const;
    3535
    36     const char*  GetInputFileName() const;
    37     const char*  GetInputFile() const;
     36    const char* GetInputFile() const;
    3837   
    3938public:
     
    4241    ~MJCalibrateSignal();
    4342
    44     Bool_t ProcessFile(MPedestalCam &camab, MPedestalCam &cam1, MPedestalCam &cam2);
     43    Bool_t Process(MPedestalCam &camab, MPedestalCam &cam1, MPedestalCam &cam2);
    4544
    4645    void SetInterlaced     ( const Bool_t b=kTRUE )  { fIsInterlaced      = b; }
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r6969 r6979  
    187187// Default constructor.
    188188//
    189 // - Sets fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL, fColor to kNONE,
     189// - fExtractor to NULL, fTimeExtractor to NULL, fColor to kNONE,
    190190//   fDisplay to kNormalDisplay, kRelTimes to kFALSE, kataCheck to kFALSE, kDebug to kFALSE,
    191191//   kIntensity to kFALSE
     
    315315    TString title = fDisplay->GetTitle();
    316316    title += "--  Calibration ";
    317     title += fSequence.IsValid() ? Form("calib%08d", fSequence.GetSequence()) : (const char*)fRuns->GetRunsAsString();
     317    title += Form("calib%08d", fSequence.GetSequence());
    318318    title += "  --";
    319319    fDisplay->SetTitle(title);
     
    13771377// Retrieve the output file written by WriteResult()
    13781378//
    1379 const char* MJCalibration::GetOutputFile() const
    1380 {
    1381     const TString name(GetOutputFileName());
    1382     if (name.IsNull())
    1383         return "";
    1384 
    1385     return Form("%s/%s", fPathOut.Data(), name.Data());
    1386 }
    1387 
    13881379const char* MJCalibration::GetOutputFileName() const
    13891380{
    1390 
    1391   if (fSequence.IsValid())
    1392     return Form("calib%08d.root", fSequence.GetSequence());
    1393   if (!fRuns)
    1394     return "";
    1395  
    1396   return Form("%s-F1.root", (const char*)fRuns->GetRunsAsFileName());
     1381    return Form("%s/calib%08d.root", fPathOut.Data(), fSequence.GetSequence());
    13971382}
    13981383
     
    15971582}
    15981583
    1599 // --------------------------------------------------------------------------
    1600 //
    1601 // Call the ProcessFile(MPedestalCam)
    1602 //
    1603 Bool_t MJCalibration::Process(MPedestalCam &pedcam)
    1604 {
    1605     if (!ReadCalibrationCam())
    1606         return ProcessFile(pedcam);
    1607 
    1608     return kTRUE;
    1609 }
    1610 
    16111584void MJCalibration::InitBlindPixel(MExtractBlindPixel &blindext,
    16121585                                   MHCalibrationChargeBlindCam &blindcam)
    16131586{
    16141587
    1615   Int_t run = fSequence.IsValid() ? fSequence.GetLastRun() : fRuns->GetRuns()[fRuns->GetNumRuns()-1];
     1588  Int_t run = fSequence.GetLastRun();
    16161589 
    16171590  //
     
    16841657// Execute the task list and the eventloop:
    16851658//
    1686 // - Check if there are fRuns, otherwise return
    16871659// - Check the colour of the files in fRuns (FindColor()), otherwise return
    16881660// - Check for consistency between run numbers and number of files
     
    17161688// - WriteResult()
    17171689//
    1718 Bool_t MJCalibration::ProcessFile(MPedestalCam &pedcam)
     1690Bool_t MJCalibration::Process(MPedestalCam &pedcam)
    17191691{
    17201692    if (!fSequence.IsValid())
    17211693    {
    1722         if (!fRuns)
    1723         {
    1724             *fLog << err << "No Runs choosen... abort." << endl;
    1725             return kFALSE;
    1726         }
    1727 
    1728         if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
    1729         {
    1730             *fLog << err << "Number of files found doesn't match number of runs... abort."
    1731                 << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl;
    1732             return kFALSE;
    1733         }
    1734     }
    1735 
    1736     // --------------------------------------------------------------------------------
     1694          *fLog << err << "ERROR - Sequence invalid..." << endl;
     1695          return kFALSE;
     1696    }
    17371697
    17381698    *fLog << inf;
    17391699    fLog->Separator(GetDescriptor());
    1740 
    1741     *fLog << "Calculate MCalibrationCam from ";
    1742     if (fSequence.IsValid())
    1743         *fLog << "Sequence #" << fSequence.GetSequence() << endl;
    1744     else
    1745         *fLog << "Runs " << fRuns->GetRunsAsString() << endl;
    1746     *fLog << endl;
     1700    *fLog << "Calculate calibration constants from Sequence #";
     1701    *fLog << fSequence.GetSequence() << endl << endl;
    17471702
    17481703    // --------------------------------------------------------------------------------
    17491704   
    17501705    if (!CheckEnv())
    1751       return kFALSE;
     1706        return kFALSE;
    17521707
    17531708    // --------------------------------------------------------------------------------
     
    17601715
    17611716    MDirIter iter;
    1762     if (fSequence.IsValid())
    1763     {
    1764         const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, IsUseRawData());
    1765         const Int_t n1 = fSequence.GetNumCalRuns();
    1766         if (n0==0)
     1717    const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, IsUseRawData());
     1718    const Int_t n1 = fSequence.GetNumCalRuns();
     1719    if (n0==0)
     1720    {
     1721        *fLog << err << "ERROR - No input files of sequence found!" << endl;
     1722        return kFALSE;
     1723    }
     1724    if (n0!=n1)
     1725    {
     1726        *fLog << err << "ERROR - Number of files found ("
     1727            << n0 << ") doesn't match number of files in sequence ("
     1728            << n1 << ")" << endl;
     1729        if (fLog->GetDebugLevel()>4)
    17671730        {
    1768             *fLog << err << "ERROR - No input files of sequence found!" << endl;
    1769             return kFALSE;
     1731            *fLog << dbg << "Files which are searched:" << endl;
     1732            iter.Print();
    17701733        }
    1771         if (n0!=n1)
    1772         {
    1773             *fLog << err << "ERROR - Number of files found ("
    1774                   << n0 << ") doesn't match number of files in sequence ("
    1775                   << n1 << ")" << endl;
    1776             if (fLog->GetDebugLevel()>4)
    1777             {
    1778                 *fLog << dbg << "Files which are searched:" << endl;
    1779                 iter.Print();
    1780             }
    1781             return kFALSE;
    1782         }
     1734        return kFALSE;
    17831735    }
    17841736
     
    18341786    if (IsUseRawData())
    18351787    {
    1836         rawread.AddFiles(fSequence.IsValid() ? iter : *fRuns);
     1788        rawread.AddFiles(iter);
    18371789        tlist.AddToList(&rawread);
    18381790    }
     
    18401792    {
    18411793        read.DisableAutoScheme();
    1842         read.AddFiles(fSequence.IsValid() ? iter : *fRuns);
     1794        read.AddFiles(iter);
    18431795        tlist.AddToList(&read);
    18441796    }
     
    18711823    calcalc.SetOutputFile("");
    18721824    timecalc.SetOutputFile("");
    1873 
    1874     if (!fSequence.IsValid())
    1875     {
    1876         calcalc.SetOutputPath(fPathOut);
    1877         calcalc.SetOutputFile(Form("%s-ChargeCalibStat.txt",(const char*)fRuns->GetRunsAsFileName()));
    1878         timecalc.SetOutputPath(fPathOut);
    1879         timecalc.SetOutputFile(Form("%s-ChargeCalibStat.txt",(const char*)fRuns->GetRunsAsFileName()));
    1880     }
    18811825
    18821826    if (IsDebug())
     
    20511995   
    20521996    return kTRUE;
    2053 }
    2054 
    2055 // --------------------------------------------------------------------------
    2056 //
    2057 // Read the following containers from GetOutputFile()
    2058 // - MCalibrationChargeCam
    2059 // - MCalibrationQECam
    2060 // - MBadPixelsCam
    2061 //
    2062 Bool_t MJCalibration::ReadCalibrationCam()
    2063 {
    2064  
    2065   if (IsNoStorage())
    2066     return kFALSE;
    2067 
    2068   const TString fname = GetOutputFile();
    2069  
    2070   if (gSystem->AccessPathName(fname, kFileExists))
    2071   {
    2072       *fLog << err << "Input file " << fname << " doesn't exist." << endl;
    2073       return kFALSE;
    2074   }
    2075 
    2076   *fLog << inf << "Reading from file: " << fname << endl;
    2077 
    2078   TFile file(fname, "READ");
    2079   if (fCalibrationCam.Read()<=0)
    2080   {
    2081       *fLog << err << "Unable to read MCalibrationChargeCam from " << fname << endl;
    2082       return kFALSE;
    2083   }
    2084 
    2085   if (fQECam.Read()<=0)
    2086   {
    2087       *fLog << err << "Unable to read MCalibrationQECam from " << fname << endl;
    2088       return kFALSE;
    2089   }
    2090 
    2091 
    2092   if (file.FindKey("MCalibrationRelTimeCam"))
    2093       if (fRelTimeCam.Read()<=0)
    2094       {
    2095           *fLog << err << "Unable to read MCalibrationRelTimeCam from " << fname << endl;
    2096           return kFALSE;
    2097       }
    2098 
    2099   if (file.FindKey("MBadPixelsCam"))
    2100   {
    2101       MBadPixelsCam bad;
    2102       if (bad.Read()<=0)
    2103       {
    2104           *fLog << err << "Unable to read MBadPixelsCam from " << fname << endl;
    2105           return kFALSE;
    2106       }
    2107       fBadPixels.Merge(bad);
    2108   }
    2109 
    2110   if (fDisplay /*&& !fDisplay->GetCanvas("Pedestals")*/) // FIXME!
    2111       fDisplay->Read();
    2112 
    2113   return kTRUE;
    21141997}
    21151998
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.h

    r6913 r6979  
    161161  MJCalibration(const char *name=NULL, const char *title=NULL);
    162162 
    163   const char* GetOutputFile() const;
    164  
    165163  MCalibrationIntensityChargeCam  &GetIntensCalibrationCam() { return fIntensCalibCam;   }
    166164  MCalibrationIntensityRelTimeCam &GetIntensRelTimeCam()     { return fIntensRelTimeCam; }
     
    199197
    200198  // Precessing
    201   Bool_t ReadCalibrationCam();
    202   Bool_t ProcessFile(MPedestalCam &pedcam);
    203199  Bool_t Process(MPedestalCam &pedcam);
    204200
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r6978 r6979  
    354354}
    355355
    356 Bool_t MJCut::ProcessFile(const MDataSet &set)
     356Bool_t MJCut::Process(const MDataSet &set)
    357357{
    358358    if (!set.IsValid())
  • trunk/MagicSoft/Mars/mjobs/MJCut.h

    r6978 r6979  
    4343    ~MJCut();
    4444
    45     Bool_t ProcessFile(const MDataSet &set);
     45    Bool_t Process(const MDataSet &set);
    4646
    4747    void EnableStorageOfSummary(Bool_t b=kTRUE)  { fStoreSummary = b; } // See SetNameSummary
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6906 r6979  
    148148}
    149149
    150 const char* MJPedestal::GetOutputFile() const
    151 {
    152     const TString name(GetOutputFileName());
    153     if (name.IsNull())
    154         return "";
    155 
    156     return Form("%s/%s", fPathOut.Data(), name.Data());
    157 }
    158 
    159150const char* MJPedestal::GetOutputFileName() const
    160151{
    161 
    162   if (fSequence.IsValid())
    163152    return Form("pedest%08d.root", fSequence.GetSequence());
    164  
    165   if (!fRuns)
    166     return "";
    167  
    168   return Form("%s-F0.root", (const char*)fRuns->GetRunsAsFileName());
    169 }
    170 
    171 //---------------------------------------------------------------------------------
    172 //
    173 // Try to read an existing MPedestalCam from a previously created output file.
    174 // If found, also an MBadPixelsCam and the corresponding display is read.
    175 //
    176 // In case of Storage type "kNoStorage" or if the file is not found or the
    177 // MPedestalCam cannot be read, return kFALSE, otherwise kTRUE.
    178 //
    179 Bool_t MJPedestal::ReadPedestalCam()
    180 {
    181     const TString fname = GetOutputFile();
    182 
    183     const Bool_t fileexist = !gSystem->AccessPathName(fname, kFileExists);
    184     if (!fileexist)
    185       {
    186         *fLog << inf << "Input file " << fname << " not found, will create pedestals" << endl;
    187         return kFALSE;
    188       }
    189 
    190     *fLog << inf << "Reading pedestals from file: " << fname << endl;
    191 
    192     TFile file(fname, "READ");
    193     if (fPedestalCamIn.Read()<=0)
    194     {
    195         *fLog << err << "Unable to read incoming MPedestalCam from " << fname << endl;
    196         return kFALSE;
    197     }
    198 
    199     if (fPedestalCamOut.Read()<=0)
    200     {
    201         *fLog << err << "Unable to read outgoing MPedestalCam from " << fname << endl;
    202         return kFALSE;
    203     }
    204 
    205     if (file.FindKey("MBadPixelsCam"))
    206     {
    207         MBadPixelsCam bad;
    208         if (bad.Read()<=0)
    209         {
    210             *fLog << err << "Unable to read MBadPixelsCam from " << fname << endl;
    211             return kFALSE;
    212         }
    213         fBadPixels.Merge(bad);
    214     }
    215 
    216     if (fDisplay && !fDisplay->GetCanvas("Pedestals"))
    217         fDisplay->Read();
    218 
    219     return kTRUE;
    220153}
    221154
     
    243176}
    244177
    245 Bool_t MJPedestal::WriteExtractor() const
    246 {
    247 
    248   const TString name  = Form("pedy%08d.root",fSequence.GetSequence());
    249   const TString fname = Form("%s/%s",fPathIn.Data(),name.Data());
    250 
    251   *fLog << inf << "Updating extractor in file: " << fname << endl;
    252 
    253   TFile file(fname, fOverwrite?"RECREATE":"NEW");
    254   if (!file.IsOpen())
    255     {
    256       *fLog << err << dbginf << "ERROR - Could not open file " << fname << endl;
    257       *fLog << err << dbginf << "Maybe, file " << fname << " already exists, call callisto with option -f then." << endl;
    258       return kFALSE;
    259     }
    260 
    261   TObjArray cont;
    262   cont.Add(fExtractor);
    263 
    264   return WriteContainer(cont);
    265 }
    266 
    267178//---------------------------------------------------------------------------------
    268179//
     
    280191    TString title = fDisplay->GetTitle();
    281192    title += "--  Pedestal ";
    282     if (fSequence.IsValid())
    283         title += fSequence.GetName();
    284     else
    285         if (fRuns)  // FIXME: What to do if an environmentfile was used?
    286             title += fRuns->GetRunsAsString();
     193    title += fSequence.GetName();
    287194    title += "  --";
    288195    fDisplay->SetTitle(title);
     
    902809    cont.Add(&fBadPixels);
    903810
    904     return WriteContainer(cont, GetOutputFileName(),fOverwrite?"RECREATE":"NEW");
     811    return WriteContainer(cont, GetOutputFileName(), fOverwrite?"RECREATE":"NEW");
    905812}
    906813
    907814Bool_t MJPedestal::Process()
    908815{
    909     if (!ReadPedestalCam())
    910         return ProcessFile();
    911 
    912     return kTRUE;
    913 }
    914 
    915 Bool_t MJPedestal::ProcessFile()
    916 {
    917816    if (!fSequence.IsValid())
    918817    {
    919         if (!fRuns)
    920         {
    921             *fLog << err << "Neither AddRuns nor SetSequence nor SetEnv was called... abort." << endl;
    922             return kFALSE;
    923         }
    924         if (fRuns && fRuns->GetNumRuns() != fRuns->GetNumEntries())
    925         {
    926             *fLog << err << "Number of files found doesn't match number of runs... abort."
    927                 << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl;
    928             return kFALSE;
    929         }
    930     }
     818          *fLog << err << "ERROR - Sequence invalid..." << endl;
     819          return kFALSE;
     820    }
     821
     822    *fLog << inf;
     823    fLog->Separator(GetDescriptor());
     824    *fLog << "Calculate pedestal from Sequence #";
     825    *fLog << fSequence.GetSequence() << endl << endl;
    931826
    932827    if (!CheckEnv())
     
    940835    fLog->Separator(GetDescriptor());
    941836    *fLog << "Calculate MPedestalCam from " << type << "-runs ";
    942     if (fSequence.IsValid())
    943         *fLog << fSequence.GetName() << endl;
    944     else
    945         if (fRuns)
    946             *fLog << fRuns->GetRunsAsString() << endl;
    947         else
    948             *fLog << "in Resource File." << endl;
     837    *fLog << fSequence.GetName() << endl;
    949838    *fLog << endl;
    950839
     
    987876    if (IsUseRawData())
    988877    {
    989         if (fRuns || fSequence.IsValid())
    990             rawread.AddFiles(fSequence.IsValid() ? iter : *fRuns);
     878        rawread.AddFiles(iter);
    991879        tlist.AddToList(&rawread);
    992880    }
     
    994882    {
    995883        read.DisableAutoScheme();
    996         if (fRuns || fSequence.IsValid())
    997           read.AddFiles(fSequence.IsValid() ? iter : *fRuns);
     884        read.AddFiles(iter);
    998885        tlist.AddToList(&read);
    999886    }
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.h

    r6845 r6979  
    9999    const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
    100100
    101     const char*  GetOutputFile() const;
    102 
    103101    //    const MHPedestalCam &GetPedestalHist() const { return fPedestalHist;  }
    104102
    105103    const Bool_t IsUseData() const { return fExtractType == kUseData; }
    106104
    107     Bool_t Process    ();
    108     Bool_t ProcessFile();
     105    Bool_t Process();
    109106
    110107    void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
Note: See TracChangeset for help on using the changeset viewer.