8 #include "St_base/StMessMgr.h"
10 #include "StChain/StRtsTable.h"
11 #include "StEvent/StEvent.h"
12 #include "DAQ_FGT/daq_fgt.h"
13 #include "DAQ_READER/daq_dta.h"
14 #include "StEvent/StGmtCollection.h"
15 #include "StEvent/StGmtStripCollection.h"
16 #include "StEvent/StGmtStrip.h"
17 #include "StGmtUtil/geometry/StGmtGeom.h"
18 #include "St_base/StMessMgr.h"
20 #include "StGmtRawMaker.h"
22 const Int_t mChIdToSeqId[128] = {
23 0,16,32,48,64,80,96,112,4,20,36,52,68,84,100,116,8,
24 24,40,56,72,88,104,120,12,28,44,60,76,92,108,124,1,
25 17,33,49,65,81,97,113,5,21,37,53,69,85,101,117,9,
26 25,41,57,73,89,105,121,13,29,45,61,77,93,109,125,2,
27 18,34,50,66,82,98,114,6,22,38,54,70,86,102,118,10,
28 26,42,58,74,90,106,122,14,30,46,62,78,94,110,126,3,
29 19,35,51,67,83,99,115,7,23,39,55,71,87,103,119,11,
30 27,43,59,75,91,107,123,15,31,47,63,79,95,111,127
38 StEvent* eventPtr = (
StEvent*)StRTSBaseMaker::GetInputDS(
"StEvent");
40 mGmtCollectionPtr = eventPtr->gmtCollection();
41 if(!mGmtCollectionPtr) {
43 if(!mGmtCollectionPtr) {
44 LOG_DEBUG <<
"::prepareEnvironment could not create StGmtCollection" <<endm;
47 eventPtr->setGmtCollection(mGmtCollectionPtr);
48 LOG_DEBUG <<
"::prepareEnvironment() has added a non existing StGmtCollection()"<<endm;
51 mGmtCollectionPtr->
Clear();
62 LOG_DEBUG <<
"StGmtRawMaker::Make()******************************************************************"<<endm;
65 LOG_ERROR <<
"Error preparing enviroment" << endm;
90 LOG_INFO <<
"StGmtRawMaker::fillHits() Trying to find gmt/adc... " << endm;
94 TString query(
"gmt/adc");
104 Int_t chanTmp=mGmtRawData->ch;
105 channel=mChIdToSeqId[chanTmp];
107 timebin=mGmtRawData->tb;
109 adc=mGmtRawData->adc;
110 arm=rts_tbl->Sector();
113 if ( (apv >= 0) && (apv <= 3)) {
116 else if ( (apv >= 12) && (apv <= 15) ) {
123 LOG_INFO <<
"StGmtRawMaker::fillHits() Got: " <<
128 " channel: " << channel <<
129 " timebin: " << timebin <<
137 moduleIdx = StGmtGeom::getModuleIdFromElecCoord( rdo, arm, apv );
138 coordNum = StGmtGeom::getCoordNumFromElecCoord( rdo, arm, apv, channel );
139 position = StGmtGeom::getPositionFromElecCoord( rdo, arm, apv, channel );
141 geoId = StGmtGeom::encodeGeoId( rdo, arm, apv, channel );
142 StGmtGeom::decodeGeoId( geoId, moduleIdx, layer, strip );
144 if( stripCollectionPtr ) {
145 geoId = StGmtGeom::encodeGeoId( rdo, arm, apv, channel );
146 StGmtStrip* stripPtr = stripCollectionPtr->getStrip( geoId );
147 if( coordNum == 999 ) {
148 stripPtr->
setAdc( 0, timebin );
153 stripPtr->
setIsY( layer );
167 LOG_INFO <<
"Str.=" << channel <<
"\tLay0\tgeoid=" << geoId<<
"\tposition=" << position << endl;
173 LOG_INFO <<
"Str.=" << channel <<
"\tLay0\tgeoid=" << geoId<<
"\tposition=" << position << endl;
176 stripPtr->
setAdc( adc, timebin );
181 stripPtr->
setIsY( layer );
187 LOG_INFO <<
"StGmtRawMaker::fillHits() Set: " << *stripPtr << endm;
191 LOG_WARN <<
"StGmtRawMaker::Make() -- Could not access module " << moduleIdx << endm;
Holds collections of GMT data.
void Clear(Option_t *opts="")
Clear method.
StRtsTable * GetNextDaqElement(const char *elementPath)
Query the STAR production chain for the DAQ data.
void setPed(Float_t ped)
Set pedestal.
void setPedErr(Float_t pedErr)
Set pedestal error.
void setElecCoords(Int_t rdo, Int_t arm, Int_t apv, Int_t chan)
Set coordinates from electronics.
void setPosition(Float_t position)
Set position relative to local origin (in module)
void setPedStdDev(Float_t pedStdDev)
Set pedestal standard deviation.
void setCharge(Float_t charge)
Set charge before the GEM (in C)
StRtsTable * DaqDta()
Return the current DAQ data block. This member function is provided for convenience.
void setIsY(Int_t isY)
Set is it a pad.
void setChargeUncert(Float_t chargeUncert)
Set charge uncertainty.
void setGeoId(Int_t geoId)
Set detector GeoId.
void setCoordNum(Int_t coord)
Set coordinate.
void setAdc(Short_t adc, Int_t tb=-1)
Set ADC for the given time bucket.
StGmtStripCollection * getStripCollection(unsigned short moduleIdx)
Pointer to the GMT strip collection in the i-th module.
Holds data for the strip in GMT.
void setModule(Int_t module)
Set module.
Int_t prepareEnvironment()