8 #ifndef W_EVENT_2011_HH
9 #define W_EVENT_2011_HH
14 #include <StTriggerUtilities/L2Emulator/L2wAlgo/L2wResult2009.h>
16 #include <StMuDSTMaker/COMMON/StMuTrack.h>
17 #include "WanaConst.h"
22 float energy,ET, adcSum;
29 void clear() { position=TVector3(0,0,0);
30 ET=energy=adcSum=0; nTower=0; iEta=iPhi=999;
33 void print(
int flag=0){
34 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());}
51 void clear() {
id=0; R=TVector3(0,0,0); Rglob=TVector3(0,0,0); iEta=iPhi=9999; }
52 void print(
int flag=0){
53 printf(
" pointed tower ID=%d; L2index: iEta=%d iPhi=%d; XYZ=(%.0f,%.0f,%.0f)cm\n",
54 id,iEta, iPhi, R.x(), R.y(), R.z());
71 float nearTpcPT, nearEmcET, nearBtowET, nearEtowET, smallNearTpcPT;
72 float awayTpcPT, awayEmcET, awayBtowET, awayEtowET;
73 float nearTotET, awayTotET, nearTotET_noEEMC, awayTotET_noEEMC;
75 TVector3 ptBalance,ptBalance_noEEMC;
76 float sPtBalance,sPtBalance_noEEMC;
77 float sPtBalance2,sPtBalance_noEEMC2;
80 TVector3 hadronicRecoil;
83 int hitSector;
int esmdGlobStrip[mxEsmdPlane];
84 float esmdShower[mxEsmdPlane][41];
85 float esmdDca[mxEsmdPlane];
float esmdDcaGlob[mxEsmdPlane];
86 float esmdE[mxEsmdPlane];
float esmdEsum7[mxEsmdPlane];
int esmdNhit[mxEsmdPlane];
87 float esmdPeakSumE[mxEsmdPlane];
int esmdPeakOffset[mxEsmdPlane];
89 TVector3 esmdXPcentroid;
93 float enePre1,enePre2,enePost;
97 void clear() { pointTower.clear();
98 cluster.clear();cl4x4.clear(); isMatch2Cl=
false; primP=TVector3(0,0,0);
99 prMuTrack=glMuTrack=0;
100 awayTpcPT=nearTpcPT=nearTotET=awayTotET=nearEmcET=awayEmcET=nearBtowET=awayBtowET=nearEtowET=awayEtowET=smallNearTpcPT=nearTotET_noEEMC=awayTotET_noEEMC=0;
101 enePre1=enePre2=enePost=0; esmdMaxADC=0;
103 ptBalance=TVector3(0,0,0); ptBalance_noEEMC=TVector3(0,0,0);
104 sPtBalance=sPtBalance_noEEMC=0;
105 sPtBalance2=sPtBalance_noEEMC2=0;
109 hadronicRecoil=TVector3(0,0,0);
111 memset(esmdGlobStrip,-999,
sizeof(esmdGlobStrip));
112 memset(esmdDca,-999.,
sizeof(esmdDca)); memset(esmdDcaGlob,-999.,
sizeof(esmdDcaGlob)); memset(esmdE,0.,
sizeof(esmdE)); memset(esmdEsum7,0.,
sizeof(esmdEsum7)); memset(esmdNhit,0,
sizeof(esmdNhit)); memset(esmdPeakSumE,0,
sizeof(esmdPeakSumE)); memset(esmdPeakOffset,0,
sizeof(esmdPeakOffset));
113 esmdXPcentroid=TVector3(0,0,0);
117 void print(
int flag=0){
118 if(prMuTrack==0) { printf(
" Track NULL pointer???\n");
return;}
119 printf(
" Track glPT=%.1f GeV/c isMatch2Cl=%d, nearTotET=%.1f, awayTotET=%.1f primPT=%.1f\n",
120 glMuTrack->
pt(),isMatch2Cl,nearTotET, awayTotET,primP.Pt());
121 pointTower.print(flag);
123 TVector3 D=pointTower.R-cluster.position;
124 printf(
" XYZ(track-cluster): |3D dist|=%.1fcm delZ=%.1fcm\n",D.Mag(),D.z());
125 printf(
" 4x4 :"); cl4x4.print(flag);
126 printf(
" nearET/GeV: TPC=%.1f Emc=%.1f (BTOW=%.1f ETOW=%.1f) sum=%.1f\n",nearTpcPT,nearEmcET,nearBtowET,nearEtowET,nearTotET);
127 printf(
" awayET/GeV: TPC=%.1f Emc=%.1f (BTOW=%.1f ETOW=%.1f) sum=%.1f\n",awayTpcPT,awayEmcET,awayBtowET,awayEtowET,awayTotET);
141 float rank,funnyRank;
143 vector <WeveEleTrack> eleTrack;
144 vector <StMuTrack*> prTrList;
147 id=-999; z=-999; funnyRank=-9999; rank=-9999;
148 eleTrack.clear(); nEEMCMatch=-999;
151 void print(
int flag=0){
152 printf(
" Vertex ID=%d Z=%.1f cm nTrack=%d\n",
id,z, eleTrack.size());
153 for(
unsigned int i=0;i< eleTrack.size();i++)
168 float adcTile[mxBTile][mxBtow];
169 float eneTile[mxBTile][mxBtow];
170 int statTile[mxBTile][mxBtow];
175 float adcBsmd[mxBSmd][mxBStrips];
176 int statBsmd[mxBSmd][mxBStrips];
179 memset(adcTile,0,
sizeof(adcTile));
180 memset(eneTile,0,
sizeof(eneTile));
181 memset(statTile,-1,
sizeof(statTile));
182 memset(tileIn,0,
sizeof(tileIn));
183 memset(adcBsmd,0,
sizeof(adcBsmd));
184 memset(statBsmd,-1,
sizeof(statBsmd));
189 void print(
int flag=0){
190 printf(
" BTOW tower ADC>500 list: ");
191 for(
int i=0;i< mxBtow;i++) {
192 if(adcTile[kBTow][i]<500)
continue;
194 printf(
"id=%d adc=%.1f ene=%.1f; ",
id,adcTile[kBTow][i],eneTile[kBTow][i]);
198 printf(
" BSMDE tower ADC>200 list: ");
199 for(
int i=0;i< mxBStrips;i++) {
200 if(adcBsmd[ kBSE][i]<200)
continue;
203 printf(
"id=%d mod=%d adc=%.1f ; ",
id,module,adcBsmd[ kBSE][i]);
207 printf(
" BTOW maxAdc=%.1f maxHtDsm=%d\n",maxAdc, maxHtDsm);
210 for(
int i=0;i<120;i++) {
212 if(i%10==0) printf(
"\n softID=%4d adc format BTOW:BPRS= ",
id);
213 printf(
"%.0f : %.0f, ", adcTile[kBTow][
id-1], adcTile[kBPrs][
id-1]);
231 float adc[mxEtowSec*mxEtowSub][mxEtowEta];
232 float ene[mxEtowSec*mxEtowSub][mxEtowEta];
233 int stat[mxEtowSec*mxEtowSub][mxEtowEta];
235 int maxSec,maxSub,maxEta;
239 memset(adc,0,
sizeof(adc));
240 memset(ene,0,
sizeof(ene));
241 memset(stat,-1,
sizeof(stat));
243 maxSec=maxSub=maxEta=0;
259 float adc[mxEtowSec*mxEtowSub][mxEtowEta][mxPrs];
260 float ene[mxEtowSec*mxEtowSub][mxEtowEta][mxPrs];
261 int stat[mxEtowSec*mxEtowSub][mxEtowEta][mxPrs];
264 memset(adc,0,
sizeof(adc));
265 memset(ene,0,
sizeof(ene));
266 memset(stat,-1,
sizeof(stat));
281 float adc[mxEtowSec][mxEsmdPlane][mxEsmdStrip];
282 float ene[mxEtowSec][mxEsmdPlane][mxEsmdStrip];
283 int stat[mxEtowSec][mxEsmdPlane][mxEsmdStrip];
286 memset(adc,0,
sizeof(adc));
287 memset(ene,0,
sizeof(ene));
288 memset(stat,-1,
sizeof(stat));
302 int l2bitET,l2bitRnd;
303 int l2EbitET,l2EbitRnd;
312 int bxStar7, bxStar48, spin4;
314 vector <WeveVertex>
vertex;
328 l2EbitET=l2EbitRnd=0;
331 bxStar7=bxStar48= spin4=-1;
334 etow.clear(); eprs.clear(); esmd.clear();
338 void print(
int flag=0,
int isMC=0) {
339 printf(
"\nmy W2011event runNo=%d ID=%d L2Wbits: ET=%d rnd=%d; muDst: bx7=%d bx48=%d nVert=%d star: Bx7m=%d, Bx48=%d, spin4=%d \n",runNo,
id,l2bitET,l2bitRnd,bx7,bx48,
vertex.size(),bxStar7, bxStar48, spin4);
340 int yyyymmdd, hhmmss; getGmt_day_hour( yyyymmdd, hhmmss);
341 printf(
" event time is: day=%d, hour=%d (GMT)\n",yyyymmdd,hhmmss);
343 for(
unsigned int i=0;i<
vertex.size();i++)
vertex[i].print(flag);
348 void getGmt_day_hour(
int & yyyymmdd,
int & hhmmss) {
349 time_t rawtime=this->time;
350 struct tm * timeinfo= gmtime ( &rawtime );
352 strftime (buffer,80,
"%k%M%S",timeinfo);
355 strftime (buffer,80,
"%G%m%d",timeinfo);
357 yyyymmdd=atoi(buffer);
Double_t pt() const
Returns pT at point of dca to primary vertex.