19 #include <Math/SMatrix.h>
20 #include <Math/SVector.h>
22 #include "MessageTools.h"
27 class ROC :
public TObject
30 ROC(
unsigned int position=0,
int chipID=-1,
unsigned int degrees=0);
60 static double calibrationFitFunction (
double * x,
double * par );
61 double calibrationFitFunctionInv(
double * x,
double * par );
62 bool calibratePixel (
int row,
int col,
int adc,
int& charge );
64 void setCalibrationFilePath (std::string path ) {calibrationFilePath_= path; }
66 void setCalibrationFunction (
int row,
int col,
double *par,
double *cov) ;
67 void setStandardPixPitch (
double raw_cm ,
double col_cm ) ;
68 void setOneRowPitch (
unsigned int raw ,
double row_cm ) ;
69 void setOneColPitch (
unsigned int col ,
double col_cm ) ;
70 void setOrientation (
unsigned int degrees ) ;
71 void setNumberOfRowsCols (
unsigned int maxRows ,
unsigned int maxCols ) ;
72 void setNumberOfRows (
unsigned int maxRows ) ;
73 void setNumberOfCols (
unsigned int maxCols ) ;
74 void setLocalXPosition (
unsigned int xLocalPosition ) {xLocalPosition_ = xLocalPosition;}
75 void setLocalYPosition (
unsigned int yLocalPosition ) {yLocalPosition_ = yLocalPosition;}
76 void setFirstRow (
unsigned int firstRow ) {firstRow_ = firstRow; }
77 void setLastRow (
unsigned int lastRow ) {lastRow_ = lastRow; }
78 void setFirstCol (
unsigned int firstCol ) {firstCol_ = firstCol; }
79 void setLastCol (
unsigned int lastCol ) {lastCol_ = lastCol; }
81 std::string getCalibrationFilePath (
void ) {
return calibrationFilePath_; }
82 int getID (
void ) {
return chipID_; }
83 unsigned int getOrientation (
void ) {
return orientation_; }
84 unsigned int getPosition (
void ) {
return position_; }
85 double getPixelCenterLocalX (
unsigned int col ) ;
86 double getPixelCenterLocalY (
unsigned int row ) ;
87 double getPixelHiEdgeLocalX (
unsigned int col ) ;
88 double getPixelHiEdgeLocalY (
unsigned int row ) ;
89 double getPixelLowEdgeLocalX (
unsigned int col ) ;
90 double getPixelLowEdgeLocalY (
unsigned int row ) ;
91 double getPixelPitchLocalX (
unsigned int col ) ;
92 double getPixelPitchLocalY (
unsigned int row ) ;
93 double getLengthLocalX (
void ) ;
94 double getLengthLocalY (
void ) ;
96 double getCalibrationError (
int row,
int col ,
int adc ) ;
97 double* getCalibrationFunction (
int row,
int col ) ;
98 bool isPixelCalibrated (
int row,
int col ) ;
100 unsigned int getNumberOfRows (
void ) {
return numberOfRows_; }
101 unsigned int getNumberOfCols (
void ) {
return numberOfCols_; }
102 unsigned int getPositionLocalX (
void ) {
return xLocalPosition_; }
103 unsigned int getPositionLocalY (
void ) {
return yLocalPosition_; }
104 unsigned int getFirstRow (
void ) {
return firstRow_; }
105 unsigned int getLastRow (
void ) {
return lastRow_; }
106 unsigned int getFirstCol (
void ) {
return firstCol_; }
107 unsigned int getLastCol (
void ) {
return lastCol_; }
113 typedef std::map< int,std::map<int, ROOT::Math::SMatrix<double,4> > > pixelCalibrationsCovDef ;
115 typedef std::pair<double, double > rowColPitchPairDef ;
117 typedef std::map<unsigned int , double> nonStandardPitchMapDef ;
119 typedef std::map< int,std::map<int, double*> > pixelCalibrationsMapDef ;
121 typedef std::map< int,std::map<int, std::vector<double> > > pixelCalibrationsTmpMapDef ;
123 bool goodRow (
unsigned int row);
124 bool goodCol (
unsigned int col);
125 void setRowPitchVector(
void);
126 void setColPitchVector(
void);
127 std::vector<double> rowPitches_;
128 std::vector<double> colPitches_;
129 std::vector<double> rowLowEdge_;
130 std::vector<double> colLowEdge_;
134 unsigned int numberOfRows_ ;
136 unsigned int numberOfCols_ ;
140 unsigned int orientation_ ;
141 unsigned int position_ ;
142 rowColPitchPairDef standardPixelPitch_ ;
143 nonStandardPitchMapDef nonStandardRowPitch_ ;
144 nonStandardPitchMapDef nonStandardColPitch_ ;
145 std::string calibrationFilePath_ ;
147 pixelCalibrationsTmpMapDef pixelCalibrationFunctionTmp_ ;
148 pixelCalibrationsCovDef pixelCalibrationCovMat_ ;
152 unsigned int xLocalPosition_;
153 unsigned int yLocalPosition_;
154 unsigned int firstRow_;
155 unsigned int lastRow_;
156 unsigned int firstCol_;
157 unsigned int lastCol_;
160 std::stringstream ss_ ;