Index: GLBFrejus/HEAD/run/sensi.C
===================================================================
--- GLBFrejus/HEAD/run/sensi.C	(revision 2)
+++ GLBFrejus/HEAD/run/sensi.C	(revision 154)
@@ -1,12 +1,36 @@
 {
 
-  gROOT->LoadMacro("TDSyst.C++");
+  Int_t nLogSin22q13 = 21;
+  Double_t logSin2Min = -4;
+  Double_t logSin2Max = -2;
+  Double_t logSin2BinWidth = 
+    (logSin2Max - logSin2Min)/double(nLogSin22q13-1.);
+  Double_t logSin2EdgeMax = logSin2Max + logSin2BinWidth/2.;
+  Double_t logSin2EdgeMin = logSin2Min - logSin2BinWidth/2.;
+
+  Int_t nDeltaCP  = 31;
+  Double_t deltaMin = -180.; //degree
+  Double_t deltaMax =  180.;
+  Double_t deltaBinWidth = (deltaMax - deltaMin)/double(nDeltaCP-1.);
+  Double_t deltaEdgeMax = deltaMax + deltaBinWidth/2.;
+  Double_t deltaEdgeMin = deltaMin - deltaBinWidth/2.;
+
+  TLegend* leg = new TLegend(0.6,0.7,0.9,0.9);
+  leg->SetTextFont(gStyle->GetTextFont());
+  leg->SetTextSize(0.07);
+  leg->SetFillColor(10);
+  
+
   TCanvas* c1 = new TCanvas("c1","Contour",100,100,600,600);
-  c1->SetGridx();
-  c1->SetGridy();
+  //  c1->SetGridx();
+  // c1->SetGridy();
   c1->SetLogy();
 
-  TH2D* hdum = new TH2D("hdum","Theta vs Delta",41,-180,180,31,1e-4,1e-1);
-  hdum->SetXTitle("#delta_{CP} (deg)");
+  TH2D* hdum = new TH2D("hdum","",
+			nDeltaCP,deltaMin,deltaMax,
+			nLogSin22q13,TMath::Power(10.,logSin2Min),
+			TMath::Power(10.,logSin2Max)
+			);
+  hdum->SetXTitle("#delta_{CP} (deg.)");
   hdum->SetYTitle("sin^{2}(2#theta_{13})");
   hdum->Draw();
@@ -19,47 +43,77 @@
   overlay->SetFillStyle(4000);
   overlay->Draw();
-  overlay->Range(-180.,-4,180.,-1);
+  overlay->Range(deltaMin,logSin2Min,deltaMax,logSin2Max);
 
-  //Original
-  TFile* file1 = new TFile("./SPLDeltaTheta2+8OldFluxCorr.root");
-  TTree* tree1 = (TTree*)file1->Get("SplGlb");
-  TDSyst* comp1 = new TDSyst(tree1,"h1");
-  comp1->Loop();
+  TFile f1("./SPLSensi440kT.root");
+  TTree* tree1 = (TTree*)f1.Get("SplGlb");
+  TH2D* histo1 = new TH2D("histo1"," Theta vs Delta",
+			  nDeltaCP,deltaEdgeMin,deltaEdgeMax,
+			  nLogSin22q13,logSin2EdgeMin,logSin2EdgeMax
+			  );
 
-  TH2D* h1 = comp1->GetHisto();
-  h1->SetContour(1);
-  h1->SetContourLevel(0,4.605); //Chi2 for 2 dof and 90% CL
-  //  h1->SetLineStyle(2);
-  h1->SetLineColor(4); //blue
+  tree1->Project(histo1->GetName(),"TMath::Log10(pow(sin(2*theta13),2)):deltaCP/pi*180.","chi2");
+  histo1->SetContour(1);
+  histo1->SetContourLevel(0,4.605); //Chi2 for 2 dof and 90% CL
+  histo1->SetLineColor(2); //red
   overlay->cd();
-  h1->Draw("CONT3 SAME");
-  overlay->Update();
+  histo1->Draw("CONT3 SAME");
+  leg->AddEntry(histo1,"440kT","l");
 
-  //Comp
-  TFile* file2 = new TFile("./OptiFlux/SPLDeltaThetaSens.root");
-  TTree* tree2 = (TTree*)file2->Get("SplGlb");
-  TDSyst* comp2 = new TDSyst(tree2,"h2");
-  comp2->Loop();
 
-  TH2D* h2 = comp2->GetHisto();
-  h2->SetContour(1);
-  h2->SetContourLevel(0,4.605); //Chi2 for 2 dof and 90% CL
-  h2->SetLineColor(2); //red
+  TFile f2("./SPLSensi330kT.root");
+  TTree* tree2 = (TTree*)f2.Get("SplGlb");
+  TH2D* histo2 = new TH2D("histo2"," Theta vs Delta",
+			  nDeltaCP,deltaEdgeMin,deltaEdgeMax,
+			  nLogSin22q13,logSin2EdgeMin,logSin2EdgeMax
+			  );
+
+  tree2->Project(histo2->GetName(),"TMath::Log10(pow(sin(2*theta13),2)):deltaCP/pi*180.","chi2");
+  histo2->SetContour(1);
+  histo2->SetContourLevel(0,4.605); //Chi2 for 2 dof and 90% CL
+  histo2->SetLineStyle(2); //dashed
+  histo2->SetLineColor(2); //red
   overlay->cd();
-  h2->Draw("CONT3 SAME");
-  overlay->Update();
+  histo2->Draw("CONT3 SAME");
+  leg->AddEntry(histo2,"330kT","l");
 
-  //Comp
-  TFile* file3 = new TFile("./OptiFlux/SPLDeltaThetaRateCorr.root");
-  TTree* tree3 = (TTree*)file3->Get("SplGlb");
-  TDSyst* comp3 = new TDSyst(tree3,"h3");
-  comp3->Loop();
 
-  TH2D* h3 = comp3->GetHisto();
-  h3->SetContour(1);
-  h3->SetContourLevel(0,4.605); //Chi2 for 2 dof and 90% CL
-  h3->SetLineColor(6); //blue
+  TFile f3("./SPLSensi220kT.root");
+  TTree* tree3 = (TTree*)f3.Get("SplGlb");
+  TH2D* histo3 = new TH2D("histo3"," Theta vs Delta",
+			  nDeltaCP,deltaEdgeMin,deltaEdgeMax,
+			  nLogSin22q13,logSin2EdgeMin,logSin2EdgeMax
+			  );
+
+  tree3->Project(histo3->GetName(),"TMath::Log10(pow(sin(2*theta13),2)):deltaCP/pi*180.","chi2");
+  histo3->SetContour(1);
+  histo3->SetContourLevel(0,4.605); //Chi2 for 2 dof and 90% CL
+  histo3->SetLineStyle(3); //dotted
+  histo3->SetLineColor(2); //red
   overlay->cd();
-  h3->Draw("CONT3 SAME");
+  histo3->Draw("CONT3 SAME");
+  leg->AddEntry(histo3,"220kT","l");
+
+
+
+
+
+  //Add text
+
+  TLatex* txt1 = new TLatex(-150,-3.7,"90% CL");
+  txt1->SetTextSize(0.07);
+  txt1->Draw();
+
+  TLatex* txt2 = new TLatex(-150,-2.3,"2y(+) & 8y(-)");
+  txt2->SetTextSize(0.07);
+  txt2->Draw();
+
+
+  TLatex* txt3 = new TLatex(60,-3.7,"#delta^{tr}_{CP}=#theta^{tr}_{13}=0");
+  txt3->SetTextSize(0.07);
+  txt3->Draw();
+
+
+
+  leg->Draw("SAME");
   overlay->Update();
 
