10 #include "StEventTypes.h"
11 #include "StEvent/StEvent.h"
14 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
15 #include "StMuDSTMaker/COMMON/StMuDst.h"
16 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
17 #include "StMuDSTMaker/COMMON/StMuEvent.h"
20 #include "StTriggerData2005.h"
21 #include "StDaqLib/TRG/L2jetResults2006.h"
22 #include "StDaqLib/TRG/trgStructures2005.h"
23 #include "StDaqLib/TRG/trgStructures.h"
26 #include "L2algoUtil/L2EmcDb.h"
27 #include "L2jetAlgo/L2jetAlgo2006.h"
28 #include "L2pedAlgo/L2pedAlgo.h"
29 #include "L2gammaAlgo/L2gammaAlgo.h"
30 #include "L2upsilon/L2upsilon2006.hh"
32 #include "StL2_2006EmulatorMaker.h"
39 mL2gammaEEmc=mL2gammaBEmc=0;
44 StL2_2006EmulatorMaker::~StL2_2006EmulatorMaker(){
51 StL2_2006EmulatorMaker::InitRun(
int runNo){
56 LOG_INFO << Form(
"::setupL2Algos2006(), dbDate=%d ", mYearMonthDay)<<endm;
59 assert(mYearMonthDay>20060000);
60 assert(mYearMonthDay<20060700);
64 memset(mL2algo,0,mL2algoN*
sizeof(
void*));
68 mL2algo[0]=mL2pedAlgo=
new L2pedAlgo(
"ped-algo",mL2EmcDb,mL2EmcDb->logPath,L2RESULTS_OFFSET_EMC_PED);
72 assert( mYearMonthDay>20060316);
73 assert( mYearMonthDay<20060620);
75 mL2algo[1]=mL2jetAlgo2006=
new L2jetAlgo2006(
"jet06-algo",mL2EmcDb,mL2EmcDb->logPath,L2RESULTS_OFFSET_DIJET);
78 assert( mYearMonthDay >= 20060406 );
79 assert( mYearMonthDay <= 20060607 );
81 mL2algo[2]=mL2gammaEEmc=
new L2gammaAlgo(
"etow_gamma",mL2EmcDb,mL2EmcDb->logPath,L2RESULTS_OFFSET_PIG+2);
82 mL2algo[3]=mL2gammaBEmc=
new L2gammaAlgo(
"btow_gamma",mL2EmcDb,mL2EmcDb->logPath,L2RESULTS_OFFSET_PIG);
85 assert( mYearMonthDay >= 20060406 );
86 assert( mYearMonthDay <= 20060607 );
88 mL2algo[4]=mL2upsilon2006=
new L2upsilon2006(
"upsilon", mL2EmcDb, mL2EmcDb->logPath,L2RESULTS_OFFSET_UPS);
89 TString fullPath=Form(
"%sL2/%d/algos/btowXYZ.dat", mSetupPath.Data(), mYear);
90 mL2upsilon2006->readGeomXYZ(fullPath.Data());
97 LOG_INFO <<
"::InitRun() done, run=" <<runNo<<
" isMC="<<mMCflag<<endm;
104 StL2_2006EmulatorMaker::Init() {
106 LOG_INFO <<Form(
"Init()")<<endm;
109 return StMaker::Init();
114 StL2_2006EmulatorMaker::Clear(
const Option_t*){
123 if( mMCflag==0) getTriggerData();
131 if(mYear==2006) l2jetOff=L2RESULTS_OFFSET_DIJET;
133 const unsigned int *l2res=( (
TrgDataType*)mTrigData)->TrgSum.L2Result;
134 printf(
" L2-jet off-line results below:\n");
138 L2jetResults2006_print(out1);
139 unsigned char cSum=L2jetResults2006_doCheckSum(out1);
142 #endif // end of debuging
160 StL2_2006EmulatorMaker::getTriggerData(){
166 if(mYear==2006) l2jetOff=L2RESULTS_OFFSET_DIJET;
168 const unsigned int *l2res=0;
174 StMuEvent *muEve = muMk -> muDst() -> event();
177 L1 = &ticB.nominal();
182 printf(
"AccessL2Decision() from ezTree:\n");
188 l2jetOff=trgAkio5.L2ResultsOffset(idJ);
189 l2res=trgDB->TrgSum.L2Result;
194 TArrayI& l2Array = muMk->
muDst()->
event()->L2Result();
195 LOG_DEBUG <<Form(
"AccessL2Decision() from regular muDst: L2Ar-size=%d",l2Array.GetSize())<<endm;
196 l2res=(
unsigned int *)l2Array.GetArray();
200 StEvent *mEvent = (
StEvent *)StMaker::GetChain()-> GetInputDS(
"StEvent");
203 assert(ticA); L1=ticA->nominal();
212 if( !(L1->isTrigger(127622) || L1->isTrigger(127652)) ) {
213 printf(
"Discard none-L2jet triggered events\n");
218 #if 0 // just debugging & cross check
220 printf(
" L2-jet online results below:\n");
224 L2jetResults2006_print(out1);
225 unsigned char cSum=L2jetResults2006_doCheckSum(out1);
228 #endif // end of debugging
231 vector<unsigned int> trgL=L1->triggerIds();
232 printf(
"trigL len=%d totEve=%d\n",trgL.size(),mTotInpEve);
234 for(ii=0;ii<trgL.size();ii++){
235 printf(
"ii=%d trigID=%d\n",ii,trgL[ii]);
262 StL2_2006EmulatorMaker::initHistoA(TString core) {
263 LOG_INFO <<Form(
"initHistoA(),")<<endm;
266 memset(hA,0,
sizeof(hA));
269 hA[1]=
new TH1F(core+
"trgID",
"event counter for Jan",10,1,11);
273 for(i=0;i<mxAH;i++) {
274 if( hA[i]==0)
continue;
static EztTrigBlob * eztTrig()
returns pointer to eztTrig
Collection of trigger ids as stored in StEvent.
A level-2 "cluster" based trigger.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Collection of trigger ids as stored in MuDst.