3 #pragma GCC system_header
10 #include "TObjArray.h"
11 #include "TObjString.h"
20 #define MDC_OTF // enable MDC On The Fly
21 #define NOISE_OTF // enable NOISE On The Fly
29 cout <<
"-----> CWB_Plugin_NN.C" << endl;
30 cout <<
"ifo " << ifo.Data() << endl;
31 cout <<
"type " << type << endl;
51 if(ifo.CompareTo(
"L1")==0) seed=1000;
52 if(ifo.CompareTo(
"H1")==0) seed=2000;
53 if(ifo.CompareTo(
"V1")==0) seed=3000;
54 if(ifo.CompareTo(
"J1")==0) seed=4000;
55 if(ifo.CompareTo(
"A2")==0) seed=5000;
56 if(ifo.CompareTo(
"Y2")==0) seed=6000;
57 if(ifo.CompareTo(
"Y3")==0) seed=7000;
60 if(ifo.CompareTo(
"L1")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
61 if(ifo.CompareTo(
"H1")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
62 if(ifo.CompareTo(
"V1")==0) fName=
"plugins/strains/advVIRGO_sensitivity_12May09_8khz_one_side.txt";
63 if(ifo.CompareTo(
"J1")==0) fName=
"plugins/strains/LCGT_sensitivity_8khz_one_side.txt";
64 if(ifo.CompareTo(
"A2")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
65 if(ifo.CompareTo(
"Y2")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
66 if(ifo.CompareTo(
"Y3")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
80 sprintf(cmd,
"network* net = (network*)%p;",NET);
81 gROOT->ProcessLine(cmd);
108 if(ifo.CompareTo(NET->
ifoName[0])==0) {
119 for(
int k=0;
k<(
int)NET->
mdcTime.size();
k++) cout <<
k <<
" mdcTime " << MDC.
mdcTime[
k] << endl;
120 for(
int k=0;
k<(
int)NET->
mdcType.size();
k++) cout <<
k <<
" mdcType " << MDC.
mdcType[
k] << endl;
127 cout <<
"CWB_Plugin_NN.C -> CWB_PLUGIN_OLIKELIHOOD implemented only for 2G" << endl;
137 cout <<
"-----> CWB_Plugin_NN.C -> " <<
" gIFACTOR : " << gIFACTOR << endl;
140 float* gSLAGSHIFT=NULL;
IMPORT(
float*,gSLAGSHIFT)
151 TList *
files = (TList*)gROOT->GetListOfFiles();
158 while ((file=(TSystemFile*)
next())) {
159 fname = file->GetName();
161 if(fname.Contains(
"wave_")) {
162 froot=(TFile*)file;froot->cd();
164 outDump.ReplaceAll(
".root.tmp",
".txt");
165 cout <<
"output file name : " << fname << endl;
169 cout <<
"CWB_Plugin_NN.C : Error - output root file not found" << endl;
173 cout <<
"CWB_Plugin_NN.C : Error - output root file not found" << endl;
178 TTree*
net_tree = (TTree *) froot->Get(
"waveburst");
181 net_tree->SetBranchAddress(
"netcluster",&pwc);
186 net_tree->Branch(
"netcluster",
"netcluster",&pwc,32000,0);
190 for(
int k=0;
k<
K;
k++) {
196 int ID = size_t(
id.data[
j]+0.5);
213 if(cfg->
dump) EVT->
dopen(outDump.Data(),
const_cast<char*
>(
"a"),
false);
214 EVT->
output2G(net_tree,NET,ID,
k,ofactor);
218 #ifdef WATPLOT // monster event display
221 sprintf(fname2,
"l_tfmap_scalogram_%d.png",ID);
222 cout <<
"write " << fname2 << endl;
224 WTS.
canvas->Print(fname2);
std::vector< char * > ifoName
virtual void resize(unsigned int)
virtual size_t size() const
void setSLags(float *slag)
TString Get(wavearray< double > &x, TString ifo)
std::vector< std::string > mdcList
cout<< "skymap size : "<< L<< endl;for(int l=0;l< L;l++) sm.set(l, l);sm > const_cast< char * >("skymap.dat")
std::vector< std::string > mdcType
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<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t 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
wavearray< double > get(char *name, size_t index=0, char atype='R', int type=1, bool=true)
param: string with parameter name param: index in the amplitude array, which define detector param: c...
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *NET, WSeries< double > *x, TString ifo, int type)
COHERENCE.
std::vector< std::string > mdcType
virtual void start(double s)
std::vector< double > mdcTime
void plot(wavearray< double > &, char *=NULL, int=1, double=0., double=0., bool=false, float=0., float=0., bool=false, float=0., bool=false)
void dopen(const char *fname, char *mode, bool header=true)
void output2G(TTree *, network *, size_t, int, double)
#define IMPORT(TYPE, VAR)
std::vector< std::string > mdcList
TIter next(twave->GetListOfBranches())
size_t cpf(const netcluster &, bool=false, int=0)
netevent EVT(itree, nifo)
netcluster * getwc(size_t n)
param: delay index
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
double factors[FACTORS_MAX]
std::vector< double > mdcTime