24 #pragma GCC system_header 31 #include "TObjArray.h" 32 #include "TObjString.h" 59 #define STRAIN_VETO_TIME 0.0 60 #define STRAIN_VETO_WINDOW 0.0 137 cout <<
"CWB_Plugin_Periodic_Frames.C - " <<
"xstart : " <<
int(xstart) <<
" xstop : " <<
int(xstop) << endl;
140 cout <<
"CWB_Plugin_Periodic_Frames.C - Error : strain frame files list name is not defined" << endl;
151 cout <<
"CWB_Plugin_Periodic_Frames.C - Strain " <<
" -> nfrFiles : " << nfrFiles << endl;
155 cout <<
"CWB_Plugin_Periodic_Frames.C - frRange : " << frRange.
start <<
" " << frRange.
stop << endl;
158 double mlength = frRange.
stop-frRange.
start;
159 double toffset = xstart-frRange.
start;
160 int nShift = toffset>=0 ?
int(toffset/mlength) :
int(toffset/mlength)-1;
168 if(gOPT.veto_time>0)
SetCAT2(ifo, cfg, gOPT.veto_time);
184 vector<waveSegment>
detSegs(1);
185 detSegs[0].start =
xstart;
186 detSegs[0].stop =
xstop;
188 detSegs_dq2.push_back(detSegs[0]);
190 for(
int i=0;
i<(
int)detSegs_dq2.size();
i++) {
191 cout <<
"detSegs_dq2[" <<
i <<
"] GPS range : " 192 << detSegs_dq2[
i].start <<
"-" << detSegs_dq2[
i].stop << endl;
196 cout <<
"live time after cat 2 : " << detSegs_ctime <<
" sec" << endl;
197 if(detSegs_ctime<cfg->
segTHR) {
198 cout <<
"CWB_Plugin_Periodic_Frames.C : job segment live time after cat2 < segTHR=" 199 << cfg->
segTHR <<
" sec, job terminated !!!" << endl;
200 cout << endl <<
"To remove this check set segTHR=0 in the parameter file" << endl << endl;
208 cout <<
"CWB_Plugin_Periodic_Frames.C : Read Strain Frames ..." << endl;
223 cout <<
"CWB_Plugin_Periodic_Frames.C - Strain " <<
" -> nfrFiles : " << nfrFiles << endl;
230 {cout <<
"CWB_Plugin_Periodic_Frames.C - input rate from frame " << x->
rate()
231 <<
" do not match the one defined in config : " << cfg->
inRate << endl;gSystem->Exit(1);}
241 if(window<=0) window = cfg->
iwindow/2.;
246 for(
int n=0;
n<cfg->
nIFO;
n++) {
262 cout <<
"Write file : " << cfg->
DQF[cfg->
nDQF-1].
file << endl;
263 if (!out.good()) {cout <<
"Error Opening File : " << cfg->
DQF[cfg->
nDQF-1].
file << endl;
exit(1);}
265 int istart =
int(gps)-window;
266 int istop =
int(gps)+window;
267 out <<
"1 " << istart <<
" " << istop <<
" " << 2*window << endl;
278 for(
int n=0;
n<(cfg->
nDQF);
n++) {
291 for(
int j=0;
j<token->GetEntries();
j++) {
293 TObjString* tok = (TObjString*)token->At(
j);
294 TString stok = tok->GetString();
296 if(stok.Contains(
"strain_veto_time=")) {
298 strain_veto_time.Remove(0,strain_veto_time.Last(
'=')+1);
299 if(strain_veto_time.IsFloat()) gOPT.veto_time=strain_veto_time.Atof();
302 if(stok.Contains(
"strain_veto_window=")) {
303 TString strain_veto_window=stok;
304 strain_veto_window.Remove(0,strain_veto_window.Last(
'=')+1);
305 if(strain_veto_window.IsFloat()) gOPT.veto_window=strain_veto_window.Atof();
320 cout <<
"-----------------------------------------" << endl;
321 cout <<
"STRAIN config options " << endl;
322 cout <<
"-----------------------------------------" << endl << endl;
323 cout <<
"STRAIN_VETO_TIME " << gOPT.veto_time << endl;
324 cout <<
"STRAIN_VETO_WINDOW " << gOPT.veto_window << endl;
std::vector< char * > ifoName
detector * getifo(size_t n)
param: detector index
virtual void rate(double r)
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
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
CWB::frame fr(FRLIST_NAME)
virtual void start(double s)
vector< waveSegment > detSegs_dq2
network ** net
NOISE_MDC_SIMULATION.
void ReadUserOptions(TString options)
#define STRAIN_VETO_WINDOW
#define IMPORT(TYPE, VAR)
void SetTimeShiftCAT2(TString ifo, CWB::config *cfg, double shift)
void setVerbose(bool verbose=true)
char channelNamesRaw[NIFO_MAX][50]
std::vector< waveSegment > segList
void setSRIndex(int srIndex)
vector< waveSegment > detSegs
virtual void stop(double s)
void readFrames(char *filename, char *channel, wavearray< double > &w)
strcpy(RunLabel, RUN_LABEL)
cout<< "total cat1 livetime : "<< int(cat1_time)<< " sec "<< cat1_time/3600.<< " h "<< cat1_time/86400.<< " day"<< endl;cout<< endl;vector< waveSegment > cat2List
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
frfile getFrList(int istart, int istop, int segEdge)
void setRetryTime(int frRetryTime=60)
void open(TString ioFile, TString chName="", Option_t *option="", bool onDisk=false, TString label=".gwf", unsigned int mode=0)
char frFiles[2 *NIFO_MAX][1024]
void SetCAT2(TString ifo, CWB::config *cfg, double gps, double window=0.0)