60 #include "StPxlDbMaker.h"
62 #include "StMessMgr.h"
63 #include "tables/St_Survey_Table.h"
64 #include "St_db_Maker/St_db_Maker.h"
65 #include "tables/St_pxlSensorStatus_Table.h"
66 #include "tables/St_pxlRowColumnStatus_Table.h"
67 #include "tables/St_pxlBadRowColumns_Table.h"
68 #include "tables/St_pxlHotPixels_Table.h"
69 #include "tables/St_pxlControl_Table.h"
70 #include "tables/St_pxlSensorTps_Table.h"
71 #include "tables/St_pxlDigmapsSim_Table.h"
72 #include "tables/St_pxlSimPar_Table.h"
79 readAllRowColumnStatus = 0;
83 Int_t StPxlDbMaker::Init()
85 ToWhiteConst(
"pxl_db", mPxlDb);
92 Int_t StPxlDbMaker::InitRun(Int_t runNumber)
97 St_Survey *idsOnTpc = (St_Survey *) GetDataBase(
"Geometry/pxl/idsOnTpc");
98 if (! idsOnTpc) {LOG_WARN <<
"idsOnTpc has not been found" << endm;
return kStErr;}
101 St_Survey *pstOnIds = (St_Survey *) GetDataBase(
"Geometry/pxl/pstOnIds");
102 if (! pstOnIds) {LOG_WARN <<
"pstOnIds has not been found" << endm;
return kStErr;}
103 pstOnIds->Print(0,1);
105 St_Survey *pxlOnPst = (St_Survey *) GetDataBase(
"Geometry/pxl/pxlOnPst");
106 if (! pxlOnPst) {LOG_WARN <<
"pxlOnPst has not been found" << endm;
return kStErr;}
107 pxlOnPst->Print(0,1);
109 St_Survey *pxlHalfOnPxl = (St_Survey *) GetDataBase(
"Geometry/pxl/pxlHalfOnPxl");
110 if (! pxlHalfOnPxl) {LOG_WARN <<
"pxlHalfOnPxl has not been found" << endm;
return kStErr;}
111 pxlHalfOnPxl->Print(0,1);
113 St_Survey *pxlSectorOnHalf = (St_Survey *) GetDataBase(
"Geometry/pxl/pxlSectorOnHalf");
114 if (! pxlSectorOnHalf) {LOG_WARN <<
"pxlSectorOnHalf has not been found" << endm;
return kStErr;}
115 pxlSectorOnHalf->Print(0,1);
117 St_Survey *pxlLadderOnSector = (St_Survey *) GetDataBase(
"Geometry/pxl/pxlLadderOnSector");
118 if (! pxlLadderOnSector) {LOG_WARN <<
"pxladderOnSector has not been found" << endm;
return kStErr;}
119 pxlLadderOnSector->Print(0,1);
121 St_Survey *pxlSensorOnLadder = (St_Survey *) GetDataBase(
"Geometry/pxl/pxlSensorOnLadder");
122 if (! pxlSensorOnLadder) {LOG_WARN <<
"pxlSensorOnLadder has not been found" << endm;
return kStErr;}
123 pxlSensorOnLadder->Print(0,1);
125 Survey_st *tables[7] = {idsOnTpc->GetTable(), pstOnIds->GetTable(), pxlOnPst->GetTable(), pxlHalfOnPxl->GetTable(),
126 pxlSectorOnHalf->GetTable(), pxlLadderOnSector->GetTable(), pxlSensorOnLadder->GetTable()
132 St_pxlSensorStatus *sensorStatus = (St_pxlSensorStatus *)GetDataBase(
"Calibrations/pxl/pxlSensorStatus");
133 if (sensorStatus) mPxlDb->setSensorStatus(sensorStatus->GetTable());
134 else {LOG_WARN <<
" no pxl sensor status table " << endm;
return kStErr;}
135 sensorStatus->Print(0,1);
137 if(readAllRowColumnStatus)
139 St_pxlRowColumnStatus *rowColumnStatus = (St_pxlRowColumnStatus *)GetDataBase(
"Calibrations/pxl/pxlRowColumnStatus");
140 if (rowColumnStatus) mPxlDb->setRowColumnStatus(rowColumnStatus->GetTable());
141 else {LOG_WARN <<
" no pxl row column status table " << endm;
return kStErr;}
142 if(Debug()) rowColumnStatus->Print(0,1);
146 St_pxlBadRowColumns *badRowColumns = (St_pxlBadRowColumns *)GetDataBase(
"Calibrations/pxl/pxlBadRowColumns");
147 if (badRowColumns) mPxlDb->setBadRowColumns(badRowColumns->GetTable());
148 else {LOG_WARN <<
" no pxl bad row columns table " << endm;
return kStErr;}
149 if(Debug()) badRowColumns->Print(0,1);
152 St_pxlHotPixels *hotPixels = (St_pxlHotPixels *)GetDataBase(
"Calibrations/pxl/pxlHotPixels");
153 if (hotPixels) mPxlDb->setHotPixels(hotPixels->GetTable());
154 else {LOG_WARN <<
" no pxl hot pixels table " << endm;
return kStErr;}
155 if(Debug()) hotPixels->Print(0,1);
158 St_pxlControl *pxlControl = (St_pxlControl *)GetDataBase(
"Geometry/pxl/pxlControl");
160 mPxlDb->setPxlControl(pxlControl->GetTable());
161 pxlControl->Print(0,1);
164 LOG_WARN <<
"InitRun : No access to pxlControl table, abort PXL reconstruction" << endm;
169 St_pxlDigmapsSim *pxlDigmapsSim = (St_pxlDigmapsSim *)GetDataBase(
"Geometry/pxl/pxlDigmapsSim");
171 mPxlDb->setPxlDigmapsSim(pxlDigmapsSim->GetTable());
172 pxlDigmapsSim->Print(0,1);
175 LOG_WARN <<
"InitRun : No access to pxlDigmapsSim table, abort PXL reconstruction" << endm;
180 St_pxlSimPar *pxlSimPar = (St_pxlSimPar *)GetDataBase(
"Calibrations/pxl/pxlSimPar");
182 mPxlDb->setPxlSimPar(pxlSimPar->GetTable());
183 pxlSimPar->Print(0,1);
186 LOG_WARN <<
"InitRun : No access to pxlSimPar table, abort PXL reconstruction" << endm;
192 dbTps = GetDataBase(
"Geometry/pxl/pxlSensorTps");
194 LOG_WARN <<
"no tps table found in db, or malformed local db config " << endm;
198 St_pxlSensorTps *datasetTps = 0;
199 datasetTps = (St_pxlSensorTps *) dbTps->
Find(
"pxlSensorTps");
202 if(Debug()) datasetTps->Print(0,1);
205 LOG_WARN <<
"ERROR: dataset does not contain tps table" << endm;
209 if ( GetDebug() >= 2)
void setThinPlateSpline(pxlSensorTps_st *pxlSensorTps)
create sensor thin plate spline functions and set their parameters
void setGeoHMatrices(Survey_st **tables)
set geoHMatrix parameters with parameters from Survey_st tables
virtual TDataSet * Find(const char *path) const