12 #include "StRHICfRawHitMaker.h"
14 #include "StEvent/StEventTypes.h"
15 #include "St_base/StMessMgr.h"
17 #include "RTS/src/DAQ_RHICF/daq_rhicf.h"
18 #include "RTS/src/DAQ_READER/daq_dta.h"
19 #include "StChain/StRtsTable.h"
20 #include "StEvent/StEvent.h"
22 #include "StRHICfDbMaker/StRHICfDbMaker.h"
23 #include "StEvent/StRHICfCollection.h"
24 #include "StEvent/StRHICfRawHit.h"
26 StRHICfRawHitMaker::StRHICfRawHitMaker(
const Char_t* name) :
StRTSBaseMaker(
"rhicf", name )
30 StRHICfRawHitMaker::~StRHICfRawHitMaker()
34 Int_t StRHICfRawHitMaker::InitRun(Int_t runNumber)
36 LOG_INFO <<
"StRHICfRawHitMaker::InitRun with run = " << runNumber << endm;
37 checkRunTypeForRHICf2017(runNumber);
41 LOG_ERROR <<
"StRHICfRawHitMaker::InitRun Failed to get StRHICfDbMaker" << endm;
50 LOG_INFO <<
"StRHICfRawHitMaker::Make()" <<endm;
53 eventPtr= (
StEvent*)StRTSBaseMaker::GetInputDS(
"StEvent");
57 if(!mRHICfCollection){
return kStFatal;}
59 mRHICfRawHitColl=mRHICfCollection->rawHitCollection();
60 if(!mRHICfRawHitColl){
return kStFatal;}
62 eventPtr->setRHICfCollection(mRHICfCollection);
66 unsigned int* gendata = (
unsigned int*) daqData->GetTable();
67 unsigned short* rawdata = (
unsigned short*) daqData->GetTable();
70 unsigned int rhicfRunIdx = mRHICfDbMaker->getRHICfRunNumberAddress();
71 unsigned int rhicfEventIdx = mRHICfDbMaker->getRHICfEventNumberAddress();
72 mRHICfCollection -> setRHICfRunNumber(gendata[rhicfRunIdx]);
73 mRHICfCollection -> setRHICfEventNumber(gendata[rhicfEventIdx]);
74 mRHICfCollection -> setRunType(getRunType());
76 unsigned int bunchIdx = mRHICfDbMaker->getBunchNumberAddress();
77 unsigned int triggerIdx = mRHICfDbMaker->getTriggerAddress();
78 unsigned int runTRGMIdx = mRHICfDbMaker->getRunTRGMAddress();
80 mRHICfCollection -> setBunchNumber(gendata[bunchIdx]);
81 mRHICfCollection -> setTriggerNumber(gendata[triggerIdx]);
82 mRHICfCollection -> setRunTRGM(gendata[runTRGMIdx]);
84 for(
int i=0; i<2; i++){
85 unsigned int runTimeIdx = mRHICfDbMaker->getRunTimeAddress(i);
86 mRHICfCollection -> setRunTime(i, gendata[runTimeIdx]);
90 for(
int it=0; it<kRHICfNtower; it++){
91 for(
int ip=0; ip<kRHICfNplate; ip++){
92 for(
int ir=0; ir<kRHICfNrange; ir++){
93 unsigned int plateADCIdx = mRHICfDbMaker -> getAdcAddress(it, ip, ir);
94 unsigned int plateADCDIdx = mRHICfDbMaker -> getAdcDAddress(it, ip, ir);
95 mRHICfRawHitColl -> setPlateADC(it, ip, ir, rawdata[plateADCIdx]);
96 mRHICfRawHitColl -> setPlateADCDelay(it, ip, ir, rawdata[plateADCDIdx]);
100 for(
int il=0; il<kRHICfNlayer; il++){
101 for(
int ixy=0; ixy<kRHICfNxy; ixy++){
102 Int_t gsobarSize = checkGSOBarSize(it);
103 for(
int ich=0; ich<gsobarSize; ich++){
104 unsigned int gsobarADCIdx = mRHICfDbMaker -> getScifiAddress(it, il, ixy, ich);
105 mRHICfRawHitColl -> setGSOBarADC(it, il, ixy, ich, rawdata[gsobarADCIdx]);
112 for(Int_t idx=0; idx<kRHICfNtdc; idx++){
115 unsigned int cad0Idx = mRHICfDbMaker->getCAD0Address(idx);
116 mRHICfRawHitColl -> setCAD0(idx, gendata[cad0Idx]);
120 unsigned int gpi0Idx = mRHICfDbMaker->getGPI0Address(idx);
121 mRHICfRawHitColl -> setGPI0(idx, gendata[gpi0Idx]);
125 unsigned int gpi1Idx = mRHICfDbMaker->getGPI1Address(idx);
126 mRHICfRawHitColl -> setGPI1(idx, gendata[gpi1Idx]);
129 unsigned int tdcIdx = mRHICfDbMaker->getTDCAddress(idx);
130 mRHICfRawHitColl -> setTDC(idx, gendata[tdcIdx]);
133 else{LOG_ERROR <<
"No RHICf data found" <<endm;}
Class StRTSBaseMaker - is an abstract StMaker to define the interface to access the DAQ data from the...
virtual StRtsTable * GetNextRaw()
This is an overloaded member function, provided for convenience.