Changeset 5236 for trunk


Ignore:
Timestamp:
10/12/04 12:12:52 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5233 r5236  
    2626     - implemented option kNoStorage for neither reading nor writing
    2727       the F0-files to disk.
     28
     29   * mjobs/MJCalibration.[h,cc]
     30     - implemented option SetTimeAndCharge() in order to use the
     31       extractor deriving from MExtractTimeAndCharge, like e.g. the
     32       digital filter.
    2833
    2934
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r5161 r5236  
    200200//
    201201MJCalibration::MJCalibration(const char *name, const char *title)
    202     : fRuns(0), fExtractor(NULL), fTimeExtractor(NULL),
     202    : fRuns(0), fExtractor(NULL), fTimeExtractor(NULL), 
    203203      fColor(MCalibrationCam::kNONE), fDisplayType(kDataCheckDisplay),
    204204      fGeometry("MGeomCamMagic")
     
    16371637
    16381638    MTaskEnv taskenv2("ExtractTime");
    1639     taskenv2.SetDefault(fTimeExtractor ? fTimeExtractor : &timespline);
    1640 
    1641     if (IsRelTimes())
    1642         tlist.AddToList(&taskenv2);
    1643 
     1639    if (!IsTimeAndCharge())
     1640      {
     1641        taskenv2.SetDefault(fTimeExtractor ? fTimeExtractor : &timespline);
     1642   
     1643        if (IsRelTimes())
     1644          tlist.AddToList(&taskenv2);
     1645      }
     1646   
    16441647    //
    16451648    // FIXME: This is not yet implemented in the classes!!!
     
    18391842Bool_t MJCalibration::WriteEventloop(MEvtLoop &evtloop) const
    18401843{
    1841     if (fPathOut.IsNull())
    1842         return kTRUE;
    1843 
    1844     const TString oname(GetOutputFile());
    1845 
    1846     *fLog << inf << "Writing to file: " << oname << endl;
    1847 
    1848     TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9);
    1849     if (!file.IsOpen())
    1850     {
    1851         *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
     1844
     1845  if (IsNoStorage())
     1846    return kTRUE;
     1847
     1848  if (fPathOut.IsNull())
     1849    return kTRUE;
     1850 
     1851  const TString oname(GetOutputFile());
     1852 
     1853  *fLog << inf << "Writing to file: " << oname << endl;
     1854 
     1855  TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9);
     1856  if (!file.IsOpen())
     1857    {
     1858      *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
     1859      return kFALSE;
     1860    }
     1861 
     1862  if (evtloop.Write(fName)<=0)
     1863    {
     1864      *fLog << err << "Unable to write MEvtloop to " << oname << endl;
    18521865        return kFALSE;
    18531866    }
    1854 
    1855     if (evtloop.Write(fName)<=0)
    1856     {
    1857         *fLog << err << "Unable to write MEvtloop to " << oname << endl;
    1858         return kFALSE;
    1859     }
    1860 
    1861     return kTRUE;
     1867 
     1868  return kTRUE;
    18621869}
    18631870
    18641871Bool_t MJCalibration::WriteTasks(MTask *t1, MTask *t2) const
    18651872{
    1866     if (fPathOut.IsNull())
    1867         return kTRUE;
    1868 
    1869     const TString oname(GetOutputFile());
    1870 
    1871     *fLog << inf << "Writing to file: " << oname << endl;
    1872 
    1873     TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9);
    1874     if (!file.IsOpen())
    1875     {
    1876         *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
    1877         return kFALSE;
    1878     }
    1879 
    1880     if (t1 && t1->Write()<=0)
    1881     {
    1882         *fLog << err << "Unable to write " << t1->GetName() << " to " << oname << endl;
    1883         return kFALSE;
    1884     }
    1885     if (t2 && t2->Write()<=0)
    1886     {
    1887         *fLog << err << "Unable to write " << t2->GetName() << " to " << oname << endl;
    1888         return kFALSE;
    1889     }
    1890 
     1873
     1874  if (IsNoStorage())
    18911875    return kTRUE;
     1876
     1877  if (fPathOut.IsNull())
     1878    return kTRUE;
     1879 
     1880  const TString oname(GetOutputFile());
     1881
     1882  *fLog << inf << "Writing to file: " << oname << endl;
     1883 
     1884  TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9);
     1885  if (!file.IsOpen())
     1886    {
     1887      *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
     1888      return kFALSE;
     1889    }
     1890 
     1891  if (t1 && t1->Write()<=0)
     1892    {
     1893      *fLog << err << "Unable to write " << t1->GetName() << " to " << oname << endl;
     1894      return kFALSE;
     1895    }
     1896 
     1897  if (t2 && t2->Write()<=0)
     1898    {
     1899      *fLog << err << "Unable to write " << t2->GetName() << " to " << oname << endl;
     1900      return kFALSE;
     1901    }
     1902 
     1903  return kTRUE;
    18921904}
    18931905
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.h

    r5135 r5236  
    121121      kNoStorage,
    122122      kHistsStorage
    123     };
     123    };                                                 // Possible flags for the storage of results
    124124 
    125125  Byte_t fStorage;                                     // Bit-field for chosen storage type
    126126
    127   enum { kRelTimes, kDataCheck, kDebug, kIntensity };  // Possible flags
     127  enum { kRelTimes, kDataCheck, kDebug, kIntensity, kTimeAndCharge };  // Possible flags
    128128
    129129  Byte_t fFlags;                                       // Bit-field for the flags
     
    134134  Bool_t IsUsePINDiode  () const { return TESTBIT(fDevices,kUsePINDiode);   }
    135135
    136   Bool_t IsRelTimes     () const { return TESTBIT(fFlags,kRelTimes);  }
    137   Bool_t IsDataCheck    () const { return TESTBIT(fFlags,kDataCheck); }
    138   Bool_t IsDebug        () const { return TESTBIT(fFlags,kDebug);     }
    139   Bool_t IsIntensity    () const { return TESTBIT(fFlags,kIntensity); }
     136  Bool_t IsRelTimes     () const { return TESTBIT(fFlags,kRelTimes);       }
     137  Bool_t IsDataCheck    () const { return TESTBIT(fFlags,kDataCheck);      }
     138  Bool_t IsDebug        () const { return TESTBIT(fFlags,kDebug);          }
     139  Bool_t IsIntensity    () const { return TESTBIT(fFlags,kIntensity);      }
     140  Bool_t IsTimeAndCharge() const { return TESTBIT(fFlags,kTimeAndCharge);  } 
    140141
    141142  Bool_t IsNoStorage    () const { return TESTBIT(fStorage,kNoStorage);    }
     
    195196  void SetDebug             ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kDebug)     : CLRBIT(fFlags,kDebug); }
    196197  void SetIntensity         ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kIntensity) : CLRBIT(fFlags,kIntensity); }
     198  void SetTimeAndCharge      ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kTimeAndCharge) : CLRBIT(fFlags,kTimeAndCharge); } 
    197199 
    198200  // Devices
Note: See TracChangeset for help on using the changeset viewer.