pdscalibdata/include/CsPadFilterV1.h

Go to the documentation of this file.
00001 #ifndef PDSCALIBDATA_CSPADFILTERV1_H
00002 #define PDSCALIBDATA_CSPADFILTERV1_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: CsPadFilterV1.h 8034 2014-04-19 00:51:18Z dubrovin@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //      Class CsPadFilterV1.
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 #include <string>
00017 #include <vector>
00018 #include <stdint.h>
00019 
00020 //----------------------
00021 // Base Class Headers --
00022 //----------------------
00023 
00024 //-------------------------------
00025 // Collaborating Class Headers --
00026 //-------------------------------
00027 #include "ndarray/ndarray.h"
00028 
00029 //------------------------------------
00030 // Collaborating Class Declarations --
00031 //------------------------------------
00032 
00033 //              ---------------------
00034 //              -- Class Interface --
00035 //              ---------------------
00036 
00037 namespace pdscalibdata {
00038 
00039 /**
00040  *  CsPad calibration data class which is actually a filter.
00041  *
00042  *  This software was developed for the LCLS project.  If you use all or 
00043  *  part of it, please give an appropriate acknowledgment.
00044  *
00045  *  @see AdditionalClass
00046  *
00047  *  @version $Id: CsPadFilterV1.h 8034 2014-04-19 00:51:18Z dubrovin@SLAC.STANFORD.EDU $
00048  *
00049  *  @author Andrei Salnikov
00050  */
00051 
00052 class CsPadFilterV1  {
00053 public:
00054 
00055   enum FilterMode { 
00056     None = 0,
00057     FullImage = 1
00058   };
00059   
00060   enum { DataSize = 16 };
00061 
00062   // Default constructor, pass-throug
00063   CsPadFilterV1 ();
00064 
00065   /// Read constants from file
00066   CsPadFilterV1 (const std::string& fname) ;
00067 
00068   /// Initialize constants from parameters
00069   CsPadFilterV1 (FilterMode mode, const double data[DataSize]) ;
00070 
00071   // Destructor
00072   ~CsPadFilterV1 () ;
00073 
00074   // access filter mode
00075   FilterMode mode() const { return FilterMode(m_mode); }
00076 
00077   // access filter data
00078   const double* data() const { return m_data; }
00079 
00080   /**
00081    *  Returns yes/no decision for the given data.
00082    *   
00083    *  @param pixelData    Pixel data from cspad, after pedestal (and 
00084    *                      optionally common mode) subtraction
00085    */
00086   bool filter(const ndarray<const int16_t, 3>& pixelData) const;
00087   
00088   /**
00089    *  Returns yes/no decision for the given data.
00090    *
00091    *  @param pixelData    Pixel data from cspad, after pedestal (and
00092    *                      optionally common mode) subtraction
00093    *  @param pixelStatus  Pixel status data
00094    */
00095   bool filter(const ndarray<const int16_t, 3>& pixelData, const ndarray<const uint16_t, 3>& pixelStatus) const;
00096 
00097 protected:
00098 
00099 private:
00100 
00101   // Data members
00102   // Data members  
00103   uint32_t m_mode;
00104   double m_data[DataSize];
00105 
00106 };
00107 
00108 } // namespace pdscalibdata
00109 
00110 #endif // PDSCALIBDATA_CSPADFILTERV1_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7