psddl_pds2psana/src/acqiris.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: acqiris.cpp 7462 2013-12-22 20:47:39Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class acqiris...
00007 //
00008 // Author List:
00009 //      Andrei Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "psddl_pds2psana/acqiris.ddl.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 
00026 //-----------------------------------------------------------------------
00027 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00028 //-----------------------------------------------------------------------
00029 
00030 //              ----------------------------------------
00031 //              -- Public Function Member Definitions --
00032 //              ----------------------------------------
00033 
00034 namespace psddl_pds2psana {
00035 namespace Acqiris {
00036 
00037 TdcDataV1::TdcDataV1(const boost::shared_ptr<const XtcType>& xtcPtr, size_t xtcSize)
00038   : Psana::Acqiris::TdcDataV1()
00039   , m_xtcObj(xtcPtr)
00040 {
00041   // special constructor for TdcDataV1
00042   // the size of the data array is unknown and needs to be determined from XTC size
00043   size_t nItems = xtcSize / Pds::Acqiris::TdcDataV1_Item::_sizeof();
00044 
00045   typedef ndarray<Psana::Acqiris::TdcDataV1_Item, 1> NDArray;
00046   typedef ndarray<const Pds::Acqiris::TdcDataV1_Item, 1> XtcNDArray;
00047   const XtcNDArray& xtc_ndarr = xtcPtr->data(nItems);
00048   _data_ndarray_storage_ = NDArray(xtc_ndarr.shape());
00049   NDArray::iterator out = _data_ndarray_storage_.begin();
00050   for (unsigned i = 0; i != nItems; ++ i, ++ out) {
00051     *out = pds_to_psana(xtc_ndarr[i]);
00052   }
00053 }
00054 
00055 } // namespace Acqiris
00056 } // namespace psddl_pds2psana

Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7