StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTriggerData2005.h
1 /***************************************************************************
2  *
3  * $Id: StTriggerData2005.h,v 2.9 2009/02/11 23:33:55 jeromel Exp $
4  *
5  * Author: Akio Ogawa, Oct 2004
6  ***************************************************************************
7  *
8  * Description: Concrete implementation of StTriggerData.
9  * For year 2005 only.
10  *
11  ***************************************************************************
12  *
13  * $Log: StTriggerData2005.h,v $
14  * Revision 2.9 2009/02/11 23:33:55 jeromel
15  * Modifications by Akio to support getDsm0_BEMCE and getDsm0_BEMCW as well as
16  * getDsm1_BEMC. However, use of const=0 impose implementation (was not done
17  * in years < 2009). Added methods with return 0.
18  *
19  * Revision 2.8 2006/09/20 00:44:56 ullrich
20  * Modified method to return length of L2 results.
21  *
22  * Revision 2.7 2006/09/19 22:53:55 ullrich
23  * Added access method to L2 results.
24  *
25  * Revision 2.6 2006/09/13 23:59:55 ullrich
26  * Added new data member mRun. Removed arg run from ctb(), ctbTraySlat(), zdcSMD()
27  *
28  * Revision 2.5 2006/08/21 19:41:51 ullrich
29  * Add run number as argument to ctb(), ctbTray(), and zdcSMD(). Used 2005 only. (Akio)
30  *
31  * Revision 2.4 2006/05/04 19:05:51 ullrich
32  * Added stuff to handle L2 results data.
33  *
34  * Revision 2.3 2006/03/22 20:58:21 ullrich
35  * Added interface to L2 results (offsets).
36  *
37  * Revision 2.2 2004/11/30 19:19:12 ullrich
38  * Added new access function for EEMC data (Akio).
39  *
40  * Revision 2.1 2004/11/02 21:18:39 ullrich
41  * Initial Revision.
42  *
43  **************************************************************************/
44 #ifndef StTriggerData2005_hh
45 #define StTriggerData2005_hh
46 
47 #include "StTriggerData.h"
48 
49 struct TrgDataType2005;
50 
52 public:
54  StTriggerData2005(const TrgDataType2005*, int run);
56 
57  void dump() const; //dump data into text
58 
59  // versison and data type information
60  unsigned int version() const;
61  unsigned int numberOfPreXing() const;
62  unsigned int numberOfPostXing() const;
63 
64  // generic Trigger infomations
65  unsigned int token() const;
66  unsigned int triggerWord() const;
67  unsigned int actionWord() const;
68  unsigned short busyStatus() const;
69  unsigned short dsmInput() const;
70  unsigned short trgToken() const;
71  unsigned short dsmAddress() const;
72  unsigned short mAddBits() const;
73  unsigned short bcData(int channel) const;
74 
75  //L2 offsets
76  int L2ResultsOffset(StL2AlgorithmId id) const;
77  bool isL2Triggered(StL2TriggerResultType id) const;
78 
79  // bunch and spin bits
80  unsigned int bunchCounterHigh() const;
81  unsigned int bunchCounterLow() const;
82  unsigned int bunchId48Bit() const;
83  unsigned int bunchId7Bit() const;
84  unsigned int spinBit() const;
85  unsigned int spinBitYellowFilled() const;
86  unsigned int spinBitYellowUp() const;
87  unsigned int spinBitYellowDown() const;
88  unsigned int spinBitYellowUnpol() const;
89  unsigned int spinBitBlueFilled() const;
90  unsigned int spinBitBlueUp() const;
91  unsigned int spinBitBlueDown() const;
92  unsigned int spinBitBlueUnpol() const;
93 
94  // High Level Trigger info
95  unsigned short tcuBits() const;
96  unsigned short lastDSM(int address) const;
97  unsigned short bemcLayer1DSM(int channel, int prepost=0) const;
98  unsigned short eemcLayer1DSM(int channel, int prepost=0) const;
99  unsigned short emcLayer2DSM(int channel) const;
100  unsigned short fpdLayer1DSMRaw(StBeamDirection eastwest, int channel, int prepost=0) const;
101  unsigned short fpdLayer1DSM(StBeamDirection eastwest, int module, int board, int prepost=0) const;
102  unsigned short fpdLayer2DSMRaw(int channel) const;
103  unsigned short fpdLayer2DSM(StBeamDirection eastwest, int module) const;
104 
105  // CTB
106  unsigned short ctbRaw(int address, int prepost=0) const;
107  unsigned short ctb(int pmt, int prepost=0) const;
108  unsigned short ctbTraySlat(int tray, int slat, int prepost=0) const;
109  unsigned short ctbSum(int prepost=0) const;
110 
111  // MWC
112  unsigned short mwc(int pmt, int prepost=0) const;
113 
114  // BBC
115  unsigned short bbcADC(StBeamDirection eastwest, int pmt, int prepost=0) const;
116  unsigned short bbcTDC(StBeamDirection eastwest, int pmt, int prepost=0) const;
117  unsigned short bbcADCSum(StBeamDirection eastwest, int prepost=0) const;
118  unsigned short bbcADCSumLargeTile(StBeamDirection eastwest, int prepost=0) const;
119  unsigned short bbcEarliestTDC(StBeamDirection eastwest, int prepost=0) const;
120  unsigned short bbcTimeDifference() const;
121 
122  // FPD
123  unsigned short fpd(StBeamDirection eastwest, int module, int pmt, int prepost=0) const;
124  unsigned short fpdSum(StBeamDirection eastwest, int module) const;
125 
126  //ZDC
127  unsigned short zdcAtChannel(int channel, int prepost=0) const;
128  unsigned short zdcAtAddress(int address, int prepost=0) const;
129  unsigned short zdcUnAttenuated(StBeamDirection eastwest, int prepost=0) const;
130  unsigned short zdcAttenuated(StBeamDirection eastwest, int prepost=0) const;
131  unsigned short zdcADC(StBeamDirection eastwest, int pmt, int prepost=0) const;
132  unsigned short zdcTDC(StBeamDirection eastwest, int prepost=0) const;
133  unsigned short zdcHardwareSum(int prepost=0) const;
134 
135  //ZDCSMD
136  unsigned short zdcSMD(StBeamDirection eastwest, int verthori, int strip, int prepost=0) const;
137 
138  // EMC
139  unsigned char bemcHighTower(int patch_id, int prepost=0) const;
140  unsigned char bemcJetPatch (int patch_id, int prepost=0) const;
141  unsigned char eemcHighTower(int patch_id, int prepost=0) const;
142  unsigned char eemcJetPatch (int patch_id, int prepost=0) const;
143  unsigned char bemcHighestTowerADC(int prepost=0) const;
144  unsigned char eemcHighestTowerADC(int prepost=0) const;
145 
146  // experts only
147  char* getTriggerStructure();
148  TrgDataType2005* getTriggerStructure2005();
149  int getRawSize() const;
150 
151  unsigned char* getDsm0_BEMCE(int prepost=0) const { return 0;}
152  unsigned char* getDsm0_BEMCW(int prepost=0) const { return 0;}
153  unsigned char * getDsm0_EEMC(int prepost=0) const;
154  unsigned short int* getDsm1_BEMC(int prepost=0) const { return 0;}
155  unsigned short int * getDsm1_EEMC(int prepost=0) const;
156  unsigned short int * getDsm2_EMC() const;
157  unsigned short int * getDsm3() const;
158  unsigned int l2ResultLength() const;
159  const unsigned int* l2Result() const;
160 
161 protected:
162  TrgDataType2005 *mData;
163 
164  ClassDef(StTriggerData2005,1)
165 };
166 
167 #endif