7 #include "StTriggerSimuResult.h"
9 #include "StDaqLib/TRG/trgStructures2005.h"
10 #include "StDaqLib/TRG/trgStructures2009.h"
12 #ifndef L2RESULTS_2009_OFFSET_DIJET_HIGH
13 #define L2RESULTS_2009_OFFSET_DIJET_HIGH 25
14 #endif // L2RESULTS_2009_OFFSET_DIJET_HIGH
16 #include "L2Emulator/L2pedAlgo/L2pedResults2006.h"
17 #include "L2Emulator/L2jetAlgo/L2jetResults2006.h"
18 #include "L2Emulator/L2gammaAlgo/L2gammaResult2006.h"
19 #include "L2Emulator/L2upsilon/L2upsilonResult2006.h"
26 mBemcDecision(kDoNotCare), mEemcDecision(kDoNotCare), mL2Decision(kDoNotCare) { }
29 for(
unsigned i=0; i<mHighTowerIds.size(); i++) {
30 if(mHighTowerIds[i] == towerId)
return mHighTowerAdcs[i];
36 for(
unsigned i=0; i<mTriggerPatchIds.size(); i++) {
37 if(mTriggerPatchIds[i] == patchId)
return mTriggerPatchAdcs[i];
44 for(
unsigned i=0; i<mJetPatchIds.size(); i++) {
45 if(mJetPatchIds[i] == jetPatchId)
return mJetPatchAdcs[i];
54 result.triggerPatchId = -1;
55 result.triggerPatchAdc = -1;
56 for(
unsigned i=0; i<mHighTowerIds.size(); i++) {
57 if(mHighTowerIds[i] == towerId) {
58 result.towerId = towerId;
59 result.towerAdc = mHighTowerAdcs[i];
60 if(i<mTriggerPatchAdcs.size()) {
61 result.triggerPatchId = mTriggerPatchIds[i];
62 result.triggerPatchAdc = mTriggerPatchAdcs[i];
65 LOG_WARN <<
"No matching TP is available for " << towerId << endm;
75 if(year==2006)
return mL2Result + L2RESULTS_OFFSET_EMC_PED;
76 if(year==2009)
return mL2Result + L2RESULTS_2009_OFFSET_EMC_PED;
79 if(year==2006)
return mL2Result + L2RESULTS_OFFSET_DIJET;
80 if(year==2009)
return mL2Result + L2RESULTS_2009_OFFSET_DIJET_HIGH;
83 if(year==2006)
return mL2Result + L2RESULTS_OFFSET_PIG;
84 if(year==2009)
return mL2Result + L2RESULTS_2009_OFFSET_BGAMMA;
87 if(year==2006)
return mL2Result + L2RESULTS_OFFSET_PIG + 2;
88 if(year==2009)
return mL2Result + L2RESULTS_2009_OFFSET_EGAMMA;
91 if(year==2006)
return mL2Result + L2RESULTS_OFFSET_UPS;
92 if(year==2009)
return mL2Result + L2RESULTS_2009_OFFSET_UPSILON;
98 const unsigned int* StTriggerSimuResult::l2Result()
const {
102 void StTriggerSimuResult::addHighTower(
int towerId,
int dsmAdc) {
103 mHighTowerIds.push_back(towerId);
104 mHighTowerAdcs.push_back(dsmAdc);
107 void StTriggerSimuResult::addTriggerPatch(
int patchId,
int dsmAdc) {
108 mTriggerPatchIds.push_back(patchId);
109 mTriggerPatchAdcs.push_back(dsmAdc);
112 void StTriggerSimuResult::addJetPatch(
int jetPatchId,
int dsmAdc) {
113 mJetPatchIds.push_back(jetPatchId);
114 mJetPatchAdcs.push_back(dsmAdc);
117 void StTriggerSimuResult::setL2Result(
const unsigned int* result) {
118 memcpy(mL2Result, result,
sizeof(mL2Result));
simple struct to return HHTP tower - trigger patch pairs
int jetPatchAdc(short jetPatchId) const
returns DSM ADC if above trigger threshold, otherwise -1
int highTowerAdc(short towerId) const
returns DSM ADC if above trigger threshold, otherwise -1
HttpResult httpPair(short towerId) const
returns simple struct encapsulating (id,adc) of HT and TP pair
int triggerPatchAdc(short patchId) const
returns DSM ADC if above trigger threshold, otherwise -1
const unsigned int * l2Result(L2ResultType algo, int year=2006) const
returns address of specific L2 result struct – cast it yourself