21 #pragma GCC system_header 28 #include "TObjArray.h" 29 #include "TObjString.h" 35 #define WAVEFORM_NAME "Waveforms/SG554Q8d9.txt" 61 cout <<
"-----> plugins/CWB_Plugin_InjectMDC.C" << endl;
62 cout <<
"ifo " << ifo.Data() << endl;
63 cout <<
"type " << type << endl;
67 double burstMDC_theta = 7.799320e-01;
68 double burstMDC_phi = 7.720941e-01;
69 double burstMDC_psi = 3.397006;
80 theta = acos(burstMDC_theta);
82 phi = burstMDC_phi > 0 ? burstMDC_phi : 2*Pi+burstMDC_phi;
85 psi = burstMDC_psi*180/
Pi;
87 cout <<
"theta : " << theta <<
" phi : " << phi <<
" psi " << psi << endl;
95 cout << ifos[
i].Data() <<
" " << ifos[
j].Data() <<
" -> " 96 <<
gNET.
GetDelay(ifos[
i].Data(),ifos[
j].Data(),phi,theta) <<
" sec " << endl;
101 char logString[1024]=
"";
104 double SimHrss = 1.213000e-21;
105 double SimEgwR2 = 1.011301e-47;
106 double GravEn_Ampl = 1.213000e-21;
107 double Internal_x = 1.0;
108 double Internal_phi = 0.0;
109 double External_x = burstMDC_theta;
110 double External_phi = burstMDC_phi;
111 double External_psi = burstMDC_psi;
113 double FrameGPS = x->
start();
115 double EarthCtrGPS = 968654066.616913;
116 char SimName[64] =
"SG554Q8d9";
117 double SimHpHp = 1.471369e-42;
121 sprintf(logString,
"%s",GravEn_SimID);
122 sprintf(logString,
"%s %e",logString,SimHrss);
123 sprintf(logString,
"%s %e",logString,SimEgwR2);
124 sprintf(logString,
"%s %e",logString,GravEn_Ampl);
125 sprintf(logString,
"%s %e",logString,Internal_x);
126 sprintf(logString,
"%s %e",logString,Internal_phi);
127 sprintf(logString,
"%s %e",logString,External_x);
128 sprintf(logString,
"%s %e",logString,External_phi);
129 sprintf(logString,
"%s %e",logString,External_psi);
131 sprintf(logString,
"%s %10.6f",logString,FrameGPS);
132 sprintf(logString,
"%s %10.6f",logString,EarthCtrGPS);
133 sprintf(logString,
"%s %s",logString,SimName);
134 sprintf(logString,
"%s %e",logString,SimHpHp);
135 sprintf(logString,
"%s %e",logString,SimHcHc);
136 sprintf(logString,
"%s %e",logString,SimHpHc);
142 double IFOctrGPS = EarthCtrGPS;
143 if(
i>0) IFOctrGPS +=
gNET.
GetDelay(ifos[
i].Data(),ifos[0].Data(),phi,theta);
146 if(ifos[i].CompareTo(ifo)==0) {
147 tShift=IFOctrGPS-EarthCtrGPS;
151 sprintf(logString,
"%s %s %10.6f %e %e",logString,ifos[i].Data(),IFOctrGPS,IFOfPlus,IFOfCross);
153 cout << logString << endl;
156 net->
mdcList.push_back(logString);
158 net->
mdcTime.push_back(EarthCtrGPS);
160 cout << endl << endl;
164 cout << endl << endl;
165 cout <<
"--------------------------------> " <<
nmdc << endl;
166 cout << endl << endl;
167 cout << mdcstring.Data() << endl;
175 if (!in.good()) {cout <<
"Error Opening File : " <<
WAVEFORM_NAME << endl;gSystem->Exit(1);}
179 int offset = (EarthCtrGPS-FrameGPS)*x->
rate();
184 hrss+=pow(x->
data[offset+size],2);
185 if (!in.good())
break;
187 if ((offset+size)>=(
int)x->
size())
break;
194 if(tShift==0)
return;
201 cout <<
"tShift : " << tShift << endl;
202 for (
int ii=0;ii<(
int)x->
size()/2;ii++) {
203 TComplex X(x->
data[2*ii],x->
data[2*ii+1]);
204 X=X*C.Exp(TComplex(0.,-2*Pi*ii*df*tShift));
205 x->
data[2*ii]=X.Re();
206 x->
data[2*ii+1]=X.Im();
std::vector< char * > ifoName
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<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ 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.
virtual size_t size() const
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)