Changeset 18123 for trunk/Mars


Ignore:
Timestamp:
02/12/15 16:26:40 (10 years ago)
Author:
tbretz
Message:
Added interface to rread and write constants as fits file.
Location:
trunk/Mars/mdrs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mdrs/MDrsCalibrationTime.cc

    r14922 r18123  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  2013 <mailto:thomas.bretz@epfl.ch>
     18!   Author(s): Thomas Bretz  2013 <mailto:tbretz@physik.rwth-aachen.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2013
     20!   Copyright: MAGIC Software Development, 2000-2015
    2121!
    2222!
     
    4848    return true;
    4949}
     50
     51bool MDrsCalibrationTime::ReadFits(const string &fname)
     52{
     53    const std::string msg = DrsCalibrateTime::ReadFitsImp(fname);
     54    if (msg.empty())
     55    {
     56        *fLog << inf << "Wrote DRS calibration file " << fname << endl;
     57        return kTRUE;
     58    }
     59
     60    *fLog << err << "Error writing to " << fname << ": " << msg << endl;
     61    return kFALSE;
     62}
     63
     64bool MDrsCalibrationTime::WriteFits(const string &fname) const
     65{
     66    const Bool_t exists = !gSystem->AccessPathName(fname.c_str(), kFileExists);
     67    if (exists)
     68    {
     69        *fLog << err << "File '" << fname << "' already exists." << endl;
     70        return kFALSE;
     71    }
     72
     73    const std::string msg = DrsCalibrateTime::WriteFitsImp(fname);
     74    if (msg.empty())
     75    {
     76        *fLog << inf << "Wrote DRS calibration file " << fname << endl;
     77        return kTRUE;
     78    }
     79
     80    *fLog << err << "Error writing to " << fname << ": " << msg << endl;
     81    return kFALSE;
     82}
  • trunk/Mars/mdrs/MDrsCalibrationTime.h

    r17697 r18123  
    4747    }
    4848
     49    bool ReadFits(const std::string &fname);
     50    bool WriteFits(const std::string &fname) const;
     51
    4952    ClassDef(MDrsCalibrationTime, 2) // A list of histograms storing the Fadc spektrum of one pixel
    5053};
Note: See TracChangeset for help on using the changeset viewer.