StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Wevent2009.h
1 // $Id: Wevent2009.h,v 1.9 2013/01/15 23:26:35 fisyak Exp $
2 //
3 //*-- Author : Jan Balewski, MIT
4 
5 //----------------------------
6 //------- W-reco event container
7 //----------------------------
8 #ifndef W_EVENT_2009_HH
9 #define W_EVENT_2009_HH
10 
11 #include <TVector3.h>
12 //get L2
13 #include <StTriggerUtilities/L2Emulator/L2wAlgo/L2wResult2009.h>
14 
15 #include <StMuDSTMaker/COMMON/StMuTrack.h>
16 #include "WanaConst.h"
17 
18 //---------------
19 class WeveCluster { // info BTOW cluster
20  public:
21  float energy,ET, adcSum;
22  int nTower; // with non-zero ADC>kSigPed
23  int iEta, iPhi; // lower-left corner of the cluster, can be negative, L2-indexing convention
24  TVector3 position; // 3D ln(E) weighted sume of tower positions
25  WeveCluster() {clear();}
26 
27  void clear() { position=TVector3(0,0,0);
28  ET=energy=adcSum=0; nTower=0; iEta=iPhi=999;}
29  void print( int flag=0){
30  printf(" Cluster ET=%.1f E=%.1f GeV, sumAdc=%.0f nTw=%d iEta=%d, iPhi=%d XYZ(%.0f,%.0f,%.0f)cm\n",ET,energy,adcSum,nTower,iEta, iPhi,position.x(),position.y(),position.z());}
31 };
32 
33 
34 
35 //---------------
36 class WevePointTower { // tower pointed by the track
37  public:
38  TVector3 R; // extrapolated position at tower entrance
39  int id;
40  int iEta, iPhi; // eta x phi bin using L2 indexing convention
41  void clear() { id=0; R=TVector3(0,0,0); iEta=iPhi=9999;}
42  void print( int flag=0){
43  printf(" pointed tower ID=%d; L2index: iEta=%d iPhi=%d; XYZ=(%.0f,%.0f,%.0f)cm\n",
44  id,iEta, iPhi, R.x(), R.y(), R.z());
45  }
46 };
47 
48 //---------------
49 class WeveEleTrack { // electron track info
50  public:
51  int isMatch2Cl; // result of cuts
52  WevePointTower pointTower;
53  const StMuTrack *glMuTrack, *prMuTrack;
54  WeveCluster cluster,cl4x4;
55  TVector3 primP; // primary momentum vector
56  float nearTpcPT, nearEmcET, nearBtowET, nearEtowET, smallNearTpcPT; // (GeV/c), around prim track direction
57  float awayTpcPT, awayEmcET, awayBtowET, awayEtowET; // (GeV/c), opposite in phi to prim track direction
58  float nearTotET, awayTotET, nearTotET_noEEMC, awayTotET_noEEMC; // (GeV), for nearCone 10 GeV is subtracted to avoid double counting
59  int awayNTr,nearNTr,smallNearNTr; // # tracks on away side
60  int awayNTow,nearNTow; // # towers on away aide
61 
62  TVector3 ptBalance,ptBalance_noEEMC;
63  float sPtBalance,sPtBalance_noEEMC;// signed pT balance (GeV/c)
64 
65  TVector3 hadronicRecoil;
66 
67  WeveEleTrack() {clear();}
68 
69  void clear() { pointTower.clear();
70  cluster.clear();cl4x4.clear(); isMatch2Cl=false; primP=TVector3(0,0,0);
71  prMuTrack=glMuTrack=0;
72  awayTpcPT=nearTpcPT=nearTotET=awayTotET=nearEmcET=awayEmcET=nearBtowET=awayBtowET=nearEtowET=awayEtowET=smallNearTpcPT=nearTotET_noEEMC=awayTotET_noEEMC=0; awayNTr=awayNTow=nearNTr=nearNTow=smallNearNTr=0;
73 
74  ptBalance=TVector3(0,0,0); ptBalance_noEEMC=TVector3(0,0,0);
75  sPtBalance=sPtBalance_noEEMC=0;
76 
77  hadronicRecoil=TVector3(0,0,0); }
78 
79  void print( int flag=0){
80  if(prMuTrack==0) { printf(" Track NULL pointer???\n"); return;}
81  printf(" Track glPT=%.1f GeV/c isMatch2Cl=%d, nearTotET=%.1f, awayTotET=%.1f primPT=%.1f\n",
82  glMuTrack->pt(),isMatch2Cl,nearTotET, awayTotET,primP.Pt());
83  pointTower.print(flag);
84  cluster.print(flag);
85  TVector3 D=pointTower.R-cluster.position;
86  printf(" XYZ(track-cluster): |3D dist|=%.1fcm delZ=%.1fcm\n",D.Mag(),D.z());
87  printf(" 4x4 :"); cl4x4.print(flag);
88  printf(" nearET/GeV: TPC=%.1f Emc=%.1f (BTOW=%.1f ETOW=%.1f) sum=%.1f\n",nearTpcPT,nearEmcET,nearBtowET,nearEtowET,nearTotET);
89  printf(" awayET/GeV: TPC=%.1f Emc=%.1f (BTOW=%.1f ETOW=%.1f) sum=%.1f\n",awayTpcPT,awayEmcET,awayBtowET,awayEtowET,awayTotET);
90  printf(" nearTr=%d nearTow=%d awayTr=%d awayTow=%d \n",nearNTr,nearNTow,awayNTr,awayNTow);
91  }
92 };
93 
94 //---------------
95 class WeveVertex { // info about vertex
96  public:
97  int id; // as store do muDst list
98  float z; // cm
99  float funnyRank;
100  vector <WeveEleTrack> eleTrack;
101 
102  void clear() {
103  id=-999; z=-999; funnyRank=-9999;
104  eleTrack.clear();
105  }
106 
107  void print( int flag=0){
108  printf(" Vertex ID=%d Z=%.1f cm nTrack=%d\n",id,z, eleTrack.size());
109  for(unsigned int i=0;i< eleTrack.size();i++)
110  eleTrack[i].print();
111  }
112 
113 };
114 
115 //---------------
116 class WeveBEMC { // info about BEMC
117  public:
118  //raw BTOW/BPRS hits
119  int tileIn[mxBTile]; // 0 if no data
120  float adcTile[mxBTile][mxBtow];
121  float eneTile[mxBTile][mxBtow];
122  int statTile[mxBTile][mxBtow];
123 
124  //raw BSMD hits, both planes
125  float adcBsmd[mxBSmd][mxBStrips];
126  int statBsmd[mxBSmd][mxBStrips];
127 
128  void clear() {
129  memset(adcTile,0,sizeof(adcTile));
130  memset(eneTile,0,sizeof(eneTile));
131  memset(statTile,-1,sizeof(statTile)); // default all dead
132  memset(tileIn,0,sizeof(tileIn)); // detector was On/Off
133  memset(adcBsmd,0,sizeof(adcBsmd));
134  memset(statBsmd,-1,sizeof(statBsmd));// default all dead
135  // memset(,0,sizeof());
136  }
137 
138  void print( int flag=0){
139  printf(" BTOW tower ADC>500 list: ");
140  for(int i=0;i< mxBtow;i++) {
141  if(adcTile[kBTow][i]<500) continue;
142  int id=i+1;
143  printf("id=%d adc=%.1f ene=%.1f; ",id,adcTile[kBTow][i],eneTile[kBTow][i]);
144  } printf("\n");
145 
146  printf(" BSMDE tower ADC>200 list: ");
147  for(int i=0;i< mxBStrips;i++) {
148  if(adcBsmd[ kBSE][i]<200) continue;
149  int id=i+1;
150  int module= 1+i/150;
151  printf("id=%d mod=%d adc=%.1f ; ",id,module,adcBsmd[ kBSE][i]);
152  } printf("\n");
153 
154  if(flag&1) {//..................
155  for(int i=0;i<120;i++) {
156  int id=7+i*40;
157  if(i%10==0) printf("\n softID=%4d adc format BTOW:BPRS= ",id);
158  printf("%.0f : %.0f, ", adcTile[kBTow][id-1], adcTile[kBPrs][id-1]);
159  }
160  printf("\n");
161  }
162  }// end of print
163 
164 };
165 
166 //--------------
167 class WeveETOW { // info about ETOW
168  public:
169 
170  //raw ETOW hit
171  int etowIn;
172  float adc[mxEtowSec*mxEtowSub][mxEtowEta]; //[phibin][etabin]
173  float ene[mxEtowSec*mxEtowSub][mxEtowEta];
174  int stat[mxEtowSec*mxEtowSub][mxEtowEta];
175 
176  void clear() {
177  memset(adc,0,sizeof(adc));
178  memset(ene,0,sizeof(ene));
179  memset(stat,-1,sizeof(stat)); // default all dead
180  }
181 
182 };
183 
184 //---------------
185 class Wevent2009 {
186  public:
187  // .....variables ....
188  L2wResult2009 *l2algo;
189  int l2bitET,l2bitRnd;
190  int trigAwaySum[16]; //for lumi
191  int trigTotalSum; //for lumi
192 
193  int id; // eventID
194  int bx7, bx48; // raw from muDst
195  bool zTag,wTag;
196  vector < WeveVertex> vertex;
197  WeveBEMC bemc;
198  WeveETOW etow;
199  // .... methods ....
200  Wevent2009() { clear();}
201 
202  void clear() {
203  //printf("W2009event:clear()\n");
204  id=0;
205  l2bitET=l2bitRnd=0;
206  bx7=bx48=-1;
207  zTag=false;
208  wTag=false;
209  vertex.clear();
210  bemc.clear();
211  etow.clear();
212  }
213 
214  //...........................
215  void print( int flag=0, int isMC=0) {
216  printf("\nmy W2009event ID=%d L2Wbits: ET=%d rnd=%d; bx7=%d bx48=%d nVert=%d\n",id,l2bitET,l2bitRnd,bx7,bx48, vertex.size());
217  if(!isMC)L2wResult2009_print(l2algo);
218  for(unsigned int i=0;i< vertex.size();i++) vertex[i].print(flag);
219  bemc.print(flag);
220 
221  }// end of PRINT
222 
223 
224 };
225 
226 #endif
227 
228 
229 // $Log: Wevent2009.h,v $
230 // Revision 1.9 2013/01/15 23:26:35 fisyak
231 // add sys/types.h for APPLE
232 //
233 // Revision 1.8 2011/09/14 14:23:21 stevens4
234 // update used for cross section PRD paper
235 //
236 // Revision 1.7 2010/12/02 18:31:43 rcorliss
237 // updated lumi code to match the starnote version
238 //
239 // Revision 1.6 2010/04/27 16:53:45 stevens4
240 // add code to remove events tagged as Zs from W candidates
241 //
242 // Revision 1.5 2010/03/14 22:50:31 balewski
243 // *** empty log message ***
244 //
245 // Revision 1.4 2010/01/10 01:45:10 stevens4
246 // fix plots w/o EEMC in veto
247 //
248 // Revision 1.3 2010/01/09 00:07:16 stevens4
249 // add jet finder
250 //
251 // Revision 1.2 2010/01/06 19:16:48 stevens4
252 // track cuts now on primary component, cleanup
253 //
254 // Revision 1.1 2009/11/23 23:00:18 balewski
255 // code moved spin-pool
256 //
Double_t pt() const
Returns pT at point of dca to primary vertex.
Definition: StMuTrack.h:256