6 gStyle->SetOptStat(00000);
9 char* iPath=
"./outEmb/";
10 char* fileName[maxFiles]={
"Wplus",
"Wminus",
"Wtau",
"Zany",
"Ze+e-Interf"};
12 for(
int i=0; i<maxFiles; i++){
13 TString file=iPath; file+=fileName[i];
14 h[i]=plReweightX(file,fileName[i]);
18 outf=
new TFile(
"zVertReweight.root",
"recreate");
19 for(
int j=0;j<maxFiles;j++)
24 TH1F* plReweightX(TString file,
char* name){
27 file+=
".wana.hist.root";
31 fdata=
new TFile(
"/star/data01/pwg/stevens4/wAnalysis/xSecPaper/sl11b/data/run9setABCD.wana.hist.root");
34 TH1F* simZ=fd->Get(
"muZv"); simZ->Rebin();
35 TH1F* dataZ=fdata->Get(
"muZv"); dataZ->Rebin();
37 assert(simZ); assert(dataZ);
40 TH1F* ratio=dataZ->Clone();
42 ratio->Scale(1./ratio->GetBinContent(24));
48 TH1F* test= simZ->Clone();
49 for(
int i=1; i<=test->GetNbinsX(); i++){
50 float z=test->GetBinCenter(i);
51 test->SetBinContent(i,test->GetBinContent(i)*ratio->GetBinContent(ratio->FindBin(z)));
54 TCanvas *c1=
new TCanvas(
"aa",
"bb",600,400);
55 dataZ->Draw(); dataZ->SetTitle(
"; Z_{vertex} (cm)");
56 test->SetLineColor(2);
57 test->DrawNormalized(
"same",dataZ->Integral());
58 simZ->SetLineColor(4);
59 simZ->DrawNormalized(
"same",dataZ->Integral());
62 TLegend *leg =
new TLegend(0.6,0.65,0.9,0.9);
64 leg->AddEntry(dataZ,
" Data Z_{vertex}",
"l");
65 leg->AddEntry(simZ,
" Thrown MC Z_{vertex}",
"l");
66 leg->AddEntry(test,
" Re-weighted MC Z_{vertex}",
"l");
68 c1->Print(Form(
"plots/vertReweight/%s.png",name));
69 c1->Print(Form(
"plots/vertReweight/%s.eps",name));
75 simZ->SetLineColor(2);
76 simZ->DrawNormalized(
"same",dataZ->GetEntries());