5 TH1F *hA[8], *hT[4], *hF[4];
10 char* file =
"st_physics_6145042_raw_2040013.MuDst.root",
12 char* inDir =
"out1/",
19 inDir=
"/star/data04/sim/balewski/tmp2/";
20 file=
"st_physics_6111024_raw_1040001.MuDst.root";
22 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
23 loadSharedLibraries();
24 cout <<
" loading done " << endl;
31 muMk =
new StMuDstMaker(0,0,inDir,file,
"MuDst.root",nFiles);
32 TChain* tree=muMk->
chain(); assert(tree);
33 int nEntries=(int)tree->GetEntries();
34 printf(
"total eve in chain =%d\n",nEntries);
35 printf(
"in=%s%s=\n",inDir,file);
45 if(eventCounter>=nEve)
break;
56 int nPrimV=muMk->
muDst()->numberOfPrimaryVertices();
60 bool fired=tic.nominal().isTrigger(trigID);
62 Int_t nPrimTrAll=muMk->
muDst()->GetNPrimaryTrack();
63 Int_t nGlobTrAll=muMk->
muDst()->GetNGlobalTrack();
65 if(eventCounter%1000==0) printf(
"\n\n ====================%d processing eventID %d nPrimV=%d nPrimTr=%d nGlobTrAll=%d =============\n", eventCounter,info.id(),nPrimV,nPrimTrAll,nGlobTrAll);
72 for(iv=0;iv<nPrimV;iv++) {
80 float rank1K=V->ranking()/1000.;
82 ((TH2F*) hA[6])->Fill(er.z() ,rank1K);
84 if(nPrimV==1 && iv==0) hA[1]->Fill(rank1K);
86 if(iv==0)hA[2]->Fill(rank1K);
87 if(iv==1)hA[3]->Fill(rank1K);
88 if(iv==2)hA[4]->Fill(rank1K);
94 for(itr=0;itr<nPrimTrAll;itr++) {
97 if(pr_track->
flag()<=0)
continue;
105 printf(
" nPrimTr=%d , VFid=%d:: ntrVF=%d nCtb=%d nBemc=%d nEEmc=%d nTpc=%d sumPt=%.1f rank=%g\n"
106 ,nPrimTr, V->vertexFinderId() ,V->nTracksUsed() ,V->nCTBMatch() ,V-> nBEMCMatch() ,V->nEEMCMatch() ,V->nCrossCentralMembrane() ,V->sumTrackPt() ,V->ranking());
111 for(iv=0;iv<nPrimV;iv++) {
112 printf(
" Prim tracks belonging to %d prim vertex:\n",iv);
115 for(itr=0;itr<nPrimTrAll;itr++) {
118 if(pr_track->
flag()<=0)
continue;
120 cout <<
"\nPrimary track " << ntr <<
" momentum " << pr_track->
p() << endl; cout <<
"\t flag=" << pr_track->
flag() <<
" nHits=" << pr_track->
nHits()<<
" vertID="<< pr_track->
vertexIndex()<< endl;
121 cout <<
"\t primV("<<iv<<
") primDCA=" << pr_track->
dca(iv) << endl;
122 if(pr_track->
dca(iv).mag()>5) cout <<
"^^^^^ 3D DCA magnitude="<<pr_track->
dca(iv).mag()<<endl;
137 hf=
new TFile(
"out.hist.root",
"recreate");
138 hA[0]=
new TH1F(
"nV",
"# of prim vertices per eve; # vertex",10,-0.5,9.5);
140 for(iv=0;iv<mxv;iv++) {
141 char tt1[100], tt2[300];
142 sprintf(tt1,
"nPTv%d",iv);
143 sprintf(tt2,
"nFitPoint for TPC prim tracks for vertex%d",iv);
144 hT[iv]=
new TH1F(tt1,tt2,50,-0.5,49.5);
146 sprintf(tt1,
"nPFv%d",iv);
147 sprintf(tt2,
"nFitPoint for FTPC prim tracks for vertex%d",iv);
148 hF[iv]=
new TH1F(tt1,tt2,50,-0.5,49.5);
151 hA[1]=
new TH1F(
"L11",
"vertex rank of 1st vertex if only one found; vertex rank/1000",100,0,20);
152 hA[2]=
new TH1F(
"Ln1",
"vertex rank of 1st vertex if more than one found; vertex rank/1000",100,0,20);
153 hA[3]=
new TH1F(
"Ln2",
"vertex rank of 2nd vertex if more than one found; vertex rank/1000",100,0,10);
154 hA[4]=
new TH1F(
"Ln3",
"vertex rank of 3rd vertex if more than one found; vertex rank/1000",100,0,10);
155 hA[5]=
new TH1F(
"zEr",
"vertex Z-error; error Z (cm)",1000,0,1.);
156 TH2F *h2=
new TH2F(
"zErL",
"Rank vs. vertex Z-error ; error Z (cm); rank/1000",100,0,0.5,100,0,20.);
158 hA[7]=
new TH1F(
"Ln2d1",
"ratio of vertex rank 2nd/1st ; rank2/rank1",100,0,1.);
165 fd=
new TFile(
"out.hist.root");
166 assert(fd->IsOpen());
190 printf(
"=%s=\n",tt1.Data());
192 h=(TH1F*)fd->Get(tt1); assert(h);
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Int_t vertexIndex() const
Returns index of associated primary vertex.
virtual void Clear(Option_t *option="")
User defined functions.
UShort_t nHitsFit() const
Return total number of hits used in fit.
short flag() const
Returns flag, (see StEvent manual for type information)
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
virtual void ls(Option_t *option="") const
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
UShort_t nHits() const
Bingchu.
StThreeVectorF dca(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex.
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
Collection of trigger ids as stored in MuDst.
StTrackTopologyMap topologyMap() const
Returns topology map.