CSPadPixCoords/include/PixCoordsCSPad.h

Go to the documentation of this file.
00001 #ifndef CSPADPIXCOORDS_PIXCOORDSCSPAD_H
00002 #define CSPADPIXCOORDS_PIXCOORDSCSPAD_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: PixCoordsCSPad.h 8040 2014-04-19 01:00:36Z dubrovin@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //      Class PixCoordsCSPad.
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 
00017 //----------------------
00018 // Base Class Headers --
00019 //----------------------
00020 #include "CSPadPixCoords/PixCoordsQuad.h"
00021 #include "PSCalib/CSPadCalibPars.h"
00022 
00023 //-------------------------------
00024 // Collaborating Class Headers --
00025 //-------------------------------
00026 
00027 //------------------------------------
00028 // Collaborating Class Declarations --
00029 //------------------------------------
00030 
00031 //              ---------------------
00032 //              -- Class Interface --
00033 //              ---------------------
00034 
00035 namespace CSPadPixCoords {
00036 
00037 /// @addtogroup CSPadPixCoords
00038 
00039 /**
00040  *  @ingroup CSPadPixCoords
00041  *
00042  *  @brief PixCoordsCSPad class fills and provides access to the CSPad pixel coordinates.
00043  *  
00044  *  Fills/holds/provides access to the arrays of the CSPad pixel coordinates, 
00045  *  using the quad, section, row, and column indexes.
00046  *
00047  *  This software was developed for the LCLS project.  If you use all or 
00048  *  part of it, please give an appropriate acknowledgment.
00049  *
00050  *  @see CSPadImageProducer, PixCoordsTest
00051  *
00052  *  @version $Id: PixCoordsCSPad.h 8040 2014-04-19 01:00:36Z dubrovin@SLAC.STANFORD.EDU $
00053  *
00054  *  @author Mikhail S. Dubrovin
00055  */
00056 
00057 
00058 class PixCoordsCSPad  {
00059 public:
00060 
00061   enum { NQuadsInCSPad = 4 };
00062   enum { N2x1InQuad    = 8 };
00063   enum { NCols2x1      = Psana::CsPad::ColumnsPerASIC     }; // 185
00064   enum { NRows2x1      = Psana::CsPad::MaxRowsPerASIC * 2 }; // 194*2 = 388
00065 
00066   /**
00067    *  @brief PixCoordsCSPad class fills and provides access to the CSPad pixel coordinates.
00068    *  
00069    *  Fills/holds/provides access to the array of the quad coordinates, indexed by the quad, section, row, and column.
00070    *  @param[in] pix_coords_quad  Pointer to the object with quad pixel coordinates.
00071    *  @param[in] cspad_calibpar   Pointer to the object with geometry calibration parameters.
00072    *  @param[in] tiltIsApplied    Boolean key indicating if the tilt angle correction for 2x1 and Quads is applied
00073    */
00074   PixCoordsCSPad ( PixCoordsQuad *pix_coords_quad,  PSCalib::CSPadCalibPars *cspad_calibpar, bool tiltIsApplied = true ) ;
00075 
00076   /// Destructor
00077   virtual ~PixCoordsCSPad () ;
00078 
00079   void fillAllQuadCoordsInCSPad() ;
00080   void fillOneQuadCoordsInCSPad(uint32_t quad) ;
00081   void fillOneQuadTiltedCoordsInCSPad(uint32_t quad) ;
00082   void setConstXYMinMax() ;
00083   void fillArrsOfCSPadPixCoords() ;
00084 
00085   /// Fill CSPAD pixel coordinate array using center_global type of constants from class PixCoordsCSPadV2
00086   void fillArrsOfCSPadPixCoordsFromCenterGlobal() ;
00087 
00088   /**
00089    *  @brief Access methods return the CSPad pixel coordinate for indicated axis, quad, section, row, and column indexes.
00090    *  The pixel coordinates can be returned in um(micrometers), pix(pixels), or int(integer pixel index).
00091    */
00092   double getPixCoor_um (CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00093   double getPixCoor_pix(CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00094   double getPixCoor_int(CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00095 
00096   /**
00097    *  @brief The group of methods which provide the direct access to coordinate arrays.
00098    */
00099   double*   getPixCoorArrX_um (){return &m_coor_x    [0][0][0][0];}
00100   double*   getPixCoorArrY_um (){return &m_coor_y    [0][0][0][0];}
00101   double*   getPixCoorArrX_pix(){return &m_coor_x_pix[0][0][0][0];}
00102   double*   getPixCoorArrY_pix(){return &m_coor_y_pix[0][0][0][0];}
00103   uint32_t* getPixCoorArrX_int(){return &m_coor_x_int[0][0][0][0];}
00104   uint32_t* getPixCoorArrY_int(){return &m_coor_y_int[0][0][0][0];}
00105 
00106 private:
00107 
00108   // Data members
00109   CSPadPixCoords::PixCoords2x1::COORDINATE XCOOR;
00110   CSPadPixCoords::PixCoords2x1::COORDINATE YCOOR;
00111   CSPadPixCoords::PixCoords2x1::COORDINATE ZCOOR;
00112 
00113   double m_degToRad; 
00114 
00115   PixCoordsQuad           *m_pix_coords_quad;  
00116   PSCalib::CSPadCalibPars *m_cspad_calibpar;  
00117   bool                     m_tiltIsApplied;
00118 
00119   double   m_coor_x    [NQuadsInCSPad][N2x1InQuad][NCols2x1][NRows2x1];
00120   double   m_coor_y    [NQuadsInCSPad][N2x1InQuad][NCols2x1][NRows2x1];
00121   double   m_coor_x_pix[NQuadsInCSPad][N2x1InQuad][NCols2x1][NRows2x1];
00122   double   m_coor_y_pix[NQuadsInCSPad][N2x1InQuad][NCols2x1][NRows2x1];
00123   uint32_t m_coor_x_int[NQuadsInCSPad][N2x1InQuad][NCols2x1][NRows2x1];
00124   uint32_t m_coor_y_int[NQuadsInCSPad][N2x1InQuad][NCols2x1][NRows2x1];
00125 
00126   double   m_xmin_quad [NQuadsInCSPad]; 
00127   double   m_ymin_quad [NQuadsInCSPad]; 
00128 
00129   double m_coor_x_min;
00130   double m_coor_y_min;
00131   double m_coor_x_max;
00132   double m_coor_y_max;
00133 
00134   /// Copy constructor is disabled by default
00135   PixCoordsCSPad ( const PixCoordsCSPad& ) ;
00136   /// Assignment constructor is disabled by default
00137   PixCoordsCSPad& operator = ( const PixCoordsCSPad& ) ;
00138 
00139   enum { NX_CSPAD = 1750,   // Image sizes are used to get constant m_coor_y_max and m_coor_y_max 
00140          NY_CSPAD = 1750 }; // In this class we do not need in these image sizes...
00141 };
00142 
00143 } // namespace CSPadPixCoords
00144 
00145 #endif // CSPADPIXCOORDS_PIXCOORDSCSPAD_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7