2 #include "StEpdDbMaker.h"
4 #include "St_db_Maker/St_db_Maker.h"
5 #include "tables/St_epdQTMap_Table.h"
6 #include "tables/St_epdFEEMap_Table.h"
7 #include "tables/St_epdStatus_Table.h"
8 #include "tables/St_epdGain_Table.h"
17 StEpdDbMaker::~StEpdDbMaker(){
45 LOG_DEBUG <<
"StEpdDbMaker::InitRun " << endm;
51 LOG_INFO <<
"StEpdDbMaker::InitRun - Date&time from St_db_Maker="
52 << dbmaker->GetDate() <<
"," << dbmaker->GetTime() << endm;
58 TDataSet *DbGeometry = GetInputDB(
"Geometry/epd");
59 TDataSet *DbCalibrations = GetInputDB(
"Calibrations/epd");
62 LOG_ERROR <<
"StEpdDbMaker::InitRun - No Geometry/epd"<<endm;
66 LOG_ERROR <<
"StEpdDbMaker::InitRun - No Calibrations/epd"<<endm;
71 St_epdQTMap *dbQTMap = (St_epdQTMap*) DbGeometry->
Find(
"epdQTMap");
72 St_epdFEEMap *dbFeeMap = (St_epdFEEMap*)DbGeometry->
Find(
"epdFEEMap");
73 St_epdStatus *dbStatus = (St_epdStatus*)DbCalibrations->
Find(
"epdStatus");
74 St_epdGain *dbGain = (St_epdGain*) DbCalibrations->
Find(
"epdGain");
78 LOG_ERROR <<
"StEpdDbMaker::InitRun - No Geometry/epd/epdQTMap "<<endm;
82 LOG_ERROR <<
"StEpdDbMaker::InitRun - No Geometry/epd/epdFEEMap "<<endm;
86 LOG_ERROR <<
"StEpdDbMaker::InitRun - No Calibrations/epd/epdStatus "<<endm;
90 LOG_ERROR <<
"StEpdDbMaker::InitRun - No Calibrations/epd/epdGain "<<endm;
95 epdQTMap_st* mEpdQtMapTable = (epdQTMap_st*)dbQTMap->GetTable();
96 epdFEEMap_st* mEpdFeeMapTable = (epdFEEMap_st*)dbFeeMap->GetTable();
97 epdStatus_st* mEpdStatusTable = (epdStatus_st*)dbStatus->GetTable();
98 epdGain_st* mEpdGainTable = (epdGain_st*)dbGain->GetTable();
102 for (Int_t i = 0; i < 768; i++) {
104 short ew = mEpdQtMapTable->ew[i];
105 short pp = mEpdQtMapTable->pp[i] -1;
106 short tile = mEpdQtMapTable->tile[i];
108 mCrateAdc[ew][pp][tile] = mEpdQtMapTable->qt_crate_adc[i];
109 mBoardAdc[ew][pp][tile] = mEpdQtMapTable->qt_board_adc[i];
110 mChannelAdc[ew][pp][tile] = mEpdQtMapTable->qt_channel_adc[i];
111 mCrateTac[ew][pp][tile] = mEpdQtMapTable->qt_crate_tac[i];
112 mBoardTac[ew][pp][tile] = mEpdQtMapTable->qt_board_tac[i];
113 mChannelTac[ew][pp][tile] = mEpdQtMapTable->qt_channel_tac[i];
116 mTuffId[ew][pp][tile] = mEpdFeeMapTable->tuff_id[i];
117 mTuffGroup[ew][pp][tile] = mEpdFeeMapTable->tuff_group[i];
118 mTuffChannel[ew][pp][tile] = mEpdFeeMapTable->tuff_channel[i];
119 mReceiverBoard[ew][pp][tile] = mEpdFeeMapTable->receiver_board[i];
120 mReceiverBoardChannel[ew][pp][tile] = mEpdFeeMapTable->receiver_board_channel[i];
121 mCamacCrateAddress[ew][pp][tile] = mEpdFeeMapTable->camac_crate_address[i];
122 mWireOneId[ew][pp][tile][0] = mEpdFeeMapTable->wire_1_id[wire1n];
124 mWireOneId[ew][pp][tile][1] = mEpdFeeMapTable->wire_1_id[wire1n];
128 mStatus[ew][pp][tile]= mEpdStatusTable->status[i];
131 mVPed[ew][pp][tile] = mEpdGainTable->vped[i];
132 mMip[ew][pp][tile] = mEpdGainTable->mip[i];
133 mQtPedestals[ew][pp][tile] = mEpdGainTable->qt_pedestals[i];
134 mDarkCurrent[ew][pp][tile] = mEpdGainTable->dark_current[i];
135 mQtPedestalsSigma[ew][pp][tile] = mEpdGainTable->qt_pedestals_sigma[i];
136 mOffset[ew][pp][tile] = mEpdGainTable->offset[i];
145 void StEpdDbMaker::ResetArrays(){
146 for(
int ew=0; ew<2 ; ew++){
147 for(
int pp=0; pp < 12;pp++){
148 for(
int tile=0; tile<32 ; tile++){
150 mCrateAdc[ew][pp][tile] = -1;
151 mBoardAdc[ew][pp][tile] = -1;
152 mChannelAdc[ew][pp][tile] = -1;
153 mCrateTac[ew][pp][tile] = -1;
154 mBoardTac[ew][pp][tile] = -1;
155 mChannelTac[ew][pp][tile] = -1;
158 mTuffId[ew][pp][tile] = -1;
159 mTuffGroup[ew][pp][tile] = -1;
160 mTuffChannel[ew][pp][tile] = -1;
161 mReceiverBoard[ew][pp][tile] = -1;
162 mReceiverBoardChannel[ew][pp][tile] = -1;
163 mCamacCrateAddress[ew][pp][tile] = -1;
164 mWireOneId[ew][pp][tile][0] = 0x0;
165 mWireOneId[ew][pp][tile][1] = 0x0;
168 mStatus[ew][pp][tile]= -1;
171 mVPed[ew][pp][tile] = -1;
172 mMip[ew][pp][tile] = -1;
173 mQtPedestals[ew][pp][tile] = -1;
174 mDarkCurrent[ew][pp][tile] = -1;
175 mQtPedestalsSigma[ew][pp][tile] = -1;
176 mOffset[ew][pp][tile] = -1;
virtual Int_t InitRun(Int_t runNumber)
virtual TDataSet * Find(const char *path) const