17 #include <TPaveText.h>
23 #include <StMuDSTMaker/COMMON/StMuDstMaker.h>
24 #include <StMuDSTMaker/COMMON/StMuDst.h>
25 #include <StMuDSTMaker/COMMON/StMuTriggerIdCollection.h>
26 #include <StMuDSTMaker/COMMON/StMuEvent.h>
27 #include <StMuDSTMaker/COMMON/StMuTrack.h>
28 #include <StMuDSTMaker/COMMON/StMuPrimaryVertex.h>
29 #include "StEmcUtil/geometry/StEmcGeom.h"
32 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
33 #include "StEEmcUtil/StEEmcSmd/EEmcSmdGeom.h"
35 #include "St2011WMaker.h"
36 #include "WanaConst.h"
37 #include "WeventDisplay.h"
40 WeventDisplay::WeventDisplay(
St2011WMaker* mk,
int mxEv) {
43 const float PI=TMath::Pi();
44 const char cPlane[ mxBSmd]={
'E',
'P'};
45 const char cEsmdPlane[ mxEsmdPlane]={
'U',
'V'};
46 char txt1[100], txt2[1000];
49 etaBL_ln=
new TLine(-1,-3.2,1,3.2); etaBL_ln->SetLineColor(kBlue);
50 etaBR_ln=
new TLine(-1,-3.2,1,3.2); etaBR_ln->SetLineColor(kBlue);
52 etaEL_ln=
new TLine(2,-3.2,3,3.2); etaEL_ln->SetLineColor(kGreen);
53 etaER_ln=
new TLine(2,-3.2,3,3.2); etaER_ln->SetLineColor(kGreen);
55 bxT=
new TBox(-1.3,0, 1.3,1.); bxT->SetFillStyle(0); bxT->SetLineStyle(2);
56 bxE=
new TBox(-1.3,0, 1,2.); bxE->SetFillStyle(0); bxE->SetLineStyle(2);
60 hEmcET=
new TH2F(
"eveBtowET",
"EMC ET sum, Z=[0.3,30]GeV; event eta ; phi",38,-1.4,2.4,63,-PI,PI);
62 hTpcET=
new TH2F(
"eveTpcET",
"TPC PT sum, Z[0.3,10]GeV/c; event eta ; phi",32,-1.6,1.6,63,-PI,PI);
64 for(
int iep=0;iep<mxBSmd;iep++) {
65 sprintf(txt1,
"eveBsmdAdc_%c",cPlane[iep]);
66 sprintf(txt2,
"BSMD_%c ADC sum Z=[30,1000]; event eta ; phi",cPlane[iep]);
67 hBsmdAdc[iep]=
new TH2F(txt1,txt2,26,-1.3,1.3,63,-PI,PI);
71 for(
int iuv=0; iuv<mxEsmdPlane; iuv++){
72 sprintf(txt1,
"eveEsmdShower_%c",cEsmdPlane[iuv]);
73 sprintf(txt2,
"ESMD_%c Shower Shape; i_strip position - track position (cm) ; MeV",cEsmdPlane[iuv]);
74 hEsmdShower[iuv]=
new TH1F(txt1,txt2,41,-10.25,10.25);
75 bxEs[iuv]=
new TBox(-5,0, 3,20.); bxEs[iuv]->SetFillStyle(3002); bxEs[iuv]->SetFillColor(kYellow);
78 hEsmdXpt=
new TH2F(
"eveEsmdXpt",
"ESMD Cross Point; X (cm); Y (cm)",100,0.,100,100,0.,100.);
83 float etabinsA[1+mxBetaStrMod*2], etaphibinsA[mxBMod2Pi+1];
84 for(
int i=0;i<mxBetaStrMod+1;i++)
85 etabinsA[mxBetaStrMod-i]=-(etabinsA[mxBetaStrMod+i]=wMK->mSmdEGeom->EtaB()[i]);
86 for(
int i=0;i<mxBMod2Pi+1;i++)
87 etaphibinsA[i]=wMK->mSmdEGeom->PhiB()[i];
88 hBsmdEtaAdc=
new TH2F(
"eveBsmdEtaAdc",
" Event: BSMD-Eta ADC vs. eta & phi; pseudorapidity; azimuth",mxBetaStrMod*2,etabinsA,mxBMod2Pi,etaphibinsA);
98 WeventDisplay::clear(){
101 for(
int iep=0;iep<mxBSmd;iep++) hBsmdAdc[iep]->Reset();
102 for(
int iuv=0;iuv<mxEsmdPlane;iuv++) hEsmdShower[iuv]->Reset();
110 WeventDisplay::draw(
const char *tit,
int eveID,
int daqSeq,
int runNo,
WeveVertex myV,
WeveEleTrack myTr){
111 if(maxEve<=0)
return;
113 TStyle *myStyle=
new TStyle();
115 myStyle->SetPalette(1,0);
116 myStyle->SetOptStat(1000010);
119 sprintf(txt,
"display-%s_run%d.eventId%06dvert%d",tit,runNo,eveID,myV.id);
121 printf(
"WeventDisplay::Draw %s\n",txt);
122 TCanvas *c0; TPaveText *pvt;
125 if(detector.compare(
"WB") == 0){
126 sprintf(txt,
"display-%s%.0f_run%d.eventId%05dvert%d",tit,myTr.cluster.ET,runNo,eveID,myV.id);
127 TFile hf(Form(
"%s.root",txt),
"recreate");
128 c0=
new TCanvas(txt,txt,850,600);
132 TPad *cU =
new TPad(tt+
"U", tt+
"U",0.,0.2,1.,1.); cU->Draw();
133 TPad *cD =
new TPad(tt+
"D", tt+
"D",0.,0.,1.,0.2); cD->Draw();
135 TPad *cU1 =
new TPad(tt+
"U1", tt+
"U1",0.,0.,0.24,1.); cU1->Draw();
136 TPad *cU2 =
new TPad(tt+
"U2", tt+
"U2",0.24,0.,0.55,1.); cU2->Draw();
137 TPad *cU3 =
new TPad(tt+
"U3", tt+
"U3",0.55,0.,1.,1.); cU3->Draw();
139 cU1->cd(); hTpcET->Draw(
"colz");
141 TVector3 rW=myTr.pointTower.R;
142 rW.SetZ(rW.z()-myV.z);
144 TEllipse *te1=
new TEllipse(rW.Eta(),rW.Phi(), 0.1,0.1);
145 te1->SetFillStyle(0);te1->SetLineStyle(3); te1->SetLineColor(kMagenta);
146 TEllipse *te2=
new TEllipse(rW.Eta(),rW.Phi(), 0.7, 0.7);
147 te2->SetFillStyle(0);te2->SetLineStyle(3); te2->SetLineColor(kBlack);
150 bxT->SetY1(rA.Phi() - wMK->par_awayDeltaPhi);
151 bxT->SetY2(rA.Phi() + wMK->par_awayDeltaPhi);
153 bxE->SetY1(rA.Phi() - wMK->par_awayDeltaPhi);
154 bxE->SetY2(rA.Phi() + wMK->par_awayDeltaPhi);
157 te1->Draw(); te2->Draw(); bxT->Draw(
"l");
158 etaBL_ln->Draw(); etaBR_ln->Draw(); etaEL_ln->Draw();
160 cU2->cd(); hEmcET->Draw(
"colz");
161 te1->Draw(); te2->Draw(); bxE->Draw(
"l");
162 etaBL_ln->Draw(); etaBR_ln->Draw();
163 etaEL_ln->Draw(); etaER_ln->Draw();
165 for(
int iep=0;iep<mxBSmd;iep++) {
167 hBsmdAdc[iep]->Draw(
"colz");
168 te1->Draw(); te2->Draw(); bxT->Draw(
"l");
169 etaBL_ln->Draw(); etaBR_ln->Draw();
173 pvt =
new TPaveText(0,0.,1,1,
"br");
175 sprintf(txt,
"run=%d eveID=%05d daq=%d vertex:ID=%d Z=%.0fcm",runNo,eveID,daqSeq,myV.id,myV.z);
176 printf(
"WeventDisplay::Event ID %s\n",txt);
179 sprintf(txt,
"TPC PT(GeV/c) near=%.1f away=%.1f ", myTr.nearTpcPT, myTr.awayTpcPT);
180 printf(
"WeventDisplay::Event TPC %s\n",txt);
183 sprintf(txt,
"BTOW ET/GeV: 2x2=%.1f near= %.1f away= %.1f",myTr.cluster.ET,myTr.nearBtowET,myTr.awayBtowET);
184 printf(
"WeventDisplay:: BTOW %s\n",txt);
187 sprintf(txt,
"Emc (Btow+Etow) ET/GeV: near= %.1f away= %.1f",myTr.nearEmcET,myTr.awayEmcET);
188 printf(
"WeventDisplay:: BTOW+ETOW %s\n",txt);
191 sprintf(txt,
"total ET/GeV: near= %.1f away= %.1f ptBalance= %.1f",myTr.nearTotET,myTr.awayTotET,myTr.ptBalance.Perp());
192 printf(
"WeventDisplay:: BTOW %s\n",txt);
198 for(
int iep=0;iep<mxBSmd;iep++) hBsmdAdc[iep]->Write();
202 else if(detector.compare(
"WE") == 0){
203 sprintf(txt,
"display-%s%.0f_run%d.eventId%05dvert%d",tit,myTr.cluster.ET,runNo,eveID,myV.id);
204 TFile hf(Form(
"%s.root",txt),
"recreate");
205 c0=
new TCanvas(txt,txt,1750,1300);
209 TPad *cL =
new TPad(tt+
"L", tt+
"L",0.,0.,0.6,1.); cL->Draw();
210 TPad *cR =
new TPad(tt+
"R", tt+
"R",0.6,0.,1.,1.); cR->Draw();
212 TPad *cLU =
new TPad(tt+
"LU", tt+
"LU",0.,0.2,1.,1.); cLU->Draw();
213 TPad *cLD =
new TPad(tt+
"LD", tt+
"LD",0.,0.,1.,0.2); cLD->Draw();
215 TPad *cLU1 =
new TPad(tt+
"LU1", tt+
"LU1",0.,0.,0.44,1.); cLU1->Draw();
216 TPad *cLU2 =
new TPad(tt+
"LU2", tt+
"LU2",0.44,0.,1.,1.); cLU2->Draw();
218 TPad *cRU =
new TPad(tt+
"RU", tt+
"RU",0.,0.5,1.,1.); cRU->Draw();
219 TPad *cRD =
new TPad(tt+
"RD", tt+
"RD",0.,0.,1.,0.5); cRD->Draw();
221 cLU1->cd(); hTpcET->Draw(
"colz");
223 TVector3 rW=myTr.pointTower.R;
224 rW.SetZ(rW.z()-myV.z);
225 TEllipse *te1=
new TEllipse(rW.Eta(),rW.Phi(), 0.1,0.1);
226 te1->SetFillStyle(0);te1->SetLineStyle(3); te1->SetLineColor(kMagenta);
227 TEllipse *te2=
new TEllipse(rW.Eta(),rW.Phi(), 0.7, 0.7);
228 te2->SetFillStyle(0);te2->SetLineStyle(3); te2->SetLineColor(kBlack);
231 bxT->SetY1(rA.Phi() - wMK->par_awayDeltaPhi);
232 bxT->SetY2(rA.Phi() + wMK->par_awayDeltaPhi);
234 bxE->SetY1(rA.Phi() - wMK->par_awayDeltaPhi);
235 bxE->SetY2(rA.Phi() + wMK->par_awayDeltaPhi);
237 te1->Draw(); te2->Draw(); bxT->Draw(
"l");
238 etaBL_ln->Draw(); etaBR_ln->Draw(); etaEL_ln->Draw();
240 cLU2->cd(); hEmcET->Draw(
"colz");
241 te1->Draw(); te2->Draw(); bxE->Draw(
"l");
242 etaBL_ln->Draw(); etaBR_ln->Draw();
243 etaEL_ln->Draw(); etaER_ln->Draw();
245 TList *Lx; TLine *tline; TLine *tlineGlob;
247 for(
int iuv=0; iuv<mxEsmdPlane; iuv++){
250 Lx=hEsmdShower[iuv]->GetListOfFunctions();
251 tline=
new TLine(myTr.esmdDca[iuv],0.,myTr.esmdDca[iuv],100.);
252 tline->SetLineColor(2);
253 tlineGlob=
new TLine(myTr.esmdGlobStrip[iuv]*0.5+myTr.esmdDcaGlob[iuv],0,myTr.esmdGlobStrip[iuv]*0.5+myTr.esmdDcaGlob[iuv],100.); tlineGlob->SetLineColor(2);
254 hEsmdShower[iuv]->Draw();
255 tline->Draw(); Lx->Add(tline);
256 tlineGlob->SetLineStyle(2); tlineGlob->Draw(); Lx->Add(tlineGlob);
257 hEsmdShower[iuv]->Draw();
259 bxEs[iuv]->SetX1( 0.5*(-wMK->parE_esmdGL+myTr.esmdPeakOffset[iuv]) -0.25);
260 bxEs[iuv]->SetX2( 0.5*(+wMK->parE_esmdGL+myTr.esmdPeakOffset[iuv]+1)-0.25);
261 bxEs[iuv]->SetY2( myTr.esmdPeakSumE[iuv]/(2*wMK->parE_esmdGL+1));
265 if( iuv==1 && myTr.prMuTrack->
pt() >= 100.0 ) {
266 TLatex* tx =
new TLatex(3,0.9*hEsmdShower[iuv]->GetMaximum(),
"| Q/P_{T} | < 0.01"); tx->SetTextColor(kRed); tx->SetTextSize(0.1); tx->Draw();
269 hEsmdShower[0]->SetFillColor(kBlue-5);
270 hEsmdShower[1]->SetFillColor(kGreen-5);
274 hEsmdXpt->Draw(
"colz");
276 int secLoop[3]={myTr.hitSector-2,myTr.hitSector-1,myTr.hitSector};
277 if(secLoop[0] < 0) secLoop[0]=11;
278 if(secLoop[2] > 11) secLoop[2]=0;
279 for(
int iuv=0; iuv<mxEsmdPlane; iuv++){
280 for(
int isec=0; isec<3; isec++){
281 for(
int k=0; k<288; k++){
283 if(!stripPtr)
continue;
284 if(wMK->wEve->esmd.ene[secLoop[isec]][iuv][k]*1e3 < 10.)
continue;
285 int nColor = (int) (wMK->wEve->esmd.ene[secLoop[isec]][iuv][k]*1e3)/20;
287 if(nColor==0) nSub=10;
288 if(nColor==1) nSub=8;
289 if(nColor==2) nSub=5;
290 if(nColor==3) nSub=1;
291 if(nColor==4) nSub=-4;
292 TVector3 end1=stripPtr->end1;
293 TVector3 end2=stripPtr->end2;
294 Lx=hEsmdXpt->GetListOfFunctions();
295 tline=
new TLine(end1.X(),end1.Y(),end2.X(),end2.Y());
296 if(iuv==0) tline->SetLineColor(kBlue-nSub);
297 if(iuv==1) tline->SetLineColor(kGreen-nSub);
298 if(wMK->wEve->esmd.adc[secLoop[isec]][iuv][k] > 3896) tline->SetLineColor(2);
299 tline->Draw(); Lx->Add(tline);
304 TEllipse *te3=
new TEllipse(rW.X(),rW.Y(), 2.0, 2.0);
305 te3->SetLineColor(kBlue); te3->SetFillStyle(0); te3->Draw();
308 TEllipse *te4=
new TEllipse(0.,0., 215., 215.);
309 te4->SetFillStyle(0); te4->SetLineColor(kBlue); te4->Draw(
"l");
310 TEllipse *te6=
new TEllipse(0.,0., 75., 75.);
311 te6->SetFillStyle(0); te6->SetLineColor(kBlue); te6->Draw(
"l");
313 for(
int iphi=0; iphi<12; iphi++){
314 float phi=(15.+ iphi*30.)/180.*TMath::Pi();
315 TVector3 r; r.SetPtThetaPhi(215,0,phi);
316 TVector3 rIn; rIn.SetPtThetaPhi(75,0,phi);
317 TLine *tl=
new TLine(rIn.X(),rIn.Y(),r.X(),r.Y());
318 tl->SetLineColor(kBlue); tl->Draw();
322 pvt =
new TPaveText(0,0.,1,1,
"br");
323 TH1F* hText =
new TH1F(
"text",
" ",1,0,1);
325 sprintf(txt,
"run=%d eveID=%05d daq=%d vertex:ID=%d Z=%.0fcm ",runNo,eveID,daqSeq,myV.id,myV.z);
326 printf(
"WeventDisplay::Event ID %s\n",txt);
327 pvt->AddText(txt); hText->SetTitle(Form(
"%s%s",hText->GetTitle(),txt));
328 sprintf(txt,
"TPC PT(GeV/c) prim=%.1f near=%.1f away=%.1f ", myTr.prMuTrack->
pt(),myTr.nearTpcPT, myTr.awayTpcPT);
329 printf(
"WeventDisplay::Event %s\n",txt);
330 pvt->AddText(txt); hText->SetTitle(Form(
"%s%s",hText->GetTitle(),txt));
332 sprintf(txt,
"ETOW ET/GeV: 2x2=%.1f EMC: near= %.1f away= %.1f ",myTr.cluster.ET,myTr.nearEmcET,myTr.awayEmcET);
333 printf(
"WeventDisplay:: %s\n",txt);
334 pvt->AddText(txt); hText->SetTitle(Form(
"%s%s",hText->GetTitle(),txt));
336 sprintf(txt,
"total ET/GeV: near= %.1f away= %.1f ptBalance= %.1f ",myTr.nearTotET,myTr.awayTotET,myTr.ptBalance.Perp());
337 printf(
"WeventDisplay:: %s\n",txt);
338 pvt->AddText(txt); hText->SetTitle(Form(
"%s%s",hText->GetTitle(),txt));
340 sprintf(txt,
"Q/Pt = %.3f : ESMD E/MeV U peak= %.1f V peak= %.1f ",(1.0*myTr.prMuTrack->
charge())/myTr.prMuTrack->
pt(),myTr.esmdPeakSumE[0],myTr.esmdPeakSumE[1]);
341 printf(
"WeventDisplay:: %s\n",txt);
342 pvt->AddText(txt); hText->SetTitle(Form(
"%s%s",hText->GetTitle(),txt));
344 float chi2=myTr.glMuTrack->
chi2();
if(chi2>999.) chi2=-1.;
345 sprintf(txt,
"Track: eta=%.1f Q=%d nFit=%d nPoss=%d r1=%.0f r2=%.0f chi2=%.1f",myTr.pointTower.R.Eta(),myTr.prMuTrack->
charge(),myTr.prMuTrack->
nHitsFit(),myTr.prMuTrack->
nHitsPoss(),myTr.glMuTrack->
firstPoint().perp(),myTr.glMuTrack->
lastPoint().perp(),chi2);
346 printf(
"WeventDisplay:: %s\n",txt);
347 pvt->AddText(txt); hText->SetTitle(Form(
"%s%s",hText->GetTitle(),txt));
354 hEsmdShower[0]->Write();
355 hEsmdShower[1]->Write();
370 if(maxEve<=0)
return;
372 int eveId=wMK->wEve->id;
373 int runNo=wMK->wEve->runNo;
374 const char *afile =
"";
375 int len=strlen(afile);
376 int daqSeq=atoi(afile+(len-18));
379 TVector3 rTw=myTr.cluster.position;
380 rTw.SetZ(rTw.z()-myV.z);
388 printf(
"WeventDisplay-%s::export run=%d eve=%d\n",tit,runNo,eveId);
391 for(
int i=0;i< mxBtow;i++) {
392 float ene=wMK->wEve->bemc.eneTile[kBTow][i];
394 TVector3 primP=wMK->positionBtow[i]-TVector3(0,0,zVert);
396 float ET=primP.Perp();
398 float eveEta=primP.Eta();
399 float evePhi=primP.Phi();
400 hEmcET->Fill(eveEta,evePhi,ET);
404 for(
int i=0;i<mxEtowPhiBin;i++){
405 for(
int j=0;j<mxEtowEta;j++){
406 float ene=wMK->wEve->etow.ene[i][j];
408 TVector3 primP=wMK->positionEtow[i][j]-TVector3(0,0,zVert);
410 float ET=primP.Perp();
412 float eveEta=primP.Eta();
413 float evePhi=primP.Phi();
414 hEmcET->Fill(eveEta,evePhi,ET);
418 hEmcET->SetMinimum(0.3); hEmcET->SetMaximum(30.);
421 float Rcylinder= wMK->mBtowGeom->Radius();
422 assert(wMK->mBtowGeom->getXYZ(20,x,y,z)==0);
423 TVector3 rL(Rcylinder,0,z+myV.z);
424 TVector3 rR(Rcylinder,0,z-myV.z);
425 float etaL=-rL.Eta(), etaR=rR.Eta();
426 etaBL_ln->SetX1(etaL); etaBL_ln->SetX2(etaL);
427 etaBR_ln->SetX1(etaR); etaBR_ln->SetX2(etaR);
430 rL=TVector3(0,214,270-myV.z);
431 rR=TVector3(0,77,270-myV.z);
432 etaL=rL.Eta(); etaR=rR.Eta();
433 etaEL_ln->SetX1(etaL); etaEL_ln->SetX2(etaL);
434 etaER_ln->SetX1(etaR); etaER_ln->SetX2(etaR);
438 hTpcET->SetMinimum(0.3);hTpcET->SetMaximum(10.);
439 if(wMK->mMuDstMaker) getPrimTracks( myV.id,myTr.pointTower.id);
440 else getPrimTracksFromTree(vertexIndex,myTr.pointTower.id);
444 for(
int iep=0;iep<mxBSmd;iep++) {
445 hBsmdAdc[iep]->SetMinimum(30);hBsmdAdc[iep]->SetMaximum(999);
446 for(
int i=0;i< mxBStrips;i++) {
447 float adc=wMK->wEve->bemc.adcBsmd[iep][i];
449 TVector3 r=wMK->positionBsmd[iep][i];
450 float z1=r.z()-zVert;
452 hBsmdAdc[iep]->Fill(r.Eta(),r.Phi(),adc);
457 for(
int iuv=0; iuv<mxEsmdPlane; iuv++)
458 for(
int j=0;j<41;j++)
459 hEsmdShower[iuv]->SetBinContent(j+1,myTr.esmdShower[iuv][j]);
463 TVector3 rW=myTr.pointTower.R;
465 hEsmdXpt->SetBins(130,rW.X()-width,rW.X()+width,130,rW.Y()-width,rW.Y()+width);
468 draw(tit,eveId, daqSeq,runNo,myV, myTr);
475 WeventDisplay::getPrimTracks(
int vertID,
int pointTowId) {
477 assert(vertID<(
int)wMK->mMuDstMaker->
muDst()->numberOfPrimaryVertices());
481 float rank=V->ranking();
484 Int_t nPrimTrAll=wMK->mMuDstMaker->
muDst()->GetNPrimaryTrack();
485 for(
int itr=0;itr<nPrimTrAll;itr++) {
487 if(prTr->
flag()<=0)
continue;
488 if(prTr->
flag()!=301 && pointTowId>0)
continue;
489 if(prTr->
flag()!=301 && prTr->
flag()!=311 && pointTowId<0)
continue;
491 if(hitFrac<wMK->par_nHitFrac)
continue;
493 TVector3 primP=TVector3(prPvect.x(),prPvect.y(),prPvect.z());
495 hTpcET->Fill(prTr->
eta(),prTr->
phi(),pT);
504 WeventDisplay::getPrimTracksFromTree(
int vertID,
int pointTowId) {
509 assert(vertID<(
int)wMK->wEve->vertex.size());
512 for(
unsigned int it=0;it<V.prTrList.size();it++){
514 if(prTr->
flag()<=0)
continue;
515 if(prTr->
flag()!=301 && pointTowId>0)
continue;
516 if(prTr->
flag()!=301 && prTr->
flag()!=311 && pointTowId<0)
continue;
518 if(hitFrac<wMK->par_nHitFrac)
continue;
520 TVector3 primP=TVector3(prPvect.x(),prPvect.y(),prPvect.z());
522 hTpcET->Fill(prTr->
eta(),prTr->
phi(),pT);
532 int eveId=wMK->mMuDstMaker->
muDst()->
event()->eventId();
533 int runNo=wMK->mMuDstMaker->
muDst()->
event()->runId();
535 sprintf(txt,
"display3D-%s_run%d.eventId%05d_vert%d.txt",tit,runNo,eveId,myV.id);
536 FILE *fd=fopen(txt,
"w"); assert(fd);
541 assert(vertID<(
int)wMK->mMuDstMaker->
muDst()->numberOfPrimaryVertices());
545 float rank=V->ranking();
548 Int_t nPrimTrAll=wMK->mMuDstMaker->
muDst()->GetNPrimaryTrack();
549 for(
int itr=0;itr<nPrimTrAll;itr++) {
551 if(prTr->
flag()<=0)
continue;
552 if(prTr->
flag()!=301)
continue;
554 if(hitFrac<wMK->par_nHitFrac)
continue;
556 fprintf(fd,
"track V %.1f %.3f %.3f primP:PT:eta:phi:Q %.1f %.3f %.3f %d\n",rV.x(),rV.y(),rV.z(), prTr->
p().perp(),prTr->
p().pseudoRapidity(),prTr->
p().phi(),prTr->
charge());
560 float Rcylinder= wMK->mBtowGeom->Radius(), Rcylinder2=Rcylinder*Rcylinder;
561 for(
int i=0;i< mxBtow;i++) {
562 float ene=wMK->wEve->bemc.eneTile[kBTow][i];
564 float delZ=wMK->positionBtow[i].z()-myV.z;
565 float e2et=Rcylinder/sqrt(Rcylinder2+delZ*delZ);
567 float detEta=wMK->positionBtow[i].Eta();
568 float detPhi=wMK->positionBtow[i].Phi();
569 fprintf(fd,
"btow V %.1f %.3f %.3f eveET:detEta:detPhi %.3f %.3f %.3f\n",rV.x(),rV.y(),rV.z(),ET, detEta,detPhi);
572 const char cPlane[ mxBSmd]={
'E',
'P'};
574 for(
int iep=0;iep<mxBSmd;iep++) {
575 for(
int i=0;i< mxBStrips;i++) {
576 float adc=wMK->wEve->bemc.adcBsmd[iep][i];
578 TVector3 r=wMK->positionBsmd[iep][i];
579 fprintf(fd,
"bsmd%c V %.1f %.3f %.3f adc:detEta:detPhi %.3f %.3f %.3f\n",cPlane[iep],rV.x(),rV.y(),rV.z(),adc,r.Eta(),r.Phi() );
584 for(
int iphi=0; iphi<mxEtowPhiBin; iphi++){
585 for(
int ieta=0; ieta<mxEtowEta; ieta++){
586 float ene=wMK->wEve->etow.ene[iphi][ieta];
588 TVector3 detP=wMK->positionEtow[iphi][ieta];
589 TVector3 primP=detP-TVector3(0,0,myV.z);
591 fprintf(fd,
"etow V %.1f %.3f %.3f eveET:detEta:detPhi %.3f %.3f %.3f\n",rV.x(),rV.y(),rV.z(),primP.Perp(), detP.Eta(),detP.Phi());
596 float eleET=myTr.cluster.ET;
597 fprintf(fd,
"recoElectron V %.1f %.3f %.3f ET:detEta:detPhi %.3f %.3f %.3f\n",rV.x(),rV.y(),rV.z() , eleET,myTr.pointTower.R.Eta(),myTr.pointTower.R.Phi());
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Double_t pt() const
Returns pT at point of dca to primary vertex.
Double_t chi2() const
Returns chi2 of fit.
UShort_t nHitsFit() const
Return total number of hits used in fit.
short flag() const
Returns flag, (see StEvent manual for type information)
Short_t charge() const
Returns charge.
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
const StThreeVectorF & firstPoint() const
Returns positions of first measured point.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
UShort_t nHitsPoss() const
Return number of possible hits on track.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
const StThreeVectorF & lastPoint() const
Returns positions of last measured point.
Double_t phi() const
Returns phi at point of dca to primary vertex.
muDst based extraction of W-signal from pp500 data from 2011
StructEEmcStrip * getStripPtr(const Int_t iStrip, const Int_t iUV, const Int_t iSec)
return a strip pointer from indices
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...