CSPadPixCoords/include/PixCoordsQuad.h

Go to the documentation of this file.
00001 #ifndef CSPADPIXCOORDS_PIXCOORDSQUAD_H
00002 #define CSPADPIXCOORDS_PIXCOORDSQUAD_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: PixCoordsQuad.h 8040 2014-04-19 01:00:36Z dubrovin@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //      Class PixCoordsQuad.
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 
00017 //----------------------
00018 // Base Class Headers --
00019 //----------------------
00020 
00021 //-------------------------------
00022 // Collaborating Class Headers --
00023 //-------------------------------
00024 #include "CSPadPixCoords/PixCoords2x1.h"
00025 #include "PSCalib/CSPadCalibPars.h"
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 PixCoordsQuad class defines the quad pixel coordinates in its local frame.
00043  *
00044  *  Use the same frame like in optical measurement, but in "matrix style" geometry:
00045  *  X axis goes along rows (from top to bottom)
00046  *  Y axis goes along columns (from left to right)
00047  *
00048  *  This software was developed for the LCLS project.  If you use all or 
00049  *  part of it, please give an appropriate acknowledgment.
00050  *
00051  *  @see CSPadImageProducer, PixCoordsTest
00052  *
00053  *  @version $Id: PixCoordsQuad.h 8040 2014-04-19 01:00:36Z dubrovin@SLAC.STANFORD.EDU $
00054  *
00055  *  @author Mikhail S. Dubrovin
00056  */
00057 
00058 class PixCoordsQuad  {
00059 public:
00060 
00061   enum { NQuadsInCSPad = 4 };
00062   enum { N2x1InQuad    = Psana::CsPad::SectorsPerQuad     }; // 8
00063   enum { NCols2x1      = Psana::CsPad::ColumnsPerASIC     }; // 185
00064   enum { NRows2x1      = Psana::CsPad::MaxRowsPerASIC * 2 }; // 194*2 = 388
00065 
00066   // Default constructor
00067   /**
00068    *  @brief PixCoordsQuad class fills and provides access to the quad pixel coordinates.
00069    *  
00070    *  Fills/holds/provides access to the array of the quad coordinates, indexed by the quad, section, row, and column.
00071    *  @param[in] pix_coords_2x1  Pointer to the object with 2x1 section pixel coordinates.
00072    *  @param[in] cspad_calibpar  Pointer to the object with geometry calibration parameters.
00073    *  @param[in] tiltIsApplied   Boolean key indicating if the tilt angle correction for 2x1 and Quads is applied
00074    */
00075   PixCoordsQuad ( PixCoords2x1 *pix_coords_2x1,  PSCalib::CSPadCalibPars *cspad_calibpar, bool tiltIsApplied = true ) ;
00076 
00077   // Destructor
00078   virtual ~PixCoordsQuad () ;
00079 
00080   void fillAllQuads();
00081   void fillOneQuad               (uint32_t quad);
00082   void fillOneSectionInQuad      (uint32_t quad, uint32_t sect, double xcenter, double ycenter, double zcenter, double rotation);
00083   void fillOneSectionTiltedInQuad(uint32_t quad, uint32_t sect, double xcenter, double ycenter, double zcenter, double rotation, double tilt);
00084   void setConstXYMinMax();
00085 
00086   /**
00087    *  Access methods return the coordinate for indicated axis, quad, section, row, and column
00088    *  indexes after the quad rotation by n*90 degree.
00089    *  The pixel coordinates can be returned in um(micrometers) and pix(pixels).
00090    */
00091   double getPixCoorRot000_um (CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00092   double getPixCoorRot090_um (CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00093   double getPixCoorRot180_um (CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00094   double getPixCoorRot270_um (CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00095 
00096   double getPixCoorRot000_pix(CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00097   double getPixCoorRot090_pix(CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00098   double getPixCoorRot180_pix(CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00099   double getPixCoorRot270_pix(CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00100 
00101   double getPixCoorRotN90_um (CSPadPixCoords::PixCoords2x1::ORIENTATION orient, 
00102                              CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00103   double getPixCoorRotN90_pix(CSPadPixCoords::PixCoords2x1::ORIENTATION orient, 
00104                              CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00105   double getPixCoorRotN90    (CSPadPixCoords::PixCoords2x1::UNITS units,
00106                              CSPadPixCoords::PixCoords2x1::ORIENTATION orient, 
00107                              CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned quad, unsigned sect, unsigned row, unsigned col) ;
00108 
00109 protected:
00110 
00111 private:
00112 
00113   // Data members
00114   CSPadPixCoords::PixCoords2x1::COORDINATE XCOOR;
00115   CSPadPixCoords::PixCoords2x1::COORDINATE YCOOR;
00116   CSPadPixCoords::PixCoords2x1::COORDINATE ZCOOR;
00117 
00118   double m_degToRad; 
00119 
00120   PixCoords2x1            *m_pix_coords_2x1;  
00121   PSCalib::CSPadCalibPars *m_cspad_calibpar;  
00122   bool                     m_tiltIsApplied;
00123 
00124   double m_coor_x[NQuadsInCSPad][N2x1InQuad][NCols2x1][NRows2x1];
00125   double m_coor_y[NQuadsInCSPad][N2x1InQuad][NCols2x1][NRows2x1];
00126 
00127   double m_coor_x_min[NQuadsInCSPad];
00128   double m_coor_x_max[NQuadsInCSPad];
00129   double m_coor_y_min[NQuadsInCSPad];
00130   double m_coor_y_max[NQuadsInCSPad];
00131 
00132   // Copy constructor and assignment are disabled by default
00133   PixCoordsQuad ( const PixCoordsQuad& ) ;
00134   PixCoordsQuad& operator = ( const PixCoordsQuad& ) ;
00135 
00136 };
00137 
00138 } // namespace CSPadPixCoords
00139 
00140 #endif // CSPADPIXCOORDS_PIXCOORDSQUAD_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7