11 #include "StEventTypes.h"
12 #include "StL2_2008EmulatorMaker.h"
16 #include "StJanEventMaker.h"
24 return StMaker::Init();
28 Int_t StJanEventMaker::InitRun(Int_t runNumber)
30 const Char_t* filename = Form(
"R%d.eve.bin", runNumber);
31 if (gSystem->Getenv(
"JOBID"))
32 filename = gSystem->ConcatFileName(gSystem->Getenv(
"SCRATCH"),
33 Form(
"%s.%s", filename, gSystem->Getenv(
"JOBID")));
35 if (mFile.is_open()) mFile.close();
39 return StMaker::InitRun(runNumber);
47 gMessMgr->Warning(
"No StEvent");
55 unsigned short *btow=0, *etow=0;
56 if(L2EmuMk->getBtowIn()) btow=L2EmuMk->getBtowBank();
57 if(L2EmuMk->getEtowIn()) etow=L2EmuMk->getEtowBank();
63 fillJanEvent(triggerData(stEvent),btow,etow,janEvent);
78 Char_t* StJanEventMaker::triggerData(
StEvent* event)
80 if (!event->triggerData()) {
81 gMessMgr->Warning(
"No StTriggerData");
85 const UShort_t JPSI_MB_BITS = 0x0802;
86 if (trgData->EvtDesc.DSMInput & JPSI_MB_BITS == JPSI_MB_BITS) {
87 cout <<
"jpsi-mb bits on" << endl;
90 cout <<
"jpsi-mb bits off" << endl;
93 return event->triggerData()->getTriggerStructure();
98 void StJanEventMaker::fillJanEvent(Char_t* trgData, UShort_t* bemcData,
101 Char_t* header = Form(
"Form2,ieve=%d,run=%d,id=%d,%d,%d,%d",
103 trgData != 0, bemcData != 0, eemcData != 0);
104 event.setHeader(header);
105 event.setTriggerData(trgData);
106 event.setBemcData(bemcData);
107 event.setEemcData(eemcData);
virtual Int_t GetRunNumber() const
Returns the current RunNumber.