00001 #ifndef PDSCALIBDATA_CSPAD2X2COMMONMODEV2_H
00002 #define PDSCALIBDATA_CSPAD2X2COMMONMODEV2_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <string>
00017
00018
00019
00020
00021 #include "pdscalibdata/CsPad2x2BaseV2.h"
00022 #include "pdscalibdata/GlobalMethods.h"
00023
00024
00025
00026
00027 #include "ndarray/ndarray.h"
00028
00029
00030
00031
00032
00033 #include "MsgLogger/MsgLogger.h"
00034
00035
00036
00037
00038
00039 namespace pdscalibdata {
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 class CsPad2x2CommonModeV2: public CsPad2x2BaseV2 {
00053 public:
00054
00055 const static size_t CMSize = 16;
00056
00057 typedef double pars_t;
00058
00059
00060 CsPad2x2CommonModeV2 ()
00061 : CsPad2x2BaseV2 ()
00062 {
00063 std::fill_n(m_pars, int(CMSize), pars_t(0));
00064
00065 m_pars[0] = 1;
00066 m_pars[1] = 25;
00067 m_pars[2] = 10;
00068 }
00069
00070
00071 CsPad2x2CommonModeV2 (const std::string& fname)
00072 : CsPad2x2BaseV2 ()
00073 {
00074 std::fill_n(m_pars, int(CMSize), pars_t(0));
00075 load_pars_from_file <pars_t> (fname, "common_mode", CMSize, m_pars, 2);
00076 }
00077
00078
00079 ~CsPad2x2CommonModeV2 (){}
00080
00081
00082 ndarray<pars_t, 1> common_mode() const {
00083 return make_ndarray(m_pars, CMSize);
00084 }
00085
00086
00087 void print()
00088 {
00089 MsgLog("CsPad2x2CommonModeV2", info, "common_mode:\n" << common_mode());
00090 }
00091
00092 protected:
00093
00094 private:
00095
00096
00097 mutable pars_t m_pars[CMSize];
00098
00099
00100
00101
00102 CsPad2x2CommonModeV2 ( const CsPad2x2CommonModeV2& ) ;
00103 CsPad2x2CommonModeV2& operator = ( const CsPad2x2CommonModeV2& ) ;
00104 };
00105
00106 }
00107
00108 #endif // PDSCALIBDATA_CSPAD2X2COMMONMODEV2_H