10 #ifndef StBTofSimResParams_h
11 #define StBTofSimResParams_h
16 #include "St_db_Maker/St_db_Maker.h"
17 #include "tables/St_tofSimResParams_Table.h"
29 double average_timeres_tof(){
return mAverageTimeResTof;}
35 double timeres_tof(
unsigned int itray,
unsigned int imodule,
unsigned int icell)
37 double result = 8.5e-11;
38 if ( itray > 120 || imodule > 32 || icell > 6 )
41 return params[ itray-1 ][ (imodule-1) * 6 + (icell-1) ];
67 DB = GetDataBase(
"Calibrations/tof/tofSimResParams");
71 LOG_WARN <<
"ERROR: could not read requested table from DB" << endm;
75 St_tofSimResParams *dataset = 0;
76 dataset = (St_tofSimResParams*) DB->
Find(
"tofSimResParams");
83 tofSimResParams_st* tofTable =
static_cast<tofSimResParams_st*
>(dataset->GetTable());
85 const int mNTray = 120;
86 const int mNCellsPerTray = 192;
88 mAverageTimeResTof = 0;
89 for (
int i = 0; i < mNTray; i++ )
91 for (
int j = 0; j < mNCellsPerTray; j++ )
93 size_t index = i * mNCellsPerTray + j;
94 params[i][j] = tofTable[0].resolution[index];
96 mAverageTimeResTof +=
params[i][j];
98 LOG_DEBUG <<
"tray:" << i <<
", mod cell:" << j <<
" = " << tofTable[0].resolution[index] <<
" == " <<
params[i][j] << endm;
102 mAverageTimeResTof=mAverageTimeResTof/(mNTray*mNCellsPerTray);
104 LOG_INFO <<
"Loaded tofSimResParams. Average = " << mAverageTimeResTof << endm;
109 LOG_WARN <<
"ERROR: dataset does not contain requested table" << endm;
117 double mAverageTimeResTof;
double timeres_tof(unsigned int itray, unsigned int imodule, unsigned int icell)
void loadParams(const int runNumber=20076002)
Loads BTOF Sim Params from database.
virtual TDataSet * Find(const char *path) const