Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_dump_slag.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 superlag used in production : used by the cwb_dump command
20 
21 {
22  #include <vector>
23 
25 
26  TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
27  TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
28  TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
29 
30  // check input user configuration
32  cfg.Import();
33  cfg.Check();
34 
35  vector<slag> slagList;
36  vector<slag> rslagList;
37 
38  vector<TString> ifos(nIFO);
39  for(int n=0;n<nIFO;n++) ifos[n]=ifo[n];
40 
41  char* lagslagFile = new char[256];
42  sprintf(lagslagFile,"%s/%s.lagslag",dump_dir,data_label);
43 
44  vector<waveSegment> cat1List=TB.readSegList(nDQF, DQF, CWB_CAT1);
45  int slagSegs=TB.getSlagJobList(cat1List, segLen).size();
46 
47  slagList=TB.getSlagList(nIFO, slagSize, slagSegs, slagOff, slagMin, slagMax, slagSite, slagFile);
48 
49  rslagList=TB.getSlagList(slagList, ifos, segLen, segMLS, segEdge, nDQF, DQF, CWB_CAT1);
50  cout << endl << "Number of selected jobs after cat1 : " << rslagList.size() << endl << endl;
51  rslagList=TB.getSlagList(rslagList, ifos, segLen, segTHR, segEdge, nDQF, DQF, CWB_CAT2);
52  cout << endl << "Number of selected jobs after cat2 : " << rslagList.size() << endl << endl;
53 
54  TB.dumpSlagList(rslagList, lagslagFile);
55 
56  // dump only slag
57  char* _slagFile = new char[256];
58  sprintf(_slagFile,"%s/%s.slag",dump_dir,data_label);
59  TB.dumpSlagList(slagList, _slagFile, true);
60 
61  cout << endl;
62  printf("%14s ","SLAG");
63  for(int n=0; n<nIFO; n++) printf("%8sifo[%d]","",n);
64  printf("\n");
65  for(int i=0;i<slagList.size();i++) {
66  if(slagList[i].slagId[1]==1) {
67  printf("%14d", slagList[i].slagId[0]);
68  for (int n=0; n<nIFO; n++) printf("%14d",slagList[i].slagId[n+2]);
69  printf("\n");
70  }
71  }
72  cout << endl;
73  cout << "Write lag+slag list : " << lagslagFile << endl;
74  cout << "Write slag list : " << _slagFile << endl;
75  cout << endl;
76 
77  exit(0);
78 }
double segMLS
Definition: test_config1.C:47
int slagSize
Definition: test_config1.C:65
CWB::config cfg
Definition: cwb_dump_slag.C:31
size_t * slagSite
Definition: test_config1.C:69
int slagOff
Definition: test_config1.C:68
vector< TString > ifos(nIFO)
int n
Definition: cwb_net.C:28
void Check()
Definition: config.cc:1411
int slagMax
Definition: test_config1.C:67
CWB::Toolbox TB
vector< slag > slagList
Definition: cwb_dump_slag.C:35
double segEdge
Definition: test_config1.C:49
i drho i
void Import(TString umacro="")
Definition: config.cc:352
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
char ifo[NIFO_MAX][8]
nDQF
Definition: cwb_eced.C:109
double segTHR
Definition: test_config1.C:48
#define nIFO
char data_label[512]
Definition: test_config1.C:160
dqfile DQF[12]
Definition: test_config1.C:171
static vector< waveSegment > getSlagJobList(vector< waveSegment > ilist, int seglen=600)
Definition: Toolbox.cc:1791
printf("total live time: non-zero lags = %10.1f \, liveTot)
segLen
Definition: cwb_eced.C:24
vector< waveSegment > cat1List
static vector< slag > getSlagList(size_t nIFO, size_t slagSize, int slagSegs, int slagOff, size_t slagMin, size_t slagMax, size_t *slagSite, char *slagFile=NULL)
Definition: Toolbox.cc:809
static void dumpSlagList(vector< slag > slagList, TString slagFile, bool slagOnly=false)
Definition: Toolbox.cc:1087
static vector< waveSegment > readSegList(dqfile DQF)
Definition: Toolbox.cc:409
char dump_dir[512]
Definition: test_config1.C:156
vector< slag > rslagList
Definition: cwb_dump_slag.C:36
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
slagFile
Definition: cwb_tune_slag.C:25
int slagMin
Definition: test_config1.C:66
exit(0)