4 proLcpTree(
int cut=0, TString run=
"R3010006",
int maxEve=10000,
5 TString wrkDir=
"/star/data04/sim/balewski/LcpRun2/maxEta1.0/",
6 TString outPath=
"fixMe/"
8 printf(
"#cut %d -->%s \n",cut,outPath.Data(),run.Data());
10 gStyle->SetPalette(1,0);
11 gStyle->SetOptStat(1111111);
13 printf(
"#run %s\n",run.Data());
16 TChain *chain =
new TChain(
"T-LCP",
"dummName");
18 TString item=wrkDir+
"/tree/"+run;
19 item=item+
".tree.root";
20 printf(
"#tree %s\n", item.Data());
21 int ret=chain->AddFile(item,-1);
22 printf(
"chain ret %d \n",ret);
26 const float Pi=3.1416;
27 TString outF=wrkDir+outPath+run+
".hist.root";
29 hFile=
new TFile(outF,
"RECREATE");
30 assert(hFile->IsOpen());
34 TH2F *h2L[100];
int nh2L=0;
37 h1[0]=
new TH1F(
"bx",
"rates vs. bXing",129,-0.5,128.5);
38 h1[1]=
new TH1F(
"pt",
"Leading Particle pT (GeV/c)",100,0.,10.);
40 h1[2]=
new TH1F(
"Zv",
"Z vertex/cm",100,-250.,250.);
41 h1[3]=
new TH1F(
"nPrim",
"No.of valid prim TPC tracks ",50,-0.5,49.5);
42 h1[4]=
new TH1F(
"cosm",
"Mike's Cosmics Rejector return value",5,-0.5,4.5);
43 h1[5]=
new TH1F(
"phi",
"LCP phi/rad",100,-3.15.,3.15);
44 h1[6]=
new TH1F(
"eta",
"LCP Eta",100,2.,2.);
45 h1[7]=
new TH1F(
"q",
"LCP charge",10,-2.,2.);
46 float bxF=-0.5, bxL=119.5;
49 TH2F *h2=
new TH2F(
"PhiBxAll",
"LCP Phi/rad vs. bXing[0-119]",nbx,bxF,bxL,nphi,-Pi,Pi);
62 char tit1[100], tit2[1000];
63 sprintf(tit1,
"PhiBxPt%d",i+1);
64 sprintf(tit2,
"LCP Phi/rad vs. bXing[0-119], cut=Pt%d",i+1);
65 h2pT[i]=
new TH2F(tit1,tit2,nbx,bxF,bxL,nphi,-Pi,Pi);
73 char coreRt[mxRt]={
'L',
'M',
'H'};
75 char tit1[100], tit2[1000];
76 sprintf(tit1,
"PhiBxPt%c",coreRt[i]);
77 sprintf(tit2,
"LCP Phi/rad vs. bXing[0-119], cut=Pt%c",coreRt[i]);
78 h2rT[i]=
new TH2F(tit1,tit2,nbx,bxF,bxL,nphi,-Pi,Pi);
85 char *coreEta[mxEta]={
"BB",
"Bc",
"Fc",
"FF"};
86 for(i=0;i<mxEta;i++) {
87 char tit1[100], tit2[1000];
88 sprintf(tit1,
"PhiBxEta%s",coreEta[i]);
89 sprintf(tit2,
"LCP Phi/rad vs. bXing[0-119], cut=Eta%s",coreEta[i]);
90 h2eta[i]=
new TH2F(tit1,tit2,nbx,bxF,bxL,nphi,-Pi,Pi);
97 char *coreq[mxq]={
"neg",
"pos"};
99 char tit1[100], tit2[1000];
100 sprintf(tit1,
"PhiBxQ%s",coreq[i]);
101 sprintf(tit2,
"LCP Phi/rad vs. bXing[0-119], cut=Q%s",coreq[i]);
102 h2q[i]=
new TH2F(tit1,tit2,nbx,bxF,bxL,nphi,-Pi,Pi);
109 int N=chain->GetEntries();
110 if(maxEve<=0) maxEve=N;
112 printf(
"#sort %d of %d\n",maxEve,N);
117 int nPrim,bx,cosm,id,nFit,charge;
118 chain->SetBranchAddress(
"bx120",&bx);
119 chain->SetBranchAddress(
"vz",&vz);
120 chain->SetBranchAddress(
"id",&
id);
121 chain->SetBranchAddress(
"pt",&pt);
122 chain->SetBranchAddress(
"phi",&phi);
123 chain->SetBranchAddress(
"eta",&eta);
124 chain->SetBranchAddress(
"q",&charge);
125 chain->SetBranchAddress(
"nPrim",&nPrim);
126 chain->SetBranchAddress(
"nFit",&nFit);
127 chain->SetBranchAddress(
"cosm",&cosm);
130 printf(
"\n::::::::::::::: L O O P O V E R E V E N T S :::::\n");
135 int ret=chain->GetEntry(k);
137 if(k%1000==0)printf(
"%d %d %d %f id=%d nFit=%d\n",k,ret,nPrim ,vz,
id,nFit);
139 if(nPrim<3 )
continue;
140 if( pt>5. )
continue;
142 if(cut==1 && (nPrim<5 || nPrim>20) )
continue;
143 if(cut==2 && fabs(vz) >50)
continue;
144 if(cut==3 && (pt<1. || pt>3.) )
continue;
145 if(cut==4 && charge<0. )
continue;
151 if(nFit<=0)
continue;
162 if(i>=0 && i<mxPt) h2pT[i]->Fill(bx,phi);
167 if(i>=0) h2rT[i]->Fill(bx,phi);
172 else if(eta<0.5) i=2;
174 h2eta[i]->Fill(bx,phi);
179 h2q[i]->Fill(bx,phi);
183 printf(
"nLcp=%d\n",nLcp);
189 TAxis *X=h2->GetXaxis();
190 TAxis *Y=h2->GetYaxis();
191 int nx=X->GetNbins();
192 int ny=Y->GetNbins();
193 printf(
"#title %s\n", h2->GetTitle());
194 printf(
"#X-axis %f, %f %d %s \n", X->GetXmin(), X->GetXmax(),nx);
195 printf(
"#Y-axis %f, %f %d %s \n", Y->GetXmin(), Y->GetXmax(),ny);
196 printf(
"#Integral(valid)= %.1f \n",h2->Integral());
198 for(i=0;i<nh2L;i++) {
200 printf(
"#Integral(%s)= %.1f \n",hx->GetName(),hx->Integral());
205 c->cd(1); h1[1]->Draw(); gPad->SetLogy();
206 c->cd(2); h1[5]->Draw();
207 c->cd(3); h1[6]->Draw();
208 c->cd(4); h2->Draw(
"colz");
209 c->cd(5); h1[2]->Draw();
210 c->cd(6); h1[7]->Draw();
212 TString outPS=outF.ReplaceAll(
"hist.root",
"pro.ps");