cspad_mod/include/DataT.h

Go to the documentation of this file.
00001 #ifndef CSPAD_MOD_DATAT_H
00002 #define CSPAD_MOD_DATAT_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: DataT.h 2470 2011-10-05 00:01:27Z salnikov@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //      Class DataT.
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 #include <vector>
00017 
00018 //----------------------
00019 // Base Class Headers --
00020 //----------------------
00021 #include "psddl_psana/cspad.ddl.h"
00022 
00023 //-------------------------------
00024 // Collaborating Class Headers --
00025 //-------------------------------
00026 
00027 //------------------------------------
00028 // Collaborating Class Declarations --
00029 //------------------------------------
00030 
00031 //              ---------------------
00032 //              -- Class Interface --
00033 //              ---------------------
00034 
00035 namespace cspad_mod {
00036 
00037 /// @addtogroup cspad_mod
00038 
00039 /**
00040  *  @ingroup cspad_mod
00041  *
00042  *  @brief Implementation of Psana::CsPad::DataT interface for
00043  *  calibrated data.
00044  *
00045  *  This software was developed for the LCLS project.  If you use all or 
00046  *  part of it, please give an appropriate acknowledgment.
00047  *
00048  *  @version $Id: DataT.h 2470 2011-10-05 00:01:27Z salnikov@SLAC.STANFORD.EDU $
00049  *
00050  *  @author Andy Salnikov
00051  */
00052 
00053 template <typename DataType, typename ElemType>
00054 class DataT : public DataType {
00055 public:
00056 
00057   typedef DataType IfaceType;
00058 
00059   // Default constructor
00060   DataT () ;
00061 
00062   // Destructor
00063   virtual ~DataT () ;
00064 
00065   /// Append new element, ownership is taken by this object
00066   void append(ElemType* elem) { m_elements.push_back(elem); }
00067 
00068   virtual const ElemType& quads(uint32_t i0) const { return *m_elements[i0]; }
00069   /** Method which returns the shape (dimensions) of the data returned by quads() method. */
00070   virtual std::vector<int> quads_shape() const { return std::vector<int>(1, m_elements.size()); }
00071 
00072 protected:
00073 
00074 private:
00075 
00076   std::vector<ElemType*> m_elements;
00077 
00078   // Copy constructor and assignment are disabled by default
00079   DataT ( const DataT& ) ;
00080   DataT& operator = ( const DataT& ) ;
00081 
00082 };
00083 
00084 typedef DataT<Psana::CsPad::DataV1, Psana::CsPad::ElementV1> DataV1;
00085 typedef DataT<Psana::CsPad::DataV2, Psana::CsPad::ElementV2> DataV2;
00086 
00087 } // namespace cspad_mod
00088 
00089 #endif // CSPAD_MOD_DATAT_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7