pdscalibdata/include/CsPadPedestalsV2.h

Go to the documentation of this file.
00001 #ifndef PDSCALIBDATA_CSPADPEDESTALSV2_H
00002 #define PDSCALIBDATA_CSPADPEDESTALSV2_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: CsPadPedestalsV2.h 8034 2014-04-19 00:51:18Z dubrovin@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //      Class CsPadPedestalsV2.
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 #include <string>
00017 
00018 //----------------------
00019 // Base Class Headers --
00020 //----------------------
00021 #include "pdscalibdata/CsPadBaseV2.h" // Quads, Segs, Rows, Cols etc.
00022 #include "pdscalibdata/GlobalMethods.h"
00023 
00024 //-------------------------------
00025 // Collaborating Class Headers --
00026 //-------------------------------
00027 #include "ndarray/ndarray.h"
00028 // #include "pdsdata/psddl/cspad.ddl.h"
00029 
00030 //------------------------------------
00031 // Collaborating Class Declarations --
00032 //------------------------------------
00033 #include "MsgLogger/MsgLogger.h"
00034 
00035 //              ---------------------
00036 //              -- Class Interface --
00037 //              ---------------------
00038 
00039 namespace pdscalibdata {
00040 
00041 /**
00042  *  This software was developed for the LCLS project.  If you use all or 
00043  *  part of it, please give an appropriate acknowledgment.
00044  *
00045  *  @see AdditionalClass
00046  *
00047  *  @version $Id: CsPadPedestalsV2.h 8034 2014-04-19 00:51:18Z dubrovin@SLAC.STANFORD.EDU $
00048  *
00049  *  @author Mikhail Dubrovin
00050  */
00051 
00052 class CsPadPedestalsV2: public CsPadBaseV2 {
00053 public:
00054 
00055   typedef float pars_t;
00056 
00057   /// Default constructor
00058   CsPadPedestalsV2()
00059   : CsPadBaseV2 ()
00060   {
00061     std::fill_n(m_pars, int(Size), pars_t(0)); // All pixels have unit rms by default
00062   }
00063   
00064   /// Read parameters from file
00065   CsPadPedestalsV2 (const std::string& fname)
00066   : CsPadBaseV2 ()
00067   {
00068     load_pars_from_file <pars_t> (fname, "pedestals", Size, m_pars);
00069   }
00070 
00071   /// Destructor
00072   ~CsPadPedestalsV2 (){}
00073 
00074   /// Access parameters
00075   ndarray<pars_t, 4> pedestals() const {
00076     return make_ndarray(m_pars, Quads, Segs, Rows, Cols);
00077   }
00078 
00079   /// Print array of parameters
00080   void  print()
00081   {
00082     MsgLog("CsPadPedestalsV2", info, "pedestals:\n" << pedestals());
00083   }
00084 
00085 protected:
00086 
00087 private:
00088 
00089   /// Data members  
00090   mutable pars_t m_pars[Size];
00091 
00092   //std::string m_comment; 
00093   
00094   /// Copy constructor and assignment are disabled by default
00095   CsPadPedestalsV2 ( const CsPadPedestalsV2& ) ;
00096   CsPadPedestalsV2& operator = ( const CsPadPedestalsV2& ) ;
00097 };
00098 
00099 } // namespace pdscalibdata
00100 
00101 #endif // PDSCALIBDATA_CSPADPEDESTALSV2_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7