+ // tracklet y resolution
+ h2 = (TH2I*)fContainer->At(kMCtrackletY);
+ gm = (TGraphErrors*)fGraphM->At(kMCtrackletY);
+ gs = (TGraphErrors*)fGraphS->At(kMCtrackletY);
+ for(Int_t iphi=1; iphi<=h2->GetNbinsX(); iphi++){
+ h = h2->ProjectionY("py", iphi, iphi);
+ if(h->GetEntries()<100) continue;
+ AdjustF1(h, &f);
+
+ if(IsVisual()){c->cd(); c->SetLogy();}
+ h->Fit(&f, opt, "", -0.5, 0.5);
+ if(IsVisual()){c->Modified(); c->Update(); gSystem->Sleep(500);}
+
+ Double_t phi = h2->GetXaxis()->GetBinCenter(iphi);
+ Int_t ip = gm->GetN();
+ gm->SetPoint(ip, phi, 10.*f.GetParameter(1));
+ gm->SetPointError(ip, 0., 10.*f.GetParError(1));
+ gs->SetPoint(ip, phi, 10.*f.GetParameter(2));
+ gs->SetPointError(ip, 0., 10.*f.GetParError(2));
+ }
+
+ // tracklet z resolution
+ h2 = (TH2I*)fContainer->At(kMCtrackletZ);
+ gm = (TGraphErrors*)fGraphM->At(kMCtrackletZ);
+ gs = (TGraphErrors*)fGraphS->At(kMCtrackletZ);
+ for(Int_t iphi=1; iphi<=h2->GetNbinsX(); iphi++){
+ h = h2->ProjectionY("py", iphi, iphi);
+ if(h->GetEntries()<100) continue;
+ AdjustF1(h, &fb);
+
+ if(IsVisual()){c->cd(); c->SetLogy();}
+ h->Fit(&fb, opt, "", -0.5, 0.5);
+ if(IsVisual()){c->Modified(); c->Update(); gSystem->Sleep(500);}
+
+ Double_t phi = h2->GetXaxis()->GetBinCenter(iphi);
+ Int_t ip = gm->GetN();
+ gm->SetPoint(ip, phi, 10.*fb.GetParameter(1));
+ gm->SetPointError(ip, 0., 10.*fb.GetParError(1));
+ gs->SetPoint(ip, phi, 10.*fb.GetParameter(2));
+ gs->SetPointError(ip, 0., 10.*fb.GetParError(2));
+ }
+
+ //tracklet phi resolution
+ h2 = (TH2I*)fContainer->At(kMCtrackletPhi);
+ gm = (TGraphErrors*)fGraphM->At(kMCtrackletPhi);
+ gs = (TGraphErrors*)fGraphS->At(kMCtrackletPhi);
+ for(Int_t iphi=1; iphi<=h2->GetNbinsX(); iphi++){
+ h = h2->ProjectionY("py", iphi, iphi);
+ if(h->GetEntries()<100) continue;
+
+ if(IsVisual()){c->cd(); c->SetLogy();}
+ h->Fit(&f, opt, "", -0.5, 0.5);
+ if(IsVisual()){c->Modified(); c->Update(); gSystem->Sleep(500);}
+
+ Double_t phi = h2->GetXaxis()->GetBinCenter(iphi);
+ Int_t ip = gm->GetN();
+ gm->SetPoint(ip, phi, f.GetParameter(1));
+ gm->SetPointError(ip, 0., f.GetParError(1));
+ gs->SetPoint(ip, phi, f.GetParameter(2));
+ gs->SetPointError(ip, 0., f.GetParError(2));
+ }
+
+ // track y resolution
+ h2 = (TH2I*)fContainer->At(kMCtrackY);
+ gm = (TGraphErrors*)fGraphM->At(kMCtrackY);
+ gs = (TGraphErrors*)fGraphS->At(kMCtrackY);
+ for(Int_t iphi=1; iphi<=h2->GetNbinsX(); iphi++){
+ h = h2->ProjectionY("py", iphi, iphi);
+ if(h->GetEntries()<100) continue;
+ AdjustF1(h, &f);
+
+ if(IsVisual()){c->cd(); c->SetLogy();}
+ h->Fit(&f, opt, "", -0.5, 0.5);
+ if(IsVisual()){c->Modified(); c->Update(); gSystem->Sleep(500);}
+
+ Double_t phi = h2->GetXaxis()->GetBinCenter(iphi);
+ Int_t ip = gm->GetN();
+ gm->SetPoint(ip, phi, 10.*f.GetParameter(1));
+ gm->SetPointError(ip, 0., 10.*f.GetParError(1));
+ gs->SetPoint(ip, phi, 10.*f.GetParameter(2));
+ gs->SetPointError(ip, 0., 10.*f.GetParError(2));
+ }
+
+ // track z resolution
+ h2 = (TH2I*)fContainer->At(kMCtrackZ);
+ gm = (TGraphErrors*)fGraphM->At(kMCtrackZ);
+ gs = (TGraphErrors*)fGraphS->At(kMCtrackZ);
+ for(Int_t iphi=1; iphi<=h2->GetNbinsX(); iphi++){
+ h = h2->ProjectionY("pz", iphi, iphi);
+ if(h->GetEntries()<70) continue;
+ AdjustF1(h, &f);
+
+ if(IsVisual()){c->cd(); c->SetLogy();}
+ h->Fit(&f, opt, "", -0.5, 0.5);
+ if(IsVisual()){c->Modified(); c->Update(); gSystem->Sleep(500);}
+
+ Double_t phi = h2->GetXaxis()->GetBinCenter(iphi);
+ Int_t ip = gm->GetN();
+ gm->SetPoint(ip, phi, 10.*f.GetParameter(1));
+ gm->SetPointError(ip, 0., 10.*f.GetParError(1));
+ gs->SetPoint(ip, phi, 10.*f.GetParameter(2));
+ gs->SetPointError(ip, 0., 10.*f.GetParError(2));
+ }
+
+ // track Pt resolution
+ h2 = (TH2I*)fContainer->At(kMCtrackPt);
+ TAxis *ax = h2->GetXaxis();
+ gm = (TGraphErrors*)fGraphM->At(kMCtrackPt);
+ gs = (TGraphErrors*)fGraphS->At(kMCtrackPt);
+ TF1 fg("fg", "gaus", -1.5, 1.5);
+ TF1 fl("fl", "landau", -4., 15.);
+ TF1 fgl("fgl", "gaus(0)+landau(3)", -5., 20.);
+ for(Int_t ip=1; ip<=ax->GetNbins(); ip++){
+ h = h2->ProjectionY("ppt", ip, ip);
+ if(h->GetEntries()<70) continue;
+
+ h->Fit(&fg, "QN", "", -1.5, 1.5);
+ fgl.SetParameter(0, fg.GetParameter(0));
+ fgl.SetParameter(1, fg.GetParameter(1));
+ fgl.SetParameter(2, fg.GetParameter(2));
+ h->Fit(&fl, "QN", "", -4., 15.);
+ fgl.SetParameter(3, fl.GetParameter(0));
+ fgl.SetParameter(4, fl.GetParameter(1));
+ fgl.SetParameter(5, fl.GetParameter(2));
+
+ if(IsVisual()){c->cd(); c->SetLogy();}
+ h->Fit(&fgl, opt, "", -5., 20.);
+ if(IsVisual()){c->Modified(); c->Update(); gSystem->Sleep(500);}
+
+ Float_t invpt = ax->GetBinCenter(ip);
+ Int_t ip = gm->GetN();
+ gm->SetPoint(ip, invpt, fgl.GetParameter(1));
+ gm->SetPointError(ip, 0., fgl.GetParError(1));
+ gs->SetPoint(ip, invpt, fgl.GetParameter(2)*invpt);
+ gs->SetPointError(ip, 0., fgl.GetParError(2));
+ // fgl.GetParameter(4) // Landau MPV
+ // fgl.GetParameter(5) // Landau Sigma
+ }
+
+
+ if(c) delete c;