Logo coherent WaveBurst  
Library Reference Guide
Logo
mdc.hh
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 /**********************************************************
20  * Package: mdc Class Library
21  * File name: mdc.hh
22  * Author: Gabriele Vedovato (vedovato@lnl.infn.it)
23  **********************************************************/
24 
25 
26 #ifndef MDC_HH
27 #define MDC_HH
28 
29 #include "TObjString.h"
30 #include "TObjArray.h"
31 #include "TString.h"
32 #include "TROOT.h"
33 #include "TMath.h"
34 #include "TSystem.h"
35 #include "TLatex.h"
36 #include "TTree.h"
37 #include "TFile.h"
38 #include "TNamed.h"
39 #include "TGlobal.h"
40 #include "TRandom.h"
41 #include "TComplex.h"
42 #include "TCanvas.h"
43 #include "TGraph.h"
44 #include "TMultiGraph.h"
45 #include "TColor.h"
46 #include "TF1.h"
47 #include "TF3.h"
48 #include "TMacro.h"
49 #include "Math/VectorUtil.h"
50 
51 #include <string>
52 #include <iostream>
53 #include <fstream>
54 #include <stdlib.h>
55 #include <math.h>
56 #include <ctype.h>
57 #include <vector>
58 
59 #include "wavecomplex.hh"
60 #include "wavearray.hh"
61 #include "watplot.hh"
62 #include "skymap.hh"
63 #include "network.hh"
64 #include "detector.hh"
65 #include "wat.hh"
66 
67 #include "History.hh"
68 #include "Toolbox.hh"
69 #include "config.hh"
70 #include "time.hh"
71 #include "gskymap.hh"
72 #include "STFT.hh"
73 
74 #include "FrameL.h"
75 
76 #ifndef __CINT__
77 #ifdef _USE_LAL
78 
79 #define LAL_USE_OLD_COMPLEX_STRUCTS
80 #define restrict // this is to getrid of restrict which is defined only in c99
81 
82 #ifdef _USE_ROOT6
83 // this instruction is necessary in ROOT6 because it seems to be defined
84 // by ROOT or other packages and it forbid to LAL to include Random.h
85 #undef _RANDOM_H
86 #endif
87 
88 #include <lal/LIGOLwXMLInspiralRead.h>
89 #include <lal/LALConfig.h>
90 #include <lal/LALStdio.h>
91 #include <lal/LALStdlib.h>
92 #include <lal/LALError.h>
93 #include <lal/LALDatatypes.h>
94 #include <lal/LIGOMetadataUtils.h>
95 #include <lal/LIGOMetadataTables.h>
96 #include <lal/AVFactories.h>
97 #include <lal/NRWaveIO.h>
98 #include <lal/NRWaveInject.h>
99 //#include <lal/Inject.h> // obsolete
100 #include <lal/FileIO.h>
101 #include <lal/Units.h>
102 #include <lal/FrequencySeries.h>
103 #include <lal/TimeSeries.h>
104 #include <lal/TimeFreqFFT.h>
105 #include <lal/VectorOps.h>
106 #include <lal/LALDetectors.h>
107 #include <lal/FindChirp.h>
108 #include <lal/Random.h>
109 #include <lal/LALNoiseModels.h>
110 #include <lal/Date.h>
111 #include <lal/LALStatusMacros.h>
112 #include <lal/LALSimulation.h>
113 #include <lal/LALInspiral.h>
114 #include <lal/LALSimInspiralWaveformFlags.h>
115 #include <lal/LALSimIMR.h>
116 #if LAL_VERSION_MAJOR > 6 || (LAL_VERSION_MAJOR == 6 && \
117  (LAL_VERSION_MINOR > 14 || (LAL_VERSION_MINOR == 14 && \
118  LAL_VERSION_MICRO >= 0 ))) // LAL_VERSION >= 6.14.0
119 #include <lal/SnglBurstUtils.h>
120 #else
121 #include <lal/LIGOMetadataBurstUtils.h>
122 #endif
123 #include <lal/LIGOLwXMLBurstRead.h>
124 #include <lal/GenerateBurst.h>
125 #include <lal/LIGOLwXML.h>
126 #if LAL_VERSION_MAJOR > 6 || (LAL_VERSION_MAJOR == 6 && \
127  (LAL_VERSION_MINOR > 19 || (LAL_VERSION_MINOR == 19 && \
128  LAL_VERSION_MICRO >= 2 ))) // LAL_VERSION >= 6.19.2
129 #include <lal/LIGOLwXMLlegacy.h>
130 #endif
131 
132 #endif
133 #endif
134 
135 #ifdef _USE_EBBH
136 #include "eBBH.hh"
137 #endif
138 
139 #define MDC_INJ_RATE 0.01 // sec^-1
140 #define MDC_INJ_JITTER 10. // sec
141 #define MDC_INJ_LENGTH 1. // sec
142 #define MDC_INJ_HRSS 2.5e-21
143 
144 #define MDC_SAMPLE_RATE 16384. // sample/sec
145 
146 #define EPZOOM 0.9999999
147 
148 enum MDC_TYPE {
149  MDC_SG = 0,
150  MDC_SGL = 0,
151  MDC_SGC = 1,
152  MDC_SGE = 2,
153  MDC_RD = 3,
154  MDC_RDL = 3,
155  MDC_RDC = 4,
156  MDC_RDE = 5,
157  MDC_WNB = 6,
158  MDC_GA = 7,
159  MDC_EBBH = 8,
163  MDC_CG = 12,
164  MDC_CGL = 12,
165  MDC_CGC = 13,
166  MDC_CGE = 14,
168  MDC_USER = 16 // must be declared as the last one
169 };
170 
174 };
175 
177  MDC_RANDOM = -1000,
180  MDC_MNGD = 2,
181  MDC_GWGC = 3,
185 };
186 
188  switch (n) {
189  case MDC_RANDOM: return "MDC_RANDOM";
190  case MDC_EARTH_FIX: return "MDC_EARTH_FIX";
191  case MDC_CELESTIAL_FIX: return "MDC_CELESTIAL_FIX";
192  case MDC_MNGD: return "MDC_MNGD";
193  case MDC_GWGC: return "MDC_GWGC";
194  case MDC_LOGFILE: return "MDC_LOGFILE";
195  case MDC_CUSTOM: return "MDC_CUSTOM";
196  case MDC_XMLFILE: return "MDC_XMLFILE";
197  default: return "MDC_RANDOM";
198  }
199 }
200 
201 enum MDC_DRAW {
202  MDC_TIME = 0,
203  MDC_FFT = 1,
204  MDC_TF = 2
205 };
206 
207 struct mdcid {
208  TString name; // name of waveform
209  int ID; // major id of waveform list
210  int id; // minor id of waveform list (Ex : the list WNB with different random waveforms)
211 };
212 
213 struct mdcpar {
215  double value;
217 };
218 
219 struct waveform { // waveform structure
220  MDC_TYPE type; // mdc type
221  bool status; // status flag used for internal mdc processing
222  TString name; // name of waveform
223  TString hpPath; // path of user define hp file
224  TString hxPath; // path of user define hx file
225  vector<mdcpar> par; // waveform parameters
226  wavearray<double> hp; // waveform hp component
227  wavearray<double> hx; // waveform hx component;
228  vector<waveform> list; // list of waveforms belonging to the same waveform class
229 };
230 
231 struct source {
232  double gps; // waveform source structure
233  double theta; // latitude (degrees)
234  double phi; // longitude (degrees)
235  double psi; // polarization (degrees)
236  double rho; // distance
237  double iota; // elliptical inclination angle (degrees)
238  double hrss; // sqrt(hp^2+hx^2)
239  int ID; // major id of waveform list
240  int id; // minor id of waveform list (Ex : the list WNB with different random waveforms)
241  waveform wf; // waveform
242 };
243 
244 static vector<double> DEFAULT_VECtOR_DOUBLE;
245 
246 namespace CWB {
247 
248 class mdc : public TNamed {
249 
250 public:
251 
252  mdc();
253  mdc(int nIFO, TString* ifo);
254  mdc(int nIFO, detector** pD);
255  mdc(network* net);
256  mdc(const CWB::mdc& value);
257  ~mdc();
258 
259  // operators
260  mdc& operator = (const mdc&);
261 
262  TString Get(wavearray<double>& x, TString ifo);
263 
264  mdcid AddWaveform(MDC_TYPE mdc_type, vector<mdcpar> par, TString uname=""); // built-in waveform
265  void AddWaveform(TString mdc_name, TString hp_fName, TString hx_fName,
266  double srate, vector<mdcpar> par=vector<mdcpar>());
267  void AddWaveform(TString mdc_name, TString hp_fName,
268  double srate, vector<mdcpar> par=vector<mdcpar>());
269  void AddWaveform(TString mdc_name, TString hp_fName, TString hx_fName);
270  void AddWaveform(TString mdc_name, TString hp_fName);
272 #ifdef _USE_LAL
273 #ifndef __CINT__
274  // LAL SimBurst waveforms
275  mdcid AddWaveform(MDC_TYPE mdc_type, SimBurst* sim_burst, vector<mdcpar> par, TString uname="");
276 #endif
277 #endif
278 
279  // read ascii waveform with fixed sample rate (1 column [h])
280  void ReadWaveform(wavearray<double>& x, TString fName, double srate);
281  // read ascii waveform with variable sample rate (2 columns [t,h])
282  void ReadWaveform(wavearray<double>& x, TString fName);
283 
284  // get size of wfList
285  inline size_t wfListSize() { return wfList.size(); }
286 
287  void SetCoordinatesSystem(MDC_COORDINATES mdc_coordinates=MDC_EARTH) {this->mdc_coordinates=mdc_coordinates;}
288  MDC_COORDINATES GetCoordinatesSystem() {return mdc_coordinates;}
289 
290  void SetSkyDistribution(MDC_DISTRIBUTION sky_distribution, vector<mdcpar> par, int seed=0, bool add=false);
291  void SetSkyDistribution(MDC_DISTRIBUTION sky_distribution, TString fName, vector<mdcpar> par, int seed=0, bool add=false);
292  void SetSkyDistribution(MDC_DISTRIBUTION sky_distribution, TString fName, int seed, bool add=false);
293  MDC_DISTRIBUTION GetSkyDistribution() {return sky_distribution;}
294  TString GetSkyFile() {return sky_file;}
295  vector<mdcpar> GetSkyParms() {return sky_parms;}
296  void DrawSkyDistribution(TString name = "skymap", TString projection = "",
297  TString coordinate = "Geographic", double resolution = 2, bool background=true);
298 
299  void GetSourceCoordinates(double& theta, double& phi, double& psi, double& rho,
300  double& iota, double& hrss, int& ID, int& id);
301  void GetSourceCoordinates(double gps, double& theta, double& phi, double& psi, double& rho,
302  double& iota, double& hrss, int& ID, int& id);
303 
304  void SetInjLength(double inj_length=MDC_INJ_LENGTH) {
305  this->inj_length = inj_length>0 ? inj_length : MDC_INJ_LENGTH;}
306  double GetInjLength() {return inj_length;}
307  void SetInjHrss(double inj_hrss=MDC_INJ_HRSS) {
308  // if inj_hrss=0 the hrss @10Kpc is the one which is defined by hp,hc waveforms
309  this->inj_hrss = inj_hrss>=0 ? inj_hrss : MDC_INJ_HRSS;}
310  double GetInjHrss() {return inj_hrss;}
311  void SetInjRate(double inj_rate=MDC_INJ_RATE) {
312  this->inj_rate = inj_rate>0 ? inj_rate : MDC_INJ_RATE;}
313  double GetInjRate() {return inj_rate;}
314  void SetInjOffset(double inj_offset=0) {
315  this->inj_offset = inj_offset>0 ? inj_offset : 0;}
316  double GetInjOffset() {return inj_offset;}
317  void SetInjJitter(double inj_jitter=MDC_INJ_JITTER) {
318  this->inj_jitter = inj_jitter>=0 ? inj_jitter : MDC_INJ_JITTER;}
319  double GetInjJitter() {return inj_jitter;}
320  void SetSourceListSeed(unsigned int srcList_seed) {
321  this->srcList_seed = srcList_seed;}
322  double GetSourceListSeed() {return srcList_seed;}
323  double GetSampleRate() {return MDC_SAMPLE_RATE;}
324 
325 #ifdef _USE_LAL
326  void SetInspiral(TString inspName, TString inspOptions="");
327  TString GetInspiral() {return inspOptions;}
328  wavearray<double> GetInspiral(TString pol, int gps_start_time, int gps_end_time);
329  TString GetInspiralOption(TString inspOption);
330 #endif
331 
332  void Dump(TString fname, int ID, int id, TString polarization);
333  void Dump(TString fname, TString name, int id, TString polarization);
334  void Dump(TString fname, wavearray<double>& x);
335  void Dump(TString dname); // dump all waveforms in dname dir
336 
337  watplot* Draw(TString name, int id=0, TString polarization="hp", MDC_DRAW type=MDC_TIME,
338  TString options = "ALP", Color_t color=kBlack);
339  watplot* Draw(int ID, int id=0, TString polarization="hp", MDC_DRAW type=MDC_TIME,
340  TString options = "ALP", Color_t color=kBlack);
342  TString options = "ALP", Color_t color=kBlack);
343  watplot* Draw(TString ifo, double gpsStart, double gpsEnd, int id,
344  MDC_DRAW type=MDC_TIME, TString options = "ALP", Color_t color=kBlack);
345 
346  void DumpLog(TString fName, TString label="", bool append=false);
347  void DumpLogHeader(TString fName, TString label="", int size=0);
348 
349  waveform GetWaveform(int ID, int id=0);
350  waveform GetWaveform(TString name, int id=0);
351  int GetWaveformID(TString name);
352  void GetWaveform(waveform& wf);
353 
354  static double GetCentralTime(wavearray<double> x);
355  static double GetCentralTime(waveform wf);
356  static double GetCentralFrequency(wavearray<double> x);
357  static double GetCentralFrequency(waveform wf);
358  static double GetTimeRange(wavearray<double> x, double& tMin, double& tMax, double efraction = EPZOOM);
359  static void TimeShift(wavearray<double>& x, double tShift=0.);
360  static void PhaseShift(wavearray<double>& x, double pShift=0.);
361 
362  double GetAntennaPattern(TString ifo, double phi, double theta, double psi=0., TString polarization="hp");
363  double GetDelay(TString ifo1, TString ifo2, double phi, double theta);
364 
365  void Print(int level=0); // *MENU*
366  virtual void Browse(TBrowser *b) {Print();}
367 
368  wavearray<double> GetWNB(double frequency, double bandwidth, double duration, int seed=0, bool mode=0);
369  wavearray<double> GetRD(double frequency, double tau, double iota, bool polarization=0);
370  wavearray<double> GetSGQ(double frequency, double Q);
371  wavearray<double> GetCGQ(double frequency, double Q);
372  wavearray<double> GetGA(double duration);
373 
374  static void AddGauss(wavearray<double> &td, double v, double u=0.);
375  static void AddExp(wavearray<double> &td, double v, int M);
376  static void AddSGBurst(wavearray<double> &td, double a, double f, double s, double d=0.);
377  static void AddCGBurst(wavearray<double> &td, double a, double f, double s, double d=0.);
378  static void AddWGNoise(wavearray<double> &td, double a, double s);
379 
380  TString WriteFrameFile(TString frDir, TString frLabel, size_t gps,
381  size_t length=1000, bool log=false, vector<TString> chName=vector<TString>());
382 
383  network* GetNetwork() {return net;}
384 
385  vector<waveform> GetWaveformList() {return wfList;}
386 
387  vector<waveform> wfList;
388 
389  std::vector<std::string> mdcList; // list of injections
390  std::vector<std::string> mdcType; // list of injection types
391  std::vector<std::string> xmlType; // list of xml injection types (used with MDC_XMLFILE)
392  std::vector<double> mdcTime; // gps time of selected injections
393  std::vector<std::string> mdcName; // list of injection names used with MDC_LOG
394  std::vector<source> srcList; // list of source MDC parameters
395 
396  double GetPar(TString name, vector<mdcpar> par, bool& error);
397  TString GetParString(TString name, vector<mdcpar> par, bool& error);
398 
399  waveform GetSourceWaveform(int& ID, int& id);
400  vector<source> GetSourceList(double start, double stop);
401  TString GetBurstLog(source src, double FrameGPS, double SimHpHp, double SimHcHc, double SimHpHc);
402 
403  watplot* DrawTime(wavearray<double>& x, TString options = "ALP", Color_t color=kBlack);
404  watplot* DrawFFT(wavearray<double>& x, TString options = "ALP", Color_t color=kBlack);
405  void DrawTF(wavearray<double>& x, TString options = "");
406 
407  TString GetBurst(wavearray<double>& x, TString ifo);
408 
409 #ifdef _USE_LAL
410  TString GetInspiral(wavearray<double>& x, TString ifo);
411  TString GenInspiralXML(int gps_start_time, int gps_end_time, bool rmFile=false);
412  TString GetInspName() {return inspName;}
413  TString GetWaveName() {return waveName;}
414 #ifndef __CINT__
415  TString GetInspiralLog(TString inspName, double FrameGPS, SimInspiralTable *thisInj);
416  void FindChirpInjectSignals(wavearray<double>& w, SimInspiralTable *injections, TString ifo);
417 #endif
418  void CreateBurstXML(TString fName, vector<mdcpar> xml_parms);
419  void FillBurstXML(bool precision=false);
420  void CloseBurstXML();
421  static TString GetBurstNameLAL(TString options);
422  int XLALInspiralTDWaveformFromSimInspiral(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, SimInspiralTable *thisRow, REAL8 deltaT);
423  static double SimIMRSEOBNRv4ROMTimeOfFrequency(double freq, double m1, double m2, double chi1, double chi2);
424  static double SimIMRSEOBNRv4ROMFrequencyOfTime(double time, double m1, double m2, double chi1, double chi2);
425 #endif
426  static double e2cosi(double e);
427  static double cosi2e(double cosi);
428 
429  TString GetTemporaryFileName(TString tag="mdc", TString ext="txt", TString dir="/tmp", bool mkdir=false);
430 
431  void SetZoom(double epzoom=EPZOOM) {if(epzoom<0||epzoom>1) epzoom=EPZOOM; this->epzoom=epzoom;}
432  double GetZoom() {return epzoom;}
433 
434  gskymap* GetGSkyMap() {return psp;}
435  CWB::STFT* GetSTFT() {return stft;}
436  watplot* GetWatPlot() {return pts;}
437 
438 #ifdef _USE_LAL
439  // posterioris sample functions
440  static void Posterior2XML(TString sampleFile, TString xmlFile, TString options="");
441  static std::map<TString, double> GetPsample(std::map<TString, int> hsample, vector<double> sample,
442  float if_lower=-1, float if_ref=-1);
443  // calibration functions
444  void CalibrateInspiral(wavearray<double>& w, TString ifo, double time, int simulation_id);
445  void SetInspiralCLB(TString inspCLB) {
446  TString extension = inspCLB(inspCLB.Last('.'),inspCLB.Sizeof()-inspCLB.Last('.')-1);
447  if(extension!=".clb") {
448  cout << "CWB::mdc::SetInspiralCLB - Error : Calibration file extension must be .clb" << endl;
449  exit(1);
450  }
451  this->inspCLB=inspCLB;
452  }
453  TString GetInspiralCLB() {return this->inspCLB;}
454 #endif
455 
456  // wavearray methods
457  static double
458  PhaseSync(wavearray<double>& w1, wavearray<double>& w2, double& sync_phase);
459  static double
460  TimeSync(wavearray<double>& w1, wavearray<double>& w2, double& sync_time);
461  static double
462  TimePhaseSync(wavearray<double>& w1, wavearray<double>& w2, double& sync_time, double& sync_phase);
463  static void
464  PhaseSync(wavearray<double>& w, double sync_phase);
465  static void
466  TimeSync(wavearray<double>& w, double sync_time);
467  static void
468  TimePhaseSync(wavearray<double>& w, double sync_time, double sync_phase);
469  static wavearray<double>
470  GetAligned(wavearray<double>* w1, wavearray<double>* w2);
471  static wavearray<double>
472  GetAdd(wavearray<double>* w1, wavearray<double>* w2);
473  static wavearray<double>
474  GetDiff(wavearray<double>* w1, wavearray<double>* w2);
475  static int
476  Align(wavearray<double>& w1, wavearray<double>& w2);
477  static double
478  GetTimeBoundaries(wavearray<double> x, double P, double& bT, double& eT, double T=-1., double Q=-1.);
479  static double
480  GetFrequencyBoundaries(wavearray<double> x, double P, double& bF, double& eF);
481  static wavearray<double>
482  GetXCorr(wavearray<double>& w1, wavearray<double>& w2);
483  static double
484  GetMatchFactor(TString match, vector<wavearray<double> >& w1, vector<wavearray<double> >& w2,
485  vector<double> tstart=DEFAULT_VECtOR_DOUBLE, vector<double> tstop=DEFAULT_VECtOR_DOUBLE);
486  static wavearray<double>
487  GetBandpass(wavearray<double> x, double bF, double eF);
488  static wavearray<double>
489  GetEnvelope(wavearray<double>* x);
490  static wavearray<double>
491  GetSpectrum(wavearray<double>* x, bool oneside=false);
492 
493 
494 private:
495 
496  void Init(int seed=0);
497  void exit(int err) {gSystem->Exit(err);} // overwrite exit system function
498 
499  network* net; //!
501  TTree* inj_tree; //!
502 
507  vector<mdcpar> sky_parms;
508 
509  std::vector<std::string> nameList;
510  std::vector<float> thList;
511  std::vector<float> phList;
512  std::vector<float> psiList;
513  std::vector<float> rhoList;
514  std::vector<float> iotaList;
515  std::vector<double> hrssList;
516  std::vector<double> gpsList;
517  std::vector<int> IDList;
518  std::vector<int> idList;
519 
520  double inj_rate;
521  double inj_offset;
522  double inj_jitter;
523  double inj_hrss;
524  double inj_length; //length sec
525  unsigned int srcList_seed; // value added to the seed used in GetSourceList (default is 0)
526 
527  // inspiral parameters
533  TString waveName; //- PN approximant to be used in computing the waveform
534  // (see enum Approximant in LALSimInspiral.h)
535 
537 
538  double epzoom; // used to zoom plots : energy percentage displayed
539 
540  gskymap* psp; //!
542  watplot* pts; //!
543 
544 #ifdef _USE_LAL
545 #ifndef __CINT__
546  // used by the CreateBurstXML,FillBurstXML,CloseBurstXML functions
547  ProcessTable *xml_process_table_head; //!
548  ProcessTable *xml_process; //!
549  ProcessParamsTable *xml_process_params_table_head; //!
550  SearchSummaryTable *xml_search_summary_table_head; //!
551  SearchSummaryTable *xml_search_summary; //!
552  TimeSlide *xml_time_slide_table_head; //!
553  SimBurst *xml_sim_burst_table_head; //!
554  SimBurst **xml_sim_burst; //!
555 #endif
556 #endif
557 
558  ClassDef(mdc,9)
559 };
560 
561 } // end namespace
562 
563 #endif
double GetTimeBoundaries(wavearray< double > x, double P, double &bT, double &eT)
MDC_DISTRIBUTION
Definition: mdc.hh:176
MDC_DRAW
Definition: mdc.hh:201
int id
Definition: mdc.hh:210
double rho
#define EPZOOM
Definition: mdc.hh:146
int ID
Definition: mdc.hh:239
TString inspCLB
Definition: mdc.hh:528
TString sky_file
Definition: mdc.hh:505
Definition: mdc.hh:202
double GetInjHrss()
Definition: mdc.hh:310
#define MDC_INJ_RATE
Definition: mdc.hh:139
TString inspDIR
Definition: mdc.hh:530
vector< mdcpar > GetSkyParms()
Definition: mdc.hh:295
double M
Definition: DrawEBHH.C:13
void Init()
Definition: ChirpMass.C:284
double duration
par [0] value
Definition: mdc.hh:219
bool status
Definition: mdc.hh:221
vector< mdcpar > sky_parms
Definition: mdc.hh:507
std::vector< float > psiList
Definition: mdc.hh:512
TString inspOptions
Definition: mdc.hh:532
Definition: ced.hh:42
std::vector< std::string > mdcList
Definition: mdc.hh:389
#define MDC_INJ_LENGTH
Definition: mdc.hh:141
double m1
void SetInjRate(double inj_rate=MDC_INJ_RATE)
Definition: mdc.hh:311
wavearray< double > a(hp.size())
int error
Definition: cwb_compile.C:43
WSeries< float > v[nIFO]
Definition: cwb_net.C:80
Definition: mdc.hh:158
Definition: mdc.hh:207
gx Draw(GWAT_TIME)
int n
Definition: cwb_net.C:28
CWB::STFT * GetSTFT()
Definition: mdc.hh:435
Definition: mdc.hh:203
void SetSourceListSeed(unsigned int srcList_seed)
Definition: mdc.hh:320
Definition: mdc.hh:181
TString("c")
std::vector< std::string > mdcType
Definition: mdc.hh:390
MDC SetSkyDistribution(MDC_CELESTIAL_FIX, par, seed)
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 frequency
unsigned int srcList_seed
Definition: mdc.hh:525
double GetInjRate()
Definition: mdc.hh:313
float theta
TString mdc[4]
network * net
Definition: mdc.hh:499
std::vector< double > gpsList
Definition: mdc.hh:516
TString xmlFile
Definition: Posterior2XML.C:34
void SetInjLength(double inj_length=MDC_INJ_LENGTH)
Definition: mdc.hh:304
TString waveName
Definition: mdc.hh:533
MDC_TYPE
Definition: mdc.hh:148
double epzoom
Definition: mdc.hh:538
std::vector< float > phList
Definition: mdc.hh:511
wavearray< double > hp
Definition: mdc.hh:226
double inj_rate
Definition: mdc.hh:520
waveform wf
int polarization
std::vector< int > IDList
Definition: mdc.hh:517
vector< waveform > GetWaveformList()
Definition: mdc.hh:385
Long_t size
double GetZoom()
Definition: mdc.hh:432
TString GetSkyFile()
Definition: mdc.hh:294
TString name
Definition: mdc.hh:214
watplot * pts
Definition: mdc.hh:542
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
Definition: ComputeSNR.C:75
Definition: mdc.hh:163
virtual void Browse(TBrowser *b)
Definition: mdc.hh:366
double value
Definition: mdc.hh:215
r add(tfmap, const_cast< char *>("hchannel"))
char ifo[NIFO_MAX][8]
std::vector< std::string > nameList
Definition: mdc.hh:509
network ** net
NOISE_MDC_SIMULATION.
MDC_COORDINATES
Definition: mdc.hh:171
double gps
Definition: mdc.hh:232
double GetSampleRate()
Definition: mdc.hh:323
Definition: mdc.hh:156
double GetInjJitter()
Definition: mdc.hh:319
#define MDC_INJ_JITTER
Definition: mdc.hh:140
size_t mode
Definition: mdc.hh:204
TString inspXML
Definition: mdc.hh:529
wavearray< double > w
Definition: Test1.C:27
nc append(pix)
#define nIFO
double tstart
double GetFrequencyBoundaries(wavearray< double > x, double P, double &bF, double &eF)
std::vector< std::string > xmlType
Definition: mdc.hh:391
float phi
TString chName[NIFO_MAX]
size_t wfListSize()
Definition: mdc.hh:285
Definition: mdc.hh:155
MDC Print()
Definition: mdc.hh:168
wavearray< double > freq
Definition: Regression_H1.C:79
double rho
Definition: mdc.hh:236
TString name
Definition: mdc.hh:222
double hrss
Definition: TestMDC.C:70
float psi
void SetInjOffset(double inj_offset=0)
Definition: mdc.hh:314
TString hxPath
Definition: mdc.hh:224
CWB::STFT * stft
Definition: mdc.hh:541
int ID
Definition: mdc.hh:209
Definition: mdc.hh:248
Definition: mdc.hh:153
gskymap * GetGSkyMap()
Definition: mdc.hh:434
#define MDC_SAMPLE_RATE
Definition: mdc.hh:144
double hrss
Definition: mdc.hh:238
int id
Definition: mdc.hh:240
TString label
Definition: MergeTrees.C:21
bool log
Definition: WaveMDC.C:41
vector< mdcpar > par
Definition: mdc.hh:225
MDC TimeShift(MDC.wfList[14].hx, 0.001)
const char * DistributionToString(MDC_DISTRIBUTION n)
Definition: mdc.hh:187
TString frDir[NIFO_MAX]
waveform wf
Definition: mdc.hh:241
static double tau
Definition: geodesics.cc:26
char fname[1024]
Definition: mdc.hh:213
cout<< "Injected signals: "<< mdc.GetEntries()<< endl;cout<< "Injected signals in histogram factor_events_inj: "<< NEVTS<< endl;float myifar, ecor, m1, m2, netcc[3], neted, penalty;float rho[2];float chirp[6];float range[2];float frequency[2];float iSNR[3], sSNR[3];sim.SetBranchAddress("mass", mass);sim.SetBranchAddress("factor", &factor);sim.SetBranchAddress("range", range);sim.SetBranchAddress("chirp", chirp);sim.SetBranchAddress("rho", rho);sim.SetBranchAddress("netcc", netcc);sim.SetBranchAddress("neted", &neted);sim.SetBranchAddress("ifar", &myifar);sim.SetBranchAddress("ecor", &ecor);sim.SetBranchAddress("penalty", &penalty);sim.SetBranchAddress("time", mytime);sim.SetBranchAddress("iSNR", iSNR);sim.SetBranchAddress("sSNR", sSNR);sim.SetBranchAddress("spin", spin);sim.SetBranchAddress("frequency", frequency);float **volume=new float *[NBINS_mass1];float **volume_first_shell=new float *[NBINS_mass1];float **radius=new float *[NBINS_mass1];float **error_volume=new float *[NBINS_mass1];float **error_volume_first_shell=new float *[NBINS_mass1];float **error_radius=new float *[NBINS_mass1];for(int i=0;i< NBINS_mass1;i++) { volume[i]=new float[NBINS_mass2];volume_first_shell[i]=new float[NBINS_mass2];radius[i]=new float[NBINS_mass2];error_volume[i]=new float[NBINS_mass2];error_volume_first_shell[i]=new float[NBINS_mass2];error_radius[i]=new float[NBINS_mass2];for(int j=0;j< NBINS_mass2;j++) { volume[i][j]=0.;volume_first_shell[i][j]=0.;radius[i][j]=0.;error_volume[i][j]=0.;error_volume_first_shell[i][j]=0.;error_radius[i][j]=0.;} } float **spin_mtot_volume=new float *[NBINS_MTOT+1];float **spin_mtot_radius=new float *[NBINS_MTOT+1];float **error_spin_mtot_volume=new float *[NBINS_MTOT+1];float **error_spin_mtot_radius=new float *[NBINS_MTOT+1];for(int i=0;i< NBINS_MTOT+1;i++) { spin_mtot_volume[i]=new float[NBINS_SPIN+1];spin_mtot_radius[i]=new float[NBINS_SPIN+1];error_spin_mtot_volume[i]=new float[NBINS_SPIN+1];error_spin_mtot_radius[i]=new float[NBINS_SPIN+1];for(int j=0;j< NBINS_SPIN+1;j++) { spin_mtot_volume[i][j]=0.;error_spin_mtot_volume[i][j]=0.;spin_mtot_radius[i][j]=0.;error_spin_mtot_radius[i][j]=0.;} } char fname[1024];sprintf(fname, "%s/recovered_signals.txt", netdir);ofstream fev;fev.open(fname, std::ofstream::out);sprintf(line, "#GPS@L1 FAR[Hz] eFAR[Hz] Pval " "ePval factor rho frequency iSNR sSNR \");fev<< line<< endl;ofstream *fev_single=new ofstream[nfactor];for(int l=1;l< nfactor+1;l++) { sprintf(fname, "%s/recovered_signals_%d.txt", netdir, l);fev_single[l - 1].open(fname, std::ofstream::out);fev_single[l - 1]<< line<< endl;} double Vrho[RHO_NBINS], eVrho[RHO_NBINS], Rrho[RHO_NBINS], eRrho[RHO_NBINS], Trho[RHO_NBINS];for(int i=0;i< RHO_NBINS;i++) { Vrho[i]=0.;eVrho[i]=0.;Rrho[i]=0.;eRrho[i]=0.;Trho[i]=RHO_MIN+i *RHO_BIN;} double dV, dV1, dV_spin_mtot, nevts, internal_volume;int nT;int countv=0;int cnt=0;int cnt2=0;int cntfreq=0;bool bcut=false;double liveTot=sim.GetMaximum("ifar");double BKG_LIVETIME_yr=liveTot/CYS;double BKG_LIVETIME_Myr=BKG_LIVETIME_yr/(1.e6);cout.precision(14);cout<< "Total live time ---> background
double precision
Definition: mdc.hh:150
Definition: mdc.hh:151
TString inspOptions
double tstop
void Dump(WSeries< double > &w, double t1, double t2, const char *fname)
double GetInjOffset()
Definition: mdc.hh:316
MDC_COORDINATES GetCoordinatesSystem()
Definition: mdc.hh:288
Definition: mdc.hh:152
void SetInjJitter(double inj_jitter=MDC_INJ_JITTER)
Definition: mdc.hh:317
Definition: skymap.hh:63
std::vector< int > idList
Definition: mdc.hh:518
vector< mdcpar > par
TString inspName
Definition: mdc.hh:531
double e
double GetCentralFrequency(wavearray< double > x)
Definition: mdc.hh:164
TString svalue
Definition: mdc.hh:216
double GetCentralTime(wavearray< double > x)
vector< waveform > wfList
Definition: mdc.hh:387
char tag[256]
Definition: cwb_merge.C:92
double inj_jitter
Definition: mdc.hh:522
double inj_offset
Definition: mdc.hh:521
double iota
Definition: mdc.hh:237
network * GetNetwork()
Definition: mdc.hh:383
double GetSourceListSeed()
Definition: mdc.hh:322
s s
Definition: cwb_net.C:155
injection * inj
Definition: mdc.hh:500
MDC_COORDINATES mdc_coordinates
Definition: mdc.hh:503
char options[256]
double inj_length
Definition: mdc.hh:524
Definition: mdc.hh:149
Definition: mdc.hh:180
wavearray< double > hx
Definition: mdc.hh:227
skymap sm
Definition: mdc.hh:536
double psi
Definition: mdc.hh:235
double gps
std::vector< std::string > mdcName
Definition: mdc.hh:393
watplot * GetWatPlot()
Definition: mdc.hh:436
double T
Definition: testWDM_4.C:11
TString xml_filename
Definition: mdc.hh:506
MDC_DISTRIBUTION sky_distribution
Definition: mdc.hh:504
std::vector< float > rhoList
Definition: mdc.hh:513
MDC_DISTRIBUTION GetSkyDistribution()
Definition: mdc.hh:293
wavearray< double > GetWaveform(int ifoId, network *NET, int lag, int id, char type, bool shift=true)
double inj_hrss
Definition: mdc.hh:523
double m2
double Q
double theta
Definition: mdc.hh:233
void SetZoom(double epzoom=EPZOOM)
Definition: mdc.hh:431
Definition: mdc.hh:154
std::vector< double > hrssList
Definition: mdc.hh:515
std::vector< float > iotaList
Definition: mdc.hh:514
void Posterior2XML(TString gwname, int seed=-1)
Definition: GWOSC_Tools.C:160
MDC AddWaveform(MDC_SGC, par)
double GetInjLength()
Definition: mdc.hh:306
void SetInjHrss(double inj_hrss=MDC_INJ_HRSS)
Definition: mdc.hh:307
std::vector< source > srcList
Definition: mdc.hh:394
double GetDelay(network *NET, TString ifo, double theta, double phi)
std::vector< double > mdcTime
Definition: mdc.hh:392
MDC ReadWaveform(x,"Waveforms/SG554Q8d9.txt", 16384.)
double phi
Definition: mdc.hh:234
MDC DumpLog("GHLTV-GWGC_v1-968600000-300000.root","CIAO")
static vector< double > DEFAULT_VECtOR_DOUBLE
Definition: mdc.hh:244
Definition: mdc.hh:231
gskymap * psp
Definition: mdc.hh:540
#define MDC_INJ_HRSS
Definition: mdc.hh:142
char fName[256]
void exit(int err)
Definition: mdc.hh:497
Definition: mdc.hh:157
double length
Definition: TestBandPass.C:18
void SetCoordinatesSystem(MDC_COORDINATES mdc_coordinates=MDC_EARTH)
Definition: mdc.hh:287
vector< waveform > list
Definition: mdc.hh:228
MDC_TYPE type
Definition: mdc.hh:220
TString name
Definition: mdc.hh:208
TString frLabel[NIFO_MAX]
Definition: mdc.hh:166
TTree * inj_tree
Definition: mdc.hh:501
TString hpPath
Definition: mdc.hh:223
Definition: mdc.hh:159
Definition: mdc.hh:165
detector ** pD
std::vector< float > thList
Definition: mdc.hh:510
CWB::STFT * stft
Definition: ChirpMass.C:121
MDC SetInspiral("inspNameTEST", inspOptions)
exit(0)