Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_merge_list.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 labels of the already merged files : used by the cwb_merge 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  int iversion;
32  if(gSystem->Getenv("CWB_MERGE_LABEL")==NULL) {
33  cout << "Error : environment CWB_MERGE_LABEL is not defined!!!" << endl;exit(1);
34  } else {
35  cwb_merge_label=TString(gSystem->Getenv("CWB_MERGE_LABEL"));
36  }
37  // check if label has the correct format (M#)
38  if(cwb_merge_label[0]!='M') {
39  cout << "Error : label " << cwb_merge_label.Data() << " has bad format (M#)" << endl;exit(1);
40  } else {
41  TString lcheck=cwb_merge_label;
42  lcheck.Remove(0,1);
43  if(!lcheck.IsDigit()) {
44  cout << "Error : label " << cwb_merge_label.Data() << " has bad format (M#)" << endl;exit(1);
45  } else {
46  iversion=lcheck.Atoi();
47  }
48  }
49 
50  vector<int> jobList = TB.getMergeJobList(merge_dir,data_label,iversion);
51 
52  for(int i=0;i<jobList.size();i++) {
53  cout << i << " jobId : " << jobList[i] << endl;
54  }
55  cout << endl;
56  cout << "List Size : " << jobList.size() << endl;
57 
58  exit(0);
59 }
TString("c")
CWB::Toolbox TB
i drho i
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
static vector< int > getMergeJobList(TString merge_dir, TString label, int version)
Definition: Toolbox.cc:1698
TString cwb_merge_label
char data_label[512]
Definition: test_config1.C:160
char merge_dir[512]
Definition: test_config1.C:147
vector< int > jobList
int iversion
exit(0)