21 #pragma GCC system_header 28 #include "TObjArray.h" 29 #include "TObjString.h" 38 #define MDC_OTF // enable MDC On The Fly 39 #define NOISE_OTF // enable NOISE On The Fly 47 cout <<
"-----> CWB_Plugin_NN.C" << endl;
48 cout <<
"ifo " << ifo.Data() << endl;
49 cout <<
"type " << type << endl;
69 if(ifo.CompareTo(
"L1")==0) seed=1000;
70 if(ifo.CompareTo(
"H1")==0) seed=2000;
71 if(ifo.CompareTo(
"V1")==0) seed=3000;
72 if(ifo.CompareTo(
"J1")==0) seed=4000;
73 if(ifo.CompareTo(
"A2")==0) seed=5000;
74 if(ifo.CompareTo(
"Y2")==0) seed=6000;
75 if(ifo.CompareTo(
"Y3")==0) seed=7000;
78 if(ifo.CompareTo(
"L1")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
79 if(ifo.CompareTo(
"H1")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
80 if(ifo.CompareTo(
"V1")==0) fName=
"plugins/strains/advVIRGO_sensitivity_12May09_8khz_one_side.txt";
81 if(ifo.CompareTo(
"J1")==0) fName=
"plugins/strains/LCGT_sensitivity_8khz_one_side.txt";
82 if(ifo.CompareTo(
"A2")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
83 if(ifo.CompareTo(
"Y2")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
84 if(ifo.CompareTo(
"Y3")==0) fName=
"plugins/strains/advLIGO_NSNS_Opt_8khz_one_side.txt";
98 sprintf(cmd,
"network* net = (network*)%p;",NET);
99 gROOT->ProcessLine(cmd);
126 if(ifo.CompareTo(NET->
ifoName[0])==0) {
137 for(
int k=0;
k<(
int)NET->
mdcTime.size();
k++) cout <<
k <<
" mdcTime " << MDC.
mdcTime[
k] << endl;
138 for(
int k=0;
k<(
int)NET->
mdcType.size();
k++) cout <<
k <<
" mdcType " << MDC.
mdcType[
k] << endl;
145 cout <<
"CWB_Plugin_NN.C -> CWB_PLUGIN_OLIKELIHOOD implemented only for 2G" << endl;
155 cout <<
"-----> CWB_Plugin_NN.C -> " <<
" gIFACTOR : " << gIFACTOR << endl;
158 float* gSLAGSHIFT=NULL;
IMPORT(
float*,gSLAGSHIFT)
169 TList *files = (TList*)gROOT->GetListOfFiles();
176 while ((file=(TSystemFile*)
next())) {
177 fname = file->GetName();
179 if(fname.Contains(
"wave_")) {
180 froot=(TFile*)file;froot->cd();
182 outDump.ReplaceAll(
".root.tmp",
".txt");
183 cout <<
"output file name : " << fname << endl;
187 cout <<
"CWB_Plugin_NN.C : Error - output root file not found" << endl;
191 cout <<
"CWB_Plugin_NN.C : Error - output root file not found" << endl;
196 TTree*
net_tree = (TTree *) froot->Get(
"waveburst");
199 net_tree->SetBranchAddress(
"netcluster",&pwc);
204 net_tree->Branch(
"netcluster",
"netcluster",&pwc,32000,0);
208 for(
int k=0;
k<
K;
k++) {
210 id = NET->
getwc(
k)->
get(const_cast<char*>(
"ID"), 0,
'L', rate);
214 int ID = size_t(
id.data[
j]+0.5);
231 if(cfg->
dump) EVT->
dopen(outDump.Data(),
const_cast<char*
>(
"a"),
false);
232 EVT->
output2G(net_tree,NET,ID,
k,ofactor);
236 #ifdef WATPLOT // monster event display 239 sprintf(fname2,
"l_tfmap_scalogram_%d.png",ID);
240 cout <<
"write " << fname2 << endl;
241 WTS.
plot(pwc, 1, nIFO,
'L', 0, const_cast<char*>(
"COLZ"));
242 WTS.
canvas->Print(fname2);
std::vector< char * > ifoName
virtual void resize(unsigned int)
void setSLags(float *slag)
TString Get(wavearray< double > &x, TString ifo)
std::vector< std::string > mdcList
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<< "\ 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
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)
virtual size_t size() const
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