Logo coherent WaveBurst  
Library Reference Guide
Logo
DrawAntennaPatternUdD.C
Go to the documentation of this file.
1 //
2 // Draw Antenna Pattern for user defined detectors
3 // Author : Gabriele Vedovato
4 
5 #define ODIR_NAME "."
6 #define OFILE_EXT "png"
7 //#define OFILE_EXT "root"
8 //#define WRITE_PLOT
9 
10 #define RESOLUTION 2
11 //#define RESOLUTION 4
12 
13 //#define COORDINATES "cWB"
14 #define COORDINATES "Geographic"
15 
16 //#define PROJECTION ""
17 #define PROJECTION "hammer"
18 //#define PROJECTION "sinusoidal"
19 
20 #define DISPLAY_WORLD_MAP
21 #define WORLD_MAP_DIR "$CWB_GWAT/data/"
22 
23 
24 // polarization=0 -> |Fx| DPF
25 // polarization=1 -> |F+| DPF
26 // polarization=2 -> |Fx|/|F+| DPF
27 // polarization=3 -> sqrt(|F+|^2+|Fx|^2) DPF
28 // polarization=4 -> |Fx|^2 DPF
29 // polarization=5 -> |F+|^2 DPF
30 // polarization=6 -> Fx only with 1 detector
31 // polarization=7 -> F+ only with 1 detector
32 // polarization=8 -> F1x/F2x only with 2 detectors
33 // polarization=9 -> F1+/F2+ only with 2 detectors
34 // polarization=10 -> sqrt(|F1+|^2+|F1x|^2)/sqrt(|F2+|^2+|F2x|^2) only with 2 detectors
35 // polarization=11 -> The same as (10) but averaged over psi only with 2 detectors
36 
37 using namespace CWB;
38 
39 void DrawAntennaPatternUdD(int polarization = 1, int palette = 0, bool btitle = true) {
40 
41  /*
42  // ------------------------------------------------
43  // 3 ET at cartesian vertexes
44  // ------------------------------------------------
45  int nIFO=9;
46 
47  detectorParams dP[9] = {{"X1", 0.0, 0.0, 0.0, 0, 90, 0, 30},
48  {"X2", 0.0, 0.0, 0.0, 0, 150, 0, -150},
49  {"X3", 0.0, 0.0, 0.0, 0, -90, 0, -30},
50 
51  {"Y1", 0.0, 90.0, 0.0, 0, 90, 0, 30},
52  {"Y2", 0.0, 90.0, 0.0, 0, 150, 0, -150},
53  {"Y3", 0.0, 90.0, 0.0, 0, -90, 0, -30},
54 
55  {"Z1", 90.0, 0.0, 0.0, 0, 90, 0, 30},
56  {"Z2", 90.0, 0.0, 0.0, 0, 150, 0, -150},
57  {"Z3", 90.0, 0.0, 0.0, 0, -90, 0, -30},
58  };
59  */
60  /*
61  // ------------------------------------------------
62  // 3 ET located on big circle (triangulation simmetry)
63  // ------------------------------------------------
64  int nIFO=5;
65 
66  detectorParams dP[9] = {{"X1", 0.0, 0.0, 0.0, 0, 90, 0, 30},
67  {"X2", 0.0, 0.0, 0.0, 0, 150, 0, -150},
68  {"X3", 0.0, 0.0, 0.0, 0, -90, 0, -30},
69 
70  {"Y1", 0.0, 120.0, 0.0, 0, 90, 0, 30},
71  {"Y2", 0.0, 120.0, 0.0, 0, 150, 0, -150},
72  {"Y3", 0.0, 120.0, 0.0, 0, -90, 0, -30},
73 
74  {"Z1", 0.0,-120.0, 0.0, 0, 90, 0, 30},
75  {"Z2", 0.0,-120.0, 0.0, 0, 150, 0, -150},
76  {"Z3", 0.0,-120.0, 0.0, 0, -90, 0, -30},
77  };
78  */
79  /*
80  // ------------------------------------------------
81  // 3 ET at L1,H1,V1 sites
82  // ------------------------------------------------
83  int nIFO=5;
84 
85  // V1
86  detectorParams dP[9] = {{"X1", 43.6314, 10.5045, 0.0, 0, 90, 0, 30},
87  {"X2", 43.6314, 10.5045, 0.0, 0, 150, 0, -150},
88  {"X3", 43.6314, 10.5045, 0.0, 0, -90, 0, -30},
89 
90  // L1
91  {"Y1", 30.5629, -90.7742, 0.0, 0, 90, 0, 30},
92  {"Y2", 30.5629, -90.7742, 0.0, 0, 150, 0, -150},
93  {"Y3", 30.5629, -90.7742, 0.0, 0, -90, 0, -30},
94 
95  // H1
96  {"Z1", 46.4551, -119.408, 0.0, 0, 90, 0, 30},
97  {"Z2", 46.4551, -119.408, 0.0, 0, 150, 0, -150},
98  {"Z3", 46.4551, -119.408, 0.0, 0, -90, 0, -30},
99  };
100 
101  */
102  /*
103  // ------------------------------------------------
104  // 3 LCT at L1,H1,V1 sites
105  // ------------------------------------------------
106  int nIFO=9;
107 
108  // V1
109  detectorParams dP[9] = {{"X1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)},
110  {"X2", 43.6314, 10.5045, 0.0, 0, (+180-70.5675), 0, (+135-70.5675)},
111  {"X3", 43.6314, 10.5045, 0.0, 0, ( -45-70.5675), 0, ( -90-70.5675)},
112 
113  // L1
114  {"Y1", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( -197.716)},
115  {"Y2", 30.5629, -90.7742, 0.0, 0, (+180-197.716), 0, (+135-197.716)},
116  {"Y3", 30.5629, -90.7742, 0.0, 0, ( -45-197.716), 0, ( -90-197.716)},
117 
118  // H1
119  {"Z1", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( -125.999)},
120  {"Z2", 46.4551, -119.408, 0.0, 0, (+180-125.999), 0, (+135-125.999)},
121  {"Z3", 46.4551, -119.408, 0.0, 0, ( -45-125.999), 0, ( -90-125.999)},
122  };
123  */
124  // ------------------------------------------------
125  // 3 LCI at L1,H1,V1 sites
126  // ------------------------------------------------
127  /*
128  int nIFO=5;
129 
130  // V1
131  detectorParams dP[9] = {{"X1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)},
132  {"X2", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( +45-70.5675)},
133  {"X3", 43.6314, 10.5045, 0.0, 0, ( +45-70.5675), 0, ( -70.5675)},
134 
135  // L1
136  {"Y1", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( -197.716)},
137  {"Y2", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( +45-197.716)},
138  {"Y3", 30.5629, -90.7742, 0.0, 0, ( +45-197.716), 0, ( -197.716)},
139 
140  // H1
141  {"Z1", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( -125.999)},
142  {"Z2", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( +45-125.999)},
143  {"Z3", 46.4551, -119.408, 0.0, 0, ( +45-125.999), 0, ( -125.999)},
144  };
145 
146  */
147  /*
148  // ------------------------------------------------
149  // 3 LCI at L1,H1,V1 sites
150  // ------------------------------------------------
151  int nIFO=5;
152 
153  // V1
154  detectorParams dP[9] = {{"X1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)},
155  {"X2", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( +45-70.5675)},
156  {"X3", 43.6314, 10.5045, 0.0, 0, ( +45-70.5675), 0, ( -70.5675)},
157 
158  // L1
159  {"Y1", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( -197.716)},
160  {"Y2", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( +45-197.716)},
161  {"Y3", 30.5629, -90.7742, 0.0, 0, ( +45-197.716), 0, ( -197.716)},
162 
163  // H1
164  {"Z1", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( -125.999)},
165  {"Z2", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( +45-125.999)},
166  {"Z3", 46.4551, -119.408, 0.0, 0, ( +45-125.999), 0, ( -125.999)},
167  };
168  */
169  /*
170  int nIFO=4;
171  detectorParams dP[4] = {
172  {"L2", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( +45-197.716 )}, // L2 LCI
173  {"L3", 30.5629, -90.7742, 0.0, 0, ( +45-197.716), 0, ( -197.716 )}, // L3 LCI
174 
175  {"H1", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( -125.999)}, // H1 LCI
176 
177  {"V1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)}, // V1 LCI
178  };
179  */
180  /*
181  int nIFO=4;
182  detectorParams dP[4] = {
183  {"L1", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( -197.716 )}, // L1
184 
185  {"H2", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( +45-125.999)}, // H2 LCI
186  {"H3", 46.4551, -119.408, 0.0, 0, ( +45-125.999), 0, ( -125.999)}, // H3 LCI
187 
188  {"V1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)}, // V1
189  };
190  */
191  /*
192  int nIFO=3;
193  detectorParams dP[3] = {
194  {"L1", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( -197.716 )}, // L1
195 
196  {"H1", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( -125.999)}, // H1
197 
198  {"V1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)}, // V1
199  };
200  */
201  /*
202  int nIFO=2;
203  detectorParams dP[2] = {
204  {"L2", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( +45-197.716 )}, // L2 LCI
205  {"L3", 30.5629, -90.7742, 0.0, 0, ( +45-197.716), 0, ( -197.716 )}, // L3 LCI
206  };
207  */
208  /*
209  int nIFO=2;
210  detectorParams dP[2] = {
211  {"L1", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( -197.716 )}, // L1 LCI
212  {"L3", 30.5629, -90.7742, 0.0, 0, ( 90+45-197.716), 0, ( 45 -197.716 )}, // L3 LCI
213  };
214  */
215  /*
216  int nIFO=6;
217  detectorParams dP[6] = {
218 
219  {"H1", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( -125.999)}, // H2 LCI
220  {"H4", 46.4551, -119.408, 0.0, 0, ( +90- 80.999), 0, ( +45-125.999)}, // H3 LCI
221 
222  {"V1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)}, // V1
223  {"V4", 43.6314, 10.5045, 0.0, 0, ( +90-25.5675), 0, ( -25.5675)}, // V1
224 
225  {"I1", 14.4, 76.4, 0.0, 0, ( +90+0.0 ), 0, ( +0.0 )}, // I1
226  {"I4", 14.4, 76.4, 0.0, 0, ( +90+45.0 ), 0, ( +45.0 )}, // I1
227  };
228  */
229  /*
230  int nIFO=4;
231  detectorParams dP[4] = {
232 
233  {"L1", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( -197.716 )}, // L1 LCI
234  {"H1", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( -125.999)}, // H2 LCI
235  {"H4", 46.4551, -119.408, 0.0, 0, ( +90- 80.999), 0, ( +45-125.999)}, // H3 LCI
236  {"V1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)}, // V1
237  {"V4", 43.6314, 10.5045, 0.0, 0, ( +90-25.5675), 0, ( -25.5675)}, // V1
238  {"I1", 14.4, 76.4, 0.0, 0, ( +90+0.0 ), 0, ( +0.0 )}, // I1
239  {"I4", 14.4, 76.4, 0.0, 0, ( +90+55.0 ), 0, ( +55.0 )}, // I1
240  };
241  */
242 
243  int nIFO=4;
244  detectorParams dP[4] = {
245  {"L1", 30.5629, -90.7742, 0.0, 0, ( +90-197.716), 0, ( -197.716 )}, // L1
246 
247  {"S1", 55.4, 82.6, 0.0, 0, ( +90-10.0 ), 0, ( -10.0 )}, // S1
248 
249  {"S4", 55.4, 82.6, 0.0, 0, ( +90+35.0 ), 0, ( +35.0 )}, // S1
250 
251  {"H1", 46.4551, -119.408, 0.0, 0, ( +90-125.999), 0, ( -125.999)}, // H1
252  /*
253  {"V1", 43.6314, 10.5045, 0.0, 0, ( +90-70.5675), 0, ( -70.5675)}, // V1
254  */
255  };
256 
257  // {"S4", 55.4, 82.6, 0.0, 0, ( +90+45.0 ), 0, ( +45.0 )}, // S1
258  // {"H4", 46.4551, -119.408, 0.0, 0, ( +90- 80.999), 0, ( +45-125.999)}. // H3 LCI
259 
260 
261  detector* pD[NIFO_MAX];
262  for(int n=0;n<nIFO;n++) pD[n] = new detector(dP[n]);
263  for(int n=0;n<nIFO;n++) cout << n << " " << pD[n]->Name << endl;
264 
265 
266  gnetwork* gNET = new gnetwork(nIFO,NULL,dP);
267 
268  gskymap* gSM = gNET->GetGskymap();
270 // gSM->SetOptions("LVC experiment", 300,40, 1200, 670);
271 
272 #ifdef DISPLAY_WORLD_MAP
273  TString world_map = gSystem->ExpandPathName(WORLD_MAP_DIR);
274  gSM->SetWorldMapPath(world_map.Data());
275  gSM->SetWorldMap();
276 #endif
277 
278  TString title;
279 
280  TH2D* h2 = (TH2D*)gSM->GetHistogram();
281  h2->GetXaxis()->SetTitleSize(0.05);
282  h2->GetXaxis()->SetLabelSize(0.05);
283  h2->GetYaxis()->SetTitleSize(0.05);
284  h2->GetYaxis()->SetLabelSize(0.05);
285  h2->GetYaxis()->SetLabelFont(42);
286  h2->GetYaxis()->SetLabelFont(42);
287  h2->GetXaxis()->SetTitleFont(42);
288  h2->GetYaxis()->SetTitleFont(42);
289 
290  if(polarization==3) {
291  //if(nIFO>1) h2->GetZaxis()->SetRangeUser(0,1.7);
292  if(nIFO>1) h2->GetZaxis()->SetRangeUser(0,1.0);
293  else h2->GetZaxis()->SetRangeUser(0,1.0);
294  }
295  if(polarization==2) h2->GetZaxis()->SetRangeUser(0,1.0);
296 
297  //detector* det = gNET->getifo(0);
298  //det->rotate(-70);
300  //gNET->DrawDelay("H1","L1");
301  //cout << gNET->GetDelay("H1","L1",0,50) << endl;
302  //cout << gNET->GetDelay("H1","L1",0,120) << endl;
303  //gNET->DrawCircles(100,60,kWhite);
304  //gNET->ClearCircles();
305  //gNET->DrawSites(kBlue,1.0);
306  //gNET->DrawSitesLabel(kBlue,0.05);
307  //gNET->DrawSites(kBlack,2.0);
308  //gNET->DrawSites(kBlack,2.5);
309  gNET->DrawSitesShortLabel(kBlack);
310  //gNET->DrawSitesLabel(kWhite,0.05);
311  gNET->DrawSites(kBlack,2.0);
312  gNET->DrawSitesArms(1000000,kWhite,3.0);
313 
314  //gNET->GetSite("X1");
315 
316  cout << "SkyMap Mean : " << gSM->mean() << endl;
317 
318 #ifdef WRITE_PLOT
319  char ofileName[128]=ODIR_NAME;
320  sprintf(ofileName,"%s/",ofileName);
321  for(int n=0; n<nIFO; n++) {
322  sprintf(ofileName,"%s%s",ofileName,pD[n]->Name);
323  }
324  if(polarization==0) sprintf(ofileName,"%s%s.%s",ofileName,"_Fc",OFILE_EXT);
325  if(polarization==1) sprintf(ofileName,"%s%s.%s",ofileName,"_Fp",OFILE_EXT);
326  if(polarization==2) sprintf(ofileName,"%s%s.%s",ofileName,"_Fc_over_Fp",OFILE_EXT);
327  if(polarization==3) sprintf(ofileName,"%s%s.%s",ofileName,"_Sqrt_Fp2_plus_Fc2",OFILE_EXT);
328 
329  cout << "Write : " << ofileName << endl;
330  gSM->Print(ofileName);
331  exit(0);
332 #endif
333 }
334 
#define WORLD_MAP_DIR
TH2D * GetHistogram()
Definition: gskymap.hh:138
gskymap * gSM
#define COORDINATES
#define PROJECTION
gnetwork * gNET
void DrawSitesArms(double mlength=600000., Color_t lcolor=kBlack, Size_t lwidth=1.0, Style_t lstyle=1)
Definition: gnetwork.cc:314
Definition: ced.hh:42
void DrawAntennaPattern(int polarization=-1, int dpaletteId=0, bool btitle=true, int order=6)
Definition: gnetwork.cc:674
int n
Definition: cwb_net.C:28
TString("c")
int palette
Definition: DrawGnetwork2.C:17
#define OFILE_EXT
int polarization
#define ODIR_NAME
double mean()
Definition: skymap.cc:480
#define nIFO
TString world_map
Definition: DrawGNET.C:16
void DrawSitesShortLabel(Color_t tcolor=kBlack, Size_t tsize=0.052, Font_t tfont=32)
Definition: gnetwork.cc:426
void DrawAntennaPatternUdD(int polarization=1, int palette=0, bool btitle=true)
const int NIFO_MAX
Definition: wat.hh:22
void DrawSites(Color_t mcolor=kBlack, Size_t msize=2.0, Style_t mstyle=20)
Definition: gnetwork.cc:257
void SetWorldMapPath(TString worldMapPath)
Definition: gskymap.hh:156
TString ofileName
Definition: MergeTrees.C:37
gskymap * GetGskymap()
Definition: gnetwork.hh:44
char title[256]
Definition: SSeriesExample.C:1
#define RESOLUTION
void SetWorldMap(bool drawWorldMap=true)
Definition: gskymap.hh:154
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
bool btitle
Definition: DrawGnetwork2.C:16
void Print(TString pname)
Definition: gskymap.cc:1122
void SetOptions(TString projection="hammer", TString coordinate="Geographic", double resolution=1, bool goff=false)
Definition: gskymap.cc:84
detector ** pD
exit(0)