9 char* file =
"st_physics_12033050_raw_4010001.MuDst.root",
16 inDir=
"/star/data05/scratch/balewski/stW-2012A/data/";
17 file=
"st_W_13078014_raw_4360001.MuDst.root";
20 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
21 loadSharedLibraries();
23 cout <<
" loading done " << endl;
30 muMk =
new StMuDstMaker(0,0,inDir,file,
"MuDst.root",nFiles);
31 TChain* tree=muMk->
chain(); assert(tree);
32 int nEntries=(int) tree->GetEntries();
33 printf(
"total eve in muDst chain =%d\n",nEntries);
34 if(nEntries<0)
return;
40 h1=
new TH1F(
"nP",
"# of prim tracks per vertex",100,0,200);
41 h2=
new TH1F(
"vR",
"PPV Vertex rank; rank", 300, -1.2e6, 1.2e6); h2->SetLineColor(kRed);
42 h3=
new TH1F(
"vRL",
"PPV Vertex rank, funny X-axis; X=Log10(rank-1e6)+ offset", 150, -9,21);
43 h2->GetXaxis()->SetTitleSize(.043);
44 h2->GetXaxis()->SetTitleSize(.043);
46 h4=
new TH1F(
"trPhi",
" prim tracks phi if PT>1.0 GeV/c; phi (rad)",50,-3.2,3.2);
47 h5=
new TH1F(
"zVerTrg",
" Z trg-vertex , rank>0; Z (cm)", 50,-200,200);
48 h6=
new TH1F(
"zVerPlp",
" Z pileup-vertex , rank<0; Z (cm)", 50,-200,200);
49 h7=
new TH1F(
"nPrV",
"# of prim tr used by PPV; rank>0",15,0,30);
54 for (Int_t iev=0;iev<nEntries; iev++) {
55 if(eventCounter>=nEve)
break;
57 int stat = chain->
Make();
65 int nPrimV=muMk->
muDst()->numberOfPrimaryVertices();
69 bool isL2EW=tic->nominal().isTrigger(trigID);
71 Int_t nGlobTrAll=muMk->
muDst()->GetNGlobalTrack();
73 TArrayI& l2Array = muEve->L2Result();
75 if(eventCounter%1==0) {
76 printf(
"ieve=%d eventID %d nPrimV=%d nGlobTrAll=%d =============\n", eventCounter,info.id(),nPrimV,nGlobTrAll);
77 printf(
"TrigID=%d fired=%d\n",trigID,isL2EW);
83 if(0)
for(iv=0;iv<nPrimV;iv++) {
89 printf(
"iv=%d Vz=%.2f +/-%.2f \n",iv,r.z(),er.z() );
93 Int_t nPrimTrAll=muMk->
muDst()->GetNPrimaryTrack();
94 for(itr=0;itr<nPrimTrAll;itr++) {
96 if(pr_track->
flag()<=0)
continue;
99 if(nPrimV>0)h1->Fill(nPrimTr);
100 float rank=V->ranking();
102 if(rank>1e6) h3->Fill(log(rank-1e6)+10);
103 else if(rank>0) h3->Fill(log(rank));
104 else h3->Fill(log(rank+1e6)-10);
106 if(1)printf(
" nPrimTr=%d , Z=%.1f VFid=%d:: ntrVF=%d nCtb=%d nBemc=%d nEEmc=%d nTpc=%d sumPt=%.1f rank=%g\n"
107 ,nPrimTr,r.z(), V->vertexFinderId() ,V->nTracksUsed() ,V->nCTBMatch() ,V-> nBEMCMatch() ,V->nEEMCMatch() ,V->nCrossCentralMembrane() ,V->sumTrackPt() ,V->ranking());
108 if (rank>0) h5->Fill(r.z());
109 if (rank>0) h7->Fill(V->nTracksUsed());
110 if (rank<0) h6->Fill(r.z());
114 for(iv=0;iv<nPrimV;iv++) {
116 Int_t nPrimTrAll=muMk->
muDst()->GetNPrimaryTrack();
117 cout<<
"\n Prim "<<nPrimTrAll<<
" tracks belonging to "<<iv<<
"-th prim vertex"<<endl;
122 for(itr=0;itr<nPrimTrAll;itr++) {
124 if(pr_track->
flag()<=0)
continue;
126 cout <<
"\nPrimary track " << ntr <<
" momentum(P vect) " << pr_track->
p() <<
" PT="<<pr_track->
pt()<<
" recoCharge="<<pr_track->
charge()<< endl; cout <<
"\t flag=" << pr_track->
flag() <<
" nHits=" << pr_track->
nHits()<<
" vertID="<< pr_track->
vertexIndex()<< endl;
127 cout <<
"\t primV("<<iv<<
") primDCA=" << pr_track->
dca(iv) << endl;
128 if(pr_track->
dca(iv).mag()>5) cout <<
"^^^^^ 3D DCA magnitude="<<pr_track->
dca(iv).mag()<<endl;
131 if(pr_track->
pt()>1.0) h4->Fill(pr_track->
phi());
141 printf(
" No EMC data for this event\n");
153 printf(
"****************************************** \n");
157 float tMnt=(t2-t1)/60.;
158 float rate=1.*eventCounter/(t2-t1);
159 printf(
"sorting done %d of nEve=%d, CPU rate=%.1f Hz, total time %.1f minute(s) \n\n",eventCounter,nEntries,rate,tMnt);
160 c=
new TCanvas(); c->Divide(2,2);
161 c->cd(1); h5->Fit(
"gaus");
162 c->cd(3); h6->Fit(
"gaus");
163 c->cd(2); h3->Draw();
164 c->cd(4); h7->Draw();
179 printf(
"\Total %d hits in Tower (only ADC>0)\n",emc->getNEndcapTowerADC());
181 for (i=0; i< emc->getNEndcapTowerADC(); i++) {
182 emc->getEndcapTowerADC(i,adc,sec,sub,eta);
183 if (adc<=0)
continue;
185 printf(
"i=%d Tower %2.2dT%c%2.2d adc=%4d\n",i,sec,sub+
'A'-1,eta,adc );
187 int adcX=1000+ (eta-1) + (sub-1)*12 +(sec-1)*60;
190 printf(
" Total %d towers with ADC>0\n",nh);
197 int sec,eta,sub,pre,adc;
201 nh= emc->getNEndcapPrsHits();
202 printf(
"\nTotal %d hits in pre1+2+post\n",nh);
203 for (i=0; i<nh; i++) {
204 hit=emc->getEndcapPrsHit(i,sec,sub,eta,pre);
205 int ss=sub + 5*(pre-1);
207 printf(
"i=%d pre/post(%d) %2.2d%c%c%2.2d : energy=%f adc=%d\n",i,pre,sec,pre+
'P'-1,sub+
'A'-1,eta,hit->
getEnergy(),adc);
208 int adcX= (eta-1) + (sub-1) *12 +(sec-1)*60 + 1000*pre;
222 for(uv=
'U'; uv<=
'V'; uv++) {
223 int nh= emc->getNEndcapSmdHits(uv);
224 printf(
"\nTotal %d hits in SMD-%c\n",nh,uv);
225 for (
int i=0; i<nh; i++) {
226 hit=emc->getEndcapSmdHit(uv,i,sec,strip);
228 printf(
" SMD-%c %2.2d%c%3.3d : energy=%f adc=%d\n",uv,sec,uv,strip,hit->
getEnergy(),adc);
229 int adcX= 1000 + strip-1 +(sec-1)*300;
243 printf(
"\Total hits in Tower (only ADC>0)\n");
245 for (i=0; i< 4800; i++) {
246 int adc = emc->getTowerADC(i);
247 if (adc<=1000)
continue;
249 printf(
" Tower id=%d adc=%4d\n",i,adc );
252 printf(
" --> %d towers with ADC>thr\n",nh);
263 nh = emc->getNPrsHits();
264 printf(
"\nTotal %d hits in pre1\n",nh);
267 for (i=0; i<nh; i++) {
273 printf(
"BPRS i=%d, id=%d adc = %d\n",i,
id,adc);
275 printf(
" --> %d BPRS hits with ADC>thr\n",n1);
283 int nh = emc->getNSmdHits(3);
284 printf(
"\nTotal %d hits in SMDE\n",nh);
285 for (
int i=0; i<nh; i++) {
291 printf(
"BSMDE i=%d, id=%d adc = %d\n",i,
id,adc);
294 int nh = emc->getNSmdHits(4);
295 printf(
"\nTotal %d hits in SMDP\n",nh);
296 for (
int i=0; i<nh; i++) {
297 hit = emc->getSmdHit(i,4);
302 printf(
"BSMDP i=%d,id=%d adc = %d\n",i,
id,adc);
305 printf(
" --> %d BSMD-E & %d BSMD-P hits with ADC>thr\n",n1,n2);
309 printL2Trig( TArrayI& l2Array) {
311 printf(
"AccessL2Decision() from regular muDst: L2Ar-size=%d\n",l2Array.GetSize());
312 unsigned int *l2res=(
unsigned int *)l2Array.GetArray();
313 for(
int i=0;i<l2Array.GetSize();i++){
314 if(l2res[i]==0)
continue;
315 printf(
"i=%d val=0x%08x\n",i,l2res[i]);
324 vector<unsigned int> idL=l1.triggerIds();
325 printf(
"nTrig=%d, trigID: ",idL.size());
326 for(
unsigned int i=0;i<idL.size(); i++){
327 printf(
"%d, ",idL[i]);
329 printf(
"\n dump L2Array:");
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
int getId() const
Return Module number.
Int_t vertexIndex() const
Returns index of associated primary vertex.
float getEnergy() const
Return Hit energy.
Double_t pt() const
Returns pT at point of dca to primary vertex.
virtual void Clear(Option_t *option="")
User defined functions.
int getAdc() const
Return ADC value.
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.
virtual void ls(Option_t *option="") const
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
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.
Double_t phi() const
Returns phi at point of dca to primary vertex.
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...
Collection of trigger ids as stored in MuDst.