5 #define REBIN_MIN_EVTS_PER_BIN 30.0
9 if(
nIFO>3) {cout <<
"slag.C : Skipping plot production - wave tree should come from a 2- or 3-fold network : " <<
net_file_name << endl;
exit(0);}
14 TB.
checkFile(gSystem->Getenv(
"CWB_ROOTLOGON_FILE"));
15 TB.
checkFile(gSystem->Getenv(
"CWB_PARAMETERS_FILE"));
16 TB.
checkFile(gSystem->Getenv(
"CWB_UPARAMETERS_FILE"));
17 TB.
checkFile(gSystem->Getenv(
"CWB_PPARAMETERS_FILE"));
18 TB.
checkFile(gSystem->Getenv(
"CWB_UPPARAMETERS_FILE"));
19 TB.
checkFile(gSystem->Getenv(
"CWB_EPPARAMETERS_FILE"));
21 gStyle->SetTitleFillColor(kWhite);
22 gStyle->SetLineColor(kWhite);
23 gStyle->SetNumberContours(256);
24 gStyle->SetCanvasColor(kWhite);
25 gStyle->SetStatBorderSize(1);
26 gStyle->SetOptStat(kFALSE);
29 gStyle->SetFrameBorderMode(0);
36 TCanvas *
c1 =
new TCanvas(
"Slag",
"Slag",32,55,750,502);
37 c1->Range(-0.75,-1.23433,6.75,8.17182);
42 c1->SetFrameFillColor(0);
43 gStyle->SetPalette(1,0);
45 TChain
wave(
"waveburst");
46 TChain
live(
"liveTime");
55 while ((branch=(TBranch*)
mynext())) {
56 if (
TString(
"slag").CompareTo(branch->GetName())==0) slagFound=
true;
59 if(!slagFound) {cout <<
"slag.C : Error - wave tree does not contain slag leaf : " <<
net_file_name << endl;
exit(1);}
72 wave.SetEstimate(num);
82 cout<<
"Number of Entries: "<<num<<endl;
83 double* slag1 =
wave.GetV1();
87 int num2 = (
int)
live.GetEntries(cut2);
88 live.SetEstimate(num2);
90 live.Draw(
"slag[1]:live",cut2,
"goff");
91 double* lslag1 =
live.GetV1();
96 double SlagMax =
wave.GetMaximum(
"slag")+
segLen/2.;
97 double SlagMin =
wave.GetMinimum(
"slag")-
segLen/2.;
98 int NSlag = TMath::FloorNint((SlagMax-SlagMin)/
segLen);
99 cout <<
"SLAG MAX : "<<
wave.GetMaximum(
"slag")<<
" s SLAG MIN : "<<
wave.GetMinimum(
"slag")<<
" s #SLAGS : "<<NSlag-1<<endl;
100 sprintf(mytitle,
"FAR distribution over slags (post cat3 & rho>%f)",
T_cut);
102 Slag->GetYaxis()->SetTitle(
"slag[1] shift [s]");
104 Slag->GetXaxis()->SetTitle(
"rho");
106 Slag->SetStats(kFALSE);
107 TH1F*
lSlag =
new TH1F(
"LSLAG",
"FAR distribution over slags",NSLAG,SlagMin,SlagMax);
109 Slag->Fill(rho[
i],slag1[i]);
112 for(
int i =0 ;
i<num2;
i++){
113 lSlag->Fill(lslag1[
i],Live[i]);
117 TH1D*
P0 =
new TH1D(
"P0",
"P0",100,0.0,1.0);
122 for(
int j =0 ;
j<NSLAG/2;
j++){
123 for(
int i =1 ;
i<NSLAG;
i++){
124 TH1D* P1 = (TH1D*) Slag->ProjectionX(
"",
i,
i+
j)->Clone();
130 P1->AndersonDarlingTest(Slag->ProjectionX(
"",
i+
j+1,
i+2*
j+1));
132 cout <<
j<<
" "<<
i<<
" bins ["<<
i<<
","<<
i+
j<<
"] bins ["<<
i+
j+1<<
","<<
i+2*
j+1<<
"]"<<endl;
136 Double_t*
xq =
new Double_t[
nq];
137 Double_t*
yq =
new Double_t[
nq];
138 Double_t*
yq2 =
new Double_t[nq+3];
139 for (Int_t
k=0;
k<
nq;
k++) xq[
k] = Float_t(
k+1)/
nq;
140 P1->GetQuantiles(nq,yq,xq);
142 for(
int l=1;
l<nq+2;
l++){yq2[
l]=yq[
l-2];}
147 TH1D *
hnew2 =
new TH1D(
"hnew2",
"rebinned",nq+2,yq2);
148 TH1D *
hnew3 =
new TH1D(
"hnew3",
"rebinned",nq+2,yq2);
149 TH1D*
Sh3 =
new TH1D(
"Sh3",
"Significance vs rho bin",nq+2,yq2);
150 TH1D*
Sh4 =
new TH1D(
"Sh4",
"Distribution of significance",200,-10.,10.);
151 TH1D*
Shn =
new TH1D(
"Shn",
"Normal Distribution",200,-10.,10.);
155 if((slag1[
m]>=Slag->GetYaxis()->GetBinLowEdge(
i))&&(slag1[
m]<Slag->GetYaxis()->GetBinUpEdge(
i+
j))) {hnew2->Fill(rho[
m]);}
156 if((slag1[
m]>=Slag->GetYaxis()->GetBinLowEdge(
i+
j+1))&&(slag1[
m]<Slag->GetYaxis()->GetBinUpEdge(
i+2*
j+1))) {hnew3->Fill(rho[
m]);}
160 cout<<
"After Rebinning"<<endl;
162 Pval[
test]= hnew2->AndersonDarlingTest(hnew3,
"D");
166 for(
int n=0;
n<
nq;
n++){
167 if((hnew2->GetBinContent(
n+1)>0.0) ||(hnew3->GetBinContent(
n+1)>0.0)){
168 w_tmp = (hnew2->GetBinContent(
n+1)-hnew3->GetBinContent(
n+1))/TMath::Sqrt(pow(hnew2->GetBinError(
n+1),2)+pow(hnew3->GetBinError(
n+1),2));
169 Sh3->SetBinContent(
n+1,w_tmp);
170 Sh4->Fill(Sh3->GetBinContent(
n+1));
176 for(
int n=0;
n<
count;
n++){Shn->Fill(P.Gaus(0,1));}
177 cout <<
"Anderson-Darling 2-sample test significance distribution vs Normal (no rescaling)"<<endl;
179 Sh4->AndersonDarlingTest(Shn,
"D");
191 P0->Fill(Pval[test]);
201 TMath::Sort(test,Pval,index,
false);
205 for(
int i=0;
i<
test;
i++){pvals[
i]=Pval[index[
i]];rank[
i]=(
i+1.)/
test;cout<<pvals[
i]<<
" "<<rank[
i]<<endl;}
206 TGraph
Gr(test,rank,pvals);
TGraph Gr(test, rank, pvals)
TIter mynext(wave.GetListOfBranches())
sprintf(cut,"rho[1]>%f", T_cut)
TString sel("slag[1]:rho[1]")
#define REBIN_MIN_EVTS_PER_BIN