3 cout<<
"Lag starts..."<<endl;
5 if(
nIFO!=3) {cout <<
"lag.C : Skipping plot production - wave tree should come from a 3-fold network : " <<
net_file_name << endl;
exit(0);}
9 TB.
checkFile(gSystem->Getenv(
"CWB_ROOTLOGON_FILE"));
10 TB.
checkFile(gSystem->Getenv(
"CWB_PARAMETERS_FILE"));
11 TB.
checkFile(gSystem->Getenv(
"CWB_UPARAMETERS_FILE"));
12 TB.
checkFile(gSystem->Getenv(
"CWB_PPARAMETERS_FILE"));
13 TB.
checkFile(gSystem->Getenv(
"CWB_UPPARAMETERS_FILE"));
14 TB.
checkFile(gSystem->Getenv(
"CWB_EPPARAMETERS_FILE"));
16 gStyle->SetTitleFillColor(kWhite);
17 gStyle->SetLineColor(kWhite);
18 gStyle->SetNumberContours(256);
19 gStyle->SetCanvasColor(kWhite);
20 gStyle->SetStatBorderSize(1);
21 gStyle->SetOptStat(kFALSE);
24 gStyle->SetFrameBorderMode(0);
31 TCanvas *
c1 =
new TCanvas(
"lag",
"lag",32,55,750,502);
32 c1->Range(-0.75,-1.23433,6.75,8.17182);
37 c1->SetFrameFillColor(0);
38 gStyle->SetPalette(1,0);
40 TChain
wave(
"waveburst");
41 TChain
live(
"liveTime");
58 wave.SetEstimate(num);
59 wave.Draw(
"lag[0]-lag[1]:lag[1]-lag[2]",cut,
"goff");
60 cout<<
"Number of Entries: "<<num<<endl;
61 double* lag01 =
wave.GetV1();
62 double* lag12 =
wave.GetV2();
65 int num2 = (
int)
live.GetEntries(cut2);
66 live.SetEstimate(num2);
67 live.Draw(
"lag[0]-lag[1]:lag[1]-lag[2]:live",cut2,
"goff");
68 double* llag01 =
live.GetV1();
69 double* llag12 =
live.GetV2();
73 double xplotlagMax = TMath::MaxElement(num,lag01);
74 double xplotlagMin = TMath::MinElement(num,lag01);
75 double yplotlagMax = TMath::MaxElement(num,lag12);
76 double yplotlagMin = TMath::MinElement(num,lag12);
78 cout<<xplotlagMin<<
" < lag[o]-lag[1] < "<<xplotlagMax<<endl;
79 cout<<yplotlagMin<<
" < lag[1]-lag[2] < "<<yplotlagMax<<endl;
86 sprintf(title,
"FAR distribution over lags (post cat3 & rho>%f)",
T_cut);
87 TH2F* lag =
new TH2F(
"SLAG",title,Nlag,xplotlagMin,xplotlagMax,Nlag,yplotlagMin,yplotlagMax);
88 lag->GetXaxis()->SetTitle(
"lag[0]-lag[1] shift [s]");
89 lag->GetXaxis()->SetNdivisions(10,kFALSE);
90 lag->GetYaxis()->SetTitle(
"lag[1]-lag[2] shift [s]");
91 lag->GetYaxis()->SetNdivisions(10,kFALSE);
92 lag->SetStats(kFALSE);
93 TH2F*
llag =
new TH2F(
"LSLAG",
"FAR distribution over lags",Nlag,xplotlagMin,xplotlagMax,Nlag,yplotlagMin,yplotlagMax);
95 lag->Fill(lag01[
i],lag12[i]);
98 for(
int i =0 ;
i<num2;
i++){
99 llag->Fill(llag01[
i],llag12[i],Live[i]);
107 c1->Update(); c1->SaveAs(fname);
115 for(
int i =1 ;
i<Nlag+1;
i++){
116 for(
int j =1 ;
j<Nlag+1;
j++){
117 if(lag->GetBinContent(
i,
j)>=1.E-15){
118 FAR[
count] = lag->GetBinContent(
i,
j);
119 D[
count] = TMath::Sqrt(pow(xaxis->GetBinCenter(
i),2)+pow(yaxis->GetBinCenter(
j),2));
120 eFAR[
count] = lag->GetBinError(
i,
j)/llag->GetBinError(
i,
j);
122 cout <<
"i :"<<
i<<
" j :"<<
j<<
" FAR :"<<FAR[count-1] <<
"+/-" <<eFAR[count-1] <<
" " <<endl;
129 cout <<
"Number of lags : " << count << endl;
130 double liveTot = llag->GetSumOfWeights();
132 cout <<
"Total BKG live time : " << liveTot << endl;
139 TMath::Sort(count,N,index,
false);
140 for(
int i =0 ;
i<
count;
i++){FAR2[
i]=FAR[index[
i]];eFAR2[
i]=eFAR[index[
i]];N[
i]=D[index[
i]];eN[
i]=0.0;}
141 TGraphErrors* FarPlot=
new TGraphErrors(count, N, FAR2, eN, eFAR2);
142 FarPlot->SetLineColor(kBlue);
143 FarPlot->SetMarkerColor(kBlue);
145 FarPlot->SetTitle(
"FAR vs lag distance");
146 FarPlot->SetMarkerStyle(20);
147 FarPlot->SetMarkerSize(1);
149 FarPlot->GetHistogram()->SetXTitle(
"#lag distance [s]");
150 FarPlot->GetHistogram()->SetYTitle(
"rate, Hz");
155 c1->Update(); c1->SaveAs(fname);
sprintf(cut,"rho[1]>%f", T_cut)