Logo coherent WaveBurst  
Library Reference Guide
Logo
EccentricityIndex.C
Go to the documentation of this file.
1 // this macro shows how to read the eBBH results from output ROOT file produced with CWB_Plugin_eBBH.C
2 // Author : G.Vedovato
3 
4 #define NCHIRP_MAX 4
5 
6 // ------------------------------------------------------------
7 // ebbh structure
8 // ------------------------------------------------------------
9 
10 struct EBBH { // structure for output for estimated parameters
11 
12  TString name;
13 
14  std::vector<TString> ifo;
15 
16  float isnr;
17  float osnr;
18 
19  double seggps; // segment start time
20 
21  float parms[NIFO_MAX]; // null pixel statistic, for each detector
22 
23  float mchirp;
24  float mass[2];
25  float spin[6]; // spin
26  float e0;
27  float rp0;
28  float dist;
29  float redshift;
30 
31  float ch_mass[NCHIRP_MAX]; // chirp mass
32  float ch_tmerger[NCHIRP_MAX]; // merger time
33  float ch_merr[NCHIRP_MAX]; // mchirp error
34  float ch_mchi2[NCHIRP_MAX]; // mchirp chi2
35  float ch_energy[NCHIRP_MAX]; // chirp energy
36 
37  float ei; // eccentricity index
38 
39  netcluster nc; // netcluster
40 
41  wavearray<double> wdat[NIFO_MAX]; // whitened data (in the vREC time range)
42  wavearray<double> winj[NIFO_MAX]; // whiten injected waveforms
43  wavearray<double> sinj[NIFO_MAX]; // strain injected waveforms
44  wavearray<double> wrec[NIFO_MAX]; // whiten reconstructed waveforms
45  wavearray<double> srec[NIFO_MAX]; // strain injected waveforms
46 
47  wavearray<double> wsim[2]; // strain simulated waveforms hp,hc
48 };
49 
50 // ------------------------------------------------------------
51 // functions
52 // ------------------------------------------------------------
53 
54 int ReadDataFromROOT(TString ifile, EBBH* ebbh);,
55 
56 void PlotMultiChirp(EBBH* ebbh);
57 void PlotMultiChirp2(EBBH* ebbh, int ifo=0, TString ptype="", TString wtype="");
58 void PlotMChirp(EBBH* ebbh);
59 void PlotChirp(EBBH* ebbh, int mch_order, double& tmerger, double& xmin, double& xmax, EColor color);
60 
61 double GetTimeBoundaries(wavearray<double> x, double P, double& bT, double& eT);
64 
65 double GetFitParameter(double mchirp);
66 void PlotCluster(watplot* WTS, netcluster* pwc, double fLow, double fHigh);
67 
68 void FindChirp(EBBH* ebbh, int mch_order, double& tmerger, double& xmin, double& xmax, int ifo, TString ptype, TString wtype);
69 
70 void FillHistogram(EBBH* ebbh, TH2F&* hN, TH2F&* hL, TH2F&* heT, TH2F&* heF, double zmax_thr=0.);
71 void PlotHistogram(EBBH* ebbh, TH2F&* hH);
72 double ChirpIntegralHistogram(EBBH* ebbh, TH2F&* h2d, double dMc);
73 
74 void DrawMChirpInstantaneousFrequency(EBBH* ebbh, TString wtype, int ifo);
75 
76 void GetCBC(EBBH* ebbh);
77 void GetEBBH(EBBH* ebbh);
78 
79 void Init();
80 void Clear();
81 
82 // -----------------------------------------------------------------------------------------------------------
83 // defines
84 // -----------------------------------------------------------------------------------------------------------
85 
86 #define FLOW 16
87 #define FHIGH 1024
88 
89 // default threshold (used in network::likelihoodWP)
90 /*
91 #define CHI2_THR 2.0
92 #define TMERGER_CUT 1.e20
93 #define ZMAX_THR 0.0
94 */
95 
96 
97 //#define CHI2_THR -2.5 // if negative the chirp pixels are tagged with pix->likelihood=0 after the selection
98 //#define TMERGER_CUT 0.1
99 #define CHI2_THR -4.5 // if negative the chirp pixels are tagged with pix->likelihood=0 after the selection
100 #define TMERGER_CUT 0.01
101 #define ZMAX_THR 0.2
102 
103 
104 
105 // ------------------------------------------------------------
106 // global variables
107 // ------------------------------------------------------------
108 
109 int gTYPE;
110 int gENTRY;
111 bool gPLOT;
113 
118 TF1* fchirp;
119 
120 TH2F* hN;
121 TH2F* hL;
122 TH2F* heT;
123 TH2F* heF;
124 
126 TGraphErrors* xgr[NCHIRP_MAX];
127 
128 TCanvas* canvas;
129 
130 int EccentricityIndex(TString ifroot, int gtype=0, int entry=0, int ifo=0, EBBH* xebbh=NULL) {
131 
132  // if gtype<0 the plot is saved with name with the following format : gTYPE_gtype_file_name.png
133 
134  // gtype = 0 -> no plots, only computation of ei
135  // gtype = 1 -> plot chirp fit function with rec spectrogram
136  // gtype = 2 -> plot chirp fit function with likelihood
137  // gtype = 3 -> plot chirp fit function with likelihood without the main chirp
138  // show residuals after chirp1 removal ( only with PlotMultiChirp2 & "like" )
139  // gtype = 4 -> plot with inj spectrogram
140  // gtype = 5 -> plot likelihood TF after with pixels selected with zmax_thr
141  // gtype = 6 -> plot chirp mass fit in f^-3/8 vs time plane
142  // gtype = 7 -> plot chirp mass fit in f^-3/8 vs time plane for all chirp
143  // gtype = 8 -> plot ifo waveform in time
144  // gtype = 9 -> plot ifo waveform in frequency
145  // gtype = 10 -> plot whitened data spectrogram
146  // gtype = 11 -> plot inj waveform spectrogram
147  // gtype = 12 -> plot rec waveform spectrogram
148  // gtype = 13 -> plot inj waveform instantaneous frequency mchirp
149  // gtype = 14 -> plot rec waveform instantaneous frequency mchirp
150  // gtype = 15 -> plot sim waveform (GetCBC) instantaneous frequency mchirp
151  // gtype = 16 -> plot sim waveform (GetEBBH) instantaneous frequency mchirp
152 
153  Init();
154 
155  if(gtype<-16 || gtype>16) {cout << "Error, gtype parameter value not allowed : [-1:11]" << endl;exit(1);}
156  if(ifroot=="") {cout << "Error, input root file name not defined" << endl;exit(1);}
157 
158  gPLOT = gtype<0 ? true : false;
159  gTYPE = abs(gtype);
160 
161  if(gPLOT) gROOT->SetBatch(true);
162 
163  gENTRY = entry;
164 
165  TString fDir = gSystem->DirName(ifroot);
166  TString fName = gSystem->BaseName(ifroot);
167 
168  if(fName.Contains("*")) {
169  TString fTag = fName;
170  fTag.ReplaceAll("*","");
171  vector<TString> fList = CWB::Toolbox::getFileListFromDir(fDir, ".root", "wave_", fTag, true);
172  if(fList.size()==0) {cout << "Error, no file selected" << endl;exit(1);}
173  if(fList.size()>1) {cout << "Error, multiple files selected" << endl;exit(1);}
174 
175  ifroot = fList[0];
176  fDir = gSystem->DirName(ifroot);
177  fName = gSystem->BaseName(ifroot);
178  }
179 
180  CWB::Toolbox::checkFile(ifroot);
181 
182  gOFILE = fName;
183  gOFILE.ReplaceAll(".root",".png"); // output file name for plot
184  gOFILE = TString::Format("gTYPE_%d_%s",gTYPE,gOFILE.Data());
185  if(gPLOT) cout << endl << "Output Plot File Name : " << gOFILE << endl << endl;
186 
187  CWB::Toolbox::checkFile(ifroot);
188 
189  EBBH ebbh;
190  MDC = new CWB::mdc();
191 
192  // read ebbh from input root file
193  int err = ReadDataFromROOT(ifroot, &ebbh);
194  if(err) return -100000;
195 
196  if(gTYPE==15) GetCBC(&ebbh); // get simulated CBC waveforms
197  if(gTYPE==16) GetEBBH(&ebbh); // get simulated EBBH waveforms
198 
199  // set waveforms start time at start segment time
200  ebbh.wdat[ifo].start(ebbh.seggps ? ebbh.wdat[ifo].start()-ebbh.seggps : 0);
201  ebbh.winj[ifo].start(ebbh.seggps ? ebbh.winj[ifo].start()-ebbh.seggps : 0);
202  ebbh.wrec[ifo].start(ebbh.seggps ? ebbh.wrec[ifo].start()-ebbh.seggps : 0);
203  ebbh.srec[ifo].start(ebbh.seggps ? ebbh.srec[ifo].start()-ebbh.seggps : 0);
204 
205  if(gTYPE==0) {PlotMultiChirp2(&ebbh); if(xebbh) {*xebbh=ebbh; Clear(); return 0;} else exit(0);}
206  if(gTYPE==1) {PlotMultiChirp2(&ebbh, ifo, "stft", "wrec");return 0;}
207  if(gTYPE==2 || gTYPE==3) {PlotMultiChirp2(&ebbh, ifo, "like", "wrec");return 0;}
208  if(gTYPE==4) {PlotMultiChirp2(&ebbh, ifo, "stft", "winj");return 0;}
209  if(gTYPE==5) {
210  FillHistogram(&ebbh, hN, hL, heT, heF, ZMAX_THR);
211  PlotHistogram(&ebbh, hL); return 0;
212 /*
213  FillHistogram(&ebbh, hN, hL, heT, heF, 0);
214  double cenergy = ChirpIntegralHistogram(&ebbh, hL, 0);
215  PlotHistogram(&ebbh, hL); return 0;
216  TH1F* hC = new TH1F("hC","hC",41,-20,20);
217  for(int i=0;i<=40;i++) {
218  double dMc = i-20;
219  double cenergy = ChirpIntegralHistogram(&ebbh, hL, dMc);
220  cout << "CHIRP ENERGY : " << dMc << " -> " << cenergy << endl;
221  hC->SetBinContent(i,cenergy);
222  }
223  hC->Draw();
224  return 0;
225 */
226  //PlotHistogram(&ebbh, hL); return 0;
227  //PlotHistogram(&ebbh, heF); return 0;
228  //PlotHistogram(&ebbh, heT); return 0;
229  //PlotHistogram(&ebbh, hN); return 0;
230  }
231  if(gTYPE==6) {PlotMChirp(&ebbh); return 0;}
232  if(gTYPE==7) {PlotMultiChirp(&ebbh);return 0;}
233  if(gTYPE==8) {
234  MDC->SetZoom(0.999);
235  watplot* plot=MDC->Draw(ebbh.winj[ifo],MDC_TIME,"ALP ZOOM",kRed);
236  MDC->Draw(ebbh.wrec[ifo],MDC_TIME,"SAME",kBlack);
237  if(plot) plot->graph[0]->SetTitle(TString::Format("%s : Rec(black), Inj(red))",ebbh.name.Data()));
238  if(gPLOT) {stft->Print(gOFILE);exit(0);} else return 0;
239  }
240  if(gTYPE==9) {
241  MDC->SetZoom(0.999);
242  watplot* plot=MDC->Draw(ebbh.winj[ifo],MDC_FFT,"ALP ZOOM",kRed);
243  MDC->Draw(ebbh.wrec[ifo],MDC_FFT,"SAME",kBlack);
244  if(plot) plot->graph[0]->SetTitle(TString::Format("%s : Rec(black), Inj(red))",ebbh.name.Data()));
245  if(gPLOT) {MDC->GetWatPlot()->canvas->Print(gOFILE);exit(0);} else return 0;
246  }
247  if(gTYPE==10) {MDC->Draw(ebbh.wdat[ifo],MDC_TF);if(gPLOT) {MDC->GetSTFT()->Print(gOFILE);exit(0);} else return 0;}
248  if(gTYPE==11) {MDC->Draw(ebbh.winj[ifo],MDC_TF);if(gPLOT) {MDC->GetSTFT()->Print(gOFILE);exit(0);} else return 0;}
249  if(gTYPE==12) {MDC->Draw(ebbh.wrec[ifo],MDC_TF);if(gPLOT) {MDC->GetSTFT()->Print(gOFILE);exit(0);} else return 0;}
250 
251  if(gTYPE==13) {DrawMChirpInstantaneousFrequency(&ebbh, "winj", ifo); return;}
252  if(gTYPE==14) {DrawMChirpInstantaneousFrequency(&ebbh, "wrec", ifo); return;}
253  if(gTYPE==15) {DrawMChirpInstantaneousFrequency(&ebbh, "wsim", ifo); return;}
254 
255  return 0;
256 }
257 
258 void Init() {
259 
260  MDC = NULL;
261  WTS = NULL;
262  PCH = NULL;
263  stft = NULL;
264 
265  hN = NULL;
266  hL = NULL;
267  heT = NULL;
268  heF = NULL;
269 
270  for(int i=0;i<NCHIRP_MAX;i++) {
271  xfit[i] = NULL;
272  xgr[i] = NULL;
273  }
274 
275  fchirp = NULL;
276 
277  canvas = NULL;
278 }
279 
280 void Clear() {
281 
282  if(MDC != NULL) delete MDC;
283  if(WTS != NULL) delete WTS;
284  if(PCH != NULL) delete PCH;
285  if(stft != NULL) delete stft;
286 
287  if(hN != NULL) delete hN;
288  if(hL != NULL) delete hL;
289  if(heT != NULL) delete heT;
290  if(heF != NULL) delete heF;
291 
292  for(int i=0;i<NCHIRP_MAX;i++) {
293  if(xfit[i] != NULL) delete xfit[i];
294  if(xgr[i] != NULL) delete xgr[i];
295  }
296 
297  if(fchirp != NULL) delete fchirp;
298 
299  if(canvas != NULL) delete canvas;
300 }
301 
302 int ReadDataFromROOT(TString ifile, EBBH* ebbh) {
303 //
304 // ----------------------------------------------------
305 // ROOT Output PE Parameters
306 // ----------------------------------------------------
307 
308  TFile* froot = new TFile(ifile,"READ");
309  TTree* itree = froot->Get("waveburst");
310  if(itree==NULL) {cout << "ReadDataFromROOT - Error : no waveburst present in the file" << endl;return 1;}
311 
312  // get detector list
313  TList* list = itree->GetUserInfo();
314  int nIFO=list->GetSize();
315  if (nIFO==0) {cout << "ReadDataFromROOT - Error : no ifo present in the tree" << endl;return 1;}
316  for (int n=0;n<list->GetSize();n++) {
317  detector* pDetector;
318  pDetector = (detector*)list->At(n);
319  ebbh->ifo.push_back(pDetector->Name);
320  detectorParams dParams = pDetector->getDetectorParams();
321  //pDetector->print();
322  }
323 
324  itree->SetBranchAddress("ndim",&nIFO);
325  itree->GetEntry(gENTRY);
326 
327  double seggps=0; // segment start time
328  float crate; // netcluster::rate
329  float parms[NIFO_MAX]; // ebbh parameters
330  float eBBH[4]; // ebbh parameters
331  float range[2]; // distance (Mpc)
332  float iSNR[NIFO_MAX];
333  float oSNR[NIFO_MAX];
334  std::vector<netpixel>* cluster;
339 
340  for(int n=0;n<nIFO;n++) {
341  wDAT[n] = new wavearray<double>;
342  wINJ[n] = new wavearray<double>;
343  wREC[n] = new wavearray<double>;
344  sREC[n] = new wavearray<double>;
345  }
346 
347  cluster = new std::vector<netpixel>;
348 
349  itree->SetBranchAddress("mass",ebbh->mass);
350  itree->SetBranchAddress("eBBH",eBBH);
351  itree->SetBranchAddress("range",range);
352  itree->SetBranchAddress("spin",ebbh->spin);
353  itree->SetBranchAddress("iSNR",iSNR);
354  itree->SetBranchAddress("oSNR",oSNR);
355 
356  itree->SetBranchAddress("ebbh_parms",parms);
357  for(int n=0;n<nIFO;n++) {
358  itree->SetBranchAddress(TString::Format("ebbh_wDAT_%d",n).Data(),&wDAT[n]);
359  itree->SetBranchAddress(TString::Format("ebbh_wINJ_%d",n).Data(),&wINJ[n]);
360  itree->SetBranchAddress(TString::Format("ebbh_wREC_%d",n).Data(),&wREC[n]);
361  itree->SetBranchAddress(TString::Format("ebbh_sREC_%d",n).Data(),&sREC[n]);
362  }
363 
364  itree->SetBranchAddress("ebbh_ch_mass", ebbh->ch_mass);
365  itree->SetBranchAddress("ebbh_ch_tmerger",ebbh->ch_tmerger);
366  itree->SetBranchAddress("ebbh_ch_merr", ebbh->ch_merr);
367  itree->SetBranchAddress("ebbh_ch_mchi2", ebbh->ch_mchi2);
368  itree->SetBranchAddress("ebbh_ch_energy", ebbh->ch_energy);
369 
370  itree->SetBranchAddress("ebbh_seggps",&seggps);
371  itree->SetBranchAddress("ebbh_crate",&crate);
372  itree->SetBranchAddress("ebbh_cluster",&cluster);
373 
374  itree->GetEntry(gENTRY);
375 
376  ebbh->e0 = eBBH[1];
377  ebbh->rp0 = eBBH[2];
378  ebbh->redshift = eBBH[3];
379  ebbh->dist = range[1];
380  ebbh->isnr = 0;
381  for(int n=0;n<nIFO;n++) ebbh->isnr += iSNR[n];
382  ebbh->isnr = sqrt(ebbh->isnr);
383  ebbh->osnr = 0;
384  for(int n=0;n<nIFO;n++) ebbh->osnr += oSNR[n];
385  ebbh->osnr = sqrt(ebbh->osnr);
386 
387  for(int n=0;n<nIFO;n++) {
388  ebbh->wdat[n] = GetAlignedWaveform(wDAT[n],wREC[n]);
389  ebbh->winj[n] = GetAlignedWaveform(wINJ[n],wREC[n]);
390  ebbh->wrec[n] = GetAlignedWaveform(wREC[n],wREC[n]);
391  ebbh->srec[n] = GetAlignedWaveform(sREC[n],wREC[n]);
392  }
393 
394  cout << "segment start time " << seggps << endl;
395  cout << "cluster rate " << crate << endl;
396  cout << "cluster size " << cluster->size() << endl;
397 
398  if(cluster->size()==0) {cout << "ReadDataFromROOT - Error : no clusters in the root file !!!" << endl;return 1;}
399 
400  ebbh->nc.rate=crate;
401  std::vector<int> pList;
402  for(int i=0;i<cluster->size();i++) {
403  ebbh->nc.pList.push_back((*cluster)[i]);
404  pList.push_back(i);
405  }
406  ebbh->nc.cList.push_back(pList);
407  clusterdata cd; // dummy cluster data
408  ebbh->nc.cData.push_back(cd);
409 
410  ebbh->seggps = seggps;
411 
412  ebbh->mchirp = pow(ebbh->mass[0]*ebbh->mass[1],3./5.)/pow(ebbh->mass[0]+ebbh->mass[1],1./5.);
413 
414  char name[1024];
415  sprintf(name,"source : m1=%0.1f m2=%0.1f mchirp=%0.1f e0=%0.1f rp0=%0.1f dist=%0.1f (Mpc) redshift=%0.1f isnr=%0.1f osnr=%0.1f",
416  ebbh->mass[0], ebbh->mass[1], ebbh->mchirp, ebbh->e0, ebbh->rp0, ebbh->dist, ebbh->redshift, ebbh->isnr, ebbh->osnr);
417  ebbh->name = name;
418 
419  for(int n=0;n<nIFO;n++) {
420  if(wDAT[n]) delete wDAT[n];
421  if(wINJ[n]) delete wINJ[n];
422  if(wREC[n]) delete wREC[n];
423  if(sREC[n]) delete sREC[n];
424  }
425  if(cluster) delete cluster;
426  if(itree) delete itree;
427  if(froot) delete froot;
428 
429  return 0;
430 }
431 
432 
433 double GetTimeBoundaries(wavearray<double> x, double P, double& bT, double& eT) {
434 
435  if(P<0) P=0;
436  if(P>1) P=1;
437 
438  int N = x.size();
439 
440  double E = 0; // signal energy
441  double avr = 0; // average
442  for(int i=0;i<N;i++) {avr+=i*x[i]*x[i]; E+=x[i]*x[i];}
443  int M=int(avr/E); // central index
444 
445  // search range which contains percentage P of the total energy E
446  int jB=0;
447  int jE=N-1;
448  double a,b;
449  double sum = ((M>=0)&&(M<N)) ? x[M]*x[M] : 0.;
450  for(int j=1; j<N; j++) {
451  a = ((M-j>=0)&&(M-j<N)) ? x[M-j] : 0.;
452  b = ((M+j>=0)&&(M+j<N)) ? x[M+j] : 0.;
453  if(a) jB=M-j;
454  if(b) jE=M+j;
455  sum += a*a+b*b;
456  if(sum/E > P) break;
457  }
458 
459  bT = x.start()+jB/x.rate();
460  eT = x.start()+jE/x.rate();
461 
462  return eT-bT;
463 }
464 
466 
467  wavearray<double> wf = *wf2;
468  wf=0;
469 
470  if(wf1==NULL) return wf;
471  if(wf1->size()==0) return wf;
472 
473  double R=wf1->rate();
474 
475  double b_wf1 = wf1->start();
476  double e_wf1 = wf1->start()+wf1->size()/R;
477  double b_wf2 = wf2->start();
478  double e_wf2 = wf2->start()+wf2->size()/R;
479 
480  int o_wf1 = b_wf1>b_wf2 ? 0 : int((b_wf2-b_wf1)*R+0.5);
481  int o_wf2 = b_wf1<b_wf2 ? 0 : int((b_wf1-b_wf2)*R+0.5);
482 
483  double startXCOR = b_wf1>b_wf2 ? b_wf1 : b_wf2;
484  double endXCOR = e_wf1<e_wf2 ? e_wf1 : e_wf2;
485  int sizeXCOR = int((endXCOR-startXCOR)*R+0.5);
486 
487  for(int i=0;i<sizeXCOR;i++) wf[i+o_wf2] = wf1->data[i+o_wf1];
488 
489  return wf;
490 }
491 
493 
494  double R=wf1->rate();
495 
496  double b_wf1 = wf1->start();
497  double e_wf1 = wf1->start()+wf1->size()/R;
498  double b_wf2 = wf2->start();
499  double e_wf2 = wf2->start()+wf2->size()/R;
500 
501  int o_wf1 = b_wf1>b_wf2 ? 0 : int((b_wf2-b_wf1)*R+0.5);
502  int o_wf2 = b_wf1<b_wf2 ? 0 : int((b_wf1-b_wf2)*R+0.5);
503 
504  double startXCOR = b_wf1>b_wf2 ? b_wf1 : b_wf2;
505  double endXCOR = e_wf1<e_wf2 ? e_wf1 : e_wf2;
506  int sizeXCOR = int((endXCOR-startXCOR)*R+0.5);
507 
508  wavearray<double> wfdif(sizeXCOR);
509  wfdif=0.;
510  wfdif.rate(R);
511  wfdif.start(b_wf1+double(o_wf1)/R);
512 
513  for(int i=0;i<sizeXCOR;i++) wfdif[i] = wf1->data[i+o_wf1] - wf2->data[i+o_wf2];
514 
515  return wfdif;
516 }
517 
518 double GetFitParameter(double mchirp) {
519 
520  const double G = watconstants::GravitationalConstant();
521  const double SM = watconstants::SolarMass();
522  const double C = watconstants::SpeedOfLightInVacuo();
523  const double Pi = TMath::Pi();
524 
525 
526  double A = (96./5.) * pow(Pi,8./3.) * pow(G*SM*mchirp/C/C/C, 5./3);
527  double B = 3./8.;
528 
529  double p0 = -A/B;
530 
531  return p0;
532 }
533 
534 void PlotCluster(watplot* WTS, netcluster* pwc, double fLow, double fHigh) {
535 
536  double RATE = pwc->rate; // original rate
537  std::vector<int>* vint = &(pwc->cList[0]); // pixel list
538  int V = vint->size(); // cluster size
539  for(int j=0; j<V; j++) { // loop over the pixels
540  netpixel* pix = pwc->getPixel(1,j);
541  if(!pix->core) continue;
542  if(pix->likelihood==0) {
543  for(int m=0; m<2; m++) {
544  pix->setdata(0,'S',m); // snr whitened reconstructed signal 00
545  pix->setdata(0,'P',m); // snr whitened reconstructed signal 90
546  pix->setdata(0,'W',m); // snr whitened at the detector 00
547  pix->setdata(0,'U',m); // snr whitened at the detector 90
548  }
549  }
550  }
551  WTS->plot(pwc, 1, 2, 'L', 0, const_cast<char*>("COLZ"));
552  WTS->hist2D->GetYaxis()->SetRangeUser(fLow, fHigh);
553  WTS->canvas->SetLogy();
554  return;
555 }
556 
557 void PlotMultiChirp(EBBH* ebbh) {
558 
559  EColor color[NCHIRP_MAX] = {kBlack, kBlue, kGreen, kMagenta};
560 
561  double mchirp[NCHIRP_MAX];
562  double energy[NCHIRP_MAX];
563 
564  canvas = new TCanvas;
565  canvas->SetGridx();
566  canvas->SetGridy();
567 
568  // plot multi chirp likelihood tf
569 
570  double tmerger=0;
571  double xmin=0;
572  double xmax=0;
573 
574  for(int i=0; i<NCHIRP_MAX; i++) {
575  PlotChirp(ebbh, i, tmerger, xmin, xmax, color[i]);
576  mchirp[i] = ebbh->ch_mass[i];
577  energy[i] = ebbh->ch_energy[i];
578  }
579 
580  char title[256];
581  sprintf(title,"chirp mass : rec = %3.3f / %3.3f / %3.3f / %3.3f - chirp_energy = %3.2f / %3.2f / %3.2f / %3.2f",
582  mchirp[0],mchirp[1],mchirp[2],mchirp[3],energy[0],energy[1],energy[2],energy[3]);
583  xgr[0]->SetTitle(title);
584 
585  if(gPLOT) {canvas->Print(gOFILE);exit(0);}
586 
587  return;
588 }
589 
590 void PlotChirp(EBBH* ebbh, int mch_order, double& tmerger, double& xmin, double& xmax, EColor color) {
591 
592  double chi2_thr = CHI2_THR;
593  double tmerger_cut = TMERGER_CUT;
594  double zmax_thr = ZMAX_THR;
595 
596  double echirp = ebbh->nc.mchirp5(1,zmax_thr,chi2_thr,tmerger_cut);
597 
598  clusterdata* pcd = &ebbh->nc.cData[0];
599 
600  ebbh->ch_mass[mch_order] = pcd->mchirp;
601  ebbh->ch_merr[mch_order] = pcd->mchirperr;
602  ebbh->ch_mchi2[mch_order] = pcd->chi2chirp;
603  ebbh->ch_energy[mch_order] = echirp;
604 
605  TGraphErrors* gr = &(pcd->chirp);
606 
607  xgr[mch_order] = new TGraphErrors(gr->GetN(),gr->GetX(),gr->GetY(),gr->GetEX(),gr->GetEY());
608 
609  char title[256];
610  sprintf(title,"chirp mass : rec = %3.3f [%3.2f] , chi2 = %3.2f",
611  pcd->mchirp,pcd->mchirperr,pcd->chi2chirp);
612 
613  xgr[mch_order]->SetTitle(title);
614  xgr[mch_order]->GetHistogram()->SetStats(kFALSE);
615  xgr[mch_order]->GetHistogram()->SetTitleFont(12);
616  xgr[mch_order]->SetFillColor(kWhite);
617  xgr[mch_order]->SetLineColor(kBlack);
618  xgr[mch_order]->GetXaxis()->SetNdivisions(506);
619  xgr[mch_order]->GetXaxis()->SetLabelFont(42);
620  xgr[mch_order]->GetXaxis()->SetLabelOffset(0.014);
621  xgr[mch_order]->GetXaxis()->SetTitleOffset(1.4);
622  xgr[mch_order]->GetYaxis()->SetTitleOffset(1.2);
623  xgr[mch_order]->GetYaxis()->SetNdivisions(506);
624  xgr[mch_order]->GetYaxis()->SetLabelFont(42);
625  xgr[mch_order]->GetYaxis()->SetLabelOffset(0.01);
626  xgr[mch_order]->GetXaxis()->SetTitleFont(42);
627  xgr[mch_order]->GetXaxis()->SetTitle("Time (sec)");
628  xgr[mch_order]->GetXaxis()->CenterTitle(true);
629  xgr[mch_order]->GetYaxis()->SetTitleFont(42);
630  xgr[mch_order]->GetYaxis()->SetTitle("Frequency^{-8/3}");
631  xgr[mch_order]->GetYaxis()->CenterTitle(true);
632  xgr[mch_order]->GetXaxis()->SetLabelSize(0.03);
633  xgr[mch_order]->GetYaxis()->SetLabelSize(0.03);
634 
635  xgr[mch_order]->SetLineColor(kGreen);
636  xgr[mch_order]->SetMarkerStyle(20);
637  xgr[mch_order]->SetMarkerColor(color);
638  xgr[mch_order]->SetMarkerSize(1);
639  mch_order==0 ? xgr[mch_order]->Draw("XAP") : xgr[mch_order]->Draw("XPsame");
640 
641  TF1* fit = &(pcd->fit);
642  double mchirp = pcd->mchirp;
643  if(tmerger==0) tmerger = -fit->GetParameter(1)/fit->GetParameter(0);
644  //if(xmin==0) xmin = fit->GetXmin();
645  //if(xmax==0) xmax = tmerger-0.001;
646  xmin = fit->GetXmin();
647  xmax = tmerger-0.001;
648  double p0 = GetFitParameter(mchirp);
649  double p1 = tmerger;
650 
651  xfit[mch_order] = new TF1(fit->GetName(), fit->GetTitle(), xmin, xmax);
652  xfit[mch_order]->SetLineColor(kRed);
653  xfit[mch_order]->SetParameter(0, p0);
654  xfit[mch_order]->SetParameter(1, p1);
655  xgr[mch_order]->Fit(xfit[mch_order],"Q");
656  xfit[mch_order]->Draw("same");
657 
658  ebbh->ch_tmerger[mch_order] = -xfit[mch_order]->GetParameter(1)/xfit[mch_order]->GetParameter(0);;
659 
660  return;
661 }
662 
663 void PlotMChirp(EBBH* ebbh) {
664 
665  double chi2_thr = CHI2_THR;
666  double tmerger_cut = TMERGER_CUT;
667  double zmax_thr = ZMAX_THR;
668 
669  ebbh->nc.cData[0].mchirp = 0;
670  ebbh->nc.cData[0].mchirperr = 0;
671  ebbh->nc.cData[0].tmrgr = 0;
672  ebbh->nc.cData[0].tmrgrerr = 0;
673  ebbh->nc.cData[0].chi2chirp = 0;
674 
675  PCH = new watplot(const_cast<char*>("chirp"));
676 
677  for(int i=0; i<NCHIRP_MAX; i++) {
678 
679  ebbh->nc.mchirp5(1,zmax_thr,chi2_thr,tmerger_cut);
680 
681  clusterdata* pcd = &ebbh->nc.cData[0];
682  printf("mchirp : %.2e %.3f %.3f %.3f %.3f \n\n",
683  pcd->mchirp, pcd->mchirperr, pcd->tmrgr,
684  pcd->tmrgrerr, pcd->chi2chirp);
685 
686  // draw chirp : f^(-8/3) vs time
687  if(gPLOT) {
688  TString ofile = gOFILE;
689  ofile.ReplaceAll("gTYPE_6",TString::Format("gTYPE_6_%d",i+1).Data());
690 
691  PCH->canvas->cd();
692  PCH->plot(pcd, 0);
693  PCH->canvas->Print(ofile);
694  } else {
695  cout << "WARNING : Not Implemented : use gtype = -6" << endl;exit(0);
696  char title[256];
697  sprintf(title,"chirp mass : rec = %3.3f [%3.2f] , chi2 = %3.2f",
698  pcd->mchirp,pcd->mchirperr,pcd->chi2chirp);
699  TGraphErrors* gr = &(pcd->chirp);
700  xgr[i] = new TGraphErrors(gr->GetN(),gr->GetX(),gr->GetY(),gr->GetEX(),gr->GetEY());
701  xgr[i]->SetTitle(title);
702  xgr[i]->Draw("ALP");
703  return;
704  TF1* fit = &(pcd->fit);
705  double tmerger = -fit->GetParameter(1)/fit->GetParameter(0);
706  double xmin = fit->GetXmin()-0.1;
707  double xmax = tmerger-0.001;
708  xfit[i] = new TF1(fit->GetName(), "pow([0]*(x-[1]),-3./8.)", xmin, xmax);
709  double p0 = GetFitParameter(pcd->mchirp);
710  double p1 = tmerger;
711  xfit[i]->SetLineColor(kRed);
712  xfit[i]->SetParameter(0, p0);
713  xfit[i]->SetParameter(1, p1);
714  xfit[i]->Draw("same");
715  return;
716  }
717  }
718 
719  exit(0);
720 }
721 
722 void PlotMultiChirp2(EBBH* ebbh, int ifo, TString ptype, TString wtype) {
723 
724  double tmerger=0;
725  double xmin=0;
726  double xmax=0;
727 
728  // plot chirp
729 
730  cout << endl;
731  cout << "-------------------------------------------------------------------------------------------------------------------------------------------" << endl;
732  cout << ebbh->name << endl;
733  cout << endl << " ";
734  cout << "spin1x=" << ebbh->spin[0] << "\tspin1y=" << ebbh->spin[1] << "\tspin1z=" << ebbh->spin[2]
735  << "\tspin2x=" << ebbh->spin[3] << "\tspin2y=" << ebbh->spin[4] << "\tspin2z=" << ebbh->spin[2] << endl;
736  cout << "-------------------------------------------------------------------------------------------------------------------------------------------" << endl;
737 
738  for(int i=0;i<NCHIRP_MAX;i++) FindChirp(ebbh, i, tmerger, xmin, xmax, ifo, ptype, wtype);
739 
740  cout << "-------------------------------------------------------------------------------------------------------------------------------------------" << endl;
741 
742  // print final
743 
744  int imax=0;
745  float emax=0;
746  // find chirp with max energy
747  for(int i=0;i<NCHIRP_MAX;i++) if(ebbh->ch_energy[i]>emax) {emax=ebbh->ch_energy[i];imax=i;}
748  int imax2=imax;
749  // find chirp with highest chirp mass and energy > (max chirp energy)/4
750  for(int i=0;i<NCHIRP_MAX;i++) {
751  if(i==imax) continue;
752  if(ebbh->ch_mass[i]>0) {
753  if(ebbh->ch_mass[i]>ebbh->ch_mass[imax]) if(ebbh->ch_energy[i]>ebbh->ch_energy[imax]/4.) imax2=i;
754  }
755  }
756  imax=imax2;
757  float ebbh->ei=0;
758  for(int i=0;i<NCHIRP_MAX;i++) {
759  if(ebbh->ch_mass[i]>0) {
760  if(ebbh->ch_mass[i]<ebbh->ch_mass[imax]) ebbh->ei+=ebbh->ch_energy[i];
761  if(ebbh->ch_mass[i]>ebbh->ch_mass[imax]) ebbh->ei-=ebbh->ch_energy[i];
762  }
763  }
764  ebbh->ei/=ebbh->ch_energy[imax];
765  ebbh->ei*=100;
766 
767  cout << "CHIRP_M -> " << " MCH_MASS : " << " rec :" << ebbh->ch_mass[imax] << " [" << ebbh->ch_merr[imax] << "]"
768  << " / "<< " inj : " << ebbh->mchirp << "\t\t\t\tMCH_EI : " << ebbh->ei << "\t\tMCH_TIME : " << ebbh->ch_tmerger[imax] << " (sec)" << endl;
769  cout << "-------------------------------------------------------------------------------------------------------------------------------------------" << endl;
770 
771  return;
772 }
773 
774 void FindChirp(EBBH* ebbh, int mch_order, double& tmerger, double& xmin, double& xmax, int ifo, TString ptype, TString wtype) {
775 
776  if((ptype!="like")&&(ptype!="stft")&&(ptype!="")) {
777  cout << "PlotMultiChirp2 Error : wrong ptype, available value are : like/stft" << endl;
778  exit(1);
779  }
780 
781  double chi2_thr = CHI2_THR;
782  double tmerger_cut = TMERGER_CUT;
783  double zmax_thr = ZMAX_THR;
784 
785  EColor lcolor = (ptype=="like") ? kBlack : kWhite;
786  int lwidth=3;
787  int lstyle=2;
788 
789  if(mch_order==0 && ptype=="like") {
790  WTS = new watplot(const_cast<char*>("wts"));
791  WTS->plot(&ebbh->nc, 1, 2, 'L', 0, const_cast<char*>("COLZ"));
792  WTS->hist2D->GetYaxis()->SetRangeUser(FLOW, FHIGH);
793  WTS->canvas->SetLogy();
794  }
795 
796  double echirp = ebbh->nc.mchirp5(1,zmax_thr,chi2_thr,tmerger_cut);
797 
798  if(mch_order==0 && ptype=="like") {
799  if(gTYPE==3) PlotCluster(WTS, &ebbh->nc, FLOW, FHIGH);
800  }
801 
802  clusterdata* pcd = &ebbh->nc.cData[0];
803  TF1* fit = &(pcd->fit);
804 
805  double mchirp = pcd->mchirp;
806 
807  if(tmerger==0) tmerger = -fit->GetParameter(1)/fit->GetParameter(0);
808  double Xmin = fit->GetXmin()-0.1;
809  double Xmax = tmerger-0.001;
810  if(mch_order==0) {xmin=Xmin;xmax=Xmax;}
811  if(Xmin<xmin) xmin = Xmin;
812  if(Xmax>xmax) xmax = Xmax;
813 
814  double p0 = GetFitParameter(mchirp);
815  double p1 = tmerger;
816 
817  ebbh->ch_mass[mch_order] = pcd->mchirp;
818  ebbh->ch_tmerger[mch_order] = -fit->GetParameter(1)/fit->GetParameter(0);
819  ebbh->ch_merr[mch_order] = pcd->mchirperr;
820  ebbh->ch_mchi2[mch_order] = pcd->chi2chirp;
821  ebbh->ch_energy[mch_order] = echirp;
822 
823  // fit function -> freq = p0 * (time-p1);
824  xfit[mch_order] = new TF1(fit->GetName(), "pow([0]*(x-[1]),-3./8.)", xmin, xmax);
825  xfit[mch_order]->SetLineColor(lcolor);
826  xfit[mch_order]->SetLineWidth(lwidth);
827  xfit[mch_order]->SetLineStyle(lstyle);
828  xfit[mch_order]->SetParameter(0, p0);
829  xfit[mch_order]->SetParameter(1, p1);
830  //mch_order==0 ? xfit[mch_order]->SetParameter(1, p1) : xfit[mch_order]->FixParameter(1, p1);
831 
832  if(mch_order==0 && ptype=="stft") {
833  if(wtype=="wdat") MDC->Draw(ebbh->wdat[ifo],MDC_TF);
834  if(wtype=="winj") MDC->Draw(ebbh->winj[ifo],MDC_TF);
835  if(wtype=="wrec") MDC->Draw(ebbh->wrec[ifo],MDC_TF);
836  stft = MDC->GetSTFT();
837  stft->GetHistogram()->SetTitle(ebbh->name);
838  stft->GetHistogram()->GetYaxis()->SetRangeUser(FLOW,FHIGH);
839  }
840  if(stft) stft->GetHistogram()->GetXaxis()->SetRangeUser(xmin,xmax+0.3);
841 
842  if(ptype!="") xfit[mch_order]->Draw("same");
843 
844  if(gPLOT && mch_order==NCHIRP_MAX-1 && ptype=="stft") {stft->Print(gOFILE);exit(0);}
845  if(gPLOT && mch_order==NCHIRP_MAX-1 && ptype=="like") {WTS->canvas->Print(gOFILE);exit(0);}
846 
847  // format standard output
848  cout.precision(1);
849  cout.setf(ios::fixed, ios::floatfield);
850 
851  cout << "CHIRP_" << mch_order+1 << " -> "
852  << " MCH_MASS : " << ebbh->ch_mass[mch_order] << "\t\tMCH_ERR : " << ebbh->ch_merr[mch_order]
853  << "\t\tMCH_CHI2 : " << ebbh->ch_mchi2[mch_order] << "\t\tMCH_EN : " << ebbh->ch_energy[mch_order]
854  << "\t\tMCH_TIME : " << setprecision(2) << ebbh->ch_tmerger[mch_order] << " (sec)" << endl;
855 
856  return;
857 }
858 
859 void FillHistogram(EBBH* ebbh, TH2F&* hN, TH2F&* hL, TH2F&* heT, TH2F&* heF, double zmax_thr) {
860 
861  netcluster* pwc = &(ebbh->nc);
862 
863  int cid = 1;
864  int nifo = ebbh->ifo.size();
865 
866  double RATE = pwc->rate; // original rate
867 
868  std::vector<int>* vint = &(pwc->cList[cid-1]); // pixel list
869 
870  int V = vint->size(); // cluster size
871  if(!V) return;
872 
873  double zmax = -1e100;
874  double etot = 0;
875  for(int j=0; j<V; j++) {
876  netpixel* pix = pwc->getPixel(cid, j);
877  if(pix->likelihood<1. || pix->frequency==0 ) continue;
878  if(pix->likelihood>zmax) zmax = pix->likelihood;
879  etot+=pix->likelihood;
880  }
881  double zthr = zmax_thr*zmax;
882 
883  int minLayers=1000;
884  int maxLayers=0;
885  double minTime=1e20;
886  double maxTime=0.;
887  double minFreq=1e20;
888  double maxFreq=0.;
889  for(int j=0; j<V; j++) { // loop over the pixels
890  netpixel* pix = pwc->getPixel(cid,j);
891  if(!pix->core) continue;
892 
893  if(pix->layers<minLayers) minLayers=pix->layers;
894  if(pix->layers>maxLayers) maxLayers=pix->layers;
895 
896  double dt = 1./pix->rate;
897  double time = int(pix->time/pix->layers)/double(pix->rate); // central bin time
898  time -= dt/2.; // begin bin time
899  if(time<minTime) minTime=time;
900  if(time+dt>maxTime) maxTime=time+dt;
901 
902  double freq = pix->frequency*pix->rate/2.;
903  if(freq<minFreq) minFreq=freq;
904  if(freq>maxFreq) maxFreq=freq;
905  }
906 
907  int minRate=RATE/(maxLayers-1);
908  int maxRate=RATE/(minLayers-1);
909 
910  double mindt = 1./maxRate;
911  double maxdt = 1./minRate;
912  double mindf = minRate/2.;
913  double maxdf = maxRate/2.;
914 
915  cout.precision(1);
916  cout.setf(ios::fixed, ios::floatfield);
917 
918 /*
919  cout << "minRate : " << minRate << "\t\t\t maxRate : " << maxRate << endl;
920  cout << "minTime : " << minTime << "\t\t\t maxTime : " << maxTime << endl;
921  cout << "minFreq : " << minFreq << "\t\t\t maxFreq : " << maxFreq << endl;
922  cout << "mindt : " << mindt << "\t\t\t maxdt : " << maxdt << endl;
923  cout << "mindf : " << mindf << "\t\t\t maxdf : " << maxdf << endl;
924 */
925 
926  double iminTime = minTime-maxdt;
927  double imaxTime = maxTime+maxdt;
928  int nTime = (imaxTime-iminTime)*maxRate;
929 
930  if(hN) { delete hN; hN=NULL; }
931  hN = new TH2F("hN", "hN", nTime, iminTime, imaxTime, 2*(maxLayers-1), 0, RATE/2);
932  if(hL) { delete hL; hL=NULL; }
933  hL = new TH2F("hL", "hL", nTime, iminTime, imaxTime, 2*(maxLayers-1), 0, RATE/2);
934  if(heT) { delete heT; heT=NULL; }
935  heT = new TH2F("heT", "heT", nTime, iminTime, imaxTime, 2*(maxLayers-1), 0, RATE/2);
936  if(heF) { delete heF; heF=NULL; }
937  heF = new TH2F("heF", "heF", nTime, iminTime, imaxTime, 2*(maxLayers-1), 0, RATE/2);
938 
939  double dFreq = (maxFreq-minFreq)/10.>2*maxdf ? (maxFreq-minFreq)/10. : 2*maxdf ;
940  double mFreq = minFreq-dFreq<0 ? 0 : minFreq-dFreq;
941  double MFreq = maxFreq+dFreq>RATE/2 ? RATE/2 : maxFreq+dFreq;
942 
943  double dTime = (maxTime-minTime)/10.>2*maxdt ? (maxTime-minTime)/10. : 2*maxdt ;
944  double mTime = minTime-dTime<iminTime ? iminTime : minTime-dTime;
945  double MTime = maxTime+dTime>imaxTime ? imaxTime : maxTime+dTime;
946 
947  int npix=0;
948  double Likelihood=0;
949  for(int n=0; n<V; n++) {
950  netpixel* pix = pwc->getPixel(cid,n);
951  if(!pix->core) continue;
952 
953  if(pix->likelihood<zthr) continue;
954 
955  double sSNR=0;
956  for(int m=0; m<nifo; m++) {
957  sSNR += pow(pix->getdata('S',m),2); // snr whitened reconstructed signal 00
958  sSNR += pow(pix->getdata('P',m),2); // snr whitened reconstructed signal 90
959  }
960 
961  int iRATE = int(pix->rate+0.5);
962  int M=maxRate/iRATE;
963  int K=2*(maxLayers-1)/(pix->layers-1);
964  double dt = 1./pix->rate;
965  double itime = int(pix->time/pix->layers)/double(pix->rate); // central bin time
966  itime -= dt/2.; // begin bin time
967  int i=(itime-iminTime)*maxRate;
968  int j=pix->frequency*K;
969  Likelihood+=sSNR;
970 // sSNR /= M*K; // Normalization (watplot not use normalization !!!)
971 //sSNR = pix->likelihood; // Use original oriinal likelihood before WP
972  for(int m=0;m<M;m++) {
973  for(int k=0;k<K;k++) {
974  double L = hL->GetBinContent(i+1+m,j+1+k-K/2);
975  hL->SetBinContent(i+1+m,j+1+k-K/2,sSNR+L);
976 
977  double N = hN->GetBinContent(i+1+m,j+1+k-K/2);
978  hN->SetBinContent(i+1+m,j+1+k-K/2,N+1);
979 
980  double eT = heT->GetBinContent(i+1+m,j+1+k-K/2);
981  //heT->SetBinContent(i+1+m,j+1+k-K/2,eT+M*M*L);
982  heT->SetBinContent(i+1+m,j+1+k-K/2,eT+M);
983 
984  double eF = heF->GetBinContent(i+1+m,j+1+k-K/2);
985  //heF->SetBinContent(i+1+m,j+1+k-K/2,eF+K*K*L);
986  heF->SetBinContent(i+1+m,j+1+k-K/2,eF+K);
987  }
988  }
989  npix++;
990  }
991  cout << "Likelihood : " << Likelihood << " npix : " << npix << endl;
992 
993  for(int i=0;i<=hL->GetNbinsX();i++) {
994  for(int j=0;j<=hL->GetNbinsY();j++) {
995 
996  double L = hL->GetBinContent(i,j);
997  if(L<=0) continue;
998 
999  double N = hN->GetBinContent(i,j);
1000 
1001  double eT = heT->GetBinContent(i,j);
1002  //heT->SetBinContent(i,j,mindt*sqrt(eT/L));
1003  //heT->SetBinContent(i,j,mindt);
1004  heT->SetBinContent(i,j,mindt*eT/N);
1005 
1006  double eF = heF->GetBinContent(i,j);
1007  //heF->SetBinContent(i,j,(mindf/2.)*sqrt(eF/L));
1008  //heF->SetBinContent(i,j,(mindf/2.));
1009  heF->SetBinContent(i,j,(mindf/2.)*eF/N);
1010  }
1011  }
1012 
1013  return;
1014 }
1015 
1016 void PlotHistogram(EBBH* ebbh, TH2F&* h2d) {
1017 
1018  if(!h2d) return;
1019 
1020  if(!canvas) canvas = new TCanvas;
1021  canvas->SetGridx();
1022  canvas->SetGridy();
1023  canvas->SetLogy();
1024 
1025  h2d->SetTitle(ebbh->name);
1026 
1027  h2d->GetYaxis()->SetRangeUser(FLOW,FHIGH);
1028 
1029  h2d->SetStats(kFALSE);
1030  h2d->SetTitleFont(12);
1031  h2d->SetFillColor(kWhite);
1032 
1033  h2d->GetXaxis()->SetNdivisions(506);
1034  h2d->GetXaxis()->SetLabelFont(42);
1035  h2d->GetXaxis()->SetLabelOffset(0.014);
1036  h2d->GetXaxis()->SetTitleOffset(1.4);
1037  h2d->GetYaxis()->SetTitleOffset(1.2);
1038  h2d->GetYaxis()->SetNdivisions(506);
1039  h2d->GetYaxis()->SetLabelFont(42);
1040  h2d->GetYaxis()->SetLabelOffset(0.01);
1041  h2d->GetZaxis()->SetLabelFont(42);
1042  h2d->GetZaxis()->SetNoExponent(false);
1043  h2d->GetZaxis()->SetNdivisions(506);
1044 
1045  h2d->GetXaxis()->SetTitleFont(42);
1046  h2d->GetXaxis()->SetTitle("Time (sec)");
1047  h2d->GetXaxis()->CenterTitle(true);
1048  h2d->GetYaxis()->SetTitleFont(42);
1049  h2d->GetYaxis()->SetTitle("Frequency (Hz)");
1050  h2d->GetYaxis()->CenterTitle(true);
1051 
1052  h2d->GetZaxis()->SetTitleOffset(0.6);
1053  h2d->GetZaxis()->SetTitleFont(42);
1054  h2d->GetZaxis()->CenterTitle(true);
1055 
1056  h2d->GetXaxis()->SetLabelSize(0.03);
1057  h2d->GetYaxis()->SetLabelSize(0.03);
1058  h2d->GetZaxis()->SetLabelSize(0.03);
1059 
1060  h2d->Draw("colz");
1061  if(fchirp) fchirp->Draw("same");
1062 
1063  if(gPLOT) {canvas->Print(gOFILE);exit(0);}
1064 
1065  return;
1066 }
1067 
1068 double ChirpIntegralHistogram(EBBH* ebbh, TH2F&* h2d, double dMc) {
1069 
1070  if(!h2d) return;
1071 
1072  const double G = watconstants::GravitationalConstant();
1073  const double SM = watconstants::SolarMass();
1074  const double C = watconstants::SpeedOfLightInVacuo();
1075  const double Pi = TMath::Pi();
1076 
1077  double Mc = ebbh->ch_mass[0];
1078  //cout << "Estimated Mc : " << Mc << endl;
1079 
1080  Mc+=dMc;
1081 
1082  double p0 = 256.*Pi/5*pow(G*Mc*SM*Pi/C/C/C, 5./3);
1083  double p1 = ebbh->ch_tmerger[0];
1084 
1085  double xmin = h2d->GetXaxis()->GetXmin();
1086  double xmax = h2d->GetXaxis()->GetXmax();
1087  if(p1<xmax) xmax=p1;
1088  cout.precision(3);
1089  //cout << "xmin : " << xmin << " xmax : " << xmax << endl;
1090 
1091  // fit function -> freq = p0 * (time-p1);
1092  fchirp = new TF1("fchirp", "pow([0]*([1]-x),-3./8.)", xmin, xmax);
1093  fchirp->SetLineColor(kBlack);
1094  fchirp->SetLineWidth(3);
1095  fchirp->SetLineStyle(2);
1096  fchirp->SetParameter(0, p0);
1097  fchirp->SetParameter(1, p1);
1098 
1099  double dT = hL->GetXaxis()->GetBinWidth(0);
1100  double dF = hL->GetYaxis()->GetBinWidth(0);
1101  //cout << "dT = " << dT << " dF = " << dF << endl;
1102 
1103  double cenergy=0.;
1104  for(int i=1;i<=hL->GetNbinsX();i++) {
1105  double T = hL->GetXaxis()->GetBinCenter(i)+hL->GetXaxis()->GetBinWidth(i)/2.;
1106  double DF = fchirp->Eval(T)-fchirp->Eval(T-dT);
1107  for(int j=0;j<=hL->GetNbinsY();j++) {
1108 
1109  double L = hL->GetBinContent(i,j);
1110  if(L<=0) continue;
1111 
1112  double F = hL->GetYaxis()->GetBinCenter(j)+hL->GetYaxis()->GetBinWidth(j)/2.;
1113 
1114  //if(F-fchirp->Eval(T-dT)<DF && (F-fchirp->Eval(T-dT)>0)) hL->SetBinContent(i,j,0);
1115  if(F-fchirp->Eval(T-dT)<DF && (F-fchirp->Eval(T-dT)>0)) cenergy+=L;
1116  }
1117  }
1118 
1119  //cout << "CHIRP ENERGY : " << cenergy << endl;
1120 
1121  delete fchirp; fchirp=NULL;
1122 
1123  return cenergy;
1124 }
1125 
1126 void DrawMChirpInstantaneousFrequency(EBBH* ebbh, TString wtype, int ifo) {
1127 
1129 
1130  if(wtype=="winj") wf = ebbh->winj[ifo]; // whiten injected waveforms
1131  if(wtype=="sinj") wf = ebbh->sinj[ifo]; // strain injected waveforms
1132  if(wtype=="wrec") wf = ebbh->wrec[ifo]; // whiten reconstructed waveforms
1133  if(wtype=="srec") wf = ebbh->srec[ifo]; // strain injected waveforms
1134  if(wtype=="wsim") wf = ebbh->wsim[0]; // simulated waveforms -> hp
1135 
1136  double start = wf.start();
1137  double imchirp = ebbh->ch_mass[0];
1138  //double tmerger = ebbh->ch_tmerger[0]-start;
1139  double tmerger = ebbh->ch_tmerger[0];
1140  cout << "mchirp5 - mchirp : " << imchirp << endl;
1141  cout << "mchirp5 - tmerger : " << tmerger << endl;
1142 
1143  //wf.start(0);
1144 
1145  // Get hp envelope
1147  MDC->SetZoom(0.999);
1148  MDC->Draw(wf,MDC_TIME,"ALP ZOOM",kGray);
1149  MDC->Draw(ewf,MDC_TIME,"same",kRed);
1150 
1151  watplot* pts = MDC->GetWatPlot();
1152  TGraph* gr = pts->getGraph(0);
1153  gr->SetTitle(ebbh->name);
1154 
1155  // Get wf instantaneous frequency
1157  //MDC->Draw(fwf,MDC_TIME,"ALP ZOOM",kBlack);return;
1158 
1159  // F -> F^-3/8
1160  double sF = 128;
1161  for(int i=0;i<fwf.size();i++) {
1162  fwf[i] = fwf[i]>FLOW ? pow(fwf[i]/sF,-8./3.) : 0;
1163  }
1164  //MDC->Draw(fwf,MDC_TIME,"ALP ZOOM",kBlack);return;
1165 
1166  const double G = watconstants::GravitationalConstant();
1167  const double SM = watconstants::SolarMass();
1168  const double C = watconstants::SpeedOfLightInVacuo();
1169  const double Pi = TMath::Pi();
1170 
1171  double M1=ebbh->mass[0];
1172  double M2=ebbh->mass[1];
1173  double Mc = pow(M1*M2,3./5.)/pow(M1+M2,1./5.);
1174  double MC = Mc;
1175  double mc = Mc;
1176  cout << "Mc " << Mc << endl;
1177  Mc *= SM;
1178  double kk = 256.*Pi/5*pow(G*SM*Pi/C/C/C, 5./3);
1179  double K = 256.*Pi/5*pow(G*Mc*Pi/C/C/C, 5./3);
1180  // scaling of frequency: in units of 128Hz
1181  kk *= pow(sF, 8./3);
1182  K *= pow(sF, 8./3);
1183 
1184  wavearray<double> tt = fwf;
1185  wavearray<double> ff = fwf;
1186  tt=0;
1187  ff=0;
1188 
1189  double dt = 1./ff.rate();
1190  double Tc = tmerger;
1191  for(int i=0;i<ff.size();i++) {
1192  double T = ff.start()+i*dt;
1193  //double F = pow(Tc-K*T,-3./8.);
1194  double F = T<Tc ? pow(K*(Tc-T),-3./8.) : 0;
1195  //double F = pow(K*(T),-3./8.);
1196  if(F<0 || F>1000) F=0;
1197  F = F>0 ? pow(F,-8./3.) : 0;
1198  tt.data[i] = T;
1199  ff.data[i] = F;
1200  if(F>1) F=0;
1201  }
1202  //MDC->Draw(ff,MDC_TIME,"ALP",kBlack);return;
1203 
1204  // remove data where the waveform amplitude (ewf) is negligeable
1205  double emax=ewf.max();
1206  int SS = 0;
1207  for(int i=0;i<fwf.size();i++) {
1208  if(ewf[i]/emax<0.1) SS++; else break;
1209  }
1210  int EE=0;
1211  for(int i=fwf.size()-1;i>=0;i--) {
1212  if(ewf[i]/emax<0.2) EE++; else break;
1213  }
1214 
1215  // ff errors
1216  wavearray<double> eff = ff;
1217  //eff=1.e20;
1218  //for(int i=0;i<fwf.size();i++) eff[i] = ewf[i]/emax>0.01 ? 1./ewf[i] : 1.e20;
1219  eff=0;
1220 
1221  TGraphErrors *grr = new TGraphErrors(fwf.size()-SS-EE, tt.data+SS, fwf.data+SS, 0, eff.data+SS);
1222  grr->GetHistogram()->SetTitle(ebbh->name);
1223  grr->GetHistogram()->GetXaxis()->SetTitle("time (sec)");
1224  grr->GetHistogram()->GetYaxis()->SetTitle("freq^-3/8 ");
1225  grr->GetHistogram()->GetXaxis()->SetTitleOffset(1.1);
1226  grr->GetHistogram()->GetYaxis()->SetTitleOffset(1.1);
1227  grr->SetMarkerStyle(7);
1228  grr->SetMarkerColor(kGray);
1229  grr->SetLineColor(kGray);
1230 
1231  TF1 *func = new TF1("func", "[0]*(x-[1])", 0.05,Tc);
1232  //func->FixParameter(0,-kk*pow(MC,1./0.6));
1233  //func->FixParameter(0,-kk*pow(imchirp,1./0.6));
1234  //func->FixParameter(1,Tc);
1235  func->SetParameter(0,-kk*pow(imchirp,1./0.6));
1236  func->SetParameter(1,Tc);
1237  func->SetLineColor(kRed);
1238  TCanvas *canvas = new TCanvas("canvas", "Linear and robust linear fitting");
1239  canvas->SetGrid();
1240  grr->Draw("ALP");
1241  printf("Ordinary least squares:\n");
1242  grr->Fit(func);
1243  func->Draw("same");
1244 
1245  double mch = -func->GetParameter(0)/kk;
1246  double mchirp = mch>0 ? pow(mch, 0.6) : -pow(-mch, 0.6);
1247 
1248  cout << "mchirp : " << mchirp << endl;
1249  cout << "mchirp-MC : " << mchirp-MC << endl;
1250  cout << "m1 m2 ichirp ochirp ochirp-ichirp : " << M1 << " " << M2 << " " << MC << " " << " " << mchirp << " " << mchirp-MC << endl;
1251 
1252 
1253  double mm = (pow(80.,-8./3.)-pow(30.,-8./3.))/(0.13);
1254  double mch1 = -mm/kk;
1255  double mchirp1 = mch1>0 ? pow(mch1, 0.6) : -pow(-mch1, 0.6);
1256  cout << "mchirp1 : " << mchirp1 << endl;
1257 
1258  return;
1259 }
1260 
1261 void GetCBC(EBBH* ebbh) {
1262 
1263  double To = 931072130;
1264 
1265  double Tc=ebbh->ch_tmerger[0];
1266 
1267  double M1 = ebbh->mass[0]<ebbh->mass[1] ? ebbh->mass[0] : ebbh->mass[1];
1268  double M2 = ebbh->mass[0]>ebbh->mass[1] ? ebbh->mass[0] : ebbh->mass[1];
1269 
1270  double S1 = fabs(ebbh->spin[0])<fabs(ebbh->spin[1]) ? fabs(ebbh->spin[0]) : fabs(ebbh->spin[1]);
1271  double S2 = fabs(ebbh->spin[0])>fabs(ebbh->spin[1]) ? fabs(ebbh->spin[0]) : fabs(ebbh->spin[1]);
1272 
1273  double DIST=ebbh->dist;
1274 
1275  // ---------------------------------
1276  // set inspiral parms
1277  // ---------------------------------
1278  TString inspOptions="";
1279  inspOptions+= TString::Format("--gps-start-time %f --gps-end-time %f ",Tc+To,Tc+To);
1280  inspOptions+= "--taper-injection start --seed 962488 ";
1281  inspOptions+= "--dir ./ ";
1282  inspOptions+= "--f-lower 24.000000 ";
1283  inspOptions+= "--time-step 60 ";
1284 
1285  inspOptions+= "--waveform IMRPhenomBthreePointFivePN ";
1286  inspOptions+= "--l-distr random ";
1287  inspOptions+= "--i-distr uniform ";
1288 
1289  inspOptions+= TString::Format("--min-mass1 %f --max-mass1 %f ",M1,M1);
1290  inspOptions+= TString::Format("--min-mass2 %f --max-mass2 %f ",M2,M2);
1291  inspOptions+= TString::Format("--min-mtotal %f --max-mtotal %f ",M1+M1,M2+M2);
1292 
1293  inspOptions+= "--m-distr componentMass ";
1294  inspOptions+= "--enable-spin --aligned ";
1295 
1296  inspOptions+= TString::Format("--min-spin1 %f --max-spin1 %f ",S1,S1);
1297  inspOptions+= TString::Format("--min-spin2 %f --max-spin2 %f ",S2,S2);
1298 
1299  inspOptions+= "--amp-order 0 ";
1300  inspOptions+= "--d-distr volume ";
1301  inspOptions+= TString::Format("--min-distance %f --max-distance %f ",DIST,DIST);
1302  //inspOptions+= "--output inspirals.xml "; // set output xml file
1303 
1304  MDC->SetInspiral("IMRPhenomBthreePointFivePN",inspOptions.Data());
1305 
1306  // Get the first waveform hp,hx components starting from gps = 931072130
1307  ebbh->wsim[0] = MDC->GetInspiral("hp",Tc+To-200,Tc+To+200);
1308  ebbh->wsim[1] = MDC->GetInspiral("hx",Tc-200,Tc+200);
1309  ebbh->wsim[0].start(ebbh->wsim[0].start()-To);
1310  ebbh->wsim[0].resample(2*FHIGH);
1311  ebbh->wsim[1].start(ebbh->wsim[1].start()-To);
1312  ebbh->wsim[1].resample(2*FHIGH);
1313  cout << "size : " << ebbh->wsim[0].size() << " rate : " << ebbh->wsim[0].rate() << " start : " << (int)ebbh->wsim[0].start() << endl;
1314 
1315  return;
1316 }
1317 
1318 void GetEBBH(EBBH* ebbh) {
1319 
1320  double To = ebbh->wrec[0].start();
1321 
1322  double Tc=ebbh->ch_tmerger[0];
1323 
1324  double M1 = ebbh->mass[0]<ebbh->mass[1] ? ebbh->mass[0] : ebbh->mass[1];
1325  double M2 = ebbh->mass[0]>ebbh->mass[1] ? ebbh->mass[0] : ebbh->mass[1];
1326 
1327  double S1 = fabs(ebbh->spin[0])<fabs(ebbh->spin[1]) ? fabs(ebbh->spin[0]) : fabs(ebbh->spin[1]);
1328  double S2 = fabs(ebbh->spin[0])>fabs(ebbh->spin[1]) ? fabs(ebbh->spin[0]) : fabs(ebbh->spin[1]);
1329 
1330  double DIST=ebbh->dist;
1331 
1332  double E0 = ebbh->e0;
1333  double RP0 = ebbh->rp0>00 ? ebbh->rp0 : 14;
1334  double REDSHIFT = ebbh->redshift;
1335 
1336  // get ebbh parameters from input command line
1337  TString ebbh_parms = TString::Format("1 %f %f %f %f %f %f",M1,M2,RP0,E0,DIST,REDSHIFT);
1338  cout << "ebbh_parms : " << ebbh_parms << endl;
1339 
1340  int gps = To+Tc;
1341 
1342  vector<mdcpar> par;
1343  par.resize(1);
1344  par[0].name=ebbh_parms;
1345  MDC->AddWaveform(MDC_EBBH, par);
1346  MDC->Print(0);
1347 
1348  // Get the first waveform hp,hx components starting from gps = 931072130
1349 
1350  waveform wf = MDC->GetWaveform("eBBH");
1351  ebbh->wsim[0] = wf.hp;
1352  ebbh->wsim[1] = wf.hx;
1353  ebbh->wsim[0].start(ebbh->wrec[0].start()-ebbh->seggps);
1354  ebbh->wsim[0].resample(2*FHIGH);
1355  ebbh->wsim[1].start(ebbh->wrec[1].start()-ebbh->seggps);
1356  ebbh->wsim[1].resample(2*FHIGH);
1357  cout << "size : " << ebbh->wsim[0].size() << " rate : " << ebbh->wsim[0].rate() << " start : " << (int)ebbh->wsim[0].start() << endl;
1358 
1359  return;
1360 }
char ofile[1024]
detectorParams getDetectorParams()
Definition: detector.cc:218
void GetEBBH(EBBH *ebbh)
Definition: mdc.hh:202
static const double C
Definition: GNGen.cc:28
#define TMERGER_CUT
static vector< TString > getFileListFromDir(TString dir_name, TString endString="", TString beginString="", TString containString="", bool fast=false)
Definition: Toolbox.cc:5108
double M
Definition: DrawEBHH.C:13
watplot * Draw(TString name, int id=0, TString polarization="hp", MDC_DRAW type=MDC_TIME, TString options="ALP", Color_t color=kBlack)
Definition: mdc.cc:2317
std::vector< wavearray< double > > wREC[MAX_TRIALS]
Definition: mdc.hh:219
double dist
Definition: ConvertGWGC.C:48
double fHigh
virtual void rate(double r)
Definition: wavearray.hh:141
void Print(TString pname)
Definition: STFT.cc:315
std::vector< pixel > cluster
Definition: wavepath.hh:61
TString ptype[nPLOT]
Definition: cwb_mkfad.C:112
float M2
void GetCBC(EBBH *ebbh)
wavearray< double > a(hp.size())
size_t frequency
Definition: netpixel.hh:111
float likelihood
Definition: netpixel.hh:114
par [0] name
#define B
int n
Definition: cwb_net.C:28
CWB::STFT * GetSTFT()
Definition: mdc.hh:435
Definition: mdc.hh:203
void Clear()
TString("c")
int gENTRY
int EccentricityIndex(TString ifroot, int gtype=0, int entry=0, int ifo=0, EBBH *xebbh=NULL)
float mchirp
Definition: netcluster.hh:84
float tmrgrerr
Definition: netcluster.hh:83
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1) *itime+ifreq;double time=itime *dT;double freq=(ifreq >0) ? ifreq *dF :dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
double SolarMass()
Definition: constants.hh:202
netpixel pix(nifo)
netcluster * pwc
Definition: cwb_job_obj.C:38
int ReadDataFromROOT(TString ifile, EBBH *ebbh)
TString mdc[4]
std::vector< TGraph * > graph
Definition: watplot.hh:194
watplot * WTS
void DrawMChirpInstantaneousFrequency(EBBH *ebbh, TString wtype, int ifo)
wavearray< double > hp
Definition: mdc.hh:226
static wavearray< double > getHilbertIFrequency(wavearray< double > x)
Definition: Toolbox.cc:6935
#define CHI2_THR
waveform wf
float tmrgr
Definition: netcluster.hh:82
size_t layers
Definition: netpixel.hh:112
int m
Definition: cwb_net.C:28
std::vector< double > oSNR[NIFO_MAX]
std::vector< vector_int > cList
Definition: netcluster.hh:397
virtual void start(double s)
Definition: wavearray.hh:137
int j
Definition: cwb_net.C:28
watplot * PCH
canvas cd(1)
i drho i
double rate
Definition: netcluster.hh:378
TList * list
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
#define NCHIRP_MAX
void plot(wavearray< double > &, char *=NULL, int=1, double=0., double=0., bool=false, float=0., float=0., bool=false, float=0., bool=false)
Definition: watplot.cc:150
#define FLOW
void PlotChirp(EBBH *ebbh, int mch_order, double &tmerger, double &xmin, double &xmax, EColor color)
TGraph * getGraph(int n)
Definition: watplot.hh:186
#define N
mdcid AddWaveform(MDC_TYPE mdc_type, vector< mdcpar > par, TString uname="")
Definition: mdc.cc:472
void Print(int level=0)
Definition: mdc.cc:2736
bool core
Definition: netpixel.hh:120
char ifo[NIFO_MAX][8]
TH2F * hist2D
Definition: watplot.hh:193
void PlotCluster(watplot *WTS, netcluster *pwc, double fLow, double fHigh)
Definition: mdc.hh:204
#define nIFO
virtual size_t size() const
Definition: wavearray.hh:145
TCanvas * canvas
Definition: watplot.hh:192
TH2F * hN
wavearray< double > freq
Definition: Regression_H1.C:79
x plot
double GetTimeBoundaries(wavearray< double > x, double P, double &bT, double &eT)
Meyer< double > * S2
double G
Definition: DrawEBHH.C:12
void Init()
Definition: mdc.hh:248
wavearray< double > GetAlignedWaveform(wavearray< double > *wf, wavearray< double > *wref)
TGraph * gr
TGraphErrors * xgr[NCHIRP_MAX]
static const double SM
Definition: GNGen.cc:26
i() int(T_cor *100))
#define ZMAX_THR
double Pi
watplot p1(const_cast< char *>("TFMap1"))
const int NIFO_MAX
Definition: wat.hh:22
void PlotMultiChirp(EBBH *ebbh)
TH2D * GetHistogram()
Definition: STFT.hh:71
bool gPLOT
printf("total live time: non-zero lags = %10.1f \, liveTot)
float mchirp
TF1 * xfit[NCHIRP_MAX]
TString inspOptions
std::vector< double > iSNR[NIFO_MAX]
int k
TString gOFILE
float spin[6]
static double A
Definition: geodesics.cc:26
float chi2chirp
Definition: netcluster.hh:86
double F
size_t time
Definition: netpixel.hh:110
vector< mdcpar > par
double * entry
Definition: cwb_setcuts.C:224
TFile * ifile
#define FHIGH
TFile * froot
netpixel * getPixel(size_t n, size_t i)
Definition: netcluster.hh:413
int npix
double ChirpIntegralHistogram(EBBH *ebbh, TH2F &*h2d, double dMc)
double dt
double GravitationalConstant()
Definition: constants.hh:131
#define RATE
float mchirperr
Definition: netcluster.hh:85
int nifo
TCanvas * canvas
wavearray< double > hx
Definition: mdc.hh:227
char title[256]
Definition: SSeriesExample.C:1
double e0
Definition: RescaleEBBH.C:17
double gps
watplot * GetWatPlot()
Definition: mdc.hh:436
double T
Definition: testWDM_4.C:11
TGraphErrors chirp
chirp fit parameters (don&#39;t remove ! fix crash when exit from CINT)
Definition: netcluster.hh:93
wavearray< double > GetDifWaveform(wavearray< double > *wf1, wavearray< double > *wf2)
double fLow
EBBH * ebbh
Definition: LoopChirpMass.C:24
void PlotHistogram(EBBH *ebbh, TH2F &*hH)
char Name[16]
Definition: detector.hh:327
void PlotMultiChirp2(EBBH *ebbh, int ifo=0, TString ptype="", TString wtype="")
double fabs(const Complex &x)
Definition: numpy.cc:55
void FindChirp(EBBH *ebbh, int mch_order, double &tmerger, double &xmin, double &xmax, int ifo, TString ptype, TString wtype)
TH2F * heF
double GetFitParameter(double mchirp)
waveform GetWaveform(int ID, int id=0)
Definition: mdc.cc:2541
vector< TString > fList
Definition: LoopChirpMass.C:28
float M1
virtual DataType_t max() const
Definition: wavearray.cc:1334
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void SetZoom(double epzoom=EPZOOM)
Definition: mdc.hh:431
TF1 * fchirp
int gTYPE
TTree * itree
DataType_t * data
Definition: wavearray.hh:319
CWB::STFT * stft
double * itime
double dFreq
Definition: DrawPSD.C:17
static wavearray< double > getHilbertEnvelope(wavearray< double > x)
Definition: Toolbox.cc:6915
double dT
Definition: testWDM_5.C:12
float mass[2]
wavearray< double > wINJ[NIFO_MAX]
void PlotMChirp(EBBH *ebbh)
TH2F * hL
float rate
Definition: netpixel.hh:113
TH2F * heT
double getdata(char type='R', size_t n=0)
Definition: netpixel.hh:74
char fName[256]
double rp0
Definition: RescaleEBBH.C:16
Definition: mdc.hh:159
CWB::mdc * MDC
void FillHistogram(EBBH *ebbh, TH2F &*hN, TH2F &*hL, TH2F &*heT, TH2F &*heF, double zmax_thr=0.)
exit(0)
double SpeedOfLightInVacuo()
Definition: constants.hh:114
bool setdata(double a, char type='R', size_t n=0)
Definition: netpixel.hh:58
double avr