00001 #ifndef CSPADPIXCOORDS_PIXCOORDSQUAD_H
00002 #define CSPADPIXCOORDS_PIXCOORDSQUAD_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "CSPadPixCoords/PixCoords2x1.h"
00025 #include "PSCalib/CSPadCalibPars.h"
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 namespace CSPadPixCoords {
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 class PixCoordsQuad {
00059 public:
00060
00061 enum { NQuadsInCSPad = 4 };
00062 enum { N2x1InQuad = Psana::CsPad::SectorsPerQuad };
00063 enum { NCols2x1 = Psana::CsPad::ColumnsPerASIC };
00064 enum { NRows2x1 = Psana::CsPad::MaxRowsPerASIC * 2 };
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 PixCoordsQuad ( PixCoords2x1 *pix_coords_2x1, PSCalib::CSPadCalibPars *cspad_calibpar, bool tiltIsApplied = true ) ;
00076
00077
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
00088
00089
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
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
00133 PixCoordsQuad ( const PixCoordsQuad& ) ;
00134 PixCoordsQuad& operator = ( const PixCoordsQuad& ) ;
00135
00136 };
00137
00138 }
00139
00140 #endif // CSPADPIXCOORDS_PIXCOORDSQUAD_H