StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBemcTrigger.h
1 //
2 // $Id: StBemcTrigger.h,v 1.16 2007/05/14 16:23:44 rfatemi Exp $
3 //
4 //
5 
6 #ifndef StMaker_H
7 #include "StMaker.h"
8 #endif
9 
10 #ifndef STAR_StBemcTrigger
11 #define STAR_StBemcTrigger
12 #include "TObject.h"
13 
14 #include "StMessMgr.h"
15 
16 #define kNPatches 300
17 #define kNJet 12
18 #define kNTowers 4800
19 #define k12bits 4096
20 #define kN_sequences 25 //# TP inside a JP as defined by StEmcDecoder
21 
22 class StEmcGeom;
23 class StEmcDecoder;
24 class StEvent;
25 class StBemcTables;
26 
27 struct emcTrigger
28 {
29 
30  short HTBits; /* High tower bits selection */
31  short PatchStatus[kNPatches]; /* online trigger patch masks */
32  short TowerStatus[kNTowers]; /* online single tower masks */
33  short HT[kNPatches]; /* trigger patch HT adc */
34  short HTID[kNPatches]; /* trigger patch HT id */
35  short Patch[kNPatches]; /* trigger patch adc */
36  short Jet[kNJet]; /* jet patch adc */
37  short Et; /* total Et */
38 };
39 
40 class StBemcTrigger: public TObject
41 {
42 private:
43 
44  StEmcGeom* mGeo;
45  StEmcDecoder* mDecoder;
46  StEvent* mEvent;
47  StBemcTables* mTables;
48  emcTrigger mTrigger;
49 
50  int get2003Trigger();
51  int get2004Trigger();
52  int get2005Trigger();
53  int get2006Trigger();
54  void PatchMap();
55 
56  int mIsTrig[50];//1==true,0==false
57  int mTowJetId[50];//JP_ID/HT_ID of trigger
58  int mDsmAdc[50];//DSM ADC of trigger
59  int mnumHT[12];//#towers in trigger
60  int mnumJP[12];//#patches in trigger
61  int mnumHTTP[6];//#HT+TP which fullf HTTP trigger
62  int mHT12005array[kNTowers];//array of towers which pass trigger
63  int mJP12005array[kNJet];//array of JP's which pass trigger
64  int mHT22005array[kNTowers];//array of towers which pass trigger
65  int mJP22005array[kNJet];//array of JP's which pass trigger
66  int mJPSI2005adc[kNJet];//array of adc of HT in each JP
67  int mJPSI2005id[kNJet];//array of id of HT in each JP
68  int mHT22006array[6][kNTowers];//array of towers which pass trigger
69  int mJP02006array[6][kNJet];//array of JP's which pass trigger
70  int mJP12006array[6][kNJet];//array of JP's which pass trigger
71  int mJPSI2006adc[6][kNJet];//array of adc of HT in each JP
72  int mJPSI2006id[6][kNJet];//array of id of HT in each JP
73  int mHTTP2006arrayHT[6][kNPatches];
74  int mHTTP2006arrayHTADC[6][kNPatches];
75  int mHTTP2006arrayTP[6][kNPatches];
76  int mHTTP2006arrayTPADC[6][kNPatches];
77  int mBL12006arrayADC[kNJet];
78 
79  int mIs2003HT1;
80  int mIs2003HT2;
81  int mIs2004HT1;
82  int mIs2004JP1;
83  int mIs2004HT2;
84  int mIs2004JP2;
85  int mIs2005HT1;
86  int mIs2005JP1;
87  int mIs2005HT2;
88  int mIs2005JP2;
89  int mIs2005ADJ;
90  int mIs2005JPSI;
91  int mIs2006HT2[6];
92  int mIs2006JP0[6];
93  int mIs2006JP1[6];
94  int mIs2006JPSI[6];
95  int mIs2006BHTTP[6];
96 
97  int HT1_ID_2003;
98  int HT2_ID_2003;
99  int HT1_ID_2004;
100  int HT2_ID_2004;
101  int JP1_ID_2004;
102  int JP2_ID_2004;
103  int HT1_ID_2005;
104  int HT2_ID_2005;
105  int JP1_ID_2005;
106  int JP2_ID_2005;
107  int ADJ_ID_2005;
108  int HT2_ID_2006[6];
109  int JP0_ID_2006[6];
110  int JP1_ID_2006[6];
111 
112  int HT1_DSM_2003;
113  int HT2_DSM_2003;
114  int HT1_DSM_2004;
115  int HT2_DSM_2004;
116  int JP1_DSM_2004;
117  int JP2_DSM_2004;
118  int HT1_DSM_2005;
119  int HT2_DSM_2005;
120  int JP1_DSM_2005;
121  int JP2_DSM_2005;
122  int ADJ_DSM_2005;
123  int HT2_DSM_2006[6];
124  int JP0_DSM_2006[6];
125  int JP1_DSM_2006[6];
126  int JP_TP[12][25];
127  int BETOT_DSM_2006;
128 
129  int numHT1_2005;
130  int numHT2_2005;
131  int numJP1_2005;
132  int numJP2_2005;
133  int numADJ_2005;
134  int numHT2_2006[6];
135  int numJP0_2006[6];
136  int numJP1_2006[6];
137  int numHTTP_2006[6];
138 
139  int HT1_2005_array[kNTowers];
140  int HT2_2005_array[kNTowers];
141  int JP1_2005_array[kNJet];
142  int JP2_2005_array[kNJet];
143  int JPSI_2005_ADC[kNJet];
144  int JPSI_2005_ID[kNJet];
145  int HT2_2006_array[6][kNTowers];
146  int JP0_2006_array[6][kNJet];
147  int JP1_2006_array[6][kNJet];
148  int JPSI_2006_ADC[6][kNJet];
149  int JPSI_2006_ID[6][kNJet];
150  int BHTTP_2006_HT[6][kNPatches];
151  int BHTTP_2006_HT_ADC[6][kNPatches];
152  int BHTTP_2006_TP[6][kNPatches];
153  int BHTTP_2006_TP_ADC[6][kNPatches];
154  int BL1_ADC_2006[kNJet/2];
155 
156 public:
157 
158 
159  StBemcTrigger();
160  virtual ~StBemcTrigger();
161 
162  int makeTrigger();
163  void zero();
164  void resetConf();
165  void setEvent(StEvent* e) { mEvent = e; }
166  void setPrint(bool a) {
167  LOG_INFO << "::setPrint() is obsolete. Use logger config file to set verbosity instead." << endm;
168  }
169  void setTableMaker(StBemcTables *tab) { mTables =tab; }
170 
171  //1==true, 0==false, -1==problems
172  int* isTrigEvent() { return mIsTrig; }
173  //return JPID/towID -1==problems
174  int* getTowPatchId() { return mTowJetId; }
175  //DSM 6bit ADC
176  int* getTowPatchDSM() { return mDsmAdc; }
177  int* getNHT() { return mnumHT; }
178  int* getNJP() { return mnumJP; }
179  int* getNHTTP() { return numHTTP_2006; }
180  int* getHT12005array() { return mHT12005array; }
181  int* getHT22005array() { return mHT22005array; }
182  int* getJP12005array(){ return mJP12005array; }
183  int* getJP22005array() { return mJP22005array; }
184  int* getJPSI2005adc() { return mJPSI2005adc; }
185  int* getJPSI2005id() { return mJPSI2005id; }
186  int* getBL12006arrayADC() { return mBL12006arrayADC; }
187  int getHT22006array(int i,int j) { return mHT22006array[i][j]; }
188  int getJP02006array(int i,int j) { return mJP02006array[i][j]; }
189  int getJP12006array(int i,int j) { return mJP12006array[i][j]; }
190  int getJPSI2006adc(int i,int j) { return mJPSI2006adc[i][j]; }
191  int getJPSI2006id(int i,int j) { return mJPSI2006id[i][j]; }
192  int getHTTP2006arrayHT(int i, int j) { return mHTTP2006arrayHT[i][j]; }
193  int getHTTP2006arrayHTADC(int i, int j) { return mHTTP2006arrayHTADC[i][j]; }
194  int getHTTP2006arrayTP(int i, int j) { return mHTTP2006arrayTP[i][j]; }
195  int getHTTP2006arrayTPADC(int i, int j) { return mHTTP2006arrayTPADC[i][j]; }
196 
197  emcTrigger getTrigger() { return mTrigger; }
198  const StEmcDecoder* decoder() const { return mDecoder; }
199 
200  int trgPatch[300];//just for testing purposes!
201 
202  ClassDef(StBemcTrigger, 1)
203 };
204 
205 #endif
206 
207 
void setPrint(bool a)
Obsolete function; users can control messages with logger config file.