H5DataTypes/src/LusiIpmFexV1.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: LusiIpmFexV1.cpp 6826 2013-09-24 21:08:01Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class LusiIpmFexV1...
00007 //
00008 // Author List:
00009 //      Andrei Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "H5DataTypes/LusiIpmFexV1.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 #include "hdf5pp/CompoundType.h"
00026 #include "hdf5pp/TypeTraits.h"
00027 #include "H5DataTypes/H5DataUtils.h"
00028 
00029 //-----------------------------------------------------------------------
00030 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00031 //-----------------------------------------------------------------------
00032 
00033 //              ----------------------------------------
00034 //              -- Public Function Member Definitions --
00035 //              ----------------------------------------
00036 
00037 namespace H5DataTypes {
00038 
00039 LusiIpmFexV1::LusiIpmFexV1 ( const XtcType& data )
00040   : sum(data.sum())
00041   , xpos(data.xpos())
00042   , ypos(data.ypos())
00043 {
00044   const ndarray<const float, 1>& ndchannel = data.channel();
00045   std::copy(ndchannel.begin(), ndchannel.end(), channel);
00046 }
00047 
00048 hdf5pp::Type
00049 LusiIpmFexV1::stored_type()
00050 {
00051   return native_type() ;
00052 }
00053 
00054 hdf5pp::Type
00055 LusiIpmFexV1::native_type()
00056 {
00057   hdf5pp::CompoundType type = hdf5pp::CompoundType::compoundType<LusiIpmFexV1>() ;
00058   type.insert_native<float>( "channel", offsetof(LusiIpmFexV1, channel), LusiIpmFexV1::CHSIZE ) ;
00059   type.insert_native<float>( "sum", offsetof(LusiIpmFexV1, sum) ) ;
00060   type.insert_native<float>( "xpos", offsetof(LusiIpmFexV1, xpos) ) ;
00061   type.insert_native<float>( "ypos", offsetof(LusiIpmFexV1, ypos) ) ;
00062 
00063   return type ;
00064 }
00065 
00066 } // namespace H5DataTypes

Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7