Logo coherent WaveBurst  
Config Reference Guide
Logo
cwb_lschunk.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 #include "ReadChunkList.C"
20 
21 #define CHUNK_FILE_LIST "Chunk_List.txt"
22 #define CHUNK_MAX_SIZE 100
23 
24 #define EXECUTE
25 
26 void cwb_lschunk(TString run, TString search="") {
27 
28  // get CWB_CONFIG
29  char cwb_config_env[1024] = "";
30  if(gSystem->Getenv("CWB_CONFIG")!=NULL) {
31  strcpy(cwb_config_env,TString(gSystem->Getenv("CWB_CONFIG")).Data());
32  }
33 
34  char chunk_file_list[1024];
35  if(search=="") {
36  sprintf(chunk_file_list,"%s/%s/CHUNKS/%s",cwb_config_env,run.Data(),CHUNK_FILE_LIST);
37  } else {
38  sprintf(chunk_file_list,"%s/%s/CHUNKS/%s/%s",cwb_config_env,run.Data(),search.Data(),CHUNK_FILE_LIST);
39  }
40  cout << chunk_file_list << endl;
41 
42  int chunk[CHUNK_MAX_SIZE];
43  double start[CHUNK_MAX_SIZE];
44  double stop[CHUNK_MAX_SIZE];
45 
46  cout << endl;
47  cout << "----------------------------------------------------------------------------------------------------" << endl;
48  cout << "chunk" << "\t\t" << "start" << "\t\t" << "stop" << "\t\t"
49  << " days\t\t" << "beg-date" << " - " << "end-date" << "\t" << "run" << endl;
50  cout << "----------------------------------------------------------------------------------------------------" << endl;
51  cout << endl;
52 
53  int nChunks = ReadChunkList(chunk_file_list, chunk, start, stop);
54 
55  cout << "----------------------------------------------------------------------------------------------------" << endl;
56  cout << endl;
57 /*
58  char ofile[1024];
59  for(int k=0;k<nChunks;k++) {
60  cout << "\t" << chunk[k] << "\t" << (int)start[k] << "\t" << (int)stop[k] << endl;
61  }
62 */
63  exit(0);
64 }
strcpy(analysis,"2G")
int ReadChunkList(TString ifile, int *chunk=NULL, double *start=NULL, double *stop=NULL)
Definition: ReadChunkList.C:22
void cwb_lschunk(TString run, TString search="")
Definition: cwb_lschunk.C:26
#define CHUNK_FILE_LIST
Definition: cwb_lschunk.C:21
#define CHUNK_MAX_SIZE
Definition: cwb_lschunk.C:22
string search
Definition: cWB_conf.py:63
string run
Definition: cWB_conf.py:6