Logo coherent WaveBurst  
Library Reference Guide
Logo
DrawDelayIndex.C
Go to the documentation of this file.
1 //
2 // Draw Delay Time skymap for two detectors
3 // Author : Gabriele Vedovato
4 
5 #define ODIR_NAME "plots"
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 "/aufs/data9/users/vedovato/S5-VSR1-Y2/lib/skyplot/"
22 
23 // polarization=0 -> |Fx| DPF
24 // polarization=1 -> |F+| DPF
25 // polarization=2 -> |Fx|/|F+| DPF
26 // polarization=3 -> sqrt(|F+|^2+|Fx|^2) DPF
27 // polarization=4 -> |Fx|^2 DPF
28 // polarization=5 -> |F+|^2 DPF
29 // polarization=6 -> Fx only with 1 detector
30 // polarization=7 -> F+ only with 1 detector
31 // polarization=8 -> F1x/F2x only with 2 detectors
32 // polarization=9 -> F1+/F2+ only with 2 detectors
33 // polarization=10 -> sqrt(|F1+|^2+|F1x|^2)/sqrt(|F2+|^2+|F2x|^2) only with 2 detectors
34 // polarization=11 -> The same as (10) but averaged over psi only with 2 detectors
35 
36 
37 #define SKYRES 0.4
38 
39 #define SAMPLE_RATE 16384.
40 
41 #define WAT_LEVEL 3
42 #define WAT_FILTER "up2"
43 #define WAT_FILTER_LENGTH 32
44 
46 
47  int nIFO=0;
48  TString ifo[10];
49  if(network.Contains("V1")) ifo[nIFO++]="V1"; // VIRGO
50  if(network.Contains("H1")) ifo[nIFO++]="H1"; // LHO1
51  if(network.Contains("L1")) ifo[nIFO++]="L1"; // LLO
52  if(network.Contains("G1")) ifo[nIFO++]="G1"; // GEO
53  if(network.Contains("T1")) ifo[nIFO++]="T1"; // TAMA
54  if(network.Contains("H2")) ifo[nIFO++]="H2"; // LHO2
55  if(network.Contains("A1")) ifo[nIFO++]="A1"; // AIGO
56  if(network.Contains("O1")) ifo[nIFO++]="O1"; // AURIGA
57  if(network.Contains("N1")) ifo[nIFO++]="N1"; // NAUTILUS
58  if(network.Contains("E1")) ifo[nIFO++]="E1"; // EXPLORER
59  if(network.Contains("A2")) ifo[nIFO++]="A2"; // AUSTRALIAN 90°
60  if(network.Contains("J1")) ifo[nIFO++]="J1"; // JAPANESE
61 
62  if(nIFO==0) {cout << "No detectors defined !!! " << endl;exit(1);}
63 
64  char ifostr[32]="";
65  for(int n=0; n<nIFO; n++) {
66  sprintf(ifostr,"%s %s",ifostr,ifo[n].Data());
67  }
68  cout << "Network : " << ifostr << endl;
69 
70  TString title;
71 
72  gnetwork* gNET = new gnetwork;
73 
74  detector* pD[3];
75  for(int i=0; i<nIFO; i++) pD[i] = new detector((char*)ifo[i].Data()); // built in detector
76  for(int i=0; i<nIFO; i++) gNET->add(pD[i]);
77 
78  gNET->setSkyMaps(SKYRES,0,180,0,360);
79  gNET->setAntenna();
80  gNET->setDelay(const_cast<char*>(ifo[0].Data()));
81 
82  gskymap* gSM = gNET->GetGskymap();
84 // gSM->SetOptions("LVC experiment", 300,40, 1200, 670);
85 
86 #ifdef DISPLAY_WORLD_MAP
87  TString world_map = gSystem->ExpandPathName(WORLD_MAP_DIR);
88  gSM->SetWorldMapPath(world_map.Data());
89  gSM->SetWorldMap();
90 #endif
91 
92  TH2D* h2 = (TH2D*)gSM->GetHistogram();
93  h2->GetXaxis()->SetTitleSize(0.05);
94  h2->GetXaxis()->SetLabelSize(0.05);
95  h2->GetYaxis()->SetTitleSize(0.05);
96  h2->GetYaxis()->SetLabelSize(0.05);
97  h2->GetYaxis()->SetLabelFont(42);
98  h2->GetYaxis()->SetLabelFont(42);
99  h2->GetXaxis()->SetTitleFont(42);
100  h2->GetYaxis()->SetTitleFont(42);
101 
102  //h2->GetZaxis()->SetRangeUser(0,1.0);
103 
104  //gNET->DrawAntennaPattern(polarization,palette,btitle);
105  //gNET->DrawDelay("H1","L1");
106  //cout << gNET->GetDelay("H1","L1",0,50) << endl;
107  //cout << gNET->GetDelay("H1","L1",0,120) << endl;
108  //gNET->DrawCircles(100,60,kWhite);
109  //gNET->ClearCircles();
110  //gNET->DrawSites(kBlue,1.0);
111  //gNET->DrawSitesLabel(kBlue,0.05);
112  //gNET->DrawSites(kBlack,2.0);
113  //gNET->DrawSites(kBlack,2.5);
114 // gNET->DrawSitesShortLabel(kBlack);
115  //gNET->DrawSitesLabel(kWhite,0.05);
116 // gNET->DrawSites(kBlack,2.0);
117 
118  skymap sm(SKYRES,0,180,0,360);
119  int L = sm.size();
120 
121  double mTau=gNET->getDelay("MAX");
122  cout<<"maximum time delay between detectors: "<<mTau<<endl;
123  char tdf00[256];
124  sprintf(tdf00,"%s/Meyer1024wat482_00%s_L%1d.dat",gSystem->ExpandPathName("$HOME_WAT_FILTERS"),WAT_FILTER,WAT_LEVEL);
125  gNET->setDelayFilters(tdf00);
126  gNET->setDelayIndex();
127  gNET->setIndexMode(0);
128  for(int n=0;n<nIFO;n++) pD[n]=gNET->getifo(n);
129 
130 // cout << pD[0]->index.data[0] << endl;
131 
132  for(int l=0;l<L;l++) sm.set(l,pD[1]->index.data[l]);
133 
134  gskymap* smd = new gskymap(SKYRES,0,180,0,360);
135  for(int l=0;l<L;l++) {
136  double th = sm.getTheta(l);
137  double ph = sm.getPhi(l);
138  double delay=pD[1]->getTau(th,ph)-pD[0]->getTau(th,ph);
139  //double sample_rate = SAMPLE_RATE/(1<<WAT_LEVEL);
140  //double sample_rate = SAMPLE_RATE/WAT_LEVEL;
141  double sample_rate = SAMPLE_RATE;
142  double idelay=pD[1]->index.data[l]-WAT_FILTER_LENGTH;
143  idelay/=sample_rate;
144  //smd->set(l,-delay);
145  //smd->set(l,idelay);
146  //smd->set(l,idelay-mTau);
147  smd->set(l,idelay-mTau+delay);
148  }
149  smd->Draw();
150 
151 // gNET->DrawDelay("V1","H1");
152 
153  gNET->DrawSitesShortLabel(kBlack);
154  //gNET->DrawSitesLabel(kWhite,0.05);
155  gNET->DrawSites(kBlack,2.0);
156 
157 }
158 
detector * getifo(size_t n)
param: detector index
Definition: network.hh:436
TH2D * GetHistogram()
Definition: gskymap.hh:138
gskymap * gSM
#define COORDINATES
gnetwork * gNET
size_t add(detector *)
param: detector structure return number of detectors in the network
Definition: network.cc:2559
void setAntenna(detector *)
param: detector (use theta, phi index array)
Definition: network.cc:2846
#define SKYRES
#define SAMPLE_RATE
int n
Definition: cwb_net.C:28
TString("c")
void set(size_t i, double a)
Definition: gskymap.hh:128
size_t setIndexMode(size_t=0)
Definition: network.cc:8105
#define WORLD_MAP_DIR
TH2F * ph
wavearray< short > index
Definition: detector.hh:368
char ifostr[64]
double getTheta(size_t i)
Definition: skymap.hh:224
void Draw(int dpaletteId=1, Option_t *option="colfz")
Definition: gskymap.cc:460
void DrawDelayIndex(TString network="H1V1")
i drho i
#define WAT_FILTER_LENGTH
char ifo[NIFO_MAX][8]
#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 setSkyMaps(double sms, double t1, double t2, double p1, double p2)
Definition: gnetwork.hh:47
char tdf00[1024]
Definition: cwb_job_obj.C:33
void setDelayIndex(double rate)
param: MDC log file
Definition: network.cc:2896
double getDelay(const char *c="")
Definition: network.cc:2818
#define WAT_LEVEL
void DrawSites(Color_t mcolor=kBlack, Size_t msize=2.0, Style_t mstyle=20)
Definition: gnetwork.cc:257
int l
void SetWorldMapPath(TString worldMapPath)
Definition: gskymap.hh:156
#define RESOLUTION
#define WAT_FILTER
void setDelay(const char *="L1")
Definition: network.cc:2767
Definition: skymap.hh:63
#define PROJECTION
gskymap * GetGskymap()
Definition: gnetwork.hh:44
double getPhi(size_t i)
Definition: skymap.hh:164
char title[256]
Definition: SSeriesExample.C:1
void SetWorldMap(bool drawWorldMap=true)
Definition: gskymap.hh:154
double mTau
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
double getTau(double, double)
param: source theta,phi angles in degrees
Definition: detector.cc:698
void set(size_t i, double a)
param: sky index param: value to set
Definition: skymap.hh:122
void setDelayFilters(detector *=NULL)
Definition: network.cc:7739
DataType_t * data
Definition: wavearray.hh:319
size_t size()
Definition: skymap.hh:136
void SetOptions(TString projection="hammer", TString coordinate="Geographic", double resolution=1, bool goff=false)
Definition: gskymap.cc:84
detector ** pD
exit(0)