00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "H5DataTypes/LusiIpmFexV1.h"
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "hdf5pp/CompoundType.h"
00026 #include "hdf5pp/TypeTraits.h"
00027 #include "H5DataTypes/H5DataUtils.h"
00028
00029
00030
00031
00032
00033
00034
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 }