test_resdec_piangle_rew.C
Go to the documentation of this file.
1 {
2  double p32iso = 0.50;
3  double p12iso = 0.50;
4  double p32rs = 0.75;
5  double p12rs = 0.25;
6 
7  const int ndial = 11;
8  const double dial_step = 2./(ndial-1);
9 
10  double epsilon = 1E-6;
11 
12  const int ncosthetabins=1000;
13 
14  TH1D * h[ndial];
15 
16  for(int i=0; i<ndial; i++) {
17  double dial = -1. + i*dial_step;
18  h[i] = new TH1D("a","",ncosthetabins,-1.,1.);
19  h[i]->SetDirectory(0);
20  if( TMath::Abs(dial) < epsilon ) { h[i]->SetLineWidth(3); }
21  if( TMath::Abs(dial-1.) < epsilon ) { h[i]->SetLineWidth(3); h[i]->SetLineStyle(kDashed); }
22  for(int j=1; j<=h[i]->GetNbinsX(); j++) {
23  double costheta = h[i]->GetBinCenter(j);
24  double P2 = 0.5 * (3.*costheta*costheta - 1.);
25  double Wiso = 1 - p32iso * P2 + p12iso * P2; // = 1.0
26  double Wrs = 1 - p32rs * P2 + p12rs * P2;
27  double Wdef = Wiso;
28  double Wtwk = dial*Wrs + (1-dial)*Wiso;
29  double wght = 1.;
30  if(Wdef>0. && Wtwk>0.) {
31  wght = Wtwk/Wdef;
32  }
33  h[i]->SetBinContent(j,wght);
34  }//j
35  }//i
36 
37  for(int i=0; i<ndial; i++) {
38  if(i==0) {
39  h[i]->Draw();
40  h[i]->GetXaxis()->SetTitle("cos#theta_{#pi}");
41  h[i]->GetYaxis()->SetTitle("W(cos#theta_{#pi})");
42  }
43  else {
44  h[i]->Draw("same");
45  }
46  }
47 
48 }
49 
size_t i(0)
const int ndial
double p32rs
TH1D * h[ndial]
double p12rs
const int ncosthetabins
const double dial_step
double epsilon
double p12iso