CSPadPixCoords/include/PixCoordsCSPad2x2.h

Go to the documentation of this file.
00001 #ifndef CSPADPIXCOORDS_PIXCOORDSCSPAD2X2_H
00002 #define CSPADPIXCOORDS_PIXCOORDSCSPAD2X2_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: PixCoordsCSPad2x2.h 8040 2014-04-19 01:00:36Z dubrovin@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //      Class PixCoordsCSPad2x2.
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/CSPad2x2CalibPars.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 PixCoordsCSPad2x2 class defines the CSPad2x2 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: PixCoordsCSPad2x2.h 8040 2014-04-19 01:00:36Z dubrovin@SLAC.STANFORD.EDU $
00054  *
00055  *  @author Mikhail S. Dubrovin
00056  */
00057 
00058 class PixCoordsCSPad2x2  {
00059 public:
00060 
00061   enum { N2x1InDet = 2 }; 
00062   enum { NCols2x1  = Psana::CsPad::ColumnsPerASIC     }; // 185
00063   enum { NRows2x1  = Psana::CsPad::MaxRowsPerASIC * 2 }; // 194*2 = 388
00064 
00065   // Default constructor
00066   /**
00067    *  @brief PixCoordsCSPad2x2 class fills and provides access to the CSPad2x2 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_2x1  Pointer to the object with 2x1 section pixel coordinates.
00071    *  @param[in] tiltIsApplied   Boolean key indicating if the tilt angle correction for 2x1 in 2x2 is applied.
00072    *             Currently is not used, because tilts for 2x1 in 2x2 are not presented in calibtration parameters. 
00073    */
00074   PixCoordsCSPad2x2 (PixCoords2x1 *pix_coords_2x1, bool tiltIsApplied = false);
00075   PixCoordsCSPad2x2 (PixCoords2x1 *pix_coords_2x1, PSCalib::CSPad2x2CalibPars *cspad_calibpar, bool tiltIsApplied = false);
00076 
00077   // Destructor
00078   virtual ~PixCoordsCSPad2x2 () ;
00079 
00080   void fillPixelCoordinateArrays();
00081 
00082   void fillOneSectionInDet      (uint32_t sect, double xcenter, double ycenter, double zcenter, double rotation);
00083   void fillOneSectionTiltedInDet(uint32_t sect, double xcenter, double ycenter, double zcenter, double rotation, double tilt);
00084   void resetXYOriginAndMinMax();
00085   void printXYLimits();
00086 
00087   /**
00088    *  Access methods return the coordinate for indicated axis, quad, section, row, and column
00089    *  indexes after the quad rotation by n*90 degree.
00090    *  The pixel coordinates can be returned in um(micrometers) and pix(pixels).
00091    */
00092   double getPixCoor_um (CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned sect, unsigned row, unsigned col) ;
00093   double getPixCoor_pix(CSPadPixCoords::PixCoords2x1::COORDINATE icoor, unsigned sect, unsigned row, unsigned col) ;
00094   double get_x_min() { return m_coor_x_min; };
00095   double get_x_max() { return m_coor_x_max; };
00096   double get_y_min() { return m_coor_y_min; };
00097   double get_y_max() { return m_coor_y_max; };
00098 
00099 protected:
00100 
00101 private:
00102 
00103   // Data members
00104   CSPadPixCoords::PixCoords2x1::COORDINATE XCOOR;
00105   CSPadPixCoords::PixCoords2x1::COORDINATE YCOOR;
00106   CSPadPixCoords::PixCoords2x1::COORDINATE ZCOOR;
00107 
00108   double m_degToRad; 
00109 
00110   PixCoords2x1               *m_pix_coords_2x1;  
00111   PSCalib::CSPad2x2CalibPars *m_cspad2x2_calibpars;  
00112   bool                        m_tiltIsApplied;
00113 
00114   double m_coor_x[NCols2x1][NRows2x1][N2x1InDet];
00115   double m_coor_y[NCols2x1][NRows2x1][N2x1InDet];
00116 
00117   double m_coor_x_min;
00118   double m_coor_x_max;
00119   double m_coor_y_min;
00120   double m_coor_y_max;
00121 
00122   // Copy constructor and assignment are disabled by default
00123   PixCoordsCSPad2x2 ( const PixCoordsCSPad2x2& ) ;
00124   PixCoordsCSPad2x2& operator = ( const PixCoordsCSPad2x2& ) ;
00125 };
00126 
00127 } // namespace CSPadPixCoords
00128 
00129 #endif // CSPADPIXCOORDS_PIXCOORDSCSPAD2X2_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7