StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TPCV2P0_Reader.hh
1 /***************************************************************************
2  * $Id: TPCV2P0_Reader.hh,v 1.5 1999/07/22 17:56:27 levine Exp $
3  * Author: Jeff Landgraf and M.J. LeVine
4  ***************************************************************************
5  * Description: common definitions for TPC
6  *
7  *
8  * change log
9  * 09-Jul-99 MJL added pointer to Bank_TPCP as arg to TPC_Reader constructor
10  * removed navigation code from TPC_Reader
11  *
12  ***************************************************************************
13  * $Log: TPCV2P0_Reader.hh,v $
14  * Revision 1.5 1999/07/22 17:56:27 levine
15  * add TPCMZCLD (mezz cluster pointer bank) description
16  *
17  * Revision 1.4 1999/07/10 21:31:26 levine
18  * Detectors RICH, EMC, TRG now have their own (defined by each detector) interfaces.
19  * Existing user code will not have to change any calls to TPC-like detector
20  * readers.
21  *
22  * Revision 1.3 1999/07/04 01:43:25 levine
23  * minor changes to make solaris CC compiler happy
24  *
25  * Revision 1.2 1999/07/02 04:43:24 levine
26  * Many changes -
27  * navigates to head of TPCP bank independent of position.
28  * move declarations out of loops where they were upsetting some compilers
29  * suppress output from class libraries with run-time switch EventReader.verbose
30  * added TPCV2P0_CPP_SR::getAsicParams()
31  *
32  *
33  **************************************************************************/
34 #ifndef TPCV2P0_READER_HH
35 #define TPCV2P0_READER_HH
36 #include "StDaqLib/GENERIC/EventReader.hh"
37 
38 // actual number of pads in each row
39 #define TPC_ROWS_PER_SECTOR 45
40 
41 static const unsigned char tpcRowLen[TPC_ROWS_PER_SECTOR] = {
42 88,96,104,112,118,126,134,142,150,158,166,174,182,98,100,102,104,106,
43 106,108,110,112,112,114,116,118,120,122,122,124,126,128,128,130,132,134,
44 136,138,138,140,142,144,144,144,144} ;
45 
46 
47 //embed version number in bank name
48 #ifdef classname
49 #undef classname
50 #endif
51 #define classname(x) x ## V2P0
52 
53 // Detector Reader Virtual Class
54 
55 struct classname(Bank_TPCP);
56 struct classname(Bank_TPCSECP);
57 struct classname(Bank_TPCRBP);
58 struct classname(Bank_TPCMZP);
59 
60 class TPCV2P0_PADK_SR ;
61 
62 struct classname(Bank_TPCADCD) ;
63 struct classname(Bank_TPCSEQD) ;
64 struct classname(Bank_TPCADCX) ;
65 struct classname(Bank_TPCPADK) ;
66 struct classname(Bank_TPCCPPR) ;
67 struct classname(Bank_TPCADCR) ;
68 struct classname(Bank_TPCCFGR) ;
69 struct classname(Bank_TPCPEDR) ;
70 struct classname(Bank_TPCRMSR) ;
71 struct classname(Bank_TPCGAINR) ;
72 struct classname(Bank_TPCBADR) ;
73 struct classname(Bank_TPCMZCLD) ;
74 
75 
77 {
78  friend class EventReader;
79  friend class TPCV2P0_ZS_SR;
80  friend class TPCV2P0_ADCR_SR;
81  friend class TPCV2P0_PEDR_SR;
82  friend class TPCV2P0_PRMS_SR;
83  friend class TPCV2P0_G_SR;
84  friend class TPCV2P0_CPP_SR;
85  friend class TPCV2P0_BC_SR;
86  friend class TPCV2P0_CR_SR;
87  friend class TPCV2P0_PADK_SR;
88 
89 public:
90  ZeroSuppressedReader *getZeroSuppressedReader(int sector);
91  ADCRawReader *getADCRawReader(int sector);
92  PedestalReader *getPedestalReader(int sector);
93  PedestalRMSReader *getPedestalRMSReader(int sector);
94  GainReader *getGainReader(int sector);
95  CPPReader *getCPPReader(int sector);
96  BadChannelReader *getBadChannelReader(int sector);
97  ConfigReader *getConfigReader(int sector);
98 
99  TPCV2P0_Reader(EventReader *er, classname(Bank_TPCP) *ptpc);
100  ~TPCV2P0_Reader();
101 
102  int MemUsed();
103 
104 protected:
105  // MemoryManager MemMan;
106 
107  // copy of EventReader pointer
108  EventReader *ercpy;
109 
110  // Bank Pointers
111  Bank_DATAP *pBankDATAP;
112  classname(Bank_TPCP) *pBankTPCP;
113  classname(Bank_TPCSECP) *getBankTPCSECP(int hypersector);
114  classname(Bank_TPCRBP) *getBankTPCRBP(int interleaved_rb, classname(Bank_TPCSECP) *pBank_TPCSECP);
115  classname(Bank_TPCMZP) *getBankTPCMZP(int mz, classname(Bank_TPCRBP) *pBank_TPCRBP);
116  classname(Bank_TPCMZP) *getBankTPCMZP(int sector, int rb, int mz);
117  classname(Bank_TPCMZCLD) *getBankTPCMZCLD(int sector, int rb, int mz);
118  // Sector Reader Buffers
119  TPCV2P0_PADK_SR *getPADKReader(int sector);
120  TPCV2P0_PADK_SR *padk[24]; // One PADK for each sector
121 
122  // Useful functions
123  classname(Bank_TPCADCD) *getBankTPCADCD(int sector, int rb, int mz);
124  classname(Bank_TPCSEQD) *getBankTPCSEQD(int sector, int rb, int mz);
125  classname(Bank_TPCADCX) *getBankTPCADCX(int sector, int rb, int mz);
126  classname(Bank_TPCPADK) *getBankTPCPADK(int sector, int rb, int mz);
127  classname(Bank_TPCCPPR) *getBankTPCCPPR(int sector, int rb, int mz);
128  classname(Bank_TPCADCR) *getBankTPCADCR(int sector, int rb, int mz);
129  classname(Bank_TPCCFGR) *getBankTPCCFGR(int sector, int rb, int mz);
130  classname(Bank_TPCPEDR) *getBankTPCPEDR(int sector, int rb, int mz);
131  classname(Bank_TPCRMSR) *getBankTPCRMSR(int sector, int rb, int mz);
132  classname(Bank_TPCGAINR) *getBankTPCGAINR(int sector, int rb, int mz);
133  classname(Bank_TPCBADR) *getBankTPCBADR(int sector, int rb, int mz);
134 
135  // Buffer and index functions for the various readers.
136  // Initially these will do nothing. Add functionality
137  // to increase performance
138  int InformBuffers(ZeroSuppressedReader *, int sector) { return FALSE; };
139  int InformBuffers(ADCRawReader *,int sector) { return FALSE; };
140  int InformBuffers(PedestalReader *,int sector) { return FALSE; };
141  int InformBuffers(PedestalRMSReader *,int sector) { return FALSE; };
142  int InformBuffers(GainReader *,int sector) { return FALSE; };
143  int InformBuffers(CPPReader *,int sector) { return FALSE; };
144  int InformBuffers(BadChannelReader *,int sector) { return FALSE; };
145  int InformBuffers(ConfigReader *,int sector) { return FALSE; };
146 
147  int AttachBuffers(ZeroSuppressedReader *, int sector) { return FALSE; };
148  int AttachBuffers(ADCRawReader *, int sector) { return FALSE; };
149  int AttachBuffers(PedestalReader *, int sector) { return FALSE; };
150  int AttachBuffers(PedestalRMSReader *, int sector) { return FALSE; };
151  int AttachBuffers(GainReader *, int sector) { return FALSE; };
152  int AttachBuffers(CPPReader *, int sector) { return FALSE; };
153  int AttachBuffers(BadChannelReader *, int sector) { return FALSE; };
154  int AttachBuffers(ConfigReader *, int sector) { return FALSE; };
155 };
156 
157 #endif
Definition: rb.hh:21