1 #include "StBemcTriggerDbThresholds.h"
7 #include "St_db_Maker/St_db_Maker.h"
14 StBemcTriggerDbThresholds::StBemcTriggerDbThresholds() {
16 LOG_INFO<<
"StBemcTriggerDbThresholds::constructor"<<endm;
21 StBemcTriggerDbThresholds::~StBemcTriggerDbThresholds(){
23 LOG_INFO<<
"StBemcTriggerDbThresholds::deconstructor"<<endl;
29 void StBemcTriggerDbThresholds::LoadTimeStamps(){
36 start_2006[0].Set(2006,04,07,04,43,21);
37 end_2006[0].Set(2006,04,11,17,21,19);
39 start_2006[1].Set(2006,4,12,1,31,30);
40 end_2006[1].Set(2006,5,9,21,16,17);
42 start_2006[2].Set(2006,5,12,3,59,6);
43 end_2006[2].Set(2006,5,12,9,16,32);
45 start_2006[3].Set(2006,5,12,20,44,24);
46 end_2006[3].Set(2006,5,13,21,50,13);
48 start_2006[4].Set(2006,5,13,21,52,39);
49 end_2006[4].Set(2006,5,15,16,47,13);
51 start_2006[5].Set(2006,5,16,2,38,45);
52 end_2006[5].Set(2006,6,5,15,49,27);
59 start_2007[0].Set(2007,4,4,5,38,44);
60 end_2007[0].Set(2007,4,12,9,13,27);
64 start_2007[1].Set(2007,4,8,3,25,59);
65 end_2007[1].Set(2007,4,15,8,23,10);
72 start_2007[2].Set(2007,4,13,20,9,29);
73 end_2007[2].Set(2007,4,23,17,24,23);
79 start_2007[3].Set(2007,4,19,5,1,48);
80 end_2007[3].Set(2007,6,26,12,57,41);
86 start_2008[0].Set(2007,12,6,12,39,10);
87 end_2008[0].Set(2007,12,10,2,42,55);
91 start_2008[1].Set(2007,12,10,19,42,27);
92 end_2008[1].Set(2008,1,28,0,56,7);
98 start_2008[2].Set(2008,2,14,7,3,42);
99 end_2008[2].Set(2008,3,10,11,1,55);
102 start_2009[0].Set(2009,2,17,0,0,0);
103 end_2009[0].Set(2009,4,15,0,0,0);
106 start_2009[1].Set(2009,4,15,0,0,1);
107 end_2009[1].Set(2009,5,15,0,0,0);
114 Int_t StBemcTriggerDbThresholds::GetHtFEEbitOffset(
int year){
116 LOG_INFO <<
"StBemcTriggerDbThresholds::GetHtFEEbitOffset()"<<endm;
120 (year>2005) ? bitOffset=2 : bitOffset=3;
130 Int_t StBemcTriggerDbThresholds::GetTP_DSM0_threshold(Int_t DSMmodule, UInt_t timestamp, Int_t layer){
135 const Int_t TP0_TH_2006[6] = { 1, 1, 1, 1, 1, 1};
136 const Int_t TP1_TH_2006[6] = { 17, 17, 20, 20, 19, 19};
137 const Int_t TP2_TH_2006[6] = { 31, 31, 31, 31, 31, 31};
138 for (
int i=0; i<6;i++)
142 if ((timestamp>=start_2006[i].Get())&&(timestamp<=end_2006[i].Get()))
144 if (layer==0) threshold=TP0_TH_2006[i];
145 if (layer==1) threshold=TP1_TH_2006[i];
146 if (layer==2) threshold=TP2_TH_2006[i];
152 if ((timestamp>=start_2006[i].Get())&&(timestamp<=end_2006[i].Get()))
155 if (layer==0) threshold=TP0_TH_2006[i];
156 if (layer==1) threshold=TP1_TH_2006[i];
157 if (layer==2) threshold=TP2_TH_2006[i];
166 const Int_t TP0_TH_2008[6] = { 24, 24, 24, 24, 24, 24};
167 for (
int i=0; i<6;i++)
171 if ((timestamp>=start_2008[i].Get())&&(timestamp<=end_2008[i].Get()))
173 if (layer==0) threshold=TP0_TH_2008[i];
179 if ((timestamp>=start_2008[i].Get())&&(timestamp<=end_2008[i].Get()))
181 if (layer==0) threshold=TP0_TH_2008[i];
191 Int_t StBemcTriggerDbThresholds::GetJP_DSM1_threshold(Int_t DSMmodule,UInt_t timestamp, Int_t layer){
196 const Int_t JP0_TH_2006[6] = { 42, 42, 48, 49, 49, 49};
197 const Int_t JP1_TH_2006[6] = { 58, 58, 58, 60, 60, 60};
198 const Int_t JP2_TH_2006[6] = {110,110,110,110,110,110};
199 for (
int i=0;i<6;i++)
203 if ((timestamp>=start_2006[i].Get())&&(timestamp<=end_2006[i].Get()))
205 if (layer==0) threshold=JP0_TH_2006[i];
206 if (layer==1) threshold=JP1_TH_2006[i];
207 if (layer==2) threshold=JP2_TH_2006[i];
214 if ((timestamp>=start_2006[i].Get())&&(timestamp<=end_2006[i].Get()))
216 if (layer==0) threshold=JP0_TH_2006[i];
217 if (layer==1) threshold=JP1_TH_2006[i];
218 if (layer==2) threshold=JP2_TH_2006[i];
226 const Int_t JP0_TH_2008[6] = { 50, 50, 50, 50, 50, 50};
227 const Int_t JP1_TH_2008[6] = { 87, 87, 87, 87, 87, 87};
228 const Int_t JP2_TH_2008[6] = {100,100,100,100,100,100};
229 for (
int i=0;i<6;i++)
233 if ((timestamp>=start_2008[i].Get())&&(timestamp<=end_2008[i].Get()))
235 if (layer==0) threshold=JP0_TH_2008[i];
236 if (layer==1) threshold=JP1_TH_2008[i];
237 if (layer==2) threshold=JP2_TH_2008[i];
244 if ((timestamp>=start_2008[i].Get())&&(timestamp<=end_2008[i].Get()))
246 if (layer==0) threshold=JP0_TH_2008[i];
247 if (layer==1) threshold=JP1_TH_2008[i];
248 if (layer==2) threshold=JP2_TH_2008[i];
258 const Int_t JP0_TH_2009[2] = { 28, 20};
259 const Int_t JP1_TH_2009[2] = { 35, 28};
260 const Int_t JP2_TH_2009[2] = { 52, 35};
261 for (
int i=0;i<2;i++)
265 if ((timestamp>=start_2009[i].Get())&&(timestamp<=end_2009[i].Get()))
267 if (layer==0) threshold=JP0_TH_2009[i];
268 if (layer==1) threshold=JP1_TH_2009[i];
269 if (layer==2) threshold=JP2_TH_2009[i];
276 if ((timestamp>=start_2009[i].Get())&&(timestamp<=end_2009[i].Get()))
278 if (layer==0) threshold=JP0_TH_2009[i];
279 if (layer==1) threshold=JP1_TH_2009[i];
280 if (layer==2) threshold=JP2_TH_2009[i];
291 Int_t StBemcTriggerDbThresholds::GetHT_DSM0_threshold(Int_t DSMmodule, UInt_t timestamp, Int_t layer){
296 const Int_t HTW0_TH_2006[6] = { 5, 5, 5, 5, 5, 5};
297 const Int_t HTW1_TH_2006[6] = { 12, 12, 16, 18, 16, 16};
298 const Int_t HTW2_TH_2006[6] = { 22, 24, 24, 24, 24, 24};
299 const Int_t HTE0_TH_2006[6] = { 11, 11, 5, 5, 5, 5};
300 const Int_t HTE1_TH_2006[6] = { 12, 12, 16, 18, 16, 16};
301 const Int_t HTE2_TH_2006[6] = { 24, 24, 24, 24, 24, 24};
302 for (
int i=0;i<6;i++){
306 if ((timestamp>=start_2006[i].Get())&&(timestamp<=end_2006[i].Get()))
308 if (layer==0) threshold=HTW0_TH_2006[i];
309 if (layer==1) threshold=HTW1_TH_2006[i];
310 if (layer==2) threshold=HTW2_TH_2006[i];
317 if ((timestamp>=start_2006[i].Get())&&(timestamp<=end_2006[i].Get()))
319 if (layer==0) threshold=HTE0_TH_2006[i];
320 if (layer==1) threshold=HTE1_TH_2006[i];
321 if (layer==2) threshold=HTE2_TH_2006[i];
328 const Int_t HTW0_TH_2007[4] = { 6, 4, 3, 3};
329 const Int_t HTW1_TH_2007[4] = { 18, 18, 18, 18};
330 const Int_t HTW2_TH_2007[4] = { 24, 24, 24, 23};
331 const Int_t HTE0_TH_2007[4] = { 6, 4, 3, 3};
332 const Int_t HTE1_TH_2007[4] = { 18, 18, 18, 18};
333 const Int_t HTE2_TH_2007[4] = { 24, 24, 24, 23};
334 for (
int i=0;i<4;i++){
338 if ((timestamp>=start_2007[i].Get())&&(timestamp<=end_2007[i].Get()))
340 if (layer==0) threshold=HTW0_TH_2007[i];
341 if (layer==1) threshold=HTW1_TH_2007[i];
342 if (layer==2) threshold=HTW2_TH_2007[i];
349 if ((timestamp>=start_2007[i].Get())&&(timestamp<=end_2007[i].Get()))
351 if (layer==0) threshold=HTE0_TH_2007[i];
352 if (layer==1) threshold=HTE1_TH_2007[i];
353 if (layer==2) threshold=HTE2_TH_2007[i];
360 const Int_t HTW0_TH_2008[6] = { 11, 11, 11};
361 const Int_t HTW1_TH_2008[6] = { 15, 15, 15};
362 const Int_t HTW2_TH_2008[6] = { 18, 18, 18};
363 const Int_t HTW3_TH_2008[6] = { 35, 35, 16};
364 const Int_t HTW4_TH_2008[6] = { 35, 35, 63};
366 const Int_t HTE0_TH_2008[6] = { 11, 11, 11};
367 const Int_t HTE1_TH_2008[6] = { 15, 15, 15};
368 const Int_t HTE2_TH_2008[6] = { 18, 18, 18};
369 const Int_t HTE3_TH_2008[6] = { 35, 35, 16};
370 const Int_t HTE4_TH_2008[6] = { 35, 35, 63};
372 for (
int i=0;i<3;i++){
376 if ((timestamp>=start_2008[i].Get())&&(timestamp<=end_2008[i].Get()))
378 if (layer==0) threshold=HTW0_TH_2008[i];
379 if (layer==1) threshold=HTW1_TH_2008[i];
380 if (layer==2) threshold=HTW2_TH_2008[i];
381 if (layer==3) threshold=HTW3_TH_2008[i];
382 if (layer==4) threshold=HTW4_TH_2008[i];
390 if ((timestamp>=start_2008[i].Get())&&(timestamp<=end_2008[i].Get()))
392 if (layer==0) threshold=HTE0_TH_2008[i];
393 if (layer==1) threshold=HTE1_TH_2008[i];
394 if (layer==2) threshold=HTE2_TH_2008[i];
395 if (layer==3) threshold=HTE3_TH_2008[i];
396 if (layer==4) threshold=HTE4_TH_2008[i];
405 const Int_t HT0_TH_2009[2] = { 11, 11};
406 const Int_t HT1_TH_2009[2] = { 15, 15};
407 const Int_t HT2_TH_2009[2] = { 19, 17};
408 const Int_t HT3_TH_2009[2] = { 25, 23};
410 for (
int i=0;i<2;i++){
414 if ((timestamp>=start_2009[i].Get())&&(timestamp<=end_2009[i].Get()))
416 if (layer==0) threshold=HT0_TH_2009[i];
417 if (layer==1) threshold=HT1_TH_2009[i];
418 if (layer==2) threshold=HT2_TH_2009[i];
419 if (layer==3) threshold=HT3_TH_2009[i];
427 if ((timestamp>=start_2009[i].Get())&&(timestamp<=end_2009[i].Get()))
429 if (layer==0) threshold=HT0_TH_2009[i];
430 if (layer==1) threshold=HT1_TH_2009[i];
431 if (layer==2) threshold=HT2_TH_2009[i];
432 if (layer==3) threshold=HT3_TH_2009[i];