cspad_mod/src/CsPad2x2ElementV1.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: CsPad2x2ElementV1.cpp 5253 2013-01-30 17:56:28Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class CsPad2x2ElementV1...
00007 //
00008 // Author List:
00009 //      Andy Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "cspad_mod/CsPad2x2ElementV1.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 #include <algorithm>
00022 
00023 //-------------------------------
00024 // Collaborating Class Headers --
00025 //-------------------------------
00026 
00027 //-----------------------------------------------------------------------
00028 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00029 //-----------------------------------------------------------------------
00030 
00031 //              ----------------------------------------
00032 //              -- Public Function Member Definitions --
00033 //              ----------------------------------------
00034 
00035 namespace cspad_mod {
00036 
00037 //----------------
00038 // Constructors --
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   // copy sb_temp array
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   // copy data shape
00063   const ndarray<const int16_t, 3>& edata = elem.data();
00064   std::copy(edata.shape(), edata.shape()+3, m_data_shape);
00065 
00066   // copy common_mode array
00067   std::copy(common_mode, common_mode+2, m_common_mode);
00068 }
00069 
00070 //--------------
00071 // Destructor --
00072 //--------------
00073 CsPad2x2ElementV1::~CsPad2x2ElementV1 ()
00074 {
00075   delete [] m_data;
00076 }
00077 
00078 
00079 
00080 } // namespace cspad_mod

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7