1 TChain *chainG =
new TChain(
"G-LCP");
2 TChain *chainR =
new TChain(
"T-LCP");
3 float ptR,ptG,phiG,phiR,etaG,etaR;
15 diffLcpMuDst_Geant(
int cut=2){
22 TString histF=
"mcLcp_cut";
27 TString fItem=
"recoEffStudy/G2032.tree.root";
28 TString evePath=
"/star/data04/sim/balewski/LcpRun2/MCrcf1200/";
31 for(subSet=2032;subSet<=2167;subSet++) {
35 chainG->AddFile(fItem, -1);
36 fItem.ReplaceAll(
"G",
"R");
37 chainR->AddFile(fItem, -1);
43 fItem=evePath+
"G2033.tree.root";
44 chainG->AddFile(fItem, -1);
45 fItem.ReplaceAll(
"G",
"R");
46 chainR->AddFile(fItem, -1);
52 chainR->SetBranchAddress(
"nPrim",&nPrimR);
53 chainR->SetBranchAddress(
"vz",&vzR);
54 chainR->SetBranchAddress(
"q",&qR);
56 chainG->SetBranchAddress(
"pt",&ptG);
57 chainR->SetBranchAddress(
"pt",&ptR);
59 chainG->SetBranchAddress(
"id",&idG);
60 chainR->SetBranchAddress(
"id",&idR);
62 chainG->SetBranchAddress(
"phi",&phiG);
63 chainR->SetBranchAddress(
"phi",&phiR);
65 chainG->SetBranchAddress(
"eta",&etaG);
66 chainR->SetBranchAddress(
"eta",&etaR);
68 int N=chainG->GetEntries();
74 ret=chainG->GetEntry(k);
76 ret=chainR->GetEntry(k);
80 if(nPrimR<=2)
continue;
81 if(fabs(vzR)>100.)
continue;
84 printf(
"%d ptG=%f ptR=%f phi %f=%f eta %f=%f\n",k,ptG,ptR,phiG,phiR,etaG,etaR);
89 if(cut==1 & ptR>=1)
continue;
90 else if(cut==2 && (ptR<1. || ptR>=2))
continue;
91 else if(cut==3 && (ptR<2. || ptR>=3))
continue;
92 else if(cut==4 && (ptR<3. || ptR>=4))
continue;
94 else if(cut==11 && (etaR<0. || etaR>0.5))
continue;
95 else if(cut==12 && (etaR<0.5 || etaR>1.0))
continue;
97 else if(cut==21 &qR!=1)
continue;
98 else if(cut==22 &qR!=-1)
continue;
105 gStyle->SetPalette(1,0);
107 gStyle->SetOptStat(1111111);
124 initHisto(TString fname){
125 fd=
new TFile(fname,
"recreate");
126 assert(fd->IsOpen());
129 h1[0]=
new TH1F(
"GvR",
"type of reco event; 0=noG*noR 1=G*noR 2=noG*R 3=G*R",5,-0.5,4.5);
131 hr[1]=
new TH1F(
"PhiR",
"Reco phi/deg",100,0,400);
132 hr[2]=
new TH1F(
"EtaR",
"Reco eta",100,-2,2);
133 hr[3]=
new TH1F(
"PtR",
"Reco pT/(GeV/c)",100,0,ptMax);
135 h1[1]=
new TH1F(
"dPhi",
"diff phi ; G-R phi/deg",100,-200,200);
136 h1[2]=
new TH1F(
"dEta",
"diff eta ; G-R eta",100,-2,2);
137 h1[3]=
new TH1F(
"dPt",
"diff pt ; G-R pT/(GeV/c)",100,-2,2);
141 h2[1]=
new TH2F(
"dPhiPT",
"diff phi; G-R diff phi/deg; G pT/GeV/c",50,-200,200,npt,0,ptMax);
142 h2[2]=
new TH2F(
"dEtaPT",
"diff eta; G-R diff eta; pTG/GeV/c",50,-2,2,npt,0,ptMax);
143 h2[3]=
new TH2F(
"dPtPT",
"diff pT; G-R diff pT/GeV/c; pTG/GeV/c",50,-1,1,npt,0,ptMax);
150 if(ptG>0.3) mType+=1;
151 if(ptR>0.3) mType+=2;
154 if(mType!=3)
continue;
159 float phi1=phiG/3.1416*180;
160 if(phi1<0) phi1+=360;
161 float phi2=phiR/3.1416*180;
162 if(phi2<0) phi2+=360;
163 float dPhi=phi1-phi2;
164 if(dPhi>180) dPhi-=360;
165 if(dPhi<-180) dPhi+=360;
172 h1[2]->Fill(etaG-etaR);
173 h1[3]->Fill(ptG-ptR);
175 h2[1]->Fill(dPhi,ptG);
176 h2[2]->Fill(etaG-etaR,ptG);
177 h2[3]->Fill(ptG-ptR,ptG);