Logo Coherent WaveBurst  
Reference Guide
Logo
 All Namespaces Files Functions Variables Macros Pages
CreateChunkCuts.C
Go to the documentation of this file.
1 #define MACRO_READ_CHUNK "/home/waveburst/O1/MACROS/ReadChunkList.C"
2 
3 #define CHUNK_MAX_SIZE 100
4 
5 #define EXECUTE
6 
7 {
8 
9  CWB::Toolbox::checkFile(MACRO_READ_CHUNK);
10 
11  // load macro
12  gROOT->LoadMacro(gSystem->ExpandPathName(MACRO_READ_CHUNK));
13 
17 
18  int nChunks = ReadChunkList(chunk,start,stop);
19 
20  char tcut[256];
21 
22  char ofile[1024];
23  sprintf(ofile,"/home/waveburst/O1/CHUNKS/O1_Chunks_Cuts.hh");
24  cout << "output file list : " << ofile << endl;
25 #ifdef EXECUTE
26  ofstream out;
27  out.open(ofile,ios::out);
28 #endif
29  for(int k=0;k<nChunks;k++) {
30 // cout << "\t" << chunk[k] << "\t" << (int)start[k] << "\t" << (int)stop[k] << endl;
31 
32  sprintf(tcut,"TCut O1_K%02d_cut(\"O1_K%02d_cut\",\"time[0]>%d && time[0]<=%d\");",chunk[k],chunk[k],start[k],stop[k]);
33 
34 #ifdef EXECUTE
35  out << tcut << endl;
36 #else
37  cout << tcut << endl;
38 #endif
39 
40  }
41 #ifdef EXECUTE
42  out.close();
43 #endif
44 
45  exit(0);
46 
47 }
int nChunks
double start[CHUNK_MAX_SIZE]
int ReadChunkList(TString ifile, int *chunk=NULL, double *start=NULL, double *stop=NULL)
Definition: ReadChunkList.C:4
char tcut[256]
int chunk[CHUNK_MAX_SIZE]
#define MACRO_READ_CHUNK
double stop[CHUNK_MAX_SIZE]
char ofile[1024]
sprintf(ofile,"/home/waveburst/O1/CHUNKS/O1_Chunks_Cuts.hh")
#define CHUNK_MAX_SIZE