Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_dump_job.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 // list the standard jobs (variable length) : used by the cwb_dump command
20 
21 {
23 
24  TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
25  TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
26  TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
27 
28  // output job list file
29  char ojobListFile[256];
30  sprintf(ojobListFile,"%s/%s.job",dump_dir,data_label);
31 
32  cout<<endl<<"-------------------------------------------------------------------------------------"<< endl<<endl;
33 
34  vector<waveSegment> cat1List=TB.readSegList(nDQF, DQF, CWB_CAT1);
35  double cat1_time=TB.getTimeSegList(cat1List);
36  cout << "total cat1 livetime : " << int(cat1_time) << " sec "
37  << cat1_time/3600. << " h " << cat1_time/86400. << " day" << endl;
38  cout << endl;
39 
40  vector<waveSegment> cat2List=TB.readSegList(nDQF, DQF, CWB_CAT2);
41  double cat2_time=TB.getTimeSegList(cat2List);
42 
43  vector<waveSegment> jobList=TB.getJobList(cat1List, cat2List, segLen, segMLS, segTHR, segEdge);
44  double job_time=TB.getTimeSegList(jobList);
45 
46  cout << endl;
47  cout << "cat1 livetime (zero lag) of the standard job list : " << int(job_time) << " sec "
48  << job_time/3600. << " h " << job_time/86400. << " day" << endl;
49 
50  double job_time_cat2 = TB.getLiveTime(jobList,cat2List);
51  cout << "cat1+cat2 livetime (zero lag) of the standard job list : " << int(job_time_cat2) << " sec "
52  << job_time_cat2/3600. << " h " << job_time_cat2/86400. << " day" << endl;
53 
54  cout<<endl<<"-------------------------------------------------------------------------------------"<< endl<<endl;
55 
56  cout<<"Final number of standard jobs : " << jobList.size() <<endl<<endl;
57  cout<<"Dump job list : includes jobs discarted by the condition livetime<segTHR"<<endl;
58  TB.dumpJobList(cat1List, ojobListFile, segLen, segMLS, segEdge);
59  cout << endl;
60 
61  exit(0);
62 }
double segMLS
Definition: test_config1.C:47
sprintf(ojobListFile,"%s/%s.job", dump_dir, data_label)
vector< waveSegment > jobList
Definition: cwb_dump_job.C:43
CWB::Toolbox TB
static double getLiveTime(vector< waveSegment > &jobList, vector< waveSegment > &dqList)
Definition: Toolbox.cc:2094
static double getTimeSegList(vector< waveSegment > list)
Definition: Toolbox.cc:611
double segEdge
Definition: test_config1.C:49
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
nDQF
Definition: cwb_eced.C:109
double segTHR
Definition: test_config1.C:48
char data_label[512]
Definition: test_config1.C:160
i() int(T_cor *100))
dqfile DQF[12]
Definition: test_config1.C:171
segLen
Definition: cwb_eced.C:24
double job_time
Definition: cwb_dump_job.C:44
char ojobListFile[256]
Definition: cwb_dump_job.C:29
double cat2_time
Definition: cwb_dump_job.C:41
static vector< waveSegment > getJobList(vector< waveSegment > ilist, double segLen=600., double segMLS=300., double segEdge=8.)
Definition: Toolbox.cc:646
cout<< endl<<"-------------------------------------------------------------------------------------"<< endl<< endl;vector< waveSegment > cat1List
Definition: cwb_dump_job.C:34
static void dumpJobList(vector< waveSegment > ilist, TString fName, double segLen=600., double segMLS=300., double segEdge=8.)
Definition: Toolbox.cc:625
static vector< waveSegment > readSegList(dqfile DQF)
Definition: Toolbox.cc:409
char dump_dir[512]
Definition: test_config1.C:156
cout<< "total cat1 livetime : "<< int(cat1_time)<< " sec "<< cat1_time/3600.<< " h "<< cat1_time/86400.<< " day"<< endl;cout<< endl;vector< waveSegment > cat2List
Definition: cwb_dump_job.C:40
double cat1_time
Definition: cwb_dump_job.C:35
exit(0)