22 #define CHUNK_FILE_LIST "Chunk_List.txt"
23 #define CHUNK_MAX_SIZE 100
29 if(
run!=
"O1" &&
run!=
"O2") {
30 cout <<
"CreateMergedHVETO : Error - run type not available !!!" << endl;
33 if(ifo!=
"L1" && ifo!=
"H1" && ifo!=
"V1") {
34 cout <<
"CreateMergedHVETO : Error - ifo type not available !!!" << endl;
39 char cwb_config_env[1024] =
"";
40 if(gSystem->Getenv(
"CWB_CONFIG")!=NULL) {
41 strcpy(cwb_config_env,TString(gSystem->Getenv(
"CWB_CONFIG")).Data());
44 char chunk_file_list[1024];
46 cout << chunk_file_list << endl;
52 int nChunks =
ReadChunkList(chunk_file_list, chunk, start, stop);
54 char vetoes_dir[1024];
56 char vetoes_dir_tmp[1024];
57 sprintf(vetoes_dir_tmp,
"%s/%s/DATA/%s/HVETO/tmp",cwb_config_env,
run.Data(),
calibVer.Data());
60 cout << vetoes_dir_tmp << endl << endl;
62 CWB::Toolbox::mkDir(vetoes_dir_tmp,
true,
true);
66 char ihveto_file[1024];
67 char ohveto_file[1024];
68 for(
int k=0;k<nChunks;k++) {
69 sprintf(ihveto_file,
"%s/%s/HVETO_%s_ANALYSIS%d_SEGMENTS.txt",vetoes_dir,ifo.Data(),ifo.Data(),chunk[k]);
70 sprintf(ohveto_file,
"%s/HVETO_%s_ANALYSIS%d_SEGMENTS_MERGED.txt",vetoes_dir_tmp,ifo.Data(),chunk[k]);
71 cout <<
"ihveto_file : " << ihveto_file << endl;
72 cout <<
"ohveto_file : " << ohveto_file << endl;
81 sprintf(
cmd,
"rm %s/%s/HVETO_%s_ANALYSIS_SEGMENTS_MERGED.txt",vetoes_dir,ifo.Data(),ifo.Data());
86 for(
int k=0;k<nChunks;k++) {
88 sprintf(
cmd,
"cat %s/HVETO_%s_ANALYSIS%d_SEGMENTS_MERGED.txt > %s/%s/HVETO_%s_ANALYSIS_SEGMENTS_MERGED.txt",
89 vetoes_dir_tmp,ifo.Data(),chunk[k],vetoes_dir,ifo.Data(),ifo.Data());
91 sprintf(
cmd,
"cat %s/HVETO_%s_ANALYSIS%d_SEGMENTS_MERGED.txt >> %s/%s/HVETO_%s_ANALYSIS_SEGMENTS_MERGED.txt",
92 vetoes_dir_tmp,ifo.Data(),chunk[k],vetoes_dir,ifo.Data(),ifo.Data());
101 cout << vetoes_dir_tmp << endl << endl;
103 CWB::Toolbox::rmDir(vetoes_dir_tmp,
false);
void CreateMergedHVETO(TString run, TString ifo, TString calibVer)
void MergeSegments(TString ifile, TString ofile, bool bexit=true)
int ReadChunkList(TString ifile, int *chunk=NULL, double *start=NULL, double *stop=NULL)
sprintf(tag,"wave_%s", data_label)