3 #pragma GCC system_header
10 #include "TObjArray.h"
11 #include "TObjString.h"
17 #define WAVEFORM_NAME "Waveforms/SG554Q8d9.txt"
43 cout <<
"-----> plugins/CWB_Plugin_InjectMDC.C" << endl;
44 cout <<
"ifo " << ifo.Data() << endl;
45 cout <<
"type " << type << endl;
49 double burstMDC_theta = 7.799320e-01;
50 double burstMDC_phi = 7.720941e-01;
51 double burstMDC_psi = 3.397006;
62 theta = acos(burstMDC_theta);
64 phi = burstMDC_phi > 0 ? burstMDC_phi : 2*Pi+burstMDC_phi;
67 psi = burstMDC_psi*180/
Pi;
69 cout <<
"theta : " << theta <<
" phi : " << phi <<
" psi " << psi << endl;
77 cout << ifos[
i].Data() <<
" " << ifos[
j].Data() <<
" -> "
78 <<
gNET.
GetDelay(ifos[
i].Data(),ifos[
j].Data(),phi,theta) <<
" sec " << endl;
83 char logString[1024]=
"";
86 double SimHrss = 1.213000e-21;
87 double SimEgwR2 = 1.011301e-47;
88 double GravEn_Ampl = 1.213000e-21;
89 double Internal_x = 1.0;
90 double Internal_phi = 0.0;
91 double External_x = burstMDC_theta;
92 double External_phi = burstMDC_phi;
93 double External_psi = burstMDC_psi;
95 double FrameGPS = x->
start();
97 double EarthCtrGPS = 968654066.616913;
98 char SimName[64] =
"SG554Q8d9";
99 double SimHpHp = 1.471369e-42;
103 sprintf(logString,
"%s",GravEn_SimID);
104 sprintf(logString,
"%s %e",logString,SimHrss);
105 sprintf(logString,
"%s %e",logString,SimEgwR2);
106 sprintf(logString,
"%s %e",logString,GravEn_Ampl);
107 sprintf(logString,
"%s %e",logString,Internal_x);
108 sprintf(logString,
"%s %e",logString,Internal_phi);
109 sprintf(logString,
"%s %e",logString,External_x);
110 sprintf(logString,
"%s %e",logString,External_phi);
111 sprintf(logString,
"%s %e",logString,External_psi);
113 sprintf(logString,
"%s %10.6f",logString,FrameGPS);
114 sprintf(logString,
"%s %10.6f",logString,EarthCtrGPS);
115 sprintf(logString,
"%s %s",logString,SimName);
116 sprintf(logString,
"%s %e",logString,SimHpHp);
117 sprintf(logString,
"%s %e",logString,SimHcHc);
118 sprintf(logString,
"%s %e",logString,SimHpHc);
124 double IFOctrGPS = EarthCtrGPS;
125 if(
i>0) IFOctrGPS +=
gNET.
GetDelay(ifos[
i].Data(),ifos[0].Data(),phi,theta);
128 if(ifos[i].CompareTo(ifo)==0) {
129 tShift=IFOctrGPS-EarthCtrGPS;
133 sprintf(logString,
"%s %s %10.6f %e %e",logString,ifos[i].Data(),IFOctrGPS,IFOfPlus,IFOfCross);
135 cout << logString << endl;
138 net->
mdcList.push_back(logString);
140 net->
mdcTime.push_back(EarthCtrGPS);
142 cout << endl << endl;
146 cout << endl << endl;
147 cout <<
"--------------------------------> " <<
nmdc << endl;
148 cout << endl << endl;
149 cout << mdcstring.Data() << endl;
157 if (!in.good()) {cout <<
"Error Opening File : " <<
WAVEFORM_NAME << endl;gSystem->Exit(1);}
161 int offset = (EarthCtrGPS-FrameGPS)*x->
rate();
166 hrss+=pow(x->
data[offset+size],2);
167 if (!in.good())
break;
169 if ((offset+size)>=(
int)x->
size())
break;
176 if(tShift==0)
return;
183 cout <<
"tShift : " << tShift << endl;
184 for (
int ii=0;ii<(
int)x->
size()/2;ii++) {
185 TComplex X(x->
data[2*ii],x->
data[2*ii+1]);
186 X=X*C.Exp(TComplex(0.,-2*Pi*ii*df*tShift));
187 x->
data[2*ii]=X.Re();
188 x->
data[2*ii+1]=X.Im();
std::vector< char * > ifoName
virtual size_t size() const
virtual void rate(double r)
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1)*itime+ifreq;double time=itime *dT;double freq=(ifreq >0)?ifreq *dF:dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
string getmdcList(size_t n)
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
virtual void start(double s)
std::vector< double > mdcTime
network ** net
NOISE_MDC_SIMULATION.
std::vector< std::string > mdcList
double GetDelay(TString ifo1, TString ifo2, double phi, double theta)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
double GetAntennaPattern(double phi, double theta, double psi=0., int polarization=1)