13 for(
int i=0;(unsigned)
i<v.size();
i++)
22 gStyle->SetOptStat(0);
24 unsigned col1 = kOrange+7;
25 unsigned col2 = kBlue+2;
28 string type[2] = {
"3pion",
"DIScharged"};
29 string seed[10] = {
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"};
35 TChain chain_CC(
"event");
36 TChain chain_tau(
"event");
39 for (
int b = 0;
b<2;
b++){
40 for (
int g = 0;
g<10;
g++){
42 if(
b==0) nevents =
"1000";
43 if(
b==1 ||
b==2) nevents =
"100";
45 if(
b==0) file =
"/gpfs/mnt/gpfs02/phenix/scratch/spjeffas/data/LeptoAna_p250_e20_"+nevents+
"events_"+seed[
g]+
"seed_"+type[
b]+
"_r0"+R_max+
".root";
46 if(
b==1) file =
"/gpfs/mnt/gpfs02/phenix/scratch/spjeffas/data/LeptoAna_p250_e20_"+nevents+
"events_"+seed[
g]+
"seed_"+type[
b]+
"_tau_r0"+R_max+
".root";
48 if(
b==0) chain_tau.Add(file.c_str());
49 if(
b==1) chain_CC.Add(file.c_str());
54 string inputFile =
"./data/Event_topology.csv";
56 TTree *
t=
new TTree(
"MyTree",
"MyTree");
57 t->ReadFile(inputFile.c_str(),
"ptmiss:acoplan:is_lq");
60 TCanvas* ctemp =
new TCanvas();
62 vector< TString > observables;
63 vector< TString > observables_name;
65 vector< float > plots_xmin;
66 vector< float > plots_xmax;
69 observables.push_back(
"Et_miss" );
70 observables_name.push_back(
"p_{T}^{miss} (GeV)" );
71 plots_xmin.push_back(0);
72 plots_xmax.push_back(50);
75 observables.push_back(
"Et_miss_phi" );
76 observables_name.push_back(
"#Delta#phi_{miss - #tau jet}" );
77 plots_xmin.push_back(0);
78 plots_xmax.push_back(180);
80 TString name_CC_base(
"h_CC_");
81 TString name_tau_base(
"h_tau_");
83 const int nvar = observables.size();
88 TString name_CC_i = name_CC_base;
89 TString name_tau_i = name_tau_base;
92 for (
int l = 0; l < observables.size(); l++ ){
93 name_CC_i = name_CC_base;
94 name_tau_i = name_tau_base;
99 h_CC[l] =
new TH1F( name_CC_i,
"", 50, plots_xmin.at(l), plots_xmax.at(l));
100 h_tau[l] =
new TH1F( name_tau_i,
"", 50, plots_xmin.at(l), plots_xmax.at(l));
104 for(
int i = 0;
i < observables.size();
i++){
108 name_CC_i = name_CC_base;
109 name_tau_i = name_tau_base;
112 name_tau_i.Append(
i);
117 int n_CC = chain_CC.Draw( observables.at(
i) +
" >> " + name_CC_i,
"",
"goff");
118 h_CC[
i]->Scale(1./h_CC[
i]->Integral());
119 h_CC[
i]->GetXaxis()->SetTitle( observables_name.at(
i) );
120 h_CC[
i]->GetYaxis()->SetRangeUser(0, .13 );
121 h_CC[
i]->SetLineColor(col1);
122 h_CC[
i]->SetFillColor(col1);
123 h_CC[
i]->SetFillStyle(0);
124 h_CC[
i]->GetYaxis()->SetTitle(
"# entries / #Sigma entries");
125 h_CC[
i]->GetYaxis()->SetTitleOffset(1.5);
128 int n_tau = chain_tau.Draw( observables.at(
i) +
" >> " + name_tau_i,
"",
"goff");
129 h_tau[
i]->Scale(1./h_tau[
i]->Integral());
130 h_tau[
i]->SetLineColor(col2);
131 h_tau[
i]->SetFillColor(col2);
132 h_tau[
i]->SetFillStyle(0);
134 TCanvas *c1 =
new TCanvas();
136 h_CC[
i]->DrawClone(
"");
137 h_tau[
i]->DrawClone(
"sames");
140 TLegend *legend =
new TLegend(0.4,0.6,0.7,0.89);
141 legend->AddEntry(h_CC[
i],
"Charged Current",
"l");
142 legend->AddEntry(h_tau[i],
"Leptoquark",
"l");
149 float Et_miss_phi_tau, Et_miss_phi_CC;
150 float tau_phi_tau, tau_phi_CC;
153 chain_CC.SetBranchAddress(
"Et_miss_phi",&Et_miss_phi_CC);
154 chain_CC.SetBranchAddress(
"reco_tau_phi",&tau_phi_CC);
156 chain_tau.SetBranchAddress(
"Et_miss_phi",&Et_miss_phi_tau);
157 chain_tau.SetBranchAddress(
"reco_tau_phi",&tau_phi_tau);
163 for(
int j = 0;
j<n_CC;
j++){
164 chain_CC.GetEntry(
j);
165 delta_phi = fabs(Et_miss_phi_CC - tau_phi_CC) * 180 / TMath::Pi();
166 if(delta_phi > 180) delta_phi = 360 -
delta_phi;
167 h_CC[
i]->Fill(delta_phi);
170 for(
int k = 0;
k<n_tau;
k++){
171 chain_tau.GetEntry(
k);
172 delta_phi = fabs(Et_miss_phi_tau - tau_phi_tau) * 180 / TMath::Pi();
173 if(delta_phi > 180) delta_phi = 360 -
delta_phi;
174 h_tau[
i]->Fill(delta_phi);
178 h_CC[
i]->Scale(1./h_CC[
i]->Integral());
179 h_CC[
i]->GetXaxis()->SetTitle( observables_name.at(
i) );
180 h_CC[
i]->GetYaxis()->SetRangeUser(0, 0.27 );
181 h_CC[
i]->SetLineColor(col1);
182 h_CC[
i]->SetFillColor(col1);
183 h_CC[
i]->SetFillStyle(0);
184 h_CC[
i]->GetYaxis()->SetTitle(
"# entries / #Sigma entries");
185 h_CC[
i]->GetYaxis()->SetTitleOffset(1.5);
187 h_tau[
i]->Scale(1./h_tau[
i]->Integral());
188 h_tau[
i]->SetLineColor(col2);
189 h_tau[
i]->SetFillColor(col2);
190 h_tau[
i]->SetFillStyle(0);
192 TCanvas *c1 =
new TCanvas();
194 h_CC[
i]->DrawClone(
"");
195 h_tau[
i]->DrawClone(
"sames");
198 TLegend *legend =
new TLegend(0.4,0.6,0.7,0.89);
199 legend->AddEntry(h_CC[
i],
"Charged Current",
"l");
200 legend->AddEntry(h_tau[i],
"Leptoquark",
"l");
208 float acoplan, ptmiss, is_lq;
211 t->SetBranchAddress(
"acoplan",&acoplan);
212 t->SetBranchAddress(
"ptmiss",&ptmiss);
213 t->SetBranchAddress(
"is_lq",&is_lq);
222 double lik_cut = 0.60;
224 int n_tot = t->GetEntries();
227 for(
int k = 0;
k < n_tot;
k++){
235 x_bin = h_tau[0]->GetXaxis()->FindBin(ptmiss);
236 likelihood.push_back( h_tau[0]->GetBinContent(x_bin) / (h_tau[0]->GetBinContent(x_bin) + h_CC[0]->GetBinContent(x_bin)));
238 x_bin = h_tau[1]->GetXaxis()->FindBin(acoplan);
239 likelihood.push_back( h_tau[1]->GetBinContent(x_bin) / (h_tau[1]->GetBinContent(x_bin) + h_CC[1]->GetBinContent(x_bin)));
242 double avg =
Average(likelihood);
245 if(avg != avg)
continue;
250 if(is_lq == 1) tau_as_tau++;
255 if(is_lq == 1) tau_as_DIS++;
264 double efficiency = tau_as_tau*1.0/(n_tot*1.0);
267 if(tau_as_tau == 0 && DIS_as_tau == 0) FP = 0;
268 else FP = DIS_as_tau*1.0/((tau_as_tau+DIS_as_tau)*1.0);
271 cout<<
" | ID SM ID LQ"<<endl;
272 cout<<
"---------------------"<<endl;
273 cout<<
"Act SM| "<<DIS_as_DIS<<
" "<<DIS_as_tau<<endl;
274 cout<<
"Act LQ| "<<tau_as_DIS<<
" "<<tau_as_tau<<endl;
278 cout<<
"LQ Recovery Rate: "<<efficiency<<endl;
279 cout<<
"False Positive Rate: "<<FP<<endl;