Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TestPrintAntennaPattern.C
Go to the documentation of this file.
1 //
2 // Print Antenna Pattern Components
3 // Author : Gabriele Vedovato
4 
5 
6 //#define L1_ENABLED
7 //#define H1_ENABLED
8 //#define V1_ENABLED
9 //#define H2_ENABLED
10 //#define G1_ENABLED
11 //#define T1_ENABLED
12 //#define A1_ENABLED
13 //#define A2_ENABLED
14 #define O1_ENABLED
15 #define N1_ENABLED
16 //#define E1_ENABLED
17 //#define J1_ENABLED
18 
19 void TestPrintAntennaPattern(double inj_theta, double inj_phi, double inj_psi=0., bool rad=false) {
20 
21  int nIFO=0;
22  TString ifo[12];
23  TString ifoName[12];
24 #ifdef H1_ENABLED
25  ifo[nIFO]="H1"; // LHO1
26  ifoName[nIFO++]="LHO1"; // LHO1
27 #endif
28 #ifdef L1_ENABLED
29  ifo[nIFO]="L1"; // LLO
30  ifoName[nIFO++]="LLO"; // LLO
31 #endif
32 #ifdef G1_ENABLED
33  ifo[nIFO]="G1"; // GEO
34  ifoName[nIFO++]="GEO"; // GEO
35 #endif
36 #ifdef V1_ENABLED
37  ifo[nIFO]="V1"; // VIRGO
38  ifoName[nIFO++]="VIRGO"; // VIRGO
39 #endif
40 #ifdef T1_ENABLED
41  ifo[nIFO]="T1"; // TAMA
42  ifoName[nIFO++]="TAMA"; // TAMA
43 #endif
44 #ifdef H2_ENABLED
45  ifo[nIFO]="H2"; // LHO2
46  ifoName[nIFO++]="LHO2"; // LHO2
47 #endif
48 #ifdef J1_ENABLED
49  ifo[nIFO]="J1"; // LCGT
50  ifoName[nIFO++]="LCGT"; // LCGT
51 #endif
52 #ifdef A1_ENABLED
53  ifo[nIFO]="A1"; // AIGO
54  ifoName[nIFO++]="AIGO1"; // AIGO
55 #endif
56 #ifdef A2_ENABLED
57  ifo[nIFO]="A2"; // AIGO
58  ifoName[nIFO++]="AIGO2"; // AIGO
59 #endif
60 #ifdef O1_ENABLED
61  ifo[nIFO]="O1"; // AURIGA
62  ifoName[nIFO++]="AURIGA"; // AURIGA
63 #endif
64 #ifdef N1_ENABLED
65  ifo[nIFO]="N1"; // NAUTILUS
66  ifoName[nIFO++]="NAUTILUS"; // NAUTILUS
67 #endif
68 #ifdef E1_ENABLED
69  ifo[nIFO]="E1"; // EXPLORER
70  ifoName[nIFO++]="EXPLORER"; // EXPLORER
71 #endif
72 
73  char ifostr[32]="";
74  for(int n=0; n<nIFO; n++) {
75  sprintf(ifostr,"%s %s",ifostr,ifo[n].Data());
76  }
77 
78  char ifoNamestr[32]="";
79  sprintf(ifoNamestr,"%s",ifoName[0].Data());
80  for(int n=1; n<nIFO; n++) {
81  sprintf(ifoNamestr,"%s %s",ifoNamestr,ifoName[n].Data());
82  }
83 
84  cout << "NETWORK : " << ifoNamestr << endl;
85 
86  gnetwork gNET(nIFO,ifo);
87  //for(int n=0;n<nIFO;n++) gNET.GetSite(ifo[n]);
88 
89  double Pi=TMath::Pi();
90  for(int n=0;n<nIFO;n++) {
91 
92  double theta = inj_theta;
93  double phi = inj_phi;
94  double psi = inj_psi;
95 
96  if(rad) {
97  theta = acos(inj_theta);
98  theta*= 180/Pi;
99 
100  phi = inj_phi > 0 ? inj_phi : 2*Pi+inj_phi;
101  phi*= 180/Pi;
102 
103  psi = inj_psi;
104  psi*= 180/Pi;
105  }
106 
107  cout << "phi : " << phi << " theta : " << theta << " psi : " << psi << endl;
108 
109  double Fp = gNET.GetAntennaPattern(ifo[n],phi,theta,psi,true);
110  double Fc = gNET.GetAntennaPattern(ifo[n],phi,theta,psi,false);
111 
112  cout << "IFO : " << ifo[n] << " Fp " << Fp << " Fc : " << Fc << endl;
113 
114  cout << "Delay : " << ifo[n] << "-" << ifo[0] << " "
115  << gNET.GetDelay(ifo[n],ifo[0],phi,theta) << endl;
116  }
117 
118  double Fp_dpf = gNET.GetAntennaPattern(inj_phi,inj_theta,inj_psi,true);
119  double Fc_dpf = gNET.GetAntennaPattern(inj_phi,inj_theta,inj_psi,false);
120 
121  cout << "Network : " << " Fp_dpf " << Fp_dpf << " Fc_dpf : " << Fc_dpf << " Fp_dpf/Fc_dpf : " << Fp_dpf/Fc_dpf << endl;
122 
123  exit(0);
124 }
125 
gnetwork * gNET
int n
Definition: cwb_net.C:10
TString("c")
float theta
char ifostr[64]
char ifo[NIFO_MAX][8]
#define nIFO
float phi
float psi
double Pi
double inj_phi
double GetDelay(TString ifo1, TString ifo2, double phi, double theta)
Definition: gnetwork.cc:907
double inj_theta
void TestPrintAntennaPattern(double inj_theta, double inj_phi, double inj_psi=0., bool rad=false)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
double GetAntennaPattern(double phi, double theta, double psi=0., int polarization=1)
Definition: gnetwork.cc:545
exit(0)