source: GLBFrejus/HEAD/run/dm31th23.C @ 2

Last change on this file since 2 was 2, checked in by campagne, 19 years ago

first import

File size: 4.3 KB
Line 
1{
2 
3  int nSin2q23;
4  double sin2Min;
5  double sin2Max;
6
7  int nDm31;
8  double dm31Min;
9  double dm31Max;
10 
11  std::ifstream fileDataCard;
12  fileDataCard.open("./dm31th23.data");
13  std::string DUMMYSTR; //comment string of the variables
14 
15  std::string ROOTFILENAME;
16
17  double DUMMYVAR; //not used variable
18
19  fileDataCard >> DUMMYSTR >> DUMMYVAR; 
20  fileDataCard >> DUMMYSTR >> DUMMYVAR; 
21  fileDataCard >> DUMMYSTR >> DUMMYVAR; 
22  fileDataCard >> DUMMYSTR >> DUMMYVAR; 
23  fileDataCard >> DUMMYSTR >> DUMMYVAR; 
24  fileDataCard >> DUMMYSTR >> DUMMYVAR; 
25  fileDataCard >> DUMMYSTR >> ROOTFILENAME; 
26  ROOTFILENAME += ".root";
27  std::cout << DUMMYSTR <<ROOTFILENAME  << std::endl; 
28
29  fileDataCard >> DUMMYSTR >> nDm31; 
30  std::cout << DUMMYSTR << nDm31  << std::endl; 
31  fileDataCard >> DUMMYSTR >> nSin2q23; 
32  std::cout << DUMMYSTR << nSin2q23 << std::endl; 
33
34  fileDataCard >> DUMMYSTR >> dm31Min; 
35  std::cout << DUMMYSTR << dm31Min << std::endl; 
36  fileDataCard >> DUMMYSTR >> dm31Max; 
37  std::cout << DUMMYSTR <<  dm31Max << std::endl; 
38
39  fileDataCard >> DUMMYSTR >> sin2Min; 
40  std::cout << DUMMYSTR <<  sin2Min << std::endl; 
41  fileDataCard >> DUMMYSTR >> sin2Max; 
42  std::cout << DUMMYSTR <<  sin2Max << std::endl; 
43
44
45  Double_t sin2BinWidth = (sin2Max - sin2Min)/double(nSin2q23-1.);
46  Double_t sin2EdgeMax = sin2Max + sin2BinWidth/2.;
47  Double_t sin2EdgeMin = sin2Min - sin2BinWidth/2.;
48
49  Double_t dm31BinWidth = (dm31Max - dm31Min)/double(nDm31-1.);
50  Double_t dm31EdgeMax = dm31Max + dm31BinWidth/2.;
51  Double_t dm31EdgeMin = dm31Min - dm31BinWidth/2.;
52
53  TLegend* leg = new TLegend(0.4,0.7,0.9,0.9);
54  leg->SetTextFont(gStyle->GetTextFont());
55  leg->SetTextSize(0.07);
56  leg->SetFillColor(10);
57 
58
59  TCanvas* c1 = new TCanvas("c1","Contour",100,100,600,600);
60  c1->SetGridx();
61  c1->SetGridy();
62
63  TH2D* hdum = new TH2D("hdum","",
64                        nSin2q23,sin2Min,sin2Max,
65                        nDm31,dm31Min,dm31Max
66                        );
67  hdum->SetYTitle("#Delta m^{2}_{31} (eV^{2})");
68  hdum->SetXTitle("sin^{2}(#theta_{23})");
69  TGaxis::SetMaxDigits(3);
70  hdum->Draw();
71
72  TPad *overlay = new TPad("overlay","",
73                           gStyle->GetPadLeftMargin(),
74                           gStyle->GetPadBottomMargin(),
75                           1-gStyle->GetPadRightMargin(),
76                           1-gStyle->GetPadTopMargin());
77  overlay->SetFillStyle(4000);
78  overlay->Draw();
79  overlay->Range(sin2Min,dm31Min,sin2Max,dm31Max);
80
81
82  TFile f1(ROOTFILENAME.data());
83  TTree* tree1 = (TTree*)f1.Get("SplGlb");
84  TH2D* histo1 = new TH2D("histo1","Dm_{31} vs sin^{2} th23",
85                          nSin2q23,sin2EdgeMin,sin2EdgeMax,
86                          nDm31,dm31EdgeMin,dm31EdgeMax
87                          );
88
89  tree1->Project(histo1->GetName(),"dm31:pow(sin(theta23),2)","chi2");
90
91  histo1->SetContour(1);
92  histo1->SetContourLevel(0,1.);  //Chi2 for 1 dof and 1sigma
93  //histo1->SetContourLevel(0,4); //Chi2 for 1 dof and 2sigma
94  //histo1->SetContourLevel(0,9); //Chi2 for 1 dof and 3sigma
95  histo1->SetLineColor(2); //red
96  overlay->cd();
97  histo1->Draw("CONT3 SAME");
98  leg->AddEntry(histo1,"1#sigma 5yrs (+)","l");
99
100
101//   TH2D* h1bis = histo1->Clone("h1bis");
102//   h1bis->SetContour(1);
103//   h1bis->SetContourLevel(0,9); //Chi2 for 1 dof and 3sigma
104//   overlay->cd();
105//   h1bis->SetLineColor(4); //blue
106//   h1bis->Draw("CONT3 SAME");
107//   leg->AddEntry(h1bis,"1#sigma 5yrs (+)","l");
108
109
110  int n0 = 1;
111  //2sigma
112  //sin^2(theta23) = 0.44 * (1+0.41-0.22)
113  //dm^2_31        = 2.4 * (1 +0.21 -0.26) 10^-3 eV^2
114  //3sigma errors
115  float sin2th0[n0]      = {0.44};
116  float dm310[n0]        = {2.4e-3};
117  float esin2th0_inf[n0] = {0.115};
118  float esin2th0_sup[n0] = {0.211};
119  float edm310_inf[n0]   = {0.875e-3};
120  float edm310_sup[n0]   = {0.792e-3};
121
122
123 
124//   TGraphAsymmErrors* point = new TGraphAsymmErrors(n0,sin2th0,dm310,
125//                                                 esin2th0_inf,esin2th0_sup,
126//                                                 edm310_inf,edm310_sup);
127 
128//   point->SetMarkerColor(4);
129//   point->SetMarkerStyle(21);
130//  leg->AddEntry(point,"3#sigma Global Adjust.","p");
131
132  TMarker* point = new TMarker(sin2th0[0],dm310[0],21);
133  point->Draw("SAME P");
134 
135
136
137//   TPaveLabel* text = new TPaveLabel(-3.7,1.,-2.7,1.1,"true sin^{2}(#theta_{23})=0.4");
138//   text->SetBorderSize(0);
139//   text->SetFillColor(10);
140//   text->SetTextSize(1.0);
141//   text->Draw("SAME");
142
143//   TLatex* txt1 = new TLatex(-3.7,0.2,"3#sigma");
144//   txt1->SetTextSize(0.1);
145//   txt1->Draw();
146
147
148
149  leg->Draw("SAME");
150  overlay->Update();
151
152
153
154
155  TCanvas c2;
156  histo1->Draw("SURF");
157
158
159
160}
Note: See TracBrowser for help on using the repository browser.