Logo coherent WaveBurst  
Config Reference Guide
Logo
CreateUniqueSlags3ifos.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 void CreateUniqueSlags3ifos(TString odir, int nSlags=9999) {
20 
21  if(nSlags%2==0) {
22  cout << "CreateUniqueSlags3ifos - Error : nSlags must be odd !!!" << endl;
23  exit(1);
24  }
25 
26  char ofname[1024];
27  sprintf(ofname,"%s/Unique_n%d.txt",odir.Data(),nSlags);
28 
29  ofstream out;
30  out.open(ofname,ios::out);
31  if(!out.good()) {cout << "CreateUniqueSlags3ifos - Error : Opening File : " << ofname << endl;gSystem->Exit(1);}
32 
33  out << "# 0 - SLAG number" << endl;
34  out << "# 1 - slag[0]" << endl;
35  out << "# 2 - slag[1]" << endl;
36  out << "# 3 - slag[2]" << endl;
37 
38  out << 0 << "\t" << 0 << "\t" << 0 << "\t" << 0 << endl;
39  for(int i=1;i<nSlags;i++) {
40  int lag0 = 0;
41  int lag1 = i%2 ? i : nSlags-i+1;
42  int lag2 = i%2 ? nSlags-i : i-1;
43  out << i << "\t" << lag0 << "\t" << lag1 << "\t" << lag2 << endl;
44  }
45 
46  out.close();
47 
48  cout << endl << "Created file : " << ofname << endl << endl;
49 
50  exit(0);
51 }
52 
void CreateUniqueSlags3ifos(TString odir, int nSlags=9999)