StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPxlRawHitMaker.h
1 
6 /***************************************************************************
7  *
8  * $Id: StPxlRawHitMaker.h,v 1.8 2016/03/03 07:36:10 qiuh Exp $
9  *
10  * Author: Jan Rusnak, Qiu Hao, Jan 2013, according codes from Xiangming Sun
11  ***************************************************************************
12  *
13  * Description:
14  * Read pixel raw hits from daq format. One raw hit is one fired pixel.
15  * More information at
16  * https://www.star.bnl.gov/protected/heavy/qiuh/HFT/software/PXL_software.pdf
17  *
18  ***************************************************************************
19  *
20  * $Log: StPxlRawHitMaker.h,v $
21  * Revision 1.8 2016/03/03 07:36:10 qiuh
22  * fix bug on row number, should use last row information FOR THE SAME SENSOR
23  *
24  * Revision 1.7 2014/08/06 11:43:35 jeromel
25  * Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
26  *
27  * Revision 1.6 2014/04/05 05:20:08 qiuh
28  * add Jtag file version print-out and some more warnings for data format errors
29  *
30  * Revision 1.5 2014/01/28 19:29:44 qiuh
31  * *** empty log message ***
32  *
33  *
34  **************************************************************************/
35 
36 #ifndef STAR_StPxlRawHitMaker
37 #define STAR_StPxlRawHitMaker
38 
39 #include "StMaker.h"
40 #include "StRTSBaseMaker.h"
41 
43 class StPxlDb;
44 
46 {
47 public:
48  StPxlRawHitMaker(const char *name = "pxl_raw_hit");
49  Int_t InitRun(Int_t runumber);
50  void Clear(const Option_t * = "");
51  Int_t Make();
52  Int_t Finish();
53 
54  virtual const char *GetCVS() const {
55  static const char cvs[] = "Tag $Name: $ $Id: StPxlRawHitMaker.h,v 1.8 2016/03/03 07:36:10 qiuh Exp $ built " __DATE__ " " __TIME__ ;
56  return cvs;
57  }
58 
59 protected:
60  void decodeSectorData();
61  Int_t getHitsDataLength();
62  void decodeHitsData();
63  void decodeWord(UInt_t val);
64  UInt_t mid(Int_t start, Int_t end, UInt_t input);
65  Int_t elementGetBit(UInt_t data, Int_t position);
66  Int_t decodeState0(Int_t val);
67  Int_t decodeStateN(Int_t val);
68 
70  UInt_t *mSectorData;
71  Int_t mSectorDataLength;
72  UInt_t *mHeaderData;
73  UInt_t *mHitsData;
74  Int_t mHitsDataLength;
75  UInt_t *mTrailerData;
76  Int_t mTrailerDataLength;
77 
79 
81  Int_t mSector;
82  Int_t mLadder;
83  Int_t mSensor;
84  Int_t mRow[40];
85  Int_t mColumn;
86 
88 
90 
92 
94  Short_t mHeaderLength;
96  UInt_t mHeaderToken;
97  UInt_t mSeparatorToken;
98  UInt_t mEndToken;
99  Short_t mChipIdStartBit;
100  Short_t mChipIdEndBit;
101  Short_t mChipIdPow;
102  Short_t mOverflowBit;
104  Short_t mCodingStartBit;
105  Short_t mCodingEndBit;
106  Short_t mDataStartBit;
107  Short_t mDataEndBit;
108  Short_t mDummyState;
109 
112  Short_t mSensorGoodStatusMax;
113 
116 
117  ClassDef(StPxlRawHitMaker, 1) //StAF chain virtual base class for Makers
118 };
119 
120 #endif
121 
Int_t decodeStateN(Int_t val)
decoding mainly to get fired column numbers in the current row
Int_t elementGetBit(UInt_t data, Int_t position)
get the bit at "position" of "data" word
Short_t mOverflowBit
bit for row overflow (more fired columns than can be read)
Int_t mLadder
ladder 1-4
Short_t mDummyState
dummy state when the last state from a sensor ends on the lower 16 bits of a 32-bit word ...
Class StRTSBaseMaker - is an abstract StMaker to define the interface to access the DAQ data from the...
Int_t mSensor
sensor 1-10
Int_t mColumn
column 0-959
void decodeSectorData()
decode data of a sector
Short_t mDataEndBit
end bit for "data", which can be row or column number, depending on rowOrColumnFlag ...
Short_t mChipIdStartBit
start bit for chip id
Short_t mRowColumnGoodStatus
row and column good status
Int_t mRow[40]
row 0-927, data from 40 sensors on a sector is mixed, need to keep 40 current row numbers ...
Short_t mCodingEndBit
end bit for "coding", which means how many sequential fired columns
UInt_t mid(Int_t start, Int_t end, UInt_t input)
decode the bits between "start" and "end" in the "input" word
UInt_t * mSectorData
pointers and lengths for data blocks
Int_t mJtagFileVersion
Jtag configure file version.
Short_t mHardwareIdPosition
position for hardware id, including sector number
Short_t mChipIdEndBit
end bit for chip id
Short_t mChipIdPow
chipId = mChipIdPow*chipIdFromHigher16Bits+chipIdFromLower16Bits
Short_t mCodingStartBit
start bit for "coding", which means how many sequential fired columns
Int_t mSector
current sector, ladder, sensor, row, column that is being worked on
Short_t mHeaderLength
decoding control paramters according to firmware
Short_t mDataStartBit
start bit for "data", which can be row or column number, depending on rowOrColumnFlag ...
Int_t getHitsDataLength()
get length of the hits data block
Int_t mOverFlowCount
count for overflow rows
Int_t decodeState0(Int_t val)
decoding mainly to get the row number for the following fired columns
Short_t mRowOrColumnFlagBit
bit for rowOrColumnFlag, which determine whether "data" is row or column number
void decodeHitsData()
decode the hits data block of a sector
Short_t mSensorGoodStatusMin
sensor good status range
StPxlDb * mPxlDb
pxl db structure containing geometry, db information and so on
StPxlRawHitCollection * mPxlRawHitCollection
generated raw hit collection
void decodeWord(UInt_t val)
decode a word (32 bits)