Logo Coherent WaveBurst  
Reference Guide
Logo
 All Namespaces Files Functions Variables Macros Pages
cwb_lschunk.C
Go to the documentation of this file.
1 #define CHUNK_FILE_LIST "Chunk_List.txt"
2 #define MACRO_READ_CHUNK "ReadChunkList.C"
3 #define CHUNK_MAX_SIZE 100
4 
5 #define EXECUTE
6 
7 void cwb_lschunk(TString run) {
8 
9  // get CWB_CONFIG
10  char cwb_config_env[1024] = "";
11  if(gSystem->Getenv("CWB_CONFIG")!=NULL) {
12  strcpy(cwb_config_env,TString(gSystem->Getenv("CWB_CONFIG")).Data());
13  }
14 
15  char chunk_file_list[1024];
16  sprintf(chunk_file_list,"%s/%s/CHUNKS/%s",cwb_config_env,run.Data(),CHUNK_FILE_LIST);
17  cout << chunk_file_list << endl;
18 
19  char macro_read_chunk_path[1024];
20  sprintf(macro_read_chunk_path,"%s/MACROS/%s",cwb_config_env,MACRO_READ_CHUNK);
21 
22  CWB::Toolbox::checkFile(macro_read_chunk_path);
23 
24  // load macro
25  gROOT->LoadMacro(gSystem->ExpandPathName(macro_read_chunk_path));
26 
27  int chunk[CHUNK_MAX_SIZE];
28  double start[CHUNK_MAX_SIZE];
29  double stop[CHUNK_MAX_SIZE];
30 
31  cout << endl;
32  cout << "----------------------------------------------------------------------------------------------------" << endl;
33  cout << "chunk" << "\t\t" << "start" << "\t\t" << "stop" << "\t\t"
34  << " days\t\t" << "beg-date" << " - " << "end-date" << "\t" << "run" << endl;
35  cout << "----------------------------------------------------------------------------------------------------" << endl;
36  cout << endl;
37 
38  int nChunks = ReadChunkList(chunk_file_list, chunk, start, stop);
39 
40  cout << "----------------------------------------------------------------------------------------------------" << endl;
41  cout << endl;
42 /*
43  char ofile[1024];
44  for(int k=0;k<nChunks;k++) {
45  cout << "\t" << chunk[k] << "\t" << (int)start[k] << "\t" << (int)stop[k] << endl;
46  }
47 */
48  exit(0);
49 }
strcpy(analysis,"2G")
int nChunks
double start[CHUNK_MAX_SIZE]
int ReadChunkList(TString ifile, int *chunk=NULL, double *start=NULL, double *stop=NULL)
Definition: ReadChunkList.C:4
#define MACRO_READ_CHUNK
Definition: cwb_lschunk.C:2
int chunk[CHUNK_MAX_SIZE]
#define CHUNK_FILE_LIST
Definition: cwb_lschunk.C:1
double stop[CHUNK_MAX_SIZE]
void cwb_lschunk(TString run)
Definition: cwb_lschunk.C:7
#define CHUNK_MAX_SIZE
Definition: cwb_lschunk.C:3