15 #include "TRotation.h"
16 #include "TPolyLine.h"
17 #include "Math/Rotation3D.h"
18 #include "Math/Vector3Dfwd.h"
23 #define WAVE_TREE_NAME "waveburst"
27 using namespace
ROOT::Math;
31 iFile = TFile::Open(fName);
32 if((iFile==NULL) || (iFile!=NULL && !iFile->IsOpen())) {
33 cout <<
"netevent::Init : Error opening root file " << fName.Data() << endl;
39 ndim = tree->GetUserInfo()->GetSize();
42 cout <<
"netevent::Init : number of detectors declared in the constructor (" << n
43 <<
") are not equals to the one ("<<ndim<<
") declared in the root file : "
44 << fName.Data() << endl;
50 <<
" not present in the root file " << fName.Data() << endl;
56 cout <<
"netevent::Init : detector number is not declared in the constructor or"
57 <<
" not present in the root file " << fName.Data() << endl;
68 if (tree == 0)
return;
113 if(
fChain->GetBranch(
"Psm")!=NULL)
fChain->SetBranchAddress(
"Psm",&
Psm);
151 cout <<
"netevent::allocate : Error - number of detectors must be > 0" << endl;
157 if (!
type)
type= (Int_t*)malloc(2*
sizeof(Int_t));
158 else type= (Int_t*)realloc(
type,2*
sizeof(Int_t));
160 else {
delete name;
name=
new string();}
169 if (!
gap)
gap= (Float_t*)malloc(
ndim*
sizeof(Float_t));
170 else gap= (Float_t*)realloc(
gap,
ndim*
sizeof(Float_t));
171 if (!
lag)
lag= (Float_t*)malloc((
ndim+1)*
sizeof(Float_t));
172 else lag= (Float_t*)realloc(
lag,(
ndim+1)*
sizeof(Float_t));
173 if (!
slag)
slag= (Float_t*)malloc((
ndim+1)*
sizeof(Float_t));
174 else slag= (Float_t*)realloc(
slag,(
ndim+1)*
sizeof(Float_t));
175 if (!
gps)
gps= (Double_t*)malloc((
ndim)*
sizeof(Double_t));
176 else gps= (Double_t*)realloc(
gps,(
ndim)*
sizeof(Double_t));
177 if (!
strain)
strain= (Double_t*)malloc(2*
sizeof(Double_t));
178 else strain= (Double_t*)realloc(
strain,2*
sizeof(Double_t));
179 if (!
phi)
phi= (Float_t*)malloc(4*
sizeof(Float_t));
180 else phi= (Float_t*)realloc(
phi,4*
sizeof(Float_t));
181 if (!
theta)
theta= (Float_t*)malloc(4*
sizeof(Float_t));
182 else theta= (Float_t*)realloc(
theta,4*
sizeof(Float_t));
183 if (!
psi)
psi= (Float_t*)malloc(2*
sizeof(Float_t));
184 else psi= (Float_t*)realloc(
psi,2*
sizeof(Float_t));
185 if (!
iota)
iota= (Float_t*)malloc(2*
sizeof(Float_t));
186 else iota= (Float_t*)realloc(
iota,2*
sizeof(Float_t));
187 if (!
bp)
bp= (Float_t*)malloc(
ndim*2*
sizeof(Float_t));
188 else bp= (Float_t*)realloc(
bp,
ndim*2*
sizeof(Float_t));
189 if (!
bx)
bx= (Float_t*)malloc(
ndim*2*
sizeof(Float_t));
190 else bx= (Float_t*)realloc(
bx,
ndim*2*
sizeof(Float_t));
192 if (!
time)
time= (Double_t*)malloc(
ndim*2*
sizeof(Double_t));
193 else time= (Double_t*)realloc(
time,
ndim*2*
sizeof(Double_t));
196 if (!
left)
left= (Float_t*)malloc(
ndim*
sizeof(Float_t));
197 else left= (Float_t*)realloc(
left,
ndim*
sizeof(Float_t));
202 if (!
stop)
stop= (Double_t*)malloc(
ndim*
sizeof(Double_t));
203 else stop= (Double_t*)realloc(
stop,
ndim*
sizeof(Double_t));
207 if (!
low)
low= (Float_t*)malloc(
ndim*
sizeof(Float_t));
208 else low= (Float_t*)realloc(
low,
ndim*
sizeof(Float_t));
209 if (!
high)
high= (Float_t*)malloc(
ndim*
sizeof(Float_t));
210 else high= (Float_t*)realloc(
high,
ndim*
sizeof(Float_t));
213 if (!
hrss)
hrss= (Double_t*)malloc(
ndim*2*
sizeof(Double_t));
214 else hrss= (Double_t*)realloc(
hrss,
ndim*2*
sizeof(Double_t));
217 if (!
null)
null= (Float_t*)malloc(
ndim*
sizeof(Float_t));
218 else null= (Float_t*)realloc(
null,
ndim*
sizeof(Float_t));
219 if (!
nill)
nill= (Float_t*)malloc(
ndim*
sizeof(Float_t));
220 else nill= (Float_t*)realloc(
nill,
ndim*
sizeof(Float_t));
221 if (!
netcc)
netcc= (Float_t*)malloc(4*
sizeof(Float_t));
222 else netcc= (Float_t*)realloc(
netcc,4*
sizeof(Float_t));
223 if (!
neted)
neted= (Float_t*)malloc(5*
sizeof(Float_t));
224 else neted= (Float_t*)realloc(
neted,5*
sizeof(Float_t));
225 if (!
rho)
rho= (Float_t*)malloc(2*
sizeof(Float_t));
226 else rho= (Float_t*)realloc(
rho,2*
sizeof(Float_t));
227 if (!
erA)
erA= (Float_t*)malloc(11*
sizeof(Float_t));
228 else erA= (Float_t*)realloc(
erA,11*
sizeof(Float_t));
229 if (!
range)
range= (Float_t*)malloc(2*
sizeof(Float_t));
230 else range= (Float_t*)realloc(
range,2*
sizeof(Float_t));
231 if (!
chirp)
chirp= (Float_t*)malloc(6*
sizeof(Float_t));
232 else chirp= (Float_t*)realloc(
chirp,6*
sizeof(Float_t));
233 if (!
eBBH)
eBBH= (Float_t*)malloc(4*
sizeof(Float_t));
234 else eBBH= (Float_t*)realloc(
eBBH,4*
sizeof(Float_t));
235 if (!
Deff)
Deff= (Float_t*)malloc(
ndim*
sizeof(Float_t));
236 else Deff= (Float_t*)realloc(
Deff,
ndim*
sizeof(Float_t));
237 if (!
mass)
mass= (Float_t*)malloc(2*
sizeof(Float_t));
238 else mass= (Float_t*)realloc(
mass,
ndim*
sizeof(Float_t));
239 if (!
spin)
spin= (Float_t*)malloc(6*
sizeof(Float_t));
240 else spin= (Float_t*)realloc(
spin,6*
sizeof(Float_t));
242 if (!
snr)
snr= (Float_t*)malloc(
ndim*
sizeof(Float_t));
243 else snr= (Float_t*)realloc(
snr,
ndim*
sizeof(Float_t));
244 if (!
xSNR)
xSNR= (Float_t*)malloc(
ndim*
sizeof(Float_t));
245 else xSNR= (Float_t*)realloc(
xSNR,
ndim*
sizeof(Float_t));
246 if (!
sSNR)
sSNR= (Float_t*)malloc(
ndim*
sizeof(Float_t));
247 else sSNR= (Float_t*)realloc(
sSNR,
ndim*
sizeof(Float_t));
248 if (!
iSNR)
iSNR= (Float_t*)malloc(
ndim*
sizeof(Float_t));
249 else iSNR= (Float_t*)realloc(
iSNR,
ndim*
sizeof(Float_t));
250 if (!
oSNR)
oSNR= (Float_t*)malloc(
ndim*
sizeof(Float_t));
251 else oSNR= (Float_t*)realloc(
oSNR,
ndim*
sizeof(Float_t));
275 for(
int i=0;
i<11;
i++)
erA[
i]=0;
285 for(
int i=0;
i<ndim+1;
i++)
slag[
i]=0;
384 return fChain->GetEntries();
390 return fChain->GetEntry(entry);
406 for(
int n=0;
n<=
ndim;
n++) this->slag[
n]=slag[
n];
511 waveTree->Branch(
"ndim", &
ndim,
"ndim/I");
512 waveTree->Branch(
"run", &
run,
"run/I");
513 waveTree->Branch(
"nevent", &
nevent,
"nevent/I");
514 waveTree->Branch(
"eventID",
eventID,
"eventID[2]/I");
515 waveTree->Branch(
"type",
type,
"type[2]/I");
516 waveTree->Branch(
"name",
name);
517 waveTree->Branch(
"rate",
rate, crate);
519 waveTree->Branch(
"usize", &
usize,
"usize/I");
520 waveTree->Branch(
"volume",
volume, cvolume);
521 waveTree->Branch(
"size",
size, csize);
523 waveTree->Branch(
"gap",
gap, cgap);
524 waveTree->Branch(
"lag",
lag, clag);
525 waveTree->Branch(
"slag",
slag, cslag);
526 waveTree->Branch(
"strain",
strain,
"strain[2]/D");
527 waveTree->Branch(
"phi",
phi,
"phi[4]/F");
528 waveTree->Branch(
"theta",
theta,
"theta[4]/F");
529 waveTree->Branch(
"psi",
psi,
"psi[2]/F");
530 waveTree->Branch(
"iota",
iota,
"iota[2]/F");
531 waveTree->Branch(
"bp",
bp, cbp);
532 waveTree->Branch(
"bx",
bx, cbx);
534 waveTree->Branch(
"time",
time, ctime);
535 waveTree->Branch(
"gps",
gps, cgps);
536 waveTree->Branch(
"left",
left, cleft);
537 waveTree->Branch(
"right",
right, cright);
538 waveTree->Branch(
"start",
start, cstart);
539 waveTree->Branch(
"stop",
stop, cstop);
540 waveTree->Branch(
"duration",
duration, cduration);
542 waveTree->Branch(
"frequency",
frequency, cfrequency);
543 waveTree->Branch(
"low",
low, clow);
544 waveTree->Branch(
"high",
high, chigh);
545 waveTree->Branch(
"bandwidth",
bandwidth, cbandwidth);
547 waveTree->Branch(
"hrss",
hrss, chrss);
548 waveTree->Branch(
"noise",
noise, cnoise);
550 waveTree->Branch(
"erA",
erA,
"erA[11]/F");
552 waveTree->Branch(
"Psm",
"skymap",&
Psm, 32000,0);
554 waveTree->Branch(
"null",
null, cnull);
555 waveTree->Branch(
"nill",
nill, cnill);
556 waveTree->Branch(
"netcc",
netcc,
"netcc[4]/F");
557 waveTree->Branch(
"neted",
neted,
"neted[5]/F");
558 waveTree->Branch(
"rho",
rho,
"rho[2]/F");
560 waveTree->Branch(
"gnet", &
gnet,
"gnet/F");
561 waveTree->Branch(
"anet", &
anet,
"anet/F");
562 waveTree->Branch(
"inet", &
inet,
"inet/F");
563 waveTree->Branch(
"ecor", &
ecor,
"ecor/F");
564 waveTree->Branch(
"norm", &
norm,
"norm/F");
565 waveTree->Branch(
"ECOR", &
ECOR,
"ECOR/F");
566 waveTree->Branch(
"penalty", &
penalty,
"penalty/F");
567 waveTree->Branch(
"likelihood", &
likelihood,
"likelihood/F");
569 waveTree->Branch(
"factor", &
factor,
"factor/F");
570 waveTree->Branch(
"chirp",
chirp, cchirp);
571 waveTree->Branch(
"range",
range, crange);
572 waveTree->Branch(
"eBBH",
eBBH, ceBBH);
573 waveTree->Branch(
"Deff",
Deff, cDeff);
574 waveTree->Branch(
"mass",
mass, cmass);
575 waveTree->Branch(
"spin",
spin, cspin);
577 waveTree->Branch(
"snr",
snr, csnr);
578 waveTree->Branch(
"xSNR",
xSNR, cxSNR);
579 waveTree->Branch(
"sSNR",
sSNR, csSNR);
580 waveTree->Branch(
"iSNR",
iSNR, ciSNR);
581 waveTree->Branch(
"oSNR",
oSNR, coSNR);
582 waveTree->Branch(
"ioSNR",
ioSNR, cioSNR);
623 for(i=0; i<6; i++)
spin[i] = a.
spin[i];
626 for(i=0; i<2; i++)
rho[
i] = a.
rho[
i];
628 for(i=0; i<4; i++)
phi[
i] = a.
phi[
i];
629 for(i=0; i<11; i++)
erA[i] = a.
erA[i];
631 for(i=0; i<4; i++)
eBBH[i] = a.
eBBH[i];
636 for(i=0; i<
ndim; i++){
698 double Pi = 3.14159265358979312;
699 this->factor =
fabs(factor);
700 factor = factor<=0 ? 1 :
fabs(factor);
702 bool pat0 = net->
pattern==0 ?
true :
false;
710 double T, injTime,
TAU, pcc;
711 double x, ndmLike, Etot;
714 std::vector<float>* vP;
715 std::vector<int>* vI;
717 bool ellips = net->
tYPe==
'i' || net->
tYPe==
'I' ||
722 bool burst = net->
tYPe==
'b' || net->
tYPe==
'B';
745 int dsize = waveTree->GetUserInfo()->GetSize();
746 if(dsize!=0 && dsize!=nIFO) {
747 cout<<
"netevent::output2G(): wrong user detector list in header tree"<<endl;
exit(1);
750 for(
int n=0;n<
nIFO;n++) {
754 waveTree->GetUserInfo()->Add(pD);
762 pwc = net->
getwc(LAG);
763 if(!pwc->
size())
return;
765 clusterID_net = pwc->
get((
char*)
"ID",0,
'S',0);
766 K = clusterID_net.
size();
769 id = size_t(clusterID_net.
data[k]+0.1);
770 if(ID&&(ID==
id)) {kid=
k;
break;}
781 rate_net = pwc->
get((
char*)
"rate",0,
'R',0);
782 vol0_net = pwc->
get((
char*)
"volume",0,
'R',0);
783 vol1_net = pwc->
get((
char*)
"VOLUME",0,
'R',0);
784 size_net = pwc->
get((
char*)
"size",0,
'R',0);
785 low_net = pwc->
get((
char*)
"low",0,
'R',0);
786 high_net = pwc->
get((
char*)
"high",0,
'R',0);
787 cFreq_net = pwc->
get((
char*)
"freq",0,
'L',0,
false);
788 duration_net = pwc->
get((
char*)
"duration",0,
'L',0,
false);
789 bandwidth_net = pwc->
get((
char*)
"bandwidth",0,
'L',0,
false);
791 for(i=1; i<=
int(nIFO); i++) {
792 start_net.
append(pwc->
get((
char*)
"start",i,
'L',0));
793 stop_net.
append(pwc->
get((
char*)
"stop",i,
'L',0));
794 noise_net.
append(pwc->
get((
char*)
"noise",i,
'S',0));
795 NOISE_net.
append(pwc->
get((
char*)
"NOISE",i,
'S',0));
799 vI = &(net->
wc_List[LAG].p_Ind[ID-1]);
802 for(i=0; i<
int(nIFO); i++)
849 for(i=0; i<5; i++) { this->
neted[
i] = 0.; }
855 for(i=0; i<
int(nIFO); i++) {
885 double xstart = this->
gps[
i]+net->
Edge;
888 if(this->
time[i]>xstop) this->
time[
i] = xstart+(this->
time[
i]-xstop);
896 this->
noise[
i] = pow(10.,noise_net.
data[m])/sqrt(inRate);
901 Aa /= pow(10.,NOISE_net.
data[m]);
911 int mdet=0;
for(i=0; i<
int(nIFO); i++)
if(this->
lag[i]==0) mdet=
i;
912 for(i=0; i<
int(nIFO); i++) {
914 double xstart = this->
gps[
i]+net->
Edge;
921 if(this->stop[i]>xstop) this->stop[
i] = xstart+(this->stop[
i]-xstop);
923 this->
duration[
i] = this->duration[mdet];
932 ind = pwc->
sArea[ID-1].size();
934 this->
erA[i] = i<ind ? pwc->sArea[ID-1][i] : 0.;
950 double chrho = this->
chirp[3]*sqrt(this->
chirp[5]);
955 if(!ellips) this->
psi[0] = gC.
arg()*180/
Pi;
969 if(T<injTime && INJ.
fill_in(net,mdcID)) {
986 this->
phi[1] = INJ.
phi[0];
987 this->
psi[1] = INJ.
psi[0];
992 for(i=0; i<6; i++) this->
spin[i] = INJ.
spin[i];
999 int idSize = pd->
RWFID.size();
1001 for (
int mm=0; mm<idSize; mm++)
if (pd->
RWFID[mm]==ID) wfIndex=mm;
1003 for(j=0; j<
nIFO; j++) {
1012 pwfINJ[
j] = INJ.
pwf[
j];
1013 if (pwfINJ[j]==NULL) {
1014 cout <<
"Error : Injected waveform not saved !!! : detector "
1019 cout <<
"Error : Reconstructed waveform not saved !!! : ID -> "
1020 << ID <<
" : detector " << net->
ifoName[
j] << endl;
1024 if (wfIndex>=0) pwfREC[
j] = pd->
RWFP[wfIndex];
1027 double rFactor = 1.;
1033 double bINJ = wfINJ->
start();
1034 double eINJ = wfINJ->
start()+wfINJ->
size()/R;
1035 double bREC = wfREC->
start();
1036 double eREC = wfREC->
start()+wfREC->
size()/R;
1041 int oINJ = bINJ>bREC ? 0 :
int((bREC-bINJ)*R+0.5);
1042 int oREC = bINJ<bREC ? 0 :
int((bINJ-bREC)*R+0.5);
1045 double startXCOR = bINJ>bREC ? bINJ : bREC;
1046 double endXCOR = eINJ<eREC ? eINJ : eREC;
1047 int sizeXCOR =
int((endXCOR-startXCOR)*R+0.5);
1050 if (sizeXCOR<=0) {*wfINJ*=1./rFactor;
continue;}
1055 for (
int i=0;i<wfINJ->
size();i++) enINJ+=wfINJ->
data[i]*wfINJ->
data[i];
1059 for (
int i=0;i<wfREC->
size();i++) enREC+=wfREC->
data[i]*wfREC->
data[i];
1062 double xcorINJ_REC=0;
1063 for (
int i=0;i<sizeXCOR;i++) xcorINJ_REC+=wfINJ->
data[i+oINJ]*wfREC->
data[i+oREC];
1066 wfREC_SUB_INJ.
resize(sizeXCOR);
1067 for (
int i=0;i<sizeXCOR;i++) wfREC_SUB_INJ.data[i]=wfREC->
data[i+oREC]-wfINJ->
data[i+oINJ];
1068 wfREC_SUB_INJ.start(startXCOR);
1069 wfREC_SUB_INJ.rate(wfREC->
rate());
1071 this->
iSNR[
j] = enINJ;
1072 this->
oSNR[
j] = enREC;
1073 this->
ioSNR[
j] = xcorINJ_REC;
1085 this->
range[1] = 0.;
1086 this->
chirp[0] = 0.;
1092 this->
theta[1] = 0.;
1099 for(i=0; i<6; i++) this->
spin[i] = 0.;
1101 for(j=0; j<
nIFO; j++) {
1114 if(this->
fP!=NULL) {
1115 fprintf(
fP,
"\n# trigger %d in lag %d for \n",
int(ID),
int(LAG));
1117 vP = &(net->
wc_List[LAG].p_Map[ID-1]);
1118 vI = &(net->
wc_List[LAG].p_Ind[ID-1]);
1122 fprintf(
fP,
"map_lenght: %d\n",
int(vP->size()));
1123 fprintf(
fP,
"#skyID theta DEC step phi R.A step probability cumulative\n");
1125 for(j=0; j<
int(vP->size()); j++) {
1128 x = (j==
int(vP->size())-1) ? 0 : x+(*vP)[
j];
1130 fprintf(
fP,
"%6d %5.1f %5.1f %6.2f %5.1f %5.1f %6.2f %e %e\n",
1137 if(waveTree!=NULL && net->
wc_List[LAG].p_Map.size()) {
1139 vP = &(net->
wc_List[LAG].p_Map[ID-1]);
1140 vI = &(net->
wc_List[LAG].p_Ind[ID-1]);
1148 for(j=0; j<
int(vP->size()); j++) {
1158 if(waveTree!=NULL) waveTree->Fill();
1175 int bLag = LAG<0 ? 0 : LAG;
1176 int eLag = LAG<0 ? net->
nLag : LAG+1;
1178 double Pi = 3.14159265358979312;
1179 this->factor =
fabs(factor);
1180 factor = factor<=0 ? 1 :
fabs(factor);
1184 double* ndm = (
double*)malloc(N*N*
sizeof(
double));
1185 int iTYPE = net->
MRA ? 0 : 1;
1191 double T, injTime,
TAU, pcc;
1192 double x, tot_null, ndmLike, Etot;
1194 std::vector<float>* vP;
1195 std::vector<int>* vI;
1197 bool ellips = net->
tYPe==
'i' || net->
tYPe==
'I' ||
1198 net->
tYPe==
'g' || net->
tYPe==
'G' ||
1199 net->
tYPe==
's' || net->
tYPe==
'S' ||
1202 bool burst = net->
tYPe==
'b' || net->
tYPe==
'B';
1237 if(waveTree!=NULL) {
1238 for(
int n=0;n<
N;n++) {
1242 waveTree->GetUserInfo()->Add(pD);
1249 for(n=bLag; n<eLag; n++){
1252 if(!p->
size())
continue;
1254 clusterID_net = p->
get((
char*)
"ID",0,
'S',iTYPE);
1255 K = clusterID_net.
size();
1276 LH_net = p->
get((
char*)
"likelihood",0,
'R',iTYPE);
1277 rate_net = p->
get((
char*)
"rate",0,
'R',iTYPE);
1278 ell_net = p->
get((
char*)
"ellipticity",0,
'R',iTYPE);
1279 psi_net = p->
get((
char*)
"psi",0,
'R',iTYPE);
1280 phi_net = p->
get((
char*)
"phi",0,
'R',iTYPE);
1281 theta_net = p->
get((
char*)
"theta",0,
'R',iTYPE);
1282 size_net = p->
get((
char*)
"size",0,
'R',iTYPE);
1283 volume_net = p->
get((
char*)
"volume",0,
'R',iTYPE);
1284 low_net = p->
get((
char*)
"low",0,
'R',iTYPE);
1285 high_net = p->
get((
char*)
"high",0,
'R',iTYPE);
1287 for(i=1; i<
int(N+1); i++)
1289 time_net.
append(p->
get((
char*)
"time",i,
'L',0));
1290 start_net.
append(p->
get((
char*)
"start",i,
'L',iTYPE));
1291 stop_net.
append(p->
get((
char*)
"stop",i,
'L',iTYPE));
1292 frequency_net.
append(p->
get((
char*)
"FREQUENCY",i,
'L',0));
1293 rSNR_net.
append(p->
get((
char*)
"SNR",i,
'R',iTYPE));
1294 gSNR_net.
append(p->
get((
char*)
"SNR",i,
'S',iTYPE));
1295 gSNR_NET.
append(p->
get((
char*)
"SNR",i,
'P',iTYPE));
1296 hrss_net.
append(p->
get((
char*)
"hrss",i,
'W',iTYPE));
1297 hrss_NET.
append(p->
get((
char*)
"hrss",i,
'U',iTYPE));
1298 noise_net.
append(p->
get((
char*)
"noise",i,
'S',iTYPE));
1299 NOISE_net.
append(p->
get((
char*)
"NOISE",i,
'S',iTYPE));
1300 energy_net.
append(p->
get((
char*)
"energy",i,
'S',iTYPE));
1301 energy_NET.
append(p->
get((
char*)
"energy",i,
'P',iTYPE));
1302 null_net.
append(p->
get((
char*)
"null",i,
'W',iTYPE));
1306 energy_net += energy_NET;
1307 energy_net *= net->
MRA ? 1.0 : 0.5;
1312 ID = size_t(clusterID_net.
data[k]+0.1);
1313 if((iID)&&(ID!=iID))
continue;
1318 net->
setndm(ID,n,
true,1);
1323 vI = &(net->
wc_List[
n].p_Ind[ID-1]);
1356 for(i=0; i<
N; i++) Etot += energy_net.
data[i*K+k];
1358 for(i=0; i<5; i++) { this->
neted[
i] = 0.; }
1407 this->
hrss[
i] = pow(pow(10.,hrss_net.
data[m]),2)+pow(pow(10.,hrss_NET.
data[m]),2);
1408 this->
hrss[
i] = sqrt(this->
hrss[i]/inRate);
1410 this->
hrss[
i] = pow(10.,hrss_net.
data[m])/sqrt(inRate);
1412 this->
noise[
i] = pow(10.,noise_net.
data[m])/sqrt(inRate);
1417 tot_null += this->
null[
i];
1418 Aa /= pow(10.,NOISE_net.
data[m]);
1425 if(x<this->
penalty) this->penalty =
x;
1433 this->
netcc[2] = 0.;
1434 this->
netcc[3] = 0.;
1436 for(i=0; i<
N; i++) {
1437 for(j=i; j<
int(N); j++) {
1443 pcc = pcc>0. ? ndm[
M]/pcc : 0.;
1446 this->
netcc[2] += x*pcc;
1448 this->
netcc[3] += x*pcc;
1451 ndmLike += ndm[M++];
1456 ind = p->
sArea[ID-1].size();
1458 this->
erA[i] = i<ind ? p->sArea[ID-1][i] : 0.;
1461 this->
netcc[0] = x/(tot_null+
x);
1464 this->
netcc[1] = x/(tot_null+
x);
1466 this->
netcc[2] /= (N-1)*ndmLike;
1467 this->
netcc[3] /= (N-1)*ndmLike;
1475 if(!ellips) this->
psi[0] = gC.
arg()*180/
Pi;
1483 for(m=0; m<
M; m++) {
1486 if(T<injTime && INJ.
fill_in(net,mdcID)) {
1503 this->
phi[1] = INJ.
phi[0];
1504 this->
psi[1] = INJ.
psi[0];
1509 for(i=0; i<6; i++) this->
spin[i] = INJ.
spin[i];
1516 int idSize = pd->
RWFID.size();
1518 for (
int mm=0; mm<idSize; mm++)
if (pd->
RWFID[mm]==ID) wfIndex=mm;
1520 for(j=0; j<
int(N); j++) {
1529 pwfINJ[
j] = INJ.
pwf[
j];
1530 if (pwfINJ[j]==NULL) {
1531 cout <<
"Error : Injected waveform not saved !!! : detector "
1536 cout <<
"Error : Reconstructed waveform not saved !!! : ID -> "
1537 << ID <<
" : detector " << net->
ifoName[
j] << endl;
1541 if (wfIndex>=0) pwfREC[
j] = pd->
RWFP[wfIndex];
1544 double rFactor = 1.;
1550 double bINJ = wfINJ->
start();
1551 double eINJ = wfINJ->
start()+wfINJ->
size()/R;
1552 double bREC = wfREC->
start();
1553 double eREC = wfREC->
start()+wfREC->
size()/R;
1558 int oINJ = bINJ>bREC ? 0 :
int((bREC-bINJ)*R+0.5);
1559 int oREC = bINJ<bREC ? 0 :
int((bINJ-bREC)*R+0.5);
1562 double startXCOR = bINJ>bREC ? bINJ : bREC;
1563 double endXCOR = eINJ<eREC ? eINJ : eREC;
1564 int sizeXCOR =
int((endXCOR-startXCOR)*R+0.5);
1567 if (sizeXCOR<=0)
continue;
1572 for (
int i=0;i<wfINJ->
size();i++) enINJ+=wfINJ->
data[i]*wfINJ->
data[i];
1577 for (
int i=0;i<sizeXCOR;i++) enREC+=wfREC->
data[i+oREC]*wfREC->
data[i+oREC];
1579 double xcorINJ_REC=0;
1580 for (
int i=0;i<sizeXCOR;i++) xcorINJ_REC+=wfINJ->
data[i+oINJ]*wfREC->
data[i+oREC];
1583 wfREC_SUB_INJ.
resize(sizeXCOR);
1584 for (
int i=0;i<sizeXCOR;i++) wfREC_SUB_INJ.data[i]=wfREC->
data[i+oREC]-wfINJ->
data[i+oINJ];
1585 wfREC_SUB_INJ.start(startXCOR);
1586 wfREC_SUB_INJ.rate(wfREC->
rate());
1587 this->
iSNR[
j] = enINJ;
1588 this->
oSNR[
j] = enREC;
1589 this->
ioSNR[
j] = xcorINJ_REC;
1601 this->
range[1] = 0.;
1602 this->
chirp[0] = 0.;
1608 this->
theta[1] = 0.;
1615 for(i=0; i<6; i++) this->
spin[i] = 0.;
1617 for(j=0; j<
int(N); j++) {
1618 this->
hrss[j+
N] = 0.;
1621 this->
time[j+
N] = 0.;
1630 if(this->
fP!=NULL) {
1631 fprintf(
fP,
"\n# trigger %d in lag %d for \n",
int(ID),
int(n));
1633 vP = &(net->
wc_List[
n].p_Map[ID-1]);
1634 vI = &(net->
wc_List[
n].p_Ind[ID-1]);
1638 fprintf(
fP,
"map_lenght: %d\n",
int(vP->size()));
1639 fprintf(
fP,
"#skyID theta DEC step phi R.A step probability cumulative\n");
1641 for(j=0; j<
int(vP->size()); j++) {
1644 x = (j==
int(vP->size())-1) ? 0 : x+(*vP)[
j];
1646 fprintf(
fP,
"%6d %5.1f %5.1f %6.2f %5.1f %5.1f %6.2f %e %e\n",
1653 if(waveTree!=NULL && net->
wc_List[n].p_Map.size()) {
1655 vP = &(net->
wc_List[
n].p_Map[ID-1]);
1656 vI = &(net->
wc_List[
n].p_Ind[ID-1]);
1664 for(j=0; j<
int(vP->size()); j++) {
1674 if(waveTree!=NULL) waveTree->Fill();
std::vector< char * > ifoName
detector * getifo(size_t n)
param: detector index
Float_t * mass
effective range for each detector
size_t append(const wavearray< DataType_t > &)
virtual void resize(unsigned int)
virtual size_t size() const
Float_t * eBBH
chirp array: 0-injmass,1-recmass,2-merr,3-tmrgr,4-terr,5-chi2
Double_t * time
beam pattern coefficients for hx
Int_t ndim
current Tree number in a TChain
Float_t * rho
biased null statistics
Float_t * high
min frequency
std::vector< netcluster > wc_List
void setSLags(float *slag)
Double_t * start
cluster duration = stopW-startW
std::vector< double > * getmdcTime()
fprintf(stdout,"start=%f duration=%f rate=%f\n", x.start(), x.size()/x.rate(), x.rate())
virtual void rate(double r)
Float_t * duration
max cluster time relative to segment start
Float_t * low
average center_of_snr frequency
wavearray< double > a(hp.size())
Int_t * size
cluster volume
Float_t * right
segment start GPS time
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
wavearray< double > get(char *name, size_t index=0, char atype='R', int type=1, bool=true)
param: string with parameter name param: index in the amplitude array, which define detector param: c...
std::vector< wavearray< double > * > RWFP
Float_t * gap
cluster union size
std::vector< vector_float > sArea
string getmdcType(size_t n)
Float_t * left
min cluster time relative to segment start
Int_t fCurrent
pointer to the analyzed TTree or TChain
double getTheta(size_t i)
Float_t * ioSNR
reconstructed snr waveform
Float_t * iota
source psi angle
TTree * fChain
root input file cointainig the analyzed TTree
double getThetaStep(size_t i)
TTree * Init(TString fName, int n)
double getPhiStep(size_t i)
virtual void start(double s)
bool getMRAwave(size_t ID, size_t lag, char atype='S', int mode=0, bool tof=false)
std::vector< detector * > ifoList
Float_t * theta
source phi angle
network ** net
NOISE_MDC_SIMULATION.
Int_t run
max size used by allocate() for the probability maps
size_t getSkyIndex(double th, double ph)
param: theta param: phi
Float_t * frequency
GPS stop time of the cluster.
wavecomplex antenna(double, double, double=0.)
param: source theta,phi, polarization angle psi in degrees
void output2G(TTree *, network *, size_t, int, double)
Int_t Psave
number of detectors
Double_t * hrss
estimated bandwidth
Int_t * volume
1/rate - wavelet time resolution
Double_t * gps
average center_of_gravity time
Double_t * stop
GPS start time of the cluster.
Float_t gnet
network energy disbalance: 0 - total, 1 - 00-phase, 2 - 90-phase
void Dump(TString analysis="2G")
Float_t * lag
time between consecutive events
Float_t * mass
detector specific effective distance
Float_t * xSNR
energy/noise_variance
std::vector< detector * > ifoList
dump file
void Show(Int_t entry=-1)
Double_t * strain
time slag [sec]
Float_t * netcc
effective correlated SNR
Float_t * slag
time lag [sec]
void output(TTree *=NULL, network *=NULL, double=0., size_t=0, int=-1)
wavearray< double > lagShift
Float_t * phi
source iota angle
Float_t * iota
[0]-reconstructed psi or phase of gc, [1]-injected psi angle
Float_t * psi
[0]-reconstructed, [1]-injected theta angle, [2]-DEC
FILE * fP
injected reconstructed xcor waveform
Float_t * phi
sqrt(h+*h+ + hx*hx)
Float_t * theta
[0]-reconstructed, [1]-injected phi angle, [2]-RA
Double_t * time
beam pattern coefficients for hx
Int_t * rate
event name: "" - prod, mdc_name - sim
WSeries< double > * getTFmap()
param: no parameters
double getNDM(size_t i, size_t j)
param: first detector param: second detector
double fabs(const Complex &x)
Float_t * nill
un-biased null statistics
Float_t * spin
mass[2], binary mass parameters
Float_t * sSNR
data-signal correlation Xk*Sk
Float_t * null
probability cc skymap
netcluster * getwc(size_t n)
param: delay index
Float_t * bx
beam pattern coefficients for hp
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
std::vector< clusterdata > cData
virtual netevent & operator=(const netevent &)
void set(size_t i, double a)
param: sky index param: value to set
string * name
event type: [0] - prod, [1]-sim
Float_t * snr
spin[6], binary spin parameters
double get(size_t i)
param: sky index
Bool_t fill_in(network *, int, bool=true)
Float_t * neted
network correlation coefficients: 0-net,1-pc,2-cc,3-net2
size_t getmdc__ID(size_t n)
for(int i=0;i< 101;++i) Cos2[2][i]=0
wavearray< double > ** pwf
[x1,y1,z1,x2,y2,z2] components of spin vector
virtual void resize(unsigned int)
bool setndm(size_t, size_t, bool=true, int=1)
param: cluster ID param: lag index param: statistic identificator param: resolution idenificator retu...
Float_t * spin
[m1,m2], binary mass parameters
bool SETNDM(size_t, size_t, bool=true, int=1)
Float_t * chirp
range to source: [0/1]-rec/inj
Float_t * Deff
injected snr in the detectors
Float_t * bp
[0]-reconstructed iota angle, [1]-injected iota angle
Float_t * iSNR
energy of reconstructed responses Sk*Sk
Int_t * eventID
event count
Float_t * bandwidth
max frequency
Int_t usize
cluster size (black pixels only)
Float_t * oSNR
injected snr waveform