Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TestReadFrames.C
Go to the documentation of this file.
1 //
2 // Test Read Frame Files
3 // Author : Gabriele Vedovato
4 
5 
6 //#define WRITE_OFILE
7 #define SORT_FILE_NAME "root/GHLTV-HBRST14_S6D_R1-Sorted.root"
8 #define JOBS_FILE_NAME "S6D_R9_segments/L1H1V1_S6D_R9_jobs.txt"
9 
10 {
11 
12  int nDQF=12;
13  dqfile DQF[12]={
14  {0 ,"S6D_R9_segments/S6D_OFFLINE_L1SCIENCE.txt" , 0, 0., false, false},
15  {0 ,"S6D_R9_segments/S6D_OFFLINE_L1_DQCAT1SEGMENTS.txt", 1, 0., true , false},
16  {0 ,"S6D_R9_segments/S6D_OFFLINE_L1_DQCAT2SEGMENTS.txt", 2, 0., true , false},
17  {0 ,"S6D_R9_segments/S6D_OFFLINE_L1_DQCAT4SEGMENTS.txt", 1, 0., true , false},
18  {1 ,"S6D_R9_segments/S6D_OFFLINE_H1SCIENCE.txt" , 0, 0., false, false},
19  {1 ,"S6D_R9_segments/S6D_OFFLINE_H1_DQCAT1SEGMENTS.txt", 1, 0., true , false},
20  {1 ,"S6D_R9_segments/S6D_OFFLINE_H1_DQCAT2SEGMENTS.txt", 2, 0., true , false},
21  {1 ,"S6D_R9_segments/S6D_OFFLINE_H1_DQCAT4SEGMENTS.txt", 1, 0., true , false},
22  {2 ,"S6D_R9_segments/S6D_OFFLINE_V1SCIENCE.txt" , 0, 0., false, false},
23  {2 ,"S6D_R9_segments/S6D_OFFLINE_V1_DQCAT1SEGMENTS.txt", 1, 0., true , false},
24  {2 ,"S6D_R9_segments/S6D_OFFLINE_V1_DQCAT2SEGMENTS.txt", 2, 0., true , false},
25  {2 ,"S6D_R9_segments/S6D_OFFLINE_V1_DQCAT4SEGMENTS.txt", 1, 0., true , false},
26  };
27 
28  cwbtb tb;
29 
30  int cat = 1;
31  std::vector<waveSegment> olist;
32  double ctime=tb.readSegList(nDQF, DQF, cat, olist);
33  cout << "ctime : " << int(ctime) << " sec " << ctime/3600. << " h " << ctime/86400. << " day" << endl;
34 
35 #ifdef WRITE_OFILE
36  tb.dumpSegList(olist,"olist.txt", false);
37 #endif
38 
40 
41  char ifile_name[256];
42  sprintf(ifile_name,"%s",JOBS_FILE_NAME);
43  cout << "Opening File : " << ifile_name << endl;
44 
45  ifstream in;
46  in.open(ifile_name,ios::in);
47  if (!in.good()) {cout << "Error Opening File : " << ifile_name << endl;exit(1);}
48 
49  frfile frf;
50  int start,stop;
51  int jobId=0;
52  while (1) {
53  in >> start >> stop;
54  if (!in.good()) break;
55  jobId++;
56  if(jobId==3991) {
57  cout << "jobId : " << jobId << " " << "start " << start << " stop " << stop << endl;
58  frf=tb.getFrList(sort_file_name, start, stop, 8);
59  tb.dumpFrList(frf, "lists/HBRST14_S6D.lst.3991");
60  }
61  }
62  cout << "OUTPUT" << endl;
63  cout << "start : " << frf.start << endl;
64  cout << "stop : " << frf.stop << endl;
65  cout << "length : " << frf.length << endl;
66  for(int n=0;n<frf.file.size();n++) {
67  cout << "file : " << frf.file[n].Data() << endl;
68  }
69 
70  olist.clear();
71 
72  exit(0);
73 }
#define SORT_FILE_NAME
Definition: TestReadFrames.C:7
int stop
Definition: Toolbox.hh:76
dqfile DQF[12]
int n
Definition: cwb_net.C:10
TString("c")
int start
Definition: Toolbox.hh:75
char ifile_name[512]
double ctime
nDQF
Definition: cwb_eced.C:92
std::vector< waveSegment > olist
int length
Definition: Toolbox.hh:77
i() int(T_cor *100))
jobId
frfile frf
#define JOBS_FILE_NAME
Definition: TestReadFrames.C:8
ifstream in
cout<< "ctime : "<< int(ctime)<< " sec "<< ctime/3600.<< " h "<< ctime/86400.<< " day"<< endl;TString sort_file_name=SORT_FILE_NAME;char ifile_name[256];sprintf(ifile_name,"%s", JOBS_FILE_NAME);cout<< "Opening File : "<< ifile_name<< endl;ifstream in;in.open(ifile_name, ios::in);if(!in.good()){cout<< "Error Opening File : "<< ifile_name<< endl;exit(1);}frfile frf;int start, stop;int jobId=0;while(1){in > start stop
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
cwbtb tb
vector< TString > file
Definition: Toolbox.hh:78
int cat
TString sort_file_name
exit(0)