24 #pragma GCC system_header 32 #include "TObjArray.h" 33 #include "TObjString.h" 69 #define MDC_PE_SIM true 70 #define MDC_PE_DUMMY false 71 #define MDC_PE_INVERT true 86 vector<TString> xml_file;
120 gOPT.xml_file.resize(0);
136 if(!gOPT.sim)
return;
140 cout <<
"Execute CWB_Plugin_MDC_PE.C : Inject On The Fly MDC ..." << endl;
162 if(gOPT.xml_file.size()==0) {
167 cout <<
"Error executing macro : " << cfg->
configPlugin.GetTitle() << endl;
176 if(xmlFile[0]==
'.') {
177 xmlFile =
xmlFile(xmlFile.Index(
'/')+1, xmlFile.Sizeof()-xmlFile.Index(
'/')-2);
180 cout <<
"---------> CWB_Plugin_MDC_PE: injections.xml = " << xmlFile << endl;
186 void *dir = gSystem->OpenDirectory(xmlFile);
192 char containString[1024];
193 sprintf(containString,
"_%d.xml",gIFACTOR);
199 cout <<
"---------> CWB_Plugin_MDC_PE: xmlFile = " << xmlFile <<
" nfactor = " << cfg->
nfactor << endl;
203 clbFile.ReplaceAll(
".xml",
".clb");
207 inspOptions+=
"--xml "+
xmlFile;
208 MDC.SetInspiral(
"PE",inspOptions);
225 if(ifo.CompareTo(net->
ifoName[0])==0) {
242 int runID = net->
nRun;
246 cout <<
"Dump : " << logFile << endl;
255 if(ifo.CompareTo(net->
ifoName[0])==0) {
257 for(
int k=0;
k<(
int)net->
mdcTime.size();
k++) cout <<
k <<
" mdcTime " << MDC.
mdcTime[
k] << endl;
258 for(
int k=0;
k<(
int)net->
mdcType.size();
k++) cout <<
k <<
" mdcType " << MDC.
mdcType[
k] << endl;
264 if(!gOPT.dummy)
return;
270 for(
int n=0;
n<cfg->
nIFO;
n++)
if(ifo==cfg->
ifo[
n]) {xIFO=
n;
break;}
272 int runID = net->
nRun;
297 if(gOPT.xml_file.size()<2)
return;
302 vector<TString> delObjList;
304 delObjList.push_back(
"strain");
305 delObjList.push_back(
"mdc");
306 delObjList.push_back(
"cstrain");
307 delObjList.push_back(
"rms");
308 delObjList.push_back(
"waveform");
309 delObjList.push_back(
"csparse");
311 jname.ReplaceAll(
":/",
"");
329 int J = pD->
IWFP.size()/2;
330 for (
int j=0;
j<J;
j++) {
339 if(gOPT.invert) *wf1 = WF2;
355 for(
int j=0;
j<token->GetEntries();
j++) {
357 TObjString* tok = (TObjString*)token->At(
j);
358 TString stok = tok->GetString();
360 if(stok.Contains(
"mdc_pe_sim=")) {
362 mdc_pe_sim.Remove(0,mdc_pe_sim.Last(
'=')+1);
363 if(mdc_pe_sim==
"true") gOPT.sim=
true;
364 if(mdc_pe_sim==
"false") gOPT.sim=
false;
367 if(stok.Contains(
"mdc_pe_dummy=")) {
369 mdc_pe_dummy.Remove(0,mdc_pe_dummy.Last(
'=')+1);
370 if(mdc_pe_dummy==
"true") gOPT.dummy=
true;
371 if(mdc_pe_dummy==
"false") gOPT.dummy=
false;
374 if(stok.Contains(
"mdc_pe_invert=")) {
376 mdc_pe_invert.Remove(0,mdc_pe_invert.Last(
'=')+1);
377 if(mdc_pe_invert==
"true") gOPT.invert=
true;
378 if(mdc_pe_invert==
"false") gOPT.invert=
false;
381 if(stok.Contains(
"mdc_pe_xml_file=")) {
383 mdc_pe_xml_file.Remove(0,mdc_pe_xml_file.Last(
'=')+1);
384 if(gOPT.xml_file.size()<2) gOPT.xml_file.push_back(mdc_pe_xml_file);
399 cout <<
"-----------------------------------------" << endl;
400 cout <<
"MDC_PE config options " << endl;
401 cout <<
"-----------------------------------------" << endl << endl;
403 cout <<
"MDC_PE_SIM " << gOPT.sim << endl;
404 cout <<
"MDC_PE_DUMMY " << gOPT.dummy << endl;
405 cout <<
"MDC_PE_INVERT " << gOPT.invert << endl;
407 for(
int n=0;
n<gOPT.xml_file.size();
n++) {
408 cout <<
"MDC_PE_XML_FILE " <<
n <<
"\t" << gOPT.xml_file[
n] << endl;
std::vector< char * > ifoName
detector * getifo(size_t n)
param: detector index
void FileGarbageCollector(TString ifName, TString ofName="", vector< TString > delObjList=vector< TString >())
TString Get(wavearray< double > &x, TString ifo)
std::vector< std::string > mdcList
virtual void rate(double r)
void PrintUserOptions(CWB::config *cfg)
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
void ReadUserOptions(TString options)
std::vector< std::string > mdcType
virtual void start(double s)
std::vector< double > mdcTime
network ** net
NOISE_MDC_SIMULATION.
void setChName(TString chName)
virtual size_t size() const
#define CWB_PLUGIN_EXPORT(VAR)
#define IMPORT(TYPE, VAR)
std::vector< std::string > mdcList
void Resample(const wavearray< DataType_t > &, double, int=6)
char channelNamesRaw[NIFO_MAX][50]
std::vector< wavearray< double > * > IWFP
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
static wavearray< double > GetDiff(wavearray< double > *w1, wavearray< double > *w2)
cout<< "Starting reading output directory ..."<< endl;vector< TString > fileList
virtual void stop(double s)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void DumpLog(TString fName, TString label="", bool append=false)
void DataConditioning(int ifactor)
std::vector< double > mdcTime
double ReadData(double mdcShift, int ifactor)
char frFiles[2 *NIFO_MAX][1024]