00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "cspad_mod/CsPad2x2ElementV1.h"
00017
00018
00019
00020
00021 #include <algorithm>
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 namespace cspad_mod {
00036
00037
00038
00039
00040 CsPad2x2ElementV1::CsPad2x2ElementV1 (const Psana::CsPad2x2::ElementV1& elem,
00041 int16_t* data,
00042 const float* common_mode)
00043 : Psana::CsPad2x2::ElementV1()
00044 , m_virtual_channel(elem.virtual_channel())
00045 , m_lane(elem.lane())
00046 , m_tid(elem.tid())
00047 , m_acq_count(elem.acq_count())
00048 , m_op_code(elem.op_code())
00049 , m_quad(elem.quad())
00050 , m_seq_count(elem.seq_count())
00051 , m_ticks(elem.ticks())
00052 , m_fiducials(elem.fiducials())
00053 , m_sb_temp()
00054 , m_frame_type(elem.frame_type())
00055 , m_data(data)
00056 , m_common_mode()
00057 {
00058
00059 const ndarray<const uint16_t, 1>& sb_temp = elem.sb_temp();
00060 std::copy(sb_temp.begin(), sb_temp.end(), m_sb_temp);
00061
00062
00063 const ndarray<const int16_t, 3>& edata = elem.data();
00064 std::copy(edata.shape(), edata.shape()+3, m_data_shape);
00065
00066
00067 std::copy(common_mode, common_mode+2, m_common_mode);
00068 }
00069
00070
00071
00072
00073 CsPad2x2ElementV1::~CsPad2x2ElementV1 ()
00074 {
00075 delete [] m_data;
00076 }
00077
00078
00079
00080 }