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