53 #ifndef StTpcRawData_h
54 #define StTpcRawData_h
59 #include "StSequence.hh"
60 #include "StTpcPixel.h"
61 #include "StDetectorDbMaker/St_tpcPadPlanesC.h"
62 #include "StDetectorDbMaker/St_tpcPadConfigC.h"
63 #define __MaxNumberOfTimeBins__ 512
64 typedef std::vector<Short_t> StVectorADC;
65 typedef std::vector<UShort_t> StVectorIDT;
71 void add(Short_t adc) {mAdc.push_back(adc);}
72 void add(Short_t adc,Int_t idt) {mAdc.push_back(adc); mIdt.push_back(idt);}
74 Short_t* adc()
const {
return (Short_t*)&mAdc[0];}
75 Bool_t isIdt()
const {
return mAdc.size() == mIdt.size();}
76 UShort_t*idt()
const {
return (UShort_t*) (isIdt() ? &mIdt[0] : 0);}
77 Int_t size()
const {
return mAdc.size();}
78 UShort_t time()
const {
return mTime;}
87 typedef std::vector<StDigitalPair> StDigitalTimeBins;
88 typedef std::vector<StDigitalTimeBins> StDigitalPadRow;
89 typedef std::vector<StDigitalPadRow> StDigitalSector;
91 typedef std::vector<StDigitalPair>::iterator StDigitalTimeBinIterator;
92 typedef StDigitalTimeBins::iterator StDigitalTimeBinsIterator;
93 typedef StDigitalPadRow::iterator StDigitalPadRowIterator;
94 typedef StDigitalSector::iterator StDigitalRowIterator;
96 typedef std::vector<StSequence> StVecSequence;
97 typedef std::vector<UShort_t*> StVecIds;
98 typedef std::vector<UChar_t> StVecPads;
99 typedef std::vector<UChar_t> StVecUChar;
100 typedef std::vector<Int_t> StVecInt;
101 typedef std::vector<StTpcPixel> StVectPixel;
109 const StDigitalTimeBins* timeBinsOfRowAndPad(Int_t rowN, Int_t padN)
const {
return (&mData[(rowN-1)][(padN-1)]);}
110 StDigitalTimeBins* timeBinsOfRowAndPad(Int_t rowN, Int_t padN) {
return (&mData[(rowN-1)][(padN-1)]);}
111 StDigitalPadRow* padsOfRow(Int_t rowN) {
return (&mData[(rowN-1)]);}
112 StDigitalSector* rows() {
return (&mData);}
114 Int_t numberOfRows()
const {
return mData.size();}
115 Int_t numberOfPadsInRow(Int_t rowN)
const {
return mData[(rowN-1)].size();}
116 Int_t numberOfTimeBins(Int_t rowN, Int_t padN)
const {
return mData[(rowN-1)][(padN-1)].size();}
119 void assignTimeBins(
int row ,
int pad, StDigitalTimeBins*);
120 Int_t getSequences(Int_t row, Int_t pad, Int_t *nSeq,
StSequence** seq, UShort_t ***Id);
121 Int_t getPadList(Int_t row, UChar_t **padList);
122 Int_t getTimeAdc(Int_t row, Int_t pad, Short_t ADCs[__MaxNumberOfTimeBins__],
123 UShort_t IDTs[__MaxNumberOfTimeBins__]);
124 Int_t getTimeAdc(Int_t row, Int_t pad, UChar_t ADCs[__MaxNumberOfTimeBins__],
125 UShort_t IDTs[__MaxNumberOfTimeBins__]);
126 Int_t putTimeAdc(Int_t row, Int_t pad, Short_t *ADCs, UShort_t *IDTs = 0);
127 Int_t putTimeAdc(Int_t row, Int_t pad, UChar_t *ADCs, UShort_t *IDTs = 0);
128 void setSector(Int_t sector) {mSector = sector;}
131 virtual void Print(
const Option_t *opt=
"")
const;
132 virtual Int_t PrintTimeAdc(Int_t row, Int_t pad)
const;
134 Int_t numberOfPadsAtRow(Int_t row) {
return (row > 0 && row <= mNoRows) ? St_tpcPadConfigC::instance()->padsPerRow(mSector, row) : 0;}
136 Int_t sector() {
return mSector;}
137 Int_t numberOfRows() {
return mNoRows;}
142 StDigitalSector mData;
145 StVecSequence mSequence;
153 StTpcRawData(Int_t noSectors = 24) {setNoSectors(noSectors);}
155 UInt_t size() {
return mSectors.size();}
156 UInt_t getNoSectors() {
return size();}
157 StTpcDigitalSector *GetSector(UInt_t sector) {
return sector > 0 && sector <= size() ? mSectors[sector-1] : 0;}
159 Int_t getVecOfPixels(StVectPixel &pixels, Int_t sector, Int_t row, Int_t padMin = 1, Int_t padMax = -1,
160 Int_t tMin = 0, Int_t tMax = -1);
161 void setNoSectors(UInt_t noSectors = 0) {mSectors.resize(noSectors);
for (UInt_t i = 0; i < noSectors; i++) mSectors[i] = 0;}
163 void clear() {Clear();}
164 void Clear(
const Option_t *opt =
"");
166 virtual void Print(
const Option_t *opt=
"")
const;
168 std::vector<StTpcDigitalSector*> mSectors;