Logo coherent WaveBurst  
Library Reference Guide
Logo
CWB_Plugin_HEN_BKG.C
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 #define XIFO 4
20 
21 #pragma GCC system_header
22 
23 #include "cwb.hh"
24 #include "config.hh"
25 #include "network.hh"
26 #include "wavearray.hh"
27 #include "TString.h"
28 #include "TObjArray.h"
29 #include "TObjString.h"
30 #include "TRandom.h"
31 #include "TComplex.h"
32 #include "TMath.h"
33 #include <vector>
34 
35 
36 void
38 //!NOISE_MDC_SIMULATION
39 // Plugin to set SkyMaskCC 'on the fly'
40 
41  if(type==CWB_PLUGIN_STRAIN) {
42 
43  // ---------------------------------
44  // read plugin config
45  // CWB_Plugin_HEN_BKG_Config.C
46  // ---------------------------------
47 
48  if(TString(ifo).CompareTo(net->ifoName[0])==0) {
49 
50  char cmd[128];
51  sprintf(cmd,"network* net = (network*)%p;",net);
52  gROOT->ProcessLine(cmd);
53  sprintf(cmd,"CWB::config* cfg = (CWB::config*)%p;",cfg);
54  gROOT->ProcessLine(cmd);
55  sprintf(cmd,"int xstart = %d;",(int)x->start());
56  gROOT->ProcessLine(cmd);
57  sprintf(cmd,"int xstop = %d;",(int)x->stop());
58  gROOT->ProcessLine(cmd);
59  int error=0;
60  cfg->configPlugin.Exec(NULL,&error);
61  if(error) {
62  cout << "Error executing macro : " << cfg->configPlugin.GetTitle() << endl;
63  cfg->configPlugin.Print();
64  gSystem->Exit(1);
65  }
66  }
67  }
68 
69  return;
70 }
std::vector< char * > ifoName
Definition: network.hh:609
CWB::config * cfg
TMacro configPlugin
Definition: config.hh:362
int error
Definition: cwb_compile.C:43
TString("c")
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
virtual void start(double s)
Definition: wavearray.hh:137
char ifo[NIFO_MAX][8]
network ** net
NOISE_MDC_SIMULATION.
jfile
Definition: cwb_job_obj.C:43
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
virtual void stop(double s)
Definition: wavearray.hh:139
char cmd[1024]
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)