Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
slag.C File Reference

Functions

wave Add (net_file_name)
 
live Add (liv_file_name)
 
legr AddEntry (g1, lab,"l")
 
legr AddEntry ("", lab,"a")
 
legl AddEntry (g2, lab,"l")
 
TB checkFile (gSystem->Getenv("CWB_ROOTLOGON_FILE"))
 
TB checkFile (gSystem->Getenv("CWB_PARAMETERS_FILE"))
 
TB checkFile (gSystem->Getenv("CWB_UPARAMETERS_FILE"))
 
TB checkFile (gSystem->Getenv("CWB_PPARAMETERS_FILE"))
 
TB checkFile (gSystem->Getenv("CWB_UPPARAMETERS_FILE"))
 
TB checkFile (gSystem->Getenv("CWB_EPPARAMETERS_FILE"))
 
c1 Clear ()
 
Slag Divide (lSlag)
 
Slag Draw ("colz")
 
lSlag2 Draw ("P")
 
FarPlot Draw ("AP")
 
legr Draw ()
 
g1 Draw ("same")
 
 exit (0)
 
 fclose (frate)
 
FarPlot Fit ("pol1")
 
FarPlot2 Fit (g1,"R")
 
FarPlot2 Fit (g2,"R+","SAME")
 
 for (long int l=0;l< num;l++)
 
gROOT ForceStyle ()
 
 fprintf (frate,"#FAR[years^-1] eFAR Tshift[days]\n")
 
FarPlot GetHistogram () -> SetXTitle("slag distance [day]")
 
cout<< "Number of slags : "
<< mycount<< endl;double
liveTot=lSlag-> 
GetSumOfWeights ()
 
lSlag2 GetXaxis () -> SetTitle("slag shift [day]")
 
Slag GetYaxis () -> SetTitle("slag[2] shift [day]")
 
 if (nIFO >3)
 
 if (!slagFound)
 
 if (!test_veto.IsNull()) sprintf(cut
 
 if (nIFO==2)
 
TChain live ("liveTime")
 
TIter mynext (wave.GetListOfBranches())
 
c1 Range (-0.75,-1.23433, 6.75, 8.17182)
 
mynext Reset ()
 
c1 SaveAs (fname)
 
lSlag2 Scale (1./86400)
 
TString sel ("slag[1]:slag[2]")
 
c1 SetBorderSize (1)
 
live SetBranchAddress ("slag", xslag)
 
live SetBranchAddress ("lag", xlag)
 
live SetBranchAddress ("live",&xlive)
 
live SetBranchStatus ("gps", false)
 
gStyle SetCanvasColor (kWhite)
 
wave SetEstimate (num)
 
c1 SetFillColor (0)
 
gStyle SetFrameBorderMode (0)
 
c1 SetFrameFillColor (0)
 
c1 SetGridx ()
 
c1 SetGridy ()
 
gStyle SetLineColor (kWhite)
 
cout<< "Total BKG live time : "
<< liveTot<< endl;double *FAR2=new
double[mycount];double *eFAR2=new
double[mycount];double *N=new
double[mycount];double *Ny=new
double[mycount];double *eN=new
double[mycount];for(int i=0;i
< mycount;i++){N[i]=D[i];}Int_t
*myindex=new Int_t[mycount];TMath::Sort(mycount,
Ny, myindex, false);for(int i=0;i
< mycount;i++){FAR2[i]=FAR[myindex[i]];eFAR2[i]=eFAR[myindex[i]];N[i]=D[myindex[i]];Ny[i]=Dy[myindex[i]];eN[i]=0.0;}TGraphErrors
*FarPlot=new TGraphErrors(mycount,
N, FAR2, eN, eFAR2);FarPlot-> 
SetLineColor (kBlue)
 
g1 SetLineColor (2)
 
g2 SetLineColor (3)
 
legr SetLineColor (1)
 
FarPlot SetLineStyle (3)
 
g1 SetLineWidth (5)
 
c1 SetLogy (kFALSE)
 
FarPlot SetMarkerColor (kBlue)
 
FarPlot SetMarkerSize (1)
 
lSlag2 SetMarkerStyle (20)
 
gStyle SetNumberContours (256)
 
gStyle SetOptFit ()
 
gStyle SetOptFit (kFALSE)
 
gStyle SetOptStat (kFALSE)
 
gStyle SetOptStat ()
 
gStyle SetPalette (1, 0)
 
gStyle SetStatBorderSize (1)
 
Slag SetStats (kFALSE)
 
lSlag2 SetTitle (mytitle)
 
FarPlot SetTitle ("FAR vs slag distance")
 
FarPlot2 SetTitle ("")
 
gStyle SetTitleFillColor (kWhite)
 
 sprintf (cut,"rho[1]>%f", T_cut)
 
 sprintf (cut2,"!(lag[%d]==0&&slag[%d]==0)", nIFO, nIFO)
 
 sprintf (fname,"%s/slag.png", netdir)
 
 sprintf (mytitle,"Live time (%d lags) over slag shift", lagSize)
 
 sprintf (fname,"%s/Live_vs_slagtime.png", netdir)
 
 sprintf (fname,"%s/FAR_vs_slag.png", netdir)
 
 sprintf (fname,"%s/FAR_vs_slag2.txt", netdir)
 
 sprintf (lab,"#chi^{2}/ndf(right) : %3.3g / %d", g1->GetChisquare(), g1->GetNDF())
 
 sprintf (lab,"P0(right) : %.2f +/- %.2f", g1->GetParameters()[0], g1->GetParErrors()[0])
 
 sprintf (lab,"P1(right) : %.2g +/- %.2g", g1->GetParameters()[1], g1->GetParErrors()[1])
 
 sprintf (lab,"#chi^{2}/ndf(left) : %3.3g / %d", g2->GetChisquare(), g2->GetNDF())
 
 sprintf (lab,"P0(left) : %.2f +/- %.2f", g2->GetParameters()[0], g2->GetParErrors()[0])
 
 sprintf (lab,"P1(left) : %.2g +/- %.2g", g2->GetParameters()[1], g2->GetParErrors()[1])
 
 sprintf (fname,"%s/FAR_vs_slag2.png", netdir)
 
c1 Update ()
 
TChain wave ("waveburst")
 
 while ((branch=(TBranch *) mynext()))
 

Variables

TBranch * branch
 
TCanvas * c1 = new TCanvas("Slag", "Slag",32,55,750,502)
 
TCanvas * c2 = new TCanvas("Slag2", "Slag2",32,55,1450,502)
 
char cut [512]
 
char cut2 [256]
 
double D [50000]
 
double Dx [50000]
 
double Dy [50000]
 
double eFAR [50000]
 
double FAR [50000]
 
TGraphErrors * FarPlot2 = new TGraphErrors(mycount, Dy, FAR, eN, eFAR)
 
char fname [1024]
 
FILE * frate = fopen(fname,"w")
 
TF1 * g1 = new TF1("g1","pol1",0,SlagMax/86400.)
 
TF1 * g2 = new TF1("g2","pol1",-SlagMax/86400.,0)
 
cout<<"Number of Entries: "
<< num<< endl;double *slag1=new
double[slag_entries];slag1=wave.GetV1();double
*slag2=new double[slag_entries];slag2=wave.GetV2();char
mytitle[256];double SlagMax=wave.GetMaximum("slag")+segLen/2.;double
SlagMin=wave.GetMinimum("slag")-segLen/2.;int
NSlag=TMath::FloorNint((SlagMax-SlagMin)/segLen);cout
<< "SLAG MAX : "
<< wave.GetMaximum("slag")
<< " s SLAG MIN : "
<< wave.GetMinimum("slag")
<< " s #SLAGS : "<< NSlag-1
<< endl;if(NSlag==1){cout
<<"Just one slag....Skipping
further execution!"<< endl;exit(0);}sprintf(mytitle,"FAR
distribution over slags (post
cat3 & rho>%f)", T_cut);TH2F
*Slag=new TH2F("SLAG", mytitle,
NSlag, SlagMin/86400., SlagMax/86400.,
NSlag, SlagMin/86400., SlagMax/86400.);Slag-> 
GetXaxis () -> SetTitle("slag[1] shift [day]")
 
char lab [256]
 
 legl = new TLegend(0.15,0.8,0.4,0.98,"","brNDC")
 
 legr = new TLegend(0.6,0.8,0.885,0.98,"","brNDC")
 
double liveMax = lSlag->GetMaximum()
 
TH2F * lSlag = new TH2F("LSLAG","Live time distribution over slags",NSlag,SlagMin/86400.,SlagMax/86400.,NSlag,SlagMin/86400.,SlagMax/86400.)
 
double LSlag [50000]
 
TH1D * lSlag2 = lSlag->ProjectionY()
 
int mycount = 0
 
int ntrg = live.GetEntries()
 
long int num = wave.GetEntries()
 
s && s
 
const int slag_entries = num
 
bool slagFound =false
 
TString test_veto = veto_not_vetoed
 
s veto_not_vetoed
 
TAxis * xaxis = Slag->GetXaxis()
 
float xlag [NIFO_MAX+1]
 
double xlive
 
float xslag [NIFO_MAX+1]
 
TAxis * yaxis = Slag->GetYaxis()
 

Function Documentation

wave Add ( net_file_name  )
live Add ( liv_file_name  )
legr AddEntry ( g1  ,
lab  ,
"l"   
)
leg_D AddEntry ( ""  ,
lab  ,
"a"   
)
legl AddEntry ( g2  ,
lab  ,
"l"   
)
TB checkFile ( gSystem->  Getenv"CWB_ROOTLOGON_FILE")
TB checkFile ( gSystem->  Getenv"CWB_PARAMETERS_FILE")
TB checkFile ( gSystem->  Getenv"CWB_UPARAMETERS_FILE")
TB checkFile ( gSystem->  Getenv"CWB_PPARAMETERS_FILE")
TB checkFile ( gSystem->  Getenv"CWB_UPPARAMETERS_FILE")
TB checkFile ( gSystem->  Getenv"CWB_EPPARAMETERS_FILE")
c1 Clear ( )

Definition at line 1261 of file CWB_Plugin_xWRC.C.

Slag Divide ( lSlag  )
Slag Draw ( "colz"  )
lSlag2 Draw ( "P"  )
FarPlot Draw ( "AP"  )
legr Draw ( )
g1 Draw ( "same"  )
exit ( )
fclose ( frate  )
FarPlot Fit ( "pol1"  )
FarPlot2 Fit ( g1  ,
"R"   
)
FarPlot2 Fit ( g2  ,
"R+"  ,
"SAME"   
)
for ( )

Definition at line 98 of file slag.C.

gROOT ForceStyle ( )
fprintf ( frate  ,
"#FAR eFAR Tshift\n [years^-1][days] 
)
FarPlot GetHistogram ( ) -> SetXTitle("slag distance [day]")

Definition at line 913 of file cbc_plots.C.

cout<< "Number of slags : " << mycount << endl; double liveTot = lSlag-> GetSumOfWeights ( )
lSlag2 GetXaxis ( ) -> SetTitle("slag shift [day]")

Definition at line 321 of file cwb_report_prod_2.C.

Slag GetYaxis ( ) -> SetTitle("slag[2] shift [day]")

Definition at line 213 of file cbc_plots.C.

if ( nIFO  ,
 
)

Definition at line 5 of file slag.C.

if ( slagFound)

Definition at line 54 of file slag.C.

if ( !test_veto.  IsNull())
if ( nIFO  = =2)

Definition at line 73 of file slag.C.

TChain live ( "liveTime"  )
TIter mynext ( wave.  GetListOfBranches())
c1 Range ( -0.  75,
-1.  23433,
6.  75,
8.  17182 
)
mynext Reset ( )
c1 SaveAs ( fname  )
lSlag2 Scale ( 1./  86400)
TString sel ( "slag:slag"  [1][2])
c1 SetBorderSize ( )
live SetBranchAddress ( "slag"  ,
xslag   
)
live SetBranchAddress ( "lag"  ,
xlag   
)
live SetBranchAddress ( "live"  ,
xlive 
)
live SetBranchStatus ( "gps"  ,
false   
)
gStyle SetCanvasColor ( kWhite  )
wave SetEstimate ( num  )
c1 SetFillColor ( )
gStyle SetFrameBorderMode ( )
c1 SetFrameFillColor ( )
c1 SetGridx ( )
c1 SetGridy ( )
gStyle SetLineColor ( kWhite  )
cout<< "Total BKG live time : " << liveTot << endl; double* FAR2 = new double[mycount]; double* eFAR2 = new double[mycount]; double* N = new double[mycount]; double* Ny = new double[mycount]; double* eN = new double[mycount]; for(int i =0 ;i<mycount;i++){N[i]=D[i];} Int_t *myindex = new Int_t[mycount]; TMath::Sort(mycount,Ny,myindex,false); for(int i =0 ;i<mycount;i++){FAR2[i]=FAR[myindex[i]];eFAR2[i]=eFAR[myindex[i]];N[i]=D[myindex[i]];Ny[i]=Dy[myindex[i]];eN[i]=0.0;} TGraphErrors* FarPlot= new TGraphErrors(mycount, N, FAR2, eN, eFAR2); FarPlot-> SetLineColor ( kBlue  )
q_inj SetLineColor ( )
g2 SetLineColor ( )
legr SetLineColor ( )
FarPlot2 SetLineStyle ( )
g2 SetLineWidth ( )
c1 SetLogy ( kFALSE  )
FarPlot SetMarkerColor ( kBlue  )
FarPlot SetMarkerSize ( )
lSlag2 SetMarkerStyle ( 20  )
gStyle SetNumberContours ( 256  )
gStyle SetOptFit ( )
gStyle SetOptFit ( kFALSE  )
gStyle SetOptStat ( kFALSE  )
gStyle SetOptStat ( )
gStyle SetPalette ( ,
 
)
gStyle SetStatBorderSize ( )
Slag SetStats ( kFALSE  )
lSlag2 SetTitle ( mytitle  )
FarPlot SetTitle ( "FAR vs slag distance )
FarPlot2 SetTitle ( ""  )
gStyle SetTitleFillColor ( kWhite  )
sprintf ( cut  ,
rho[1],
%f ,
T_cut   
)
sprintf ( cut2  ,
"!(lag[%d]==0&&slag[%d]==0)"  ,
nIFO  ,
nIFO   
)
sprintf ( fname  ,
"%s/slag.png"  ,
netdir   
)
sprintf ( mytitle  ,
"Live time (%d lags) over slag shift ,
lagSize   
)
sprintf ( fname  ,
"%s/Live_vs_slagtime.png"  ,
netdir   
)
sprintf ( fname  ,
"%s/FAR_vs_slag.png"  ,
netdir   
)
sprintf ( fname  ,
"%s/FAR_vs_slag2.txt"  ,
netdir   
)
sprintf ( lab  ,
"#chi^{2}/ndf(right) : %3.3g / %d"  ,
g1->  GetChisquare(),
g1->  GetNDF() 
)
sprintf ( lab  ,
"P0(right) : %.2f +/- %.2f"  ,
g1->  GetParameters()[0],
g1->  GetParErrors()[0] 
)
sprintf ( lab  ,
"P1(right) : %.2g +/- %.2g"  ,
g1->  GetParameters()[1],
g1->  GetParErrors()[1] 
)
sprintf ( lab  ,
"#chi^{2}/ndf(left) : %3.3g / %d"  ,
g2->  GetChisquare(),
g2->  GetNDF() 
)
sprintf ( lab  ,
"P0(left) : %.2f +/- %.2f"  ,
g2->  GetParameters()[0],
g2->  GetParErrors()[0] 
)
sprintf ( lab  ,
"P1(left) : %.2g +/- %.2g"  ,
g2->  GetParameters()[1],
g2->  GetParErrors()[1] 
)
sprintf ( fname  ,
"%s/FAR_vs_slag2.png"  ,
netdir   
)
c1 Update ( )
TChain wave ( "waveburst"  )
while ( (branch=(TBranch *) mynext())  )

Definition at line 50 of file slag.C.

Variable Documentation

TBranch* branch

Definition at line 47 of file slag.C.

TCanvas* c1 = new TCanvas("Slag", "Slag",32,55,750,502)

Definition at line 31 of file slag.C.

TCanvas* c2 = new TCanvas("Slag2", "Slag2",32,55,1450,502)

Definition at line 207 of file slag.C.

s cut

Definition at line 57 of file slag.C.

char cut2[256]

Definition at line 58 of file slag.C.

double D[50000]

Definition at line 145 of file slag.C.

double Dx[50000]

Definition at line 146 of file slag.C.

double Dy[50000]

Definition at line 147 of file slag.C.

double eFAR[50000]

Definition at line 144 of file slag.C.

double FAR[50000]

Definition at line 142 of file slag.C.

TGraphErrors* FarPlot2 = new TGraphErrors(mycount, Dy, FAR, eN, eFAR)

Definition at line 225 of file slag.C.

char fname[1024]

Definition at line 56 of file slag.C.

FILE* frate = fopen(fname,"w")

Definition at line 217 of file slag.C.

TF1* g1 = new TF1("g1","pol1",0,SlagMax/86400.)

Definition at line 245 of file slag.C.

TF1* g2 = new TF1("g2","pol1",-SlagMax/86400.,0)

Definition at line 248 of file slag.C.

h2gd GetXaxis ( ) -> SetTitle("slag[1] shift [day]")

Definition at line 91 of file slag.C.

char lab[256]

Definition at line 259 of file slag.C.

legl = new TLegend(0.15,0.8,0.4,0.98,"","brNDC")

Definition at line 258 of file slag.C.

legr = new TLegend(0.6,0.8,0.885,0.98,"","brNDC")

Definition at line 257 of file slag.C.

double liveMax = lSlag->GetMaximum()

Definition at line 169 of file slag.C.

TH2F* lSlag = new TH2F("LSLAG","Live time distribution over slags",NSlag,SlagMin/86400.,SlagMax/86400.,NSlag,SlagMin/86400.,SlagMax/86400.)

Definition at line 97 of file slag.C.

double LSlag[50000]

Definition at line 143 of file slag.C.

TH1D* lSlag2 = lSlag->ProjectionY()

Definition at line 125 of file slag.C.

int mycount = 0

Definition at line 141 of file slag.C.

int ntrg = live.GetEntries()

Definition at line 112 of file slag.C.

num = wave.GetEntries()

Definition at line 65 of file slag.C.

s&& s

Definition at line 63 of file slag.C.

const int slag_entries = num

Definition at line 76 of file slag.C.

bool slagFound =false

Definition at line 48 of file slag.C.

TString test_veto = veto_not_vetoed

Definition at line 62 of file slag.C.

s veto_not_vetoed

Definition at line 63 of file slag.C.

TAxis* xaxis = Slag->GetXaxis()

Definition at line 139 of file slag.C.

float xlag[NIFO_MAX+1]

Definition at line 104 of file slag.C.

double xlive

Definition at line 106 of file slag.C.

float xslag[NIFO_MAX+1]

Definition at line 105 of file slag.C.

TAxis* yaxis = Slag->GetYaxis()

Definition at line 140 of file slag.C.