24 TB.
checkFile(gSystem->Getenv(
"CWB_ROOTLOGON_FILE"));
25 TB.
checkFile(gSystem->Getenv(
"CWB_PARAMETERS_FILE"));
27 TB.
checkFile(gSystem->Getenv(
"CWB_NETC_FILE"));
30 if(gSystem->Getenv(
"CWB_BATCH")!=NULL) {
31 cwb_batch=
TString(gSystem->Getenv(
"CWB_BATCH"));
38 if(gSystem->Getenv(
"CWB_JOBID")==NULL) {
39 cout <<
"Error : environment CWB_JOBID is not defined!!!" << endl;
exit(1);
41 if(
TString(gSystem->Getenv(
"CWB_JOBID")).IsDigit()) {
42 cwb_jobid=
TString(gSystem->Getenv(
"CWB_JOBID")).Atoi();
44 cout <<
"Error : environment CWB_JOBID is not defined!!!" << endl;
exit(1);
48 if(gSystem->Getenv(
"CWB_CED_DIR")!=NULL) {
50 if(cwb_ced_dir.Sizeof()>1) {
56 TString cwb_inet_options=
TString(gSystem->Getenv(
"CWB_INET_OPTIONS"));
57 if(cwb_inet_options.CompareTo(
"")!=0) {
58 TString inet_options = cwb_inet_options;
60 if(!inet_options.Contains(
"--")) {
63 for(
int j=0;
j<token->GetEntries();
j++){
65 TObjString* tok = (TObjString*)token->At(
j);
66 TString stok = tok->GetString();
68 if(stok==
"true")
cedDump =
true;
70 if(stok==
"false")
cedDump =
false;
71 if(stok==
"root")
cedDump =
true;
72 if(stok.Contains(
"cedDump=")) {
74 cedDump_par.Remove(0,cedDump_par.Last(
'=')+1);
75 if(cedDump_par==
"true")
cedDump=
true;
76 if(cedDump_par==
"false")
cedDump=
false;
79 if(stok.Contains(
"gps=")) {
81 gps_par.Remove(0,gps_par.Last(
'=')+1);
82 if(gps_par.IsFloat()) gSystem->Setenv(
"CWB_GPS_EVENT",gps_par);
84 if(stok.Contains(
"iwindow=")) {
86 iwindow_par.Remove(0,iwindow_par.Last(
'=')+1);
87 if(iwindow_par.IsFloat())
gap=iwindow_par.Atof();
89 if(stok.Contains(
"netCC=")) {
91 netCC_par.Remove(0,netCC_par.Last(
'=')+1);
92 if(netCC_par.IsFloat())
netCC=netCC_par.Atof();
94 if(stok.Contains(
"Acore=")) {
96 Acore_par.Remove(0,Acore_par.Last(
'=')+1);
97 if(Acore_par.IsFloat())
Acore=Acore_par.Atof();
99 if(stok.Contains(
"dump=")) {
101 dump_par.Remove(0,dump_par.Last(
'=')+1);
102 if(dump_par==
"true")
dump=
true;
103 if(dump_par==
"false")
dump=
false;
105 if(stok.Contains(
"plugin=")) {
107 plugin_par.Remove(0,plugin_par.Last(
'=')+1);
108 if(plugin_par.EndsWith(
".C"))
plugin=TMacro(plugin_par);
110 if(stok.Contains(
"search=")) {
112 search_par.Remove(0,search_par.Last(
'=')+1);
113 if(search_par==
"r")
SEARCH()=
'r';
114 if(search_par==
"i")
SEARCH()=
'i';
115 if(search_par==
"p")
SEARCH()=
'p';
116 if(search_par==
"l")
SEARCH()=
'l';
117 if(search_par==
"c")
SEARCH()=
'c';
118 if(search_par==
"e")
SEARCH()=
'e';
119 if(search_par==
"s")
SEARCH()=
's';
120 if(search_par==
"g")
SEARCH()=
'g';
121 if(search_par==
"b")
SEARCH()=
'b';
123 if(stok.Contains(
"optim=")) {
125 optim_par.Remove(0,optim_par.Last(
'=')+1);
126 if(optim_par==
"true")
optim=
true;
127 if(optim_par==
"false")
optim=
false;
135 TMacro cwb_inet_plugin = gSystem->ExpandPathName(
"$HOME_WAT/tools/cwb/plugins/CWB_Plugin_cwb_inet.C");
137 char fpluginName[1024];
138 unsigned int Pid = gSystem->GetPid();
139 sprintf(fpluginName,
"%s/CWB_Plugin_cwb_inet_%s_%d_job%d.XXXXXX",
145 if(!out.good()) {cout <<
"cwb_inet.C - Error : Opening File : " << fpluginName << endl;gSystem->Exit(1);}
147 TList* fLines =
plugin.GetListOfLines();
150 out <<
"// --> BEGIN USER PLUGIN CODE" << endl;
151 while ((obj = (TObjString*)
next())) {
153 line.ReplaceAll(
"CWB_Plugin(",
"CWB_UserPlugin(");
154 out << line.Data() << endl;
156 out <<
"// --> END USER PLUGIN CODE" << endl << endl;
159 TList* fLines = cwb_inet_plugin.GetListOfLines();
162 out <<
"// --> BEGIN CWB_INET PLUGIN CODE" << endl;
163 while ((obj = (TObjString*)
next())) {
165 out << line.Data() << endl;
167 if((
TString(
plugin.GetName())!=
"")&&(line.Contains(
"CWB_Plugin("))) {
169 out <<
" CWB_UserPlugin(jfile, cfg, net, x, ifo, type); // CALL USER PLUGIN CODE" << endl;
173 out <<
"// --> END CWB_INET PLUGIN CODE" << endl;
176 if(cwb_inet_options.Contains(
"frdisplay"))
plugin = fpluginName;
177 if(cwb_inet_options.Contains(
"psd"))
plugin = fpluginName;
178 if(cwb_inet_options.Contains(
"inj"))
plugin = fpluginName;
179 if(cwb_inet_options.Contains(
"wdm"))
plugin = fpluginName;
180 if(cwb_inet_options.Contains(
"nrms"))
plugin = fpluginName;
181 if(cwb_inet_options.Contains(
"emax"))
plugin = fpluginName;
182 if(cwb_inet_options.Contains(
"sparse"))
plugin = fpluginName;
183 if(cwb_inet_options.Contains(
"ced"))
plugin = fpluginName;
184 plugin.SetName(fpluginName);
190 if(cwb_gps_event.CompareTo(
"")!=0) {
191 if(!cwb_gps_event.IsFloat()) {cout<<
"Error : CWB_GPS_EVENT is not a number" << endl;
exit(1);}
192 if(cwb_gps_event.Atoi()>0) gps_event=cwb_gps_event.Atoi();
202 TString cwb_mdc_factor=
TString(gSystem->Getenv(
"CWB_MDC_FACTOR"));
203 if(cwb_mdc_factor.CompareTo(
"")!=0) {
204 if(!cwb_mdc_factor.IsFloat()) {cout<<
"Error : CWB_MDC_FACTOR is not a number" << endl;
exit(1);}
205 if(cwb_mdc_factor.Atof()>0) mdc_factor=cwb_mdc_factor.Atof();
214 if(cwb_job_lag.CompareTo(
"")!=0) {
215 if(!cwb_job_lag.IsFloat()) {cout<<
"Error : CWB_JOB_LAG is not a number" << endl;
exit(1);}
216 job_lag=cwb_job_lag.Atoi();
240 cout<<
"lag step: "<<
lagStep<<endl;
241 cout<<
"number of time lags_ced : " << lags_ced << endl;
248 for(
int n=0;
n<
nIFO;
n++)
printf(
"%14.5f",pD_CED[
n]->lagShift.data[0]);
254 if(gps_event==0)
return;
274 cout <<
"Write file : " <<
DQF[
nDQF-1].
file << endl;
275 if (!out.good()) {cout <<
"Error Opening File : " <<
DQF[
nDQF-1].
file << endl;
exit(1);}
278 int istart =
int(gps_event)-
gap;
279 int istop =
int(gps_event)+
gap;
280 out <<
"1 " << istart <<
" " << istop <<
" " << 2*
gap << endl;
286 cout <<
"cwb_inet gps_event>1 is not implemented with : !!!" << endl;
287 cout <<
"if slagSize=1 -> slagMin=slagMax=slagOff=0, slagFile=NULL "<<endl;
291 cout <<
"cwb_inet gps_event>1 is not implemented with slagSize>1 !!!" << endl;
298 if(jobList.size()==0) {
299 cout << endl <<
"cwb_inet standard job list size = 0 !!!" << endl << endl;
302 jobSegLen = jobList[cwb_jobid-1].stop-jobList[cwb_jobid-1].start;
306 if(tShift<0) tShift=jobSegLen-
fabs(tShift);
308 int istart =
int(gps_event+tShift)-
gap;
309 int istop =
int(gps_event+tShift)+
gap;
310 out << n+1 <<
" " << istart <<
" " << istop <<
" " << 2*
gap << endl;
316 for(
int n=0;
n<
nIFO;
n++)
if(pD_CED[
n]!=NULL)
delete pD_CED[
n];
detector * getifo(size_t n)
param: detector index
virtual void resize(unsigned int)
size_t add(detector *)
param: detector structure return number of detectors in the network
virtual void rate(double r)
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
printf("total live time: non-zero lags = %10.1f \, liveTot)
TIter next(twave->GetListOfBranches())
vector< waveSegment > cat1List
wavearray< double > lagShift
double fabs(const Complex &x)
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
detectorParams detParms[4]
int setTimeShifts(size_t=1, double=1., size_t=0, size_t=0, const char *=NULL, const char *="w", size_t *=NULL)
param number of time lags param time shift step in seconds param first lag ID param maximum lag ID pa...
detector * pD_CED[NIFO_MAX]