269 fAu=1.49597870700e11;
270 fPc=3.08567758149e16;
280 fHbar=6.58211928e-22;
314 fMapTS.LoadUTCparameterFiles();
315 for (Int_t i=0; i<3; i++)
333 for (Int_t i=0; i<6; i++)
352 for (Int_t i=0; i<5; i++)
359 for (Int_t i=0; i<10; i++)
395 for (Int_t i=0; i<2; i++)
410 if (gROOT->GetListOfCanvases()->FindObject(
"NcAstrolab"))
delete fCanvas;
452 if (fTasks) fTasks->Clear();
471 size=t.fRefs->GetSize();
472 fRefs=new TObjArray(size);
473 for (Int_t i=0; i<size; i++)
475 NcSignal* sx=(NcSignal*)t.fRefs->At(i);
476 if (sx) fRefs->AddAt(sx->Clone(),i);
482 size=t.fSigs->GetSize();
483 fSigs=new TObjArray(size);
484 for (Int_t i=0; i<size; i++)
486 NcSignal* sx=(NcSignal*)t.fSigs->At(i);
487 if (sx) fSigs->AddAt(sx->Clone(),i);
498 for (Int_t ih=0; ih<2; ih++)
503 for (Int_t i=0; i<4; i++)
505 fMarkerSize[i]=t.fMarkerSize[i];
506 fMarkerStyle[i]=t.fMarkerStyle[i];
507 fMarkerColor[i]=t.fMarkerColor[i];
514 SetTimeScramble(t.fTscmode,t.fTscmin,t.fTscmax,t.fTscfunc);
526 SetPositionScramble(t.fRscmode,t.fDscmin,t.fDscmax,t.fDscfunc,t.fThetascmin,t.fThetascmax,t.fThetascfunc,t.fPhiscmin,t.fPhiscmax,t.fPhiscfunc);
535 if (fx) fNuAngle=(TF1*)fx->Clone();
565 TString name=GetName();
566 TString title=GetTitle();
567 printf(
" *%-s::Data*",ClassName());
568 if (name!=
"") printf(
" Name : %-s",name.Data());
569 if (title!=
"") printf(
" Title : %-s",title.Data());
574 printf(
" Position longitude : ");
PrintAngle(l,
"deg",u,3);
575 printf(
" latitude : ");
PrintAngle(b,
"deg",u,3);
576 printf(
" for detector ID : %-i \n",
fLabId);
577 printf(
" Local user reference frame orientation w.r.t X0=South, Y0=East and Z0=Zenith : \n");
578 printf(
" (Note : At the Poles (e.g. IceCube) South means the Greenwich meridian) \n");
579 TString saxes[3]={
"Local X-axis",
"Local Y-axis",
"Local Z-axis"};
580 for (Int_t i=0; i<5; i+=2)
593 if (utc && mode!=4)
Date(4);
597 printf(
" ------------------ Time scrambling ----------------- \n");
600 printf(
" *** Scrambling is applied only for off-source patch (background) data generation in MatchBurstData() *** \n");
601 printf(
" *** The actual stored source and measurement data are not modified *** \n");
606 printf(
" *** Each obtained time difference will be scrambled (mode %-i) *** \n",
fTscmode);
607 printf(
" *** The angular differences are not affected *** \n");
608 printf(
" --> Tailored for scrambling entries in a specific time window without affecting \n");
609 printf(
" the event selection based on angular separation w.r.t. a source. \n");
615 printf(
" *** Each measurement is stored with a scrambled timestamp (mode %-i) *** \n",
fTscmode);
616 printf(
" *** The data of the sources are not modified *** \n");
617 printf(
" *** Off-source (background) data : At each source matching, the measurement is given a new scrambled fake timestamp *** \n");
618 printf(
" --> Tailored for blind analyses without access to the unblinded measurement data \n");
622 printf(
" *** At each source matching, the measurement is given a new scrambled fake timestamp (mode %-i) *** \n",
fTscmode);
624 printf(
" --> Possible patterns in the distribution of sources on the sky will stay intact \n");
628 printf(
" *** At each measurement matching, the source is retrieved from the storage with a scrambled fake timestamp (mode %-i) *** \n",
fTscmode);
629 printf(
" *** The measurements are not affected --> Detection efficiency is unaltered *** \n");
630 printf(
" --> Both time and angular differences will be scrambled \n");
631 printf(
" --> Possible patterns in the distribution of sources on the sky will be washed out \n");
633 TString sx=
"offsets";
634 if (abs(
fTscmode)==1) sx=
"differences";
635 printf(
" Time %-s are randomly drawn from the interval [%-g,%-g] sec. \n",sx.Data(),
fTscmin,
fTscmax);
638 printf(
" Randomising TF1 function %-s is used. \n",
fTscfunc->GetName());
642 printf(
" Uniform randomisation is used. \n");
648 printf(
" ------------------ Position scrambling ------------------ \n");
651 printf(
" *** Scrambling is applied only for off-source patch (background) data generation in MatchBurstData() *** \n");
652 printf(
" *** The actual stored source and measurement data are not modified *** \n");
656 printf(
" *** The data of the sources and the measurement timestamps are not modified *** \n");
662 printf(
" *** Each obtained angular difference will be scrambled (mode %-i) *** \n",
fRscmode);
663 printf(
" *** The time differences are not affected *** \n");
664 printf(
" ---> Tailored for scrambling entries within a specific angular range w.r.t. a source,");
665 printf(
" without affecting the event selection based on the time difference w.r.t. a transient source. \n");
666 printf(
" Angular differences are randomly drawn from the interval [%-g,%-g] degrees. \n",
fDscmin,
fDscmax);
669 printf(
" Randomising TF1 function %-s is used. \n",
fDscfunc->GetName());
673 printf(
" Homogeneous solid angle randomisation is used. \n");
679 printf(
" *** Each measurement is stored with a scrambled fake local position (mode %-i) *** \n",
fRscmode);
680 printf(
" *** Off-source (background) data : At each source matching, the measurement is given a new scrambled fake local position *** \n");
681 printf(
" --> Tailored for blind analyses without access to the unblinded measurement data \n");
686 printf(
" *** At each source matching, the measurement is given a new scrambled fake local position (mode %-i) *** \n",
fRscmode);
691 printf(
" The local coordinates (r,theta,phi) of the measurement are modified to (r+dr,theta+dtheta,phi+dphi) with : \n");
693 printf(
" dr is randomly drawn from the interval [%-g,%-g] \n",
fDscmin,
fDscmax);
696 printf(
" Randomising TF1 function %-s is used. \n",
fDscfunc->GetName());
700 printf(
" Uniform randomisation is used. \n");
706 printf(
" Randomising TF1 function %-s is used. \n",
fThetascfunc->GetName());
710 printf(
" Uniform cos(theta) randomisation is used. \n");
713 printf(
" dphi is randomly drawn from the interval [%-g,%-g] degrees. \n",
fPhiscmin,
fPhiscmax);
716 printf(
" Randomising TF1 function %-s is used. \n",
fPhiscfunc->GetName());
720 printf(
" Uniform phi randomisation is used. \n");
725 printf(
" ------------------ \n");
728 Int_t iseed,cnt1,cnt2;
730 cout <<
" *** Current settings of the internal NcRandom randomiser : iseed=" << iseed <<
" cnt1=" << cnt1 <<
" cnt2=" << cnt2 << endl;
734 cout <<
" *** The internal NcRandom randomiser is currently not intialised ***" << endl;
735 cout <<
" Automatic initialisation will be performed with the actual timestamp at the first random number request." << endl;
736 cout <<
" This will ensure different random sequences for different NcAstrolab instances." << endl;
737 cout <<
" To obtain reproducible scrambled results, please invoke SetRandomiser() before the first SetSignal() invokation." << endl;
739 printf(
" ------------------ \n");
809 Double_t r=1,theta=0,phi=0;
819 Double_t p[3]={r,theta,phi};
820 fLabPos.SetPosition(p,
"sph",
"deg");
875 SetNameTitle(
"User",
"Virtual Lab for general use");
885 if (name==
"Greenwich")
888 SetNameTitle(
"Greenwich",
"The Royal Observatory in the UK");
901 SetNameTitle(
"Amanda",
"Antarctic Muon And Neutrino Detector Array");
912 SetNameTitle(
"IceCube",
"The South Pole Neutrino Observatory");
924 SetNameTitle(
"WSRT",
"The Westerbork Synthesis Radio Telescope");
935 SetNameTitle(
"Astron",
"The Netherlands Institute for Radio Astronomy");
946 SetNameTitle(
"ARA",
"The Askaryan Radio Array at the South Pole");
956 SetNameTitle(
"RNO-G",
"The Greenland Radio Neutrino Observatory at Summit Station");
962 Int_t ids[35]={11,12,13,14,15,16,17,21,22,23,24,25,26,27,33,34,35,36,37,44,45,46,47,54,55,56,57,64,65,66,67,74,75,76,77};
963 Float_t ls[35]={-38.5023,-38.4962,-38.4901,-38.4841,-38.4780,-38.4719,-38.4657,-38.4660,-38.4599,-38.4538,-38.4477,-38.4416,-38.4355,-38.4293,
964 -38.4175,-38.4114,-38.4053,-38.3991,-38.3930,-38.3751,-38.3689,-38.3627,-38.3566,-38.3388,-38.3326,-38.3264,-38.3202,-38.3025,
965 -38.2963,-38.2900,-38.2838,-38.2662,-38.2599,-38.2537,-38.2474};
966 Float_t bs[35]={72.58923,72.60009,72.61095,72.62181,72.63267,72.64353,72.65439,72.58741,72.59827,72.60912,72.61998,72.63084,72.64170,72.65256,
967 72.60729,72.61815,72.62901,72.63987,72.65073,72.61631,72.62717,72.63803,72.64889,72.61447,72.62533,72.63618,72.64704,72.61262,
968 72.62347,72.63433,72.64518,72.61076,72.62161,72.63247,72.64332};
973 for (Int_t i=0; i<35; i++)
995 SetNameTitle(
"ARCA",
"The KM3NeT/ARCA Neutrino detector near Sicily");
1003 cout <<
" *" << ClassName() <<
"::SetExperiment* Unsupported experiment name : " << name.Data() << endl;
1004 printf(
" Experiment is set to %-s with detector identifier %-i \n",
fExperiment.Data(),
fLabId);
1054 Double_t pi=acos(-1.);
1056 Double_t offset=90.;
1057 if (u==
"rad") offset=pi/2.;
1060 fLabPos.GetPosition(p,
"sph",u);
1169 if (!
fRan)
return 0;
1171 iseed=
fRan->GetSeed();
1172 cnt1=
fRan->GetCnt1();
1173 cnt2=
fRan->GetCnt2();
1301 if (out==
"deg" || out==
"rad")
1305 printf(
"%*.*f %-s",5+ndig,ndig,b,out.Data());
1309 printf(
"%-.*f %-s",ndig,b,out.Data());
1314 Double_t epsilon=1.e-12;
1315 Int_t word=0,ddd=0,hh=0,mm=0,ss=0;
1326 s=fabs(b)-Double_t(ddd*10000+mm*100+ss);
1352 printf(
" -0d %02i' %0*.*f\"",mm,3+ndig,ndig,s);
1356 printf(
"%4id %02i' %0*.*f\"",ddd,mm,3+ndig,ndig,s);
1363 printf(
"-0d %-i' %-.*f\"",mm,ndig,s);
1367 printf(
"%-id %-i' %-.*f\"",ddd,mm,ndig,s);
1381 s=fabs(b)-Double_t(hh*10000+mm*100+ss);
1407 printf(
" -0h %02im %0*.*fs",mm,3+ndig,ndig,s);
1411 printf(
"%3ih %02im %0*.*fs",hh,mm,3+ndig,ndig,s);
1418 printf(
"-0h %-im %-.*fs",mm,ndig,s);
1422 printf(
"%-ih %-im %-.*fs",hh,mm,ndig,s);
1516 if (frame!=
"equ" && frame!=
"gal" && frame!=
"ecl" && frame!=
"hor" && frame!=
"icr" && frame!=
"loc")
return 0;
1518 if (frame==
"equ" && mode!=
"M" && mode!=
"m" && mode!=
"T" && mode!=
"t" && mode!=
"B" && mode!=
"b" && mode!=
"J" && mode!=
"j")
return 0;
1531 ts->
GetMJD(mjd,isec,ins);
1533 ts2.
SetMJD(mjd,isec,ins,ips);
1536 vec[0]=r->
GetX(1,
"sph",
"rad");
1537 vec[1]=r->
GetX(2,
"sph",
"rad");
1538 vec[2]=r->
GetX(3,
"sph",
"rad");
1549 sx=
SetSignal(&q,
"hor",mode,&ts2,jref,name,type);
1590 if (mode==
"T" || mode==
"t")
1597 if (mode==
"T" || mode==
"t" || mode==
"M" || mode==
"m")
1604 if (mode==
"B" || mode==
"b") te.
SetEpoch(1950,
"B");
1605 if (mode==
"J" || mode==
"j") te.
SetEpoch(2000,
"J");
1669 fSigs=
new TObjArray();
1673 size=
fSigs->GetSize();
1675 jlast=
fSigs->GetLast();
1678 if (jref>size)
fSigs->Expand(jref);
1682 if (jlast==jmax)
fSigs->Expand(size+1);
1700 sxsig->SetName(name);
1701 sxsig->SetTitle(
"Observed event in ICRS coordinates");
1710 fSigs->AddAt(sxsig,jref-1);
1719 fRefs=
new TObjArray();
1723 size=
fRefs->GetSize();
1725 jlast=
fRefs->GetLast();
1728 if (jref>size)
fRefs->Expand(jref);
1732 if (jlast==jmax)
fRefs->Expand(size+1);
1750 sxref->SetName(name);
1751 sxref->SetTitle(
"Reference event in ICRS coordinates");
1760 fRefs->AddAt(sxref,jref-1);
1765 if (
fRscmode !=2 || !type)
return sx;
1772 Int_t index=
fSigs->IndexOf(sx);
1809 Double_t pi=acos(-1.);
1814 Float_t temp=cosmin;
1818 Double_t cosang=
fRan->Uniform(cosmin,cosmax);
1819 dtheta=acos(cosang)*180./pi;
1835 if (vec[0]<=0) vec[0]=1e-20;
1898 if (name.Contains(
"*"))
return 0;
1908 ts->
Almanac(0,0,0,0,name,&lx,&bx,&rx);
1916 if (set && jref)
SetSignal(rx,lx,
"deg",bx,
"deg",
"ecl",ts,jref,
"M",name,type);
1921NcSignal*
NcAstrolab::SetSignal(Double_t d,Double_t a,TString au,Double_t b,TString bu,TString frame,
NcTimestamp* ts,Int_t jref,TString mode,TString name,Int_t type)
2010 Double_t vec[3]={0,0,0};
2016 if (mode!=
"M" && mode!=
"m" && mode!=
"T" && mode!=
"t" && mode!=
"B" && mode!=
"b" && mode!=
"J" && mode!=
"j")
return 0;
2050 if (frame==
"loc" || frame==
"pdir")
2071NcSignal*
NcAstrolab::SetSignal(Double_t d,Double_t a,TString au,Double_t b,TString bu,TString frame,TString s,Double_t e,Int_t jref,TString mode,TString name,Int_t type)
2158 NcSignal* sx=
SetSignal(d,a,au,b,bu,frame,&tx,jref,mode,name,type);
2245 if (!s)
return -999;
2312 TObjArray* arr=
fRefs;
2313 if (type) arr=
fSigs;
2320 n=arr->GetEntries();
2392 if (frame!=
"equ" && frame!=
"gal" && frame!=
"ecl" && frame!=
"hor" && frame!=
"icr" && frame!=
"loc")
return 0;
2394 if (frame==
"equ" && mode!=
"M" && mode!=
"m" && mode!=
"T" && mode!=
"t" && mode!=
"B" && mode!=
"b" && mode!=
"J" && mode!=
"j")
return 0;
2415 if (fabs(dt)>
fMaxDt)
return 0;
2419 TString name=sx->GetName();
2437 if (frame==
"equ" && mode!=
"J" && mode!=
"j")
2442 if (mode!=
"B" && mode!=
"b")
2454 if (mode==
"T" || mode==
"t")
Nutate(q,ts);
2547 Double_t xg=R*cos(B)*cos(L);
2548 Double_t yg=R*cos(B)*sin(L);
2549 Double_t zg=R*sin(B);
2553 ts->
Almanac(0,0,0,0,
"Earth*",&l0,&b0,&r0);
2558 Double_t x0=r0*cos(b0)*cos(l0);
2559 Double_t y0=r0*cos(b0)*sin(l0);
2560 Double_t z0=r0*sin(b0);
2568 Double_t Rh=sqrt(xh*xh+yh*yh+zh*zh);
2569 Double_t Bh=atan2(zh,sqrt(xh*xh+yh*yh));
2570 Double_t Lh=atan2(yh,xh);
2572 Double_t twopi=2.*acos(-1.);
2573 while (Lh<0) { Lh+=twopi; }
2574 while (Lh>twopi) { Lh-=twopi; }
2625 Double_t xh=R*cos(B)*cos(L);
2626 Double_t yh=R*cos(B)*sin(L);
2627 Double_t zh=R*sin(B);
2631 ts->
Almanac(0,0,0,0,
"Earth*",&l0,&b0,&r0);
2636 Double_t x0=r0*cos(b0)*cos(l0);
2637 Double_t y0=r0*cos(b0)*sin(l0);
2638 Double_t z0=r0*sin(b0);
2646 Double_t Rg=sqrt(xg*xg+yg*yg+zg*zg);
2647 Double_t Bg=atan2(zg,sqrt(xg*xg+yg*yg));
2648 Double_t Lg=atan2(yg,xg);
2650 Double_t twopi=2.*acos(-1.);
2651 while (Lg<0) { Lg+=twopi; }
2652 while (Lg>twopi) { Lg-=twopi; }
2751 if (frame==
"equ" || frame==
"gal" || frame==
"ecl" || frame==
"icr")
2872 if (j>=0) sx=
GetSignal(d,a,au,b,bu,frame,ts,j,mode,type);
2876NcSignal*
NcAstrolab::GetSignal(Double_t& d,Double_t& a,TString au,Double_t& b,TString bu,TString frame,TString s,Double_t e,Int_t jref,TString mode,Int_t type)
2957 if (s!=
"B" && s!=
"b" && s!=
"J" && s!=
"j")
return 0;
2966NcSignal*
NcAstrolab::GetSignal(Double_t& d,Double_t& a,TString au,Double_t& b,TString bu,TString frame,TString s,Double_t e,TString name,TString mode,Int_t type)
3051 if (j>=0) sx=
GetSignal(d,a,au,b,bu,frame,s,e,j,mode,type);
3078 if (jref<0)
return 0;
3086 if (!type && !
fRefs)
return 0;
3087 if (type && !
fSigs)
return 0;
3092 if (jref<=fSigs->GetSize()) sx=(
NcSignal*)
fSigs->At(jref-1);
3096 if (jref<=fRefs->GetSize()) sx=(
NcSignal*)
fRefs->At(jref-1);
3161 if (!
fRefs)
return 0;
3166 nrem=
fRefs->GetEntries();
3173 if (j>0 && j<=fRefs->GetSize())
3175 TObject* obj=
fRefs->RemoveAt(j-1);
3184 if (compress)
fRefs->Compress();
3243 TObjArray* arr=
fRefs;
3244 if (type) arr=
fSigs;
3246 if (!arr)
return nrem;
3251 nrem=arr->GetEntries();
3267 if (j>0 && j<=arr->GetSize())
3269 TObject* obj=arr->RemoveAt(j-1);
3281 Int_t n=arr->GetEntries();
3315 if (name==
"")
return nrem;
3357 if (name==
"")
return 0;
3365 TObjArray* arr=
fRefs;
3366 if (type) arr=
fSigs;
3373 for (Int_t j=1; j<=arr->GetSize(); j++)
3378 namex=sx->GetName();
3379 if (!namex.Contains(name))
continue;
3389 Int_t n=arr->GetEntries();
3412 if (name==
"")
return -1;
3416 TObjArray* arr=
fRefs;
3417 if (type) arr=
fSigs;
3419 if (!arr)
return -1;
3421 for (Int_t i=0; i<arr->GetSize(); i++)
3426 if (name==sx->GetName())
3453 TObjArray* arr=
fRefs;
3454 if (type) arr=
fSigs;
3456 if (!arr)
return -1;
3458 for (Int_t i=0; i<arr->GetSize(); i++)
3565 TString slha=
"LAHA";
3566 if (mode==
"M" || mode==
"m")
3571 else if ((mode==
"B" || mode==
"b" || mode==
"J" || mode==
"j") && emode==
"M")
3580 d=90.-r.
GetX(2,
"sph",
"deg");
3581 a=r.
GetX(3,
"sph",
"rad");
3582 if (mode==
"B" || mode==
"b") mode=
"B1950";
3583 if (mode==
"J" || mode==
"j") mode=
"J2000";
3584 cout <<
"Equatorial (" << mode.Data() <<
") | a :";
3585 if (!align) {cout <<
" ";}
PrintAngle(a,
"rad",
"hms",ndig,align);
3586 if (!align) {cout <<
" ";}
PrintAngle(a,
"rad",
"deg",ndig,align);
3588 if (!align) {cout <<
" ";}
PrintAngle(d,
"deg",
"dms",ndig,align);
3589 if (!align) {cout <<
" ";}
PrintAngle(d,
"deg",
"deg",ndig,align);
3590 cout <<
" | " << slha.Data() <<
" : ";
3592 cout <<
" ";
PrintAngle(lha,
"deg",
"deg",ndig,align);
3598 b=90.-r.
GetX(2,
"sph",
"deg");
3599 l=r.
GetX(3,
"sph",
"deg");
3600 cout <<
"Galactic | l :";
3601 if (!align) {cout <<
" ";}
PrintAngle(l,
"deg",
"deg",ndig,align);
3602 if (!align) {cout <<
" ";}
PrintAngle(l,
"deg",
"dms",ndig,align);
3604 if (!align) {cout <<
" ";}
PrintAngle(b,
"deg",
"deg",ndig,align);
3605 if (!align) {cout <<
" ";}
PrintAngle(b,
"deg",
"dms",ndig,align);
3606 cout <<
" | " << slha.Data() <<
" : ";
3608 cout <<
" ";
PrintAngle(lha,
"deg",
"deg",ndig,align);
3614 b=90.-r.
GetX(2,
"sph",
"deg");
3615 l=r.
GetX(3,
"sph",
"deg");
3616 cout <<
"ICRS | l :";
3617 if (!align) {cout <<
" ";}
PrintAngle(l,
"deg",
"deg",ndig,align);
3618 if (!align) {cout <<
" ";}
PrintAngle(l,
"deg",
"dms",ndig,align);
3620 if (!align) {cout <<
" ";}
PrintAngle(b,
"deg",
"deg",ndig,align);
3621 if (!align) {cout <<
" ";}
PrintAngle(b,
"deg",
"dms",ndig,align);
3622 cout <<
" | " << slha.Data() <<
" : ";
3624 cout <<
" ";
PrintAngle(lha,
"deg",
"deg",ndig,align);
3630 b=90.-r.
GetX(2,
"sph",
"deg");
3631 l=r.
GetX(3,
"sph",
"deg");
3632 cout <<
"Geocentric ecliptic | l :";
3633 if (!align) {cout <<
" ";}
PrintAngle(l,
"deg",
"deg",ndig,align);
3634 if (!align) {cout <<
" ";}
PrintAngle(l,
"deg",
"dms",ndig,align);
3636 if (!align) {cout <<
" ";}
PrintAngle(b,
"deg",
"deg",ndig,align);
3637 if (!align) {cout <<
" ";}
PrintAngle(b,
"deg",
"dms",ndig,align);
3638 cout <<
" | " << slha.Data() <<
" : ";
3640 cout <<
" ";
PrintAngle(lha,
"deg",
"deg",ndig,align);
3645 Double_t alt=90.-r.
GetX(2,
"sph",
"deg");
3646 Double_t azi=180.-r.
GetX(3,
"sph",
"deg");
3655 cout <<
"Horizontal | azi :";
3656 if (!align) {cout <<
" ";}
PrintAngle(azi,
"deg",
"deg",ndig,align);
3657 if (!align) {cout <<
" ";}
PrintAngle(azi,
"deg",
"dms",ndig,align);
3659 if (!align) {cout <<
" ";}
PrintAngle(alt,
"deg",
"deg",ndig,align);
3660 if (!align) {cout <<
" ";}
PrintAngle(alt,
"deg",
"dms",ndig,align);
3661 cout <<
" | " << slha.Data() <<
" : ";
3663 cout <<
" ";
PrintAngle(lha,
"deg",
"deg",ndig,align);
3668 Double_t theta=r.
GetX(2,
"sph",
"deg");
3669 Double_t phi=r.
GetX(3,
"sph",
"deg");
3670 cout <<
"Local-frame | phi :";
3671 if (!align) {cout <<
" ";}
PrintAngle(phi,
"deg",
"deg",ndig,align);
3672 if (!align) {cout <<
" ";}
PrintAngle(phi,
"deg",
"dms",ndig,align);
3673 cout <<
" | theta :";
3674 if (!align) {cout <<
" ";}
PrintAngle(theta,
"deg",
"deg",ndig,align);
3675 if (!align) {cout <<
" ";}
PrintAngle(theta,
"deg",
"dms",ndig,align);
3676 cout <<
" | " << slha.Data() <<
" : ";
3678 cout <<
" ";
PrintAngle(lha,
"deg",
"deg",ndig,align);
3683 TString name=sx->GetName();
3684 if (name !=
"") cout <<
" " << name.
Data();
3769 if (j>=0)
PrintSignal(frame,mode,ts,ndig,j,emode,type,align);
3848 if (nmax>0) width=log10(nmax);
3856 if (maxsig>maxj) maxj=maxsig;
3857 if (maxj>0) width=log10(maxj);
3865 if (mode==
"T" || mode==
"t") dform=-1;
3866 if ((mode==
"B" || mode==
"b" || mode==
"J" || mode==
"j") && emode==
"T") dform=-1;
3874 printf(
" *%-s::ListSignals* Name : %-s Title : %-s \n",ClassName(),GetName(),GetTitle());
3877 cout <<
" Timestamp of the measurement stored at index=" << j;
3881 cout <<
" *Scrambled* timestamp of the measurement stored at index=" << j;
3883 cout <<
" (Lab time offset w.r.t. UT : ";
PrintTime(
fToffset,12); cout <<
")" << endl;
3886 cout <<
" Corresponding location of this measurement" << endl;
3887 cout <<
" ";
PrintSignal(frame,mode,tx,ndig,j,emode,1); cout << endl;
3918 nstored=arr->GetEntries();
3921 for (Int_t i=1; i<=arr->GetSize(); i++)
3927 if (nmax>=0 && jlist>nmax)
break;
3930 namex=sx->GetName();
3931 if (name!=
"*" && !namex.Contains(name))
continue;
3935 printf(
" *%-s::ListSignals* Name : %-s Title : %-s \n",ClassName(),GetName(),GetTitle());
3939 cout <<
" User provided timestamp (Lab time offset w.r.t. UT : ";
PrintTime(
fToffset,12); cout <<
")";
3949 cout <<
" Current timestamp of the laboratory (Lab time offset w.r.t. UT : ";
PrintTime(
fToffset,12); cout <<
")";
3959 if (nmax<0 || nmax>=nstored)
3965 cout <<
" === All stored reference signals according to the above timestamp ===" << endl;
3969 cout <<
" === All stored reference signals according to their actual recorded timestamp ===" << endl;
3976 cout <<
" === All stored measurements according to their actual observation timestamp ===" << endl;
3980 cout <<
" === All stored measurements according to their *scrambled* observation timestamp ===" << endl;
3981 cout <<
" === Time scrambling was performed by adding dt from the interval [dtmin,dtmax] to their actual timestamp" << endl;
3982 cout <<
" === dtmin : " <<
fTscmin <<
" dtmax : " <<
fTscmax <<
" sec.";
3985 cout <<
" Randomising TF1 function " <<
fTscfunc->GetName() <<
" was used." << endl;
3989 cout <<
" Uniform randomisation was used." << endl;
4000 cout <<
" === The first " << nmax <<
" stored reference signals according to the above timestamp ===" << endl;
4004 cout <<
" === The first " << nmax <<
" stored reference signals according to their actual recorded timestamp ===" << endl;
4011 cout <<
" === The first " << nmax <<
" stored measurements according to their actual observation timestamp ===" << endl;
4015 cout <<
" === The first " << nmax <<
" stored measurements according to their *scrambled* observation timestamp ===" << endl;
4016 cout <<
" === Time scrambling was performed by adding dt from the interval [dtmin,dtmax] to their actual timestamp" << endl;
4017 cout <<
" === dtmin : " <<
fTscmin <<
" dtmax : " <<
fTscmax <<
" sec.";
4020 cout <<
" Randomising TF1 function " <<
fTscfunc->GetName() <<
" was used." << endl;
4024 cout <<
" Uniform randomisation was used." << endl;
4031 if (type==1 || (!type && j<0)) tx=0;
4032 printf(
" Index : %*d ",width,i);
PrintSignal(frame,mode,tx,ndig,i,emode,type,kTRUE); printf(
"\n");
4115 Double_t pi=acos(-1.);
4119 Double_t x=-16.6170;
4123 a*=pi/(180.*3600.*1000.);
4124 x*=pi/(180.*3600.*1000.);
4125 e*=pi/(180.*3600.*1000.);
4128 mat[0]=1.-0.5*(a*a+x*x);
4132 mat[4]=1.-0.5*(a*a+e*e);
4136 mat[8]=1.-0.5*(e*e+x*x);
4154 Double_t mat[9]={0,0,0,0,0,0,0,0,0};
4161 Double_t pi=acos(-1.);
4163 Double_t t=(ts->
GetJD()-2451545.0)/36525.;
4166 Double_t eps0=84381.406;
4167 Double_t psi=5038.481507*t-1.0790069*pow(t,2)-0.00114045*pow(t,3)+0.000132851*pow(t,4)
4168 -0.0000000951*pow(t,4);
4169 Double_t om=eps0-0.025754*t+0.0512623*pow(t,2)-0.00772503*pow(t,3)-0.000000467*pow(t,4)
4170 +0.0000003337*pow(t,5);
4171 Double_t chi=10.556403*t-2.3814292*pow(t,2)-0.00121197*pow(t,3)+0.000170663*pow(t,4)
4172 -0.0000000560*pow(t,5);
4175 eps0*=pi/(180.*3600.);
4176 psi*=pi/(180.*3600.);
4177 om*=pi/(180.*3600.);
4178 chi*=pi/(180.*3600.);
4180 Double_t s1=sin(eps0);
4181 Double_t s2=sin(-psi);
4182 Double_t s3=sin(-om);
4183 Double_t s4=sin(chi);
4184 Double_t c1=cos(eps0);
4185 Double_t c2=cos(-psi);
4186 Double_t c3=cos(-om);
4187 Double_t c4=cos(chi);
4189 mat[0]=c4*c2-s2*s4*c3;
4190 mat[1]=c4*s2*c1+s4*c3*c2*c1-s1*s4*s3;
4191 mat[2]=c4*s2*s1+s4*c3*c2*s1+c1*s4*s3;
4192 mat[3]=-s4*c2-s2*c4*c3;
4193 mat[4]=-s4*s2*c1+c4*c3*c2*c1-s1*c4*s3;
4194 mat[5]=-s4*s2*s1+c4*c3*c2*s1+c1*c4*s3;
4196 mat[7]=-s3*c2*c1-s1*c3;
4197 mat[8]=-s3*c2*s1+c3*c1;
4213 Double_t mat[9]={0,0,0,0,0,0,0,0,0};
4220 Double_t pi=acos(-1.);
4222 Double_t dpsi,deps,eps;
4223 ts->
Almanac(&dpsi,&deps,&eps);
4226 dpsi*=pi/(180.*3600.);
4227 deps*=pi/(180.*3600.);
4228 eps*=pi/(180.*3600.);
4230 Double_t s1=sin(eps);
4231 Double_t s2=sin(-dpsi);
4232 Double_t s3=sin(-(eps+deps));
4233 Double_t c1=cos(eps);
4234 Double_t c2=cos(-dpsi);
4235 Double_t c3=cos(-(eps+deps));
4241 mat[4]=c3*c2*c1-s1*s3;
4242 mat[5]=c3*c2*s1+c1*s3;
4244 mat[7]=-s3*c2*c1-s1*c3;
4245 mat[8]=-s3*c2*s1+c3*c1;
4270 Double_t vec[3]={1,0,0};
4307 fG.SetAngles(x.
GetX(2,
"sph",
"deg"),x.
GetX(3,
"sph",
"deg"),
4308 y.
GetX(2,
"sph",
"deg"),y.
GetX(3,
"sph",
"deg"),
4309 z.
GetX(2,
"sph",
"deg"),z.
GetX(3,
"sph",
"deg"));
4323 Double_t dpsi,deps,eps;
4324 ts->
Almanac(&dpsi,&deps,&eps);
4333 Double_t theta2=90.-eps;
4335 Double_t theta3=eps;
4338 fE.SetAngles(theta1,phi1,theta2,phi2,theta3,phi3);
4363 Double_t vec[3]={1,0,0};
4382 fH.SetAngles(x.
GetX(2,
"sph",
"deg"),x.
GetX(3,
"sph",
"deg"),
4383 y.
GetX(2,
"sph",
"deg"),y.
GetX(3,
"sph",
"deg"),
4384 z.
GetX(2,
"sph",
"deg"),z.
GetX(3,
"sph",
"deg"));
4421 fL.SetAngles(t1,p1,t2,p2,t3,p3);
4475 if (in==out)
return a;
4478 Double_t pi=acos(-1.);
4479 Double_t epsilon=1.e-12;
4480 Int_t word=0,ddd=0,hh=0,mm=0,ss=0;
4485 if (in==
"rad") b*=180./pi;
4487 if (in==
"hrs") b*=15.;
4496 s=b-Double_t(ddd*10000+mm*100+ss);
4497 b=Double_t(ddd)+Double_t(mm)/60.+(Double_t(ss)+s)/3600.;
4507 s=b-Double_t(hh*10000+mm*100+ss);
4508 b=15.*(Double_t(hh)+Double_t(mm)/60.+(Double_t(ss)+s)/3600.);
4516 if (out==
"rad") b*=pi/180.;
4518 if (out==
"hrs") b/=15.;
4549 b=Double_t(10000*ddd+100*mm+ss)+s;
4582 b=Double_t(10000*hh+100*mm+ss)+s;
4614 omega=(ph2-ph1)*(cos(th1)-cos(th2));
4615 if (omega<0) omega=-omega;
4660 if (mode==
"M" || mode==
"m")
GetSignal(d,a,
"deg",b,
"deg",
"equ",ts,jref,
"M",type);
4661 if (mode==
"A" || mode==
"a")
GetSignal(d,a,
"deg",b,
"deg",
"equ",ts,jref,
"T",type);
4876 MatchSignals(matches,da,au,dt,tu,mode,j,j,0,1,1,1);
4888 MatchSignals(matches,da,au,dt,tu,mode,1,0,0,1,1,1);
4911Double_t
NcAstrolab::GetSeparation(TString name1,TString name2,TString au,Double_t* dt,TString tu,Int_t mode,Double_t* diftheta,Double_t* difphi)
4990 Double_t da=
GetSeparation(i,j,au,dtx,tu,mode,0,diftheta,difphi);
4992Double_t dthetax,dphix;
4994printf(
" i=%-i j=%-i da=%-g dt=%-g %-s dtheta=%-g dphi=%-g %-s \n",i,j,da,dtx,tu.Data(),dthetax,dphix,au.Data());
5000Double_t
NcAstrolab::GetSeparation(Int_t i,Int_t j,TString au,Double_t& dt,TString tu,Int_t mode,Int_t bkgpatch,Double_t* diftheta,Double_t* difphi)
5052 if (diftheta) *diftheta=-999;
5053 if (difphi) *difphi=-999;
5055 if (!i || !j)
return dang;
5056 if ((i>0 || j>0) && !
fRefs)
return dang;
5057 if ((i<0 || j<0) && !
fSigs)
return dang;
5089 if (!si || !sj)
return dang;
5093 if (!ti || !tj)
return dang;
5140 TString name=sxref->GetName();
5157 if (Tscmode==1 || Tscmode==3 || (Tscmode<0 && bkgpatch))
5168 if (Tscmode==3 || (abs(Tscmode)>1 && bkgpatch)) txtmp.
AddSec(trndm);
5172 if (Tscmode==1 || (Tscmode==-1 && bkgpatch))
5176 trndm/=double(24*3600);
5196 name=sxref->GetName();
5200 GetSignal(rxevt,
"loc",
"T",txevt,idxevt,evttype);
5201 GetSignal(rxref,
"loc",
"T",&txtmp,idxref,reftype);
5204 Double_t pi=acos(-1.);
5213 if (Rscmode==1 || (Rscmode==-1 && bkgpatch))
5221 Float_t temp=cosmin;
5225 cosang=
fRan->Uniform(cosmin,cosmax);
5227 if (au==
"deg") dang*=180./pi;
5232 if (au==
"rad") dang*=pi/180.;
5237 if (Rscmode==3 || (abs(Rscmode)>1 && bkgpatch))
5272 Float_t temp=cosmin;
5276 cosang=
fRan->Uniform(cosmin,cosmax);
5277 dtheta=acos(cosang)*180./pi;
5293 if (vec[0]<=0) vec[0]=1e-20;
5306 dtheta=vec[1]-refvec[1];
5307 dphi=vec[2]-refvec[2];
5308 if (diftheta) *diftheta=dtheta;
5309 if (difphi) *difphi=dphi;
5400 MatchSignals(matches,da,au,dt,tu,mode,1,0,0,1,1,1);
5403 if (!nhits)
return 0;
5411 for (Int_t i=1; i<=nhits; i++)
5424 if (!jfill)
return 0;
5429void NcAstrolab::MatchSignals(
NcDevice& matches,Double_t da,TString au,Double_t dt,TString tu,Int_t mode,Int_t i1,Int_t i2,Int_t itype,Int_t j1,Int_t j2,Int_t jtype)
5547 TString name=
"Matches";
5548 TString title=
"Space and time matchings of NcAstrolab stored signals";
5549 matches.SetNameTitle(name.Data(),title.Data());
5551 if (tu==
"d") tux=
"days";
5552 if (tu==
"s") tux=
"sec";
5553 TString namedamin=
"psimin in ";
5555 TString namedtmin=
"dtmin in ";
5563 TString nameda=
"psi in ";
5565 TString namedt=
"t2-t1 in ";
5574 if ((!itype || !jtype) && !
fRefs)
5576 printf(
" *%-s::MatchSignals* Error: itype=%-i jtype=%-i but no reference signals are present. \n",ClassName(),itype,jtype);
5580 if ((itype || jtype) && !
fSigs)
5582 printf(
" *%-s::MatchSignals* Error: itype=%-i jtype=%-i but no measurements are present. \n",ClassName(),itype,jtype);
5597 if (i2<1 || i2>nrefs) i2=nrefs;
5601 if (i2<1 || i2>nsigs) i2=nsigs;
5605 if (j2<1 || j2>nrefs) j2=nrefs;
5609 if (j2<1 || j2>nsigs) j2=nsigs;
5612 if (i1<1 || j1<1 || i1>i2 || j1>j2)
5614 printf(
" *%-s::MatchSignals* Inconsistent parameters: i1=%-i i2=%-i itype=%-i j1=%-i j2=%-i jtype=%-i. \n",ClassName(),i1,i2,itype,j1,j2,jtype);
5618 Double_t dang,dtime;
5628 for (Int_t i=i1; i<=i2; i++)
5633 for (Int_t j=j1; j<=j2; j++)
5636 if (itype==jtype && i==j)
continue;
5643 if ((fabs(dang)<=da || da<0) && (fabs(dtime)<=dt || dt<0))
5649 name+=sx->GetName();
5653 title+=sx->GetName();
5655 data.SetNameTitle(name.Data(),title.Data());
5656 data.SetUniqueID(
id);
5666 if (first || fabs(dang)<dangmin)
5673 if (first || fabs(dtime)<fabs(dtmin))
5691void NcAstrolab::MatchSignals(
NcDevice& matches,TString name,Double_t da,TString au,Double_t dt,TString tu,Int_t mode,Int_t itype,Int_t j1,Int_t j2,Int_t jtype)
5814 printf(
" *%-s::MatchSignals* Object %-s not found for itype=%-i. \n",ClassName(),name.Data(),itype);
5818 MatchSignals(matches,da,au,dt,tu,mode,i,i,itype,j1,j2,jtype);
5907 if (tmax>tmin)
fTscfunc->SetRange(tmin,tmax);
6031 if (abs(mode)==1 && dmin<0) dmin=0;
6032 if (abs(mode)==1 && dmax>180) dmax=180;
6035 if (dmax<dmin) dmax=dmin;
6036 if (thmax<thmin) thmax=thmin;
6037 if (phimax<phimin) phimax=phimin;
6050 if (dmax>dmin)
fDscfunc->SetRange(dmin,dmax);
6074 if (phimax>phimin)
fPhiscfunc->SetRange(phimin,phimax);
6246 sx=
GetSignal(r,frame,mode,ts,jref,type);
6252 TString namesave=sx->GetName();
6259 Double_t pi=acos(-1.);
6261 if (frame==
"equ" || frame==
"gal" || frame==
"icr" || frame==
"ecl" || frame==
"loc")
6263 theta=(pi/2.)-r.
GetX(2,
"sph",
"rad");
6264 phi=r.
GetX(3,
"sph",
"rad");
6269 theta=(pi/2.)-r.
GetX(2,
"sph",
"rad");
6270 phi=pi-r.
GetX(3,
"sph",
"rad");
6281 if (frame==
"gal" || frame==
"icr" || frame==
"ecl")
6286 if (frame==
"hor" || frame==
"loc")
6302 if (proj==
"hamh" || proj==
"aith" || proj==
"merh" || proj==
"cylh" || proj==
"angh") hist=1;
6303 if (proj==
"UTh" || proj==
"LTh" || proj==
"GSTh" || proj==
"LSTh") hist=1;
6304 if (proj==
"UYh" || proj==
"LYh" || proj==
"GSYh" || proj==
"LSYh") hist=1;
6309 if (!
fCanvas || !(gROOT->GetListOfCanvases()->FindObject(
"NcAstrolab")))
fCanvas=
new TCanvas(
"NcAstrolab",
"Skymap");
6327 titleup+=
"Geocentric Equatorial (";
6329 if (mode==
"J") titleup+=
"2000";
6330 if (mode==
"B") titleup+=
"1950";
6333 if (frame==
"gal") titleup+=
"Heliocentric Galactic";
6334 if (frame==
"ecl") titleup+=
" Geocentric Ecliptic";
6335 if (frame==
"hor") titleup+=
" Standard Horizon";
6336 if (frame==
"icr") titleup+=
"Static Barycentric ICRS";
6339 titleup+=
" User defined Local";
6343 titleup+=
" Coordinates";
6344 titlelow=
"Projection : ";
6345 if (proj==
"ham" || proj==
"hamh") titlelow+=
"Hammer";
6346 if (proj==
"cyl" || proj==
"cylh") titlelow+=
"Cylindrical";
6347 if (proj==
"ait" || proj==
"aith") titlelow+=
"Aitoff";
6348 if (proj==
"mer" || proj==
"merh") titlelow+=
"Mercator";
6349 if (proj==
"ang" || proj==
"angh")
6351 titlelow+=
"sin(b) vs. l";
6355 titlelow+=
" Central Meridian : ";
6357 Int_t angmax,hmin,hmax,dmin,dmax;
6463 if (clr==1 || proj!=
fProj)
6485 Float_t xmargin=0.5;
6486 Float_t ymargin=0.3;
6487 fCanvas->Range(xlow-xmargin,ylow-ymargin,xup+xmargin,yup+ymargin);
6490 if (proj==
"ham" || proj==
"ait")
6493 TEllipse* outline=
new TEllipse(0,0,xup,yup);
6503 const Int_t nphi=13;
6504 Double_t gphiarr[nphi]={0,30,60,90,120,150,180,210,240,270,300,330,360};
6508 Float_t gstep=180./float(ndots);
6511 for (Int_t iph=0; iph<nphi; iph++)
6513 gphi=gphiarr[iph]*pi/180.;
6514 if (frame==
"hor") gphi=pi-gphi;
6516 for (Int_t ith=1; ith<ndots; ith++)
6518 gtheta=gtheta-(gstep*pi/180.);
6519 Project(gphi,gtheta,proj,xgrid,ygrid);
6530 Double_t gtharr[nth]={15,30,45,60,75,105,120,135,150,165};
6533 gstep=360./float(ndots);
6539 for (Int_t ith=0; ith<nth; ith++)
6541 gtheta=pi/2.-(gtharr[ith]*pi/180.);
6542 igs=int(90.-gtharr[ith]);
6543 if (frame==
"loc") igs=int(gtharr[ith]);
6548 for (Int_t iphi=1; iphi<ndots; iphi++)
6551 Project(gphi,gtheta,proj,xgrid,ygrid);
6567 if (proj==
"ham" || proj==
"ait")
6569 lgs->DrawLatex(xtext-0.25,ytext,gs.Data());
6573 lgs->DrawLatex(xtext-0.4,ytext-0.02,gs.Data());
6578 if (proj==
"ham" || proj==
"ait")
6580 lgs->DrawLatex(xtext-0.3,ytext-0.1,gs.Data());
6584 lgs->DrawLatex(xtext-0.4,ytext-0.02,gs.Data());
6590 TLine* line=
new TLine(xlow,0,xup,0);
6593 line=
new TLine(0,yup,0,ylow);
6598 TLatex* header=
new TLatex;
6600 header->SetTextAlign(21);
6601 header->DrawLatex(0,yup+0.2,titleup.Data());
6602 TLatex* footer=
new TLatex;
6604 footer->SetTextAlign(21);
6605 footer->DrawLatex(0,ylow-0.25,titlelow.Data());
6608 TLatex* left=
new TLatex;
6610 if (proj==
"ham" || proj==
"ait")
6612 left->DrawLatex(xlow-0.4,0,sleft.Data());
6616 left->DrawLatex(xlow-0.15,yup+0.05,sleft.Data());
6619 TLatex* right=
new TLatex;
6621 if (proj==
"ham" || proj==
"ait")
6623 right->DrawLatex(xup+0.1,0,sright.Data());
6627 right->DrawLatex(xup-0.1,yup+0.05,sright.Data());
6630 TLatex* up=
new TLatex;
6632 if (proj==
"ham" || proj==
"ait")
6634 up->DrawLatex(-0.1,yup+0.05,sup.Data());
6638 up->DrawLatex(-0.1,yup+0.05,scenter.Data());
6643 up->DrawLatex(xlow-0.4,yup-0.04,sup.Data());
6647 TLatex* low=
new TLatex;
6649 if (proj==
"ham" || proj==
"ait")
6651 low->DrawLatex(-0.15,ylow-0.15,slow.Data());
6655 if (proj!=
"ang") low->DrawLatex(xlow-0.4,ylow,slow.Data());
6663 sx=
SetSignal(1,0,
"deg",0,
"deg",
"gal",0,-1,
"J",
"GC",0);
6664 Int_t idx=
fRefs->IndexOf(sx);
6672 if (frame==
"equ" || frame==
"gal" || frame==
"icr" || frame==
"ecl" || frame==
"loc")
6674 thetagc=(pi/2.)-rgc.
GetX(2,
"sph",
"rad");
6675 phigc=rgc.
GetX(3,
"sph",
"rad");
6679 thetagc=(pi/2.)-rgc.
GetX(2,
"sph",
"rad");
6680 phigc=pi-rgc.
GetX(3,
"sph",
"rad");
6685 Project(phigc,thetagc,proj,xgc,ygc);
6708 if (frame==
"equ") xfac=6;
6709 if (proj==
"angh") yfac=1;
6713 if (clr==1 || proj!=
fProj)
6717 for (Int_t i=0; i<2; i++)
6727 fHist[type]->Reset();
6731 TString title=titleup;
6734 fHist[type]->SetNameTitle(
"SkyMap",title.Data());
6735 fHist[type]->GetXaxis()->SetTitle(
"Degrees from central Meridian");
6738 fHist[type]->SetBins(1000,-181,181,100,-1.1,1.1);
6739 fHist[type]->GetYaxis()->SetTitle(
"sin(b)");
6743 fHist[type]->SetBins(1000,-181,181,500,-91,91);
6744 fHist[type]->GetYaxis()->SetTitle(
"Projected Latitude in degrees");
6748 fHist[type]->GetXaxis()->SetTitle(
"Hours from central Meridian");
6751 fHist[type]->SetBins(200,-12.1,12.1,100,-1.1,1.1);
6752 if (frame==
"equ")
fHist[type]->GetYaxis()->SetTitle(
"sin(#delta)");
6756 fHist[type]->SetBins(200,-12.1,12.1,500,-91,91);
6757 if (frame==
"equ")
fHist[type]->GetYaxis()->SetTitle(
"Projected Declination in degrees");
6764 fHist[type]->GetYaxis()->SetTitle(
"sin(alt)=cos(zenith)");
6768 fHist[type]->GetYaxis()->SetTitle(
"Projected Altitude in degrees");
6775 fHist[type]->GetYaxis()->SetTitle(
"cos(#theta)=sin(b)");
6779 fHist[type]->GetYaxis()->SetTitle(
"Projected degrees from the equator");
6787 fHist[type]->Fill(x*xfac,theta*180./pi);
6789 else if (proj==
"hamh" || proj==
"aith" || proj==
"cylh" || proj==
"angh")
6791 fHist[type]->Fill(x*xfac,y*yfac);
6793 else if (proj==
"UTh" || proj==
"LTh" || proj==
"GSTh" || proj==
"LSTh")
6796 fHist[type]->SetBins(100,0,24,181,-90.5,90.5);
6800 TString title=
"Day view";
6813 if (proj==
"LTh") tmode=
"LMT";
6817 if (mode==
"T") tmode=
"GAST";
6822 if (mode==
"T") tmode=
"LAST";
6824 if (proj==
"UTh") title+=
";Universal Time";
6825 if (proj==
"LTh") title+=
";Local Time";
6826 if (proj==
"GSTh") title+=
";Greenwich Sidereal Time";
6827 if (proj==
"LSTh") title+=
";Local Sidereal Time";
6834 title+=
" in hours;";
6835 TString ytitle=
"Declination ";
6836 if (frame==
"equ" && mode==
"J") ytitle+=
"(J2000)";
6837 if (frame==
"equ" && mode==
"B") ytitle+=
"(B1950)";
6838 if (frame==
"equ" && mode==
"M") ytitle+=
"(Mean)";
6839 if (frame==
"equ" && mode==
"T") ytitle+=
"(True)";
6840 if (frame==
"gal") ytitle=
"Galactic latitude";
6841 if (frame==
"ecl") ytitle=
"Geocentric Ecliptic latitude";
6842 if (frame==
"hor") ytitle=
"Horizon altitude";
6843 if (frame==
"icr") ytitle=
"ICRS latitude";
6844 if (frame==
"loc") ytitle=
"Angle w.r.t. local frame equator";
6845 ytitle+=
" in degrees";
6847 fHist[type]->SetTitle(title);
6848 fHist[type]->SetStats(kFALSE);
6853 for (Int_t i=0; i<24; i++)
6855 if (tmode==
"UT") hour=tx.
GetUT();
6856 if (tmode==
"LMT") hour=tx.
GetLT(toffset);
6857 if (tmode==
"GMST") hour=tx.
GetGMST();
6858 if (tmode==
"GAST") hour=tx.
GetGAST();
6859 if (tmode==
"LMST") hour=tx.
GetLMST(toffset);
6860 if (tmode==
"LAST") hour=tx.
GetLAST(toffset);
6863 GetSignal(d,a,
"deg",b,
"deg",frame,&tx,jref,mode,type);
6865 if (frame==
"hor") b=90.-b;
6866 if (frame==
"loc") b=90.-a;
6868 fHist[type]->Fill(hour,b);
6876 else if (proj==
"UYh" || proj==
"LYh" || proj==
"GSYh" || proj==
"LSYh")
6879 fHist[type]->SetBins(1500,0,370,181,-90.5,90.5);
6886 if (proj==
"LYh") tmode=
"LMT";
6890 if (mode==
"T") tmode=
"GAST";
6895 if (mode==
"T") tmode=
"LAST";
6899 if (proj==
"LYh" || proj==
"LSYh") ts->
GetDayTimeString(tmode,0,toffset,0,&time);
6901 TString title=
"Year view";
6913 title+=
";Day of the year;";
6914 TString ytitle=
"Declination ";
6915 if (frame==
"equ" && mode==
"J") ytitle+=
"(J2000)";
6916 if (frame==
"equ" && mode==
"B") ytitle+=
"(B1950)";
6917 if (frame==
"equ" && mode==
"M") ytitle+=
"(Mean)";
6918 if (frame==
"equ" && mode==
"T") ytitle+=
"(True)";
6919 if (frame==
"gal") ytitle=
"Galactic latitude";
6920 if (frame==
"ecl") ytitle=
"Geocentric Ecliptic latitude";
6921 if (frame==
"hor") ytitle=
"Horizon altitude";
6922 if (frame==
"icr") ytitle=
"ICRS latitude";
6923 if (frame==
"loc") ytitle=
"Angle w.r.t. local frame equator";
6924 ytitle+=
" in degrees";
6926 fHist[type]->SetTitle(title);
6927 fHist[type]->SetStats(kFALSE);
6933 if (proj==
"UYh" || proj==
"GSYh")
6935 tx.
SetUT(year.Atoi(),1,1,
"00:00:00");
6938 if (proj==
"LYh" || proj==
"LSYh")
6940 tx.
SetLT(toffset,year.Atoi(),1,1,
"00:00:00");
6941 hour=ts->
GetLT(toffset);
6947 for (Int_t i=0; i<367; i++)
6951 GetSignal(d,a,
"deg",b,
"deg",frame,&tx,jref,mode,type);
6953 if (frame==
"hor") b=90.-b;
6954 if (frame==
"loc") b=90.-a;
6956 if (proj==
"UYh" || proj==
"GSYh") day=tx.GetDayOfYear();
6957 if (proj==
"LYh" || proj==
"LSYh") day=tx.GetDayOfYear(kFALSE,toffset);
6959 fHist[type]->Fill(day,b);
6969 if ((!type &&
fHist[1]) || (type &&
fHist[0]))
6971 fHist[type]->Draw(
"same");
6975 fHist[type]->Draw();
6978 if (proj==
"UTh" || proj==
"LTh" || proj==
"GSTh" || proj==
"LSTh" ||
6979 proj==
"UYh" || proj==
"LYh" || proj==
"GSYh" || proj==
"LSYh")
6987 if (proj==
"UTh" || proj==
"LTh" || proj==
"GSTh" || proj==
"LSTh") line=
new TLine(0,0,24,0);
6988 if (proj==
"UYh" || proj==
"LYh" || proj==
"GSYh" || proj==
"LSYh") line=
new TLine(0,0,370,0);
6991 line->SetLineWidth(3);
7094 GetSignal(d,a,
"deg",b,
"deg",frame,ts,name,mode,type);
7210 if (
fRefs && type<=0)
7220 if (!j || !tx) tx=ts;
7226 for (Int_t i=1; i<=
fRefs->GetSize(); i++)
7232 if (nmax>=0 && jdisp>nmax)
break;
7235 namex=sx->GetName();
7236 if (name!=
"*" && !namex.Contains(name))
continue;
7262 for (Int_t j=1; j<=
fSigs->GetSize(); j++)
7268 if (nmax>=0 && jdisp>nmax)
break;
7271 namex=sx->GetName();
7272 if (name!=
"*" && !namex.Contains(name))
continue;
7307 if (type<0 || type >3)
return;
7326 if (type<0 || type >3)
return;
7345 if (type<0 || type >3)
return;
7380 Double_t pi=acos(-1.);
7381 Double_t twopi=2.*pi;
7428 Double_t pi=acos(-1.);
7451 if (proj==
"ang" || proj==
"angh")
7469 Double_t pi=acos(-1.);
7486 Double_t k=1./sqrt(1.+cos(b)*cos(l/2.));
7487 x=2.*k*cos(b)*sin(l/2.);
7502 Double_t pi=acos(-1.);
7505 Double_t k=acos(cos(b)*cos(l/2.));
7508 x=4.*k*cos(b)*sin(l/2.)/(pi*sin(k));
7509 y=2.*k*sin(b)/(pi*sin(k));
7530 Double_t pi=acos(-1.);
7531 Double_t bcut=85.051*pi/180.;
7535 if (b > bcut) b=bcut;
7536 if (b < -bcut) b=-bcut;
7537 y=0.5*log((1.+sin(b))/(1.-sin(b)))/pi;
7614 if (name==
"Me")
fMe=value;
7615 if (name==
"Mmu")
fMmu=value;
7616 if (name==
"Mtau")
fMtau=value;
7624 if (name==
"Mp")
fMp=value;
7625 if (name==
"Mn")
fMn=value;
7626 if (name==
"MW")
fMW=value;
7627 if (name==
"GammaW")
fGammaW=value;
7628 if (name==
"MZ")
fMZ=value;
7629 if (name==
"GammaZ")
fGammaZ=value;
7630 if (name==
"AlphaEM")
fAlphaEM=value;
7631 if (name==
"Fermi")
fFermi=value;
7640 if (name==
"Boltz")
fBoltz=value;
7647 if (name==
"Gn")
fGn=value;
7648 if (name==
"Au")
fAu=value;
7649 if (name==
"Pc")
fPc=value;
7650 if (name==
"Hubble")
fHubble=value;
7651 if (name==
"OmegaM")
fOmegaM=value;
7652 if (name==
"OmegaR")
fOmegaR=value;
7653 if (name==
"OmegaL")
fOmegaL=value;
7654 if (name==
"OmegaB")
fOmegaB=value;
7655 if (name==
"OmegaC")
fOmegaC=value;
7685 if (name==
"SpeedC")
return fSpeedC;
7686 if (name==
"Qe")
return fQe;
7687 if (name==
"Me")
return fMe;
7688 if (name==
"Mmu")
return fMmu;
7689 if (name==
"Mtau")
return fMtau;
7690 if (name==
"Amu")
return fAmu;
7691 if (name==
"Mp")
return fMp;
7692 if (name==
"Mn")
return fMn;
7693 if (name==
"MW")
return fMW;
7694 if (name==
"GammaW")
return fGammaW;
7695 if (name==
"GammaZ")
return fGammaZ;
7696 if (name==
"AlphaEM")
return fAlphaEM;
7697 if (name==
"Fermi")
return fFermi;
7698 if (name==
"Planck")
return fPlanck;
7699 if (name==
"Boltz")
return fBoltz;
7700 if (name==
"Newton")
return fNewton;
7701 if (name==
"Gn")
return fGn;
7702 if (name==
"Au")
return fAu;
7703 if (name==
"Pc")
return fPc;
7704 if (name==
"Hubble")
return fHubble;
7705 if (name==
"OmegaM")
return fOmegaM;
7706 if (name==
"OmegaR")
return fOmegaR;
7707 if (name==
"OmegaL")
return fOmegaL;
7708 if (name==
"OmegaB")
return fOmegaB;
7709 if (name==
"OmegaC")
return fOmegaC;
7712 if (name==
"Hbar")
return fHbar;
7713 if (name==
"Hbarc")
return fHbarc;
7714 if (name==
"Hbarc2")
return fHbarc2;
7725 if (name==
"Jy")
return 1e-23;
7772 if (z<=0 ||
fHubble<=0)
return 0;
7776 TF1 f(
"f",
"1./sqrt([0]*pow((1.+x),4)+[1]*pow((1.+x),3)+[2])");
7783 Double_t dist=f.Integral(0,z);
7786 Double_t distm=dist*1e6*
fPc;
7790 if (u==
"Gpc") val=dist*1e-3;
7791 if (u==
"Mpc") val=dist;
7792 if (u==
"pc") val=dist*1e6;
7793 if (u==
"ly") val=dist*3.26156e6;
7794 if (u==
"m") val=distm;
7795 if (u==
"km") val=distm*1e-3;
7796 if (u==
"cm") val=distm*1e2;
7798 if (!t) val=val/(z+1.);
7960 if (z<=0 ||
fHubble<=0)
return 0;
7964 TF1 f(
"f",
"1./((1.+x)*sqrt([0]*pow((1.+x),4)+[1]*pow((1.+x),3)+[2]))");
7971 Double_t dist=f.Integral(0,z);
7974 Double_t distm=dist*1e6*
fPc;
7978 if (u==
"Gpc") val=dist*1e-3;
7979 if (u==
"Mpc") val=dist;
7980 if (u==
"pc") val=dist*1e6;
7981 if (u==
"ly") val=dist*3.26156e6;
7982 if (u==
"m") val=distm;
7983 if (u==
"km") val=distm*1e-3;
7984 if (u==
"cm") val=distm*1e2;
8037 if (z<0 ||
fHubble<=0)
return 0;
8039 TF1 f(
"f",
"sqrt([0]*pow((1.+x),4)+[1]*pow((1.+x),3)+[2])");
8046 Double_t H=f.Eval(z);
8049 Double_t Hm=H/(1e6*
fPc);
8053 if (u==
"Gpc") val=H/1e-3;
8054 if (u==
"Mpc") val=H;
8055 if (u==
"pc") val=H/1e6;
8056 if (u==
"ly") val=H/3.26156e6;
8058 if (u==
"km") val=Hm/1e-3;
8059 if (u==
"cm") val=Hm/1e2;
8094 if (Z<0 || N<0)
return 0;
8108 Double_t term1=a*ra;
8109 Double_t term2=b*pow(ra,2./3.);
8110 Double_t term3=s*pow((rn-rz),2.)/ra;
8111 Double_t term4=d*pow(rz,2.)/pow(ra,1./3.);
8117 if (oz && on) term5=delta/sqrt(ra);
8118 if (!oz && !on) term5=-delta/sqrt(ra);
8121 Double_t bnz=term1-term2-term3-term4-term5;
8131 Double_t mass=rz*
fMp+rn*
fMn-bnz;
8136 mass=2.013553212712*
fAmu;
8142 mass=3.0155007134*
fAmu;
8148 mass=3.0149322468*
fAmu;
8154 mass=4.001506179125*
fAmu;
8183 value=bnz/(
fAmu*ra);
8223 if (Z<=0 || A<1 || A<Z)
return -1;
8225 X0=716.4*A/(Z*(Z+1.)*(log(287./sqrt(Z))));
8228 if (rho==0) X0=X0/mN;
8229 if (rho>0) X0=X0/rho;
8273 if (sigma<=0 || rho<=0 || mode<0 || mode>4)
return -1;
8276 Double_t n=fabs(rho)/mN;
8280 lambda=1./(sigma*n);
8282 if (mode==1 || mode==4) lambda=lambda*n;
8283 if (mode==3) lambda=lambda*rho;
8323 if (x<0 || lambda<=0)
return -1;
8325 prob=1.-exp(-x/lambda);
8408 if (x<0 || lambda<=0)
return -1;
8410 prob=exp(-x/lambda);
8490 if (prob<=0 || prob>1 || lambda<=0)
return -1;
8492 x=-lambda*log(prob);
8530 if (prob<=0 || prob>1)
return -1;
8569 if (prob<=0 || prob>1 || lambda<=0)
return -1;
8610 if (prob<=0 || prob>1)
return -1;
8669 if (eprimgev) *eprimgev=0;
8670 if (alpha) *alpha=0;
8671 if (!mode || mode>3 || mode<-4 || !type || abs(type)>3)
return 0;
8673 const Double_t fnumuccn=6.77e-15;
8674 const Double_t fanumuccn=3.34e-15;
8678 const Double_t fnuetote=0.25+sinw2+4.*pow(sinw2,2.)/3.;
8679 const Double_t fanuetote=(1./12.)+(sinw2/3.)+4.*pow(sinw2,2.)/3.;
8680 Double_t fnumucce=1.;
8681 const Double_t fnumunce=0.25-sinw2+4.*pow(sinw2,2.)/3.;
8682 const Double_t fanumunce=(1./12.)-(sinw2/3.)+4.*pow(sinw2,2.)/3.;
8683 const Double_t f4=1./3.;
8686 const Double_t c0nu=-1.826;
8687 const Double_t c1nu=-17.31;
8688 const Double_t c2nunc=-6.448;
8689 const Double_t c2nucc=-6.406;
8690 const Double_t c3nu=1.431;
8691 const Double_t c4nunc=-18.61;
8692 const Double_t c4nucc=-17.91;
8693 const Double_t c0anu=-1.033;
8694 const Double_t c1anu=-15.95;
8695 const Double_t c2anunc=-7.296;
8696 const Double_t c2anucc=-7.247;
8697 const Double_t c3anu=1.569;
8698 const Double_t c4anunc=-18.30;
8699 const Double_t c4anucc=-17.72;
8701 Double_t rncnu=0.2261/0.7221;
8702 Double_t rncanu=0.1307/0.3747;
8705 Double_t ynucc[12]={0.483,0.477,0.472,0.426,0.332,0.237,0.250,0.237,0.225,0.216,0.208,0.205};
8706 Double_t ynunc[12]={0.474,0.470,0.467,0.428,0.341,0.279,0.254,0.239,0.227,0.217,0.210,0.207};
8707 Double_t yanucc[12]={0.333,0.340,0.354,0.345,0.301,0.266,0.249,0.237,0.225,0.216,0.208,0.205};
8708 Double_t yanunc[12]={0.350,0.354,0.368,0.358,0.313,0.273,0.253,0.239,0.227,0.217,0.210,0.207};
8710 Double_t loge=log10(egev);
8712 Int_t index=int(loge+0.5);
8713 if (index<1) index=1;
8714 if (index>12) index=12;
8719 if (abs(mode)==1) y=ynucc[index-1];
8720 if (abs(mode)==2) y=ynunc[index-1];
8721 if (mode==3) y=(ynucc[index-1]+rncnu*ynunc[index-1])/(1.+rncnu);
8722 if (mode==-3) y=(ynucc[index-1]+fnumunce*ynunc[index-1])/(1.+fnumunce);
8726 if (abs(mode)==1) y=yanucc[index-1];
8727 if (abs(mode)==2) y=yanunc[index-1];
8728 if (mode==3) y=(yanucc[index-1]+rncanu*yanunc[index-1])/(1.+rncanu);
8729 if (mode==-3) y=(yanucc[index-1]+fnumunce*yanunc[index-1])/(1.+fnumunce);
8731 *eprimgev=egev*(1.-y);
8738 *alpha=sqrt(2.e-3*mtarg/egev)*y*180./((1.-y)*acos(-1.));
8743 Double_t c0=0,c1=0,c2=0,c3=0,c4=0;
8759 if (type<0) fact=fanumuccn;
8763 fact=fnumuccn*rncnu;
8764 if (type<0) fact=fanumuccn*rncanu;
8808 Double_t lne=log(loge-c0);
8809 Double_t logsigma=c1+c2*lne+c3*pow(lne,2.)+c4/lne;
8811 xsec=pow(10.,logsigma);
8819 if (mode==-3 && type==-1 && egev>elow && egev<eup)
8821 xsec=5.02e-7/xscale;
8822 if (eprimgev) *eprimgev=0;
8823 if (alpha) *alpha=0;
8828 Double_t mlepton=
fMe;
8829 if (abs(type)==2) mlepton=
fMmu;
8830 if (abs(type)==3) mlepton=
fMtau;
8831 Double_t eth=1.e-3*(pow(mlepton,2.)-pow(
fMe,2.))/(2.*
fMe);
8838 if (eprimgev) *eprimgev=egev;
8839 if (alpha) *alpha=0;
8849 if (type>1) fact=fnumucce;
8853 if (type>1) fact=fnumunce;
8854 if (type<-1) fact=fanumunce;
8858 if (type==1) fact=fnuetote;
8859 if (type==-1) fact=fanuetote;
8860 if (type>1) fact=fnumucce+fnumunce;
8861 if (type<-1) fact=fanumunce;
8863 if (mode==-4 && type==-1) fact=f4;
8912 if (E<=0 || mode<0 || mode>2)
return value;
8918 Double_t mean=1.38711583;
8919 Double_t median=0.86842105;
8920 Double_t mpv=0.560150;
8921 Double_t sigma=0.226679;
8924 Double_t p=log10(E);
8925 Double_t scale=1./(pow(1.5,p)*sqrt(E));
8935 fNuAngle=
new TF1(
"NuAngle",
"TMath::Landau(x,[0],[1],1)",0,90);
8936 fNuAngle->SetTitle(
"Landau pdf;Neutrino-lepton opening angle in degrees;PDF");
8944 Double_t ang=
fNuAngle->GetRandom();
8948 Double_t fact=acos(-1.)/180.;
8958 if (mode==1) value=median;
8959 if (mode==2) value=ang;
8990 Double_t pi=acos(-1.);
8991 Double_t cosmax=cos(thetamin*pi/180.);
8992 Double_t cosmin=cos(thetamax*pi/180.);
8993 Double_t cost=
fRan->Uniform(cosmin,cosmax);
8994 Double_t theta=acos(cost)*180./pi;
8995 Double_t phi=
fRan->Uniform(phimin,phimax);
9000 Double_t err[3]={0,0,0};
9008 v.
SetVector(norm,theta,phi,
"sph",
"deg");
9042 Double_t norm=v.
GetX(1,
"sph",
"deg");
9043 Double_t theta=v.
GetX(2,
"sph",
"deg");
9044 Double_t phi=v.
GetX(3,
"sph",
"deg");
9045 Double_t err[3]={0,0,0};
9057 v.
SetVector(norm,theta,phi,
"sph",
"deg");
9064 m.SetAngles(90.+theta,phi,90,phi+90.,theta,phi);
9067 Double_t pi=acos(-1.);
9069 Double_t cosmin=cos(fabs(sigma)*pi/180.);
9071 Double_t phimax=360;
9075 cost=
fRan->Uniform(cosmin,cosmax);
9076 theta=acos(cost)*180./pi;
9080 theta=
fRan->Gauss(0.,sigma);
9082 phi=
fRan->Uniform(phimin,phimax);
9085 v.
SetVector(norm,theta,phi,
"sph",
"deg");
9120 Double_t norm=v.
GetX(1,
"sph",
"deg");
9121 Double_t theta=v.
GetX(2,
"sph",
"deg");
9122 Double_t phi=v.
GetX(3,
"sph",
"deg");
9123 Double_t err[3]={0,0,0};
9135 v.
SetVector(norm,theta,phi,
"sph",
"deg");
9142 m.SetAngles(90.+theta,phi,90,phi+90.,theta,phi);
9146 Double_t phimax=360;
9148 phi=
fRan->Uniform(phimin,phimax);
9151 v.
SetVector(norm,theta,phi,
"sph",
"deg");
9260 if (mode<0 || mode>3)
return hdx;
9262 if (!hx)
return hdx;
9264 if (nc<1)
return hdx;
9266 Int_t nenhx=hx->GetEntries();
9267 if (nenhx<=nc)
return hdx;
9269 Int_t idxbin=TMath::Nint(dxbin);
9270 if (idxbin<-2)
return hdx;
9275 if (dxmin>=0 && dxmax>=dxmin && dxbin>0)
9278 Double_t range=dxmax-dxmin;
9279 if (range>dxbin) nbins=TMath::Nint(range/dxbin);
9280 hdx.SetBins(nbins,dxmin,dxmax);
9284 Double_t binwidth=hdx.GetXaxis()->GetBinWidth(1);
9285 s.Form(
"Dx interval distribution between %-i consecutive entries (nc=%-i, mode=%-i);Dx interval;Counts per bin of size %-.3g",nc+1,nc,mode,binwidth);
9286 hdx.SetNameTitle(
"DxHistogram",s);
9297 Double_t x1,x2,deltax;
9299 Double_t deltaxmin=0;
9300 Double_t deltaxmax=0;
9301 Bool_t found=kFALSE;
9305 Int_t nbhx=hx->GetNbinsX();
9310 for (Int_t i=1; i<=nbhx; i++)
9314 xlow=hx->GetBinLowEdge(i);
9315 bsize=hx->GetBinWidth(i);
9317 x1=hx->GetBinCenter(i);
9318 if (mode==1 || mode==3) x1=
fRan->Uniform(xlow,xup);
9319 value=hx->GetBinContent(i);
9322 if (mode<2) nx1=TMath::Nint(value);
9328 if (nx1>1) jstart=i;
9330 for (Int_t j=jstart; j<=nbhx; j++)
9332 xlow=hx->GetBinLowEdge(j);
9333 bsize=hx->GetBinWidth(j);
9335 x2=hx->GetBinCenter(j);
9336 if (mode==1 || mode==3) x2=
fRan->Uniform(xlow,xup);
9337 value=hx->GetBinContent(j);
9340 if (mode<2) nx2=TMath::Nint(value);
9342 if (j==i) nx2=nx1-1;
9345 if (nx2<1)
continue;
9352 if (dxmin>=0 && dxmax>=dxmin && dxbin>0)
9358 if (!found || deltax<deltaxmin) deltaxmin=deltax;
9359 if (!found || deltax>deltaxmax) deltaxmax=deltax;
9371 if (!found)
return hdx;
9374 Int_t nen=hdx.GetEntries();
9378 if (!idxbin && dxbin<=0) dxbin=hx->GetBinWidth(1);
9381 dxbin=(hx->GetBinWidth(1))*fact;
9382 if (deltaxmin>0 && deltaxmin>dxbin) dxbin=deltaxmin;
9383 if (dxbin<=0) dxbin=hx->GetBinWidth(1);
9387 dxbin=hx->GetBinWidth(1);
9388 dxbin=dxbin*float(nc);
9396 if (mode==1 || mode==3)
9398 bsize=hx->GetBinWidth(1);
9399 dxmin=dxmin-2.*bsize;
9400 if (dxmin<0) dxmin=0;
9405 dxmax=deltaxmax+dxbin;
9407 if (mode==1 || mode==3)
9409 bsize=hx->GetBinWidth(1);
9410 dxmax=dxmax+2.*bsize;
9460 if (!hin)
return hout;
9462 Int_t nbins=hin->GetNbinsX();
9463 if (!nbins)
return hout;
9466 const TArrayD* xarr=hin->GetXaxis()->GetXbins();
9467 Int_t xsize=xarr->GetSize();
9470 Double_t xmin=hin->GetXaxis()->GetXmin();
9471 Double_t xmax=hin->GetXaxis()->GetXmax();
9472 hout.SetBins(nbins,xmin,xmax);
9476 const Double_t* xbins=xarr->GetArray();
9477 hout.SetBins(nbins,xbins);
9481 hout.SetNameTitle(
"DifHistogram",hin->GetTitle());
9484 TString sxin=hin->GetXaxis()->GetTitle();
9485 TString syin=hin->GetYaxis()->GetTitle();
9494 syout=f->GetExpFormula(
"p");
9505 sxin.ReplaceAll(
"^{10}log",
"");
9506 sxin.ReplaceAll(
"^{10}Log",
"");
9507 sxin.ReplaceAll(
"log10",
"");
9508 sxin.ReplaceAll(
"Log10",
"");
9509 sxin.ReplaceAll(
"log",
"");
9510 sxin.ReplaceAll(
"Log",
"");
9511 sxin.ReplaceAll(
"ln",
"");
9512 sxin.ReplaceAll(
"Ln",
"");
9517 syout.ReplaceAll(
"((",
"(");
9518 syout.ReplaceAll(
"))",
")");
9521 hout.GetXaxis()->SetTitle(sxout.Data());
9522 hout.GetYaxis()->SetTitle(syout.Data());
9532 for (Int_t i=1; i<=nbins; i++)
9534 x=hin->GetBinCenter(i);
9535 y=hin->GetBinContent(i);
9536 err=fabs(hin->GetBinError(i));
9537 width=hin->GetBinWidth(i);
9538 binlow=hin->GetBinLowEdge(i);
9542 if (width<=0)
continue;
9548 width=pow(10.,binup)-pow(10.,binlow);
9553 width=exp(binup)-exp(binlow);
9567 hout.SetBinContent(i,y);
9568 hout.SetBinError(i,err);
9604 hout.SetName(
"CountsHistogram");
9609 s=
"CountsHistogram;";
9618 s+=spec.GetXaxis()->GetTitle();
9625 Double_t step=(xmax-xmin)/
double(nbins);
9626 Double_t* xbins=
new Double_t[nbins+1];
9628 for (Int_t ibin=0; ibin<=nbins; ibin++)
9634 hout.SetBins(nbins,xbins);
9641 for (Int_t ibin=1; ibin<=nbins; ibin++)
9650 xlow=pow(10,xbins[ibin-1]);
9651 xup=pow(10,xbins[ibin]);
9655 xlow=exp(xbins[ibin-1]);
9656 xup=exp(xbins[ibin]);
9659 N=spec.Integral(xlow,xup);
9702 hout.SetName(
"CountsHistogram");
9703 Int_t nbins=hin.GetNbinsX();
9705 if (nbins<1)
return hout;
9707 TAxis* ax=hin.GetXaxis();
9708 Double_t xmin=ax->GetXmin();
9709 Double_t xmax=ax->GetXmax();
9710 hout.SetBins(nbins,xmin,xmax);
9717 TString tx=ax->GetTitle();
9724 if (mode==0) s+=
"x";
9725 if (mode==1) s+=
"^{10}Log(x)";
9726 if (mode==2) s+=
"Ln(x)";
9740 for (Int_t ibin=1; ibin<=nbins; ibin++)
9742 x=hin.GetBinCenter(ibin);
9743 xlow=hin.GetBinLowEdge(ibin);
9744 xup=xlow+hin.GetBinWidth(ibin);
9745 N=hin.GetBinContent(ibin);
9755 dx=pow(10,xup)-pow(10,xlow);
9761 dx=exp(xup)-exp(xlow);
9768 fval=fscale->Eval(xval);
9802 if (!hin || mode<1 || mode>2)
return hout;
9804 Int_t nbins=hin->GetNbinsX();
9805 if (!nbins)
return hout;
9808 const TArrayD* xarr=hin->GetXaxis()->GetXbins();
9809 Int_t xsize=xarr->GetSize();
9812 Double_t xmin=hin->GetXaxis()->GetXmin();
9813 Double_t xmax=hin->GetXaxis()->GetXmax();
9814 hout.SetBins(nbins,xmin,xmax);
9818 const Double_t* xbins=xarr->GetArray();
9819 hout.SetBins(nbins,xbins);
9823 hout.SetNameTitle(
"LogHistogram",hin->GetTitle());
9828 if (mode==2) s=
"Ln(";
9829 s+=hin->GetYaxis()->GetTitle();
9833 hout.GetXaxis()->SetTitle(hin->GetXaxis()->GetTitle());
9834 hout.GetYaxis()->SetTitle(s.Data());
9840 for (Int_t i=1; i<=nbins; i++)
9842 y=hin->GetBinContent(i);
9843 err=fabs(hin->GetBinError(i));
9860 hout.SetBinContent(i,y);
9862 hout.SetBinError(i,err);
9903 Int_t Noff=int(pars[0]);
9904 Double_t Toff=pars[1];
9905 Double_t bmax=pars[2];
9906 Double_t prec=pars[3];
9908 if (b<=0 || Noff<0 || Toff<=0)
return 0;
9910 Double_t rNoff=Noff;
9911 if (bmax<0) bmax=100.*rNoff/Toff;
9921 lnU=log(Toff)+rNoff*log(b*Toff)-b*Toff;
9924 lnD=math.
LnGamma(Noff+1,bmax*Toff,1);
9928 if (lnprob < -fabs(prec))
return 0;
9930 if (lnprob > fabs(prec)) lnprob=fabs(prec);
9982 Int_t Non=TMath::Nint(pars[0]);
9983 Double_t Ton=pars[1];
9984 Int_t Noff=TMath::Nint(pars[2]);
9985 Double_t Toff=pars[3];
9986 Double_t smax=pars[4];
9987 Double_t bmax=pars[5];
9988 Double_t prec=pars[6];
9990 if (s<0 || Non<0 || Ton<=0 || Noff<0 || Toff<=0)
return 0;
9993 if (smax<0) smax=100.*rNon/Ton;
9995 Double_t rNoff=Noff;
9996 if (bmax<0) bmax=100.*rNoff/Toff;
10001 Int_t ndim=Non+Noff+1;
10002 TArrayD lnfacN(ndim);
10006 for (Int_t i=1; i<ndim; i++)
10017 Double_t gammaP1=0;
10018 Double_t gammaP2=0;
10021 for(Int_t i=0; i<=Non; i++)
10026 gammaP1=math.
Gamma(Non+Noff+1-i,bmax*(Ton+Toff),0);
10027 gammaP2=math.
Gamma(i+1,smax*Ton,0);
10030 lnU=-s*Ton+ri*log(s)+ri*log(Ton+Toff)-lnfacN[i]-lnfacN[Non-i]+lnfacN[Non+Noff-i]-lnfacN[Non+Noff]+lnfacN[Non];
10032 if ((lnU > -fabs(prec)) && (lnU < fabs(prec))) sumU+=exp(lnU)*gammaP1;
10035 lnD=ri*log(Ton+Toff)-(ri+1.)*log(Ton)-lnfacN[i]-lnfacN[Non-i]+lnfacN[Non+Noff-i]+lnfacN[i]-lnfacN[Non+Noff]+lnfacN[Non];
10037 if ((lnD > -fabs(prec)) && (lnD < fabs(prec))) sumD+=exp(lnD)*gammaP1*gammaP2;
10040 if (sumD) prob=sumU/sumD;
10077 if (bmax<0) bmax=100.*Noff/Toff;
10082 pdf.SetParName(0,
"Noff");
10083 pdf.SetParName(1,
"Toff");
10084 pdf.SetParName(2,
"bmax");
10085 pdf.SetParName(3,
"prec");
10087 pdf.SetParameter(
"Noff",Noff);
10088 pdf.SetParameter(
"Toff",Toff);
10089 pdf.SetParameter(
"bmax",bmax);
10090 pdf.SetParameter(
"prec",prec);
10092 pdf.SetTitle(
"Bayesian posterior background rate PDF;Background rate B in Hz;p(B|Noff,Toff,I)");
10093 pdf.SetRange(0,bmax);
10138 if (smax<0) smax=100.*Non/Ton;
10144 if (bmax<0) bmax=100.*Noff/Toff;
10149 pdf.SetParName(0,
"Non");
10150 pdf.SetParName(1,
"Ton");
10151 pdf.SetParName(2,
"Noff");
10152 pdf.SetParName(3,
"Toff");
10153 pdf.SetParName(4,
"smax");
10154 pdf.SetParName(5,
"bmax");
10155 pdf.SetParName(6,
"prec");
10157 pdf.SetParameter(
"Non",Non);
10158 pdf.SetParameter(
"Ton",Ton);
10159 pdf.SetParameter(
"Noff",Noff);
10160 pdf.SetParameter(
"Toff",Toff);
10161 pdf.SetParameter(
"smax",smax);
10162 pdf.SetParameter(
"bmax",bmax);
10163 pdf.SetParameter(
"prec",prec);
10165 pdf.SetTitle(
"Bayesian posterior signal rate PDF;Signal rate S in Hz;p(S|Non,Ton,Noff,Toff,I)");
10166 pdf.SetRange(0,smax);
10190 if (p<=0 || p>100)
return 0;
10198 nu=pdf.GetQuantiles(1,ua,xa);
10217 if (p<=0 || p>100 || !his)
return 0;
10225 his->ComputeIntegral();
10228 nu=his->GetQuantiles(1,ua,xa);
10272 if (p<=0 || p>100 || n<2)
return 0;
10275 Double_t prec=1./double(n);
10278 Double_t* q=
new Double_t[n];
10279 Double_t* sumq=
new Double_t[n];
10281 for (Int_t i=0; i<n; i++)
10286 Int_t ncalc=pdf.GetQuantiles(n,q,sumq);
10298 Double_t xmode=pdf.GetMaximumX();
10300 Double_t diff,diffmin;
10301 diffmin=fabs(q[ncalc-1]-q[0]);
10302 for (Int_t i=0; i<ncalc; i++)
10304 diff=fabs(xmode-q[i]);
10313 Double_t xmin=q[0];
10314 Double_t xmax=q[ncalc-1];
10315 Double_t totint=pdf.Integral(xmin,xmax);
10330 Double_t ylow=pdf.Eval(q[ilow]);
10331 Double_t yup=pdf.Eval(q[iup]);
10332 Double_t frac=p/100.;
10333 if (frac>1) frac=1;
10334 Double_t credint=-1;
10335 while (credint<frac*totint)
10337 if (yup>ylow && iup<(ncalc-1))
10343 else if (ylow>yup && ilow>0)
10347 ylow=pdf.Eval(xlow);
10349 else if (iup<(ncalc-1))
10359 ylow=pdf.Eval(xlow);
10365 credint=pdf.Integral(xlow,xup);
10369 Double_t intfrac=credint/totint;
10449 if (p<=0 || p>100 || !his)
return 0;
10451 Int_t nbins=his->GetNbinsX();
10454 if (nbins<2)
return 0;
10457 his->ComputeIntegral();
10461 Double_t* q=
new Double_t[n];
10462 Int_t ncalc=his->GetQuantiles(n,q);
10473 Int_t imode=his->GetMaximumBin();
10476 Double_t totint=his->Integral(1,ncalc,
"width");
10490 Double_t ylow=his->GetBinContent(ilow);
10491 Double_t yup=his->GetBinContent(iup);
10492 Double_t frac=p/100.;
10493 if (frac>1) frac=1;
10494 Double_t credint=-1;
10495 while (credint<frac*totint)
10497 if (yup>ylow && iup<(ncalc-1))
10501 yup=his->GetBinContent(iup);
10503 else if (ylow>yup && ilow>0)
10507 ylow=his->GetBinContent(ilow);
10509 else if (iup<(ncalc-1))
10513 yup=his->GetBinContent(iup);
10519 ylow=his->GetBinContent(ilow);
10525 credint=his->Integral(ilow,iup,
"width");
10529 Double_t intfrac=credint/totint;
10668 if (!mode.Contains(
"M") && !mode.Contains(
"K") && !mode.Contains(
"P"))
return -1;
10669 if (mode.Contains(
"M") && (mode.Contains(
"K") || mode.Contains(
"P")))
return -1;
10670 if (mode.Contains(
"K") && (mode.Contains(
"M") || mode.Contains(
"P")))
return -1;
10671 if (mode.Contains(
"P") && (mode.Contains(
"M") || mode.Contains(
"K")))
return -1;
10673 if (!h1)
return -1;
10674 if (!h2 && !pdf)
return -1;
10675 if (h2 && pdf)
return -1;
10677 ULong64_t nrep=ULong64_t(nr);
10683 nrep=ULong64_t(1.e19);
10691 TAxis* xaxis=h1->GetXaxis();
10692 Double_t xmin1=xaxis->GetXmin();
10693 Double_t xmax1=xaxis->GetXmax();
10694 Double_t range1=xmax1-xmin1;
10695 Int_t nbins1=h1->GetNbinsX();
10696 Double_t nen1=h1->GetSumOfWeights();
10697 Double_t underflow1=h1->GetBinContent(0);
10698 Double_t overflow1=h1->GetBinContent(nbins1+1);
10699 if (mode.Contains(
"U")) nen1=nen1+underflow1;
10700 if (mode.Contains(
"O")) nen1=nen1+overflow1;
10702 if (nbins1<=0 || nen1<=0 || range1<=0)
10704 cout <<
" *" << ClassName() <<
"::KolmogorovTest* Histogram h1 is empty or has inconsistent data." << endl;
10705 cout <<
" h1 : nentries=" << nen1 <<
" nbins=" << nbins1 <<
" xmin=" << xmin1 <<
" xmax=" << xmax1 << endl;
10711 xaxis=h2->GetXaxis();
10712 Double_t xmin2=xaxis->GetXmin();
10713 Double_t xmax2=xaxis->GetXmax();
10714 Double_t range2=xmax2-xmin2;
10715 Int_t nbins2=h2->GetNbinsX();
10716 Double_t nen2=h2->GetSumOfWeights();
10718 if (nen2<=0 || range2<=0)
10720 cout <<
" *" << ClassName() <<
"::KolmogorovTest* Histogram h2 is empty or has inconsistent data." << endl;
10721 cout <<
" h2 : nentries=" << nen2 <<
" nbins=" << nbins2 <<
" xmin=" << xmin2 <<
" xmax=" << xmax2 << endl;
10725 Double_t prec=1e-6;
10726 if (nbins2!=nbins1 || fabs(xmin2-xmin1)>prec || fabs(xmax2-xmax1)>prec)
10728 cout <<
" *" << ClassName() <<
"::KolmogorovTest* Histograms h1 and h2 do not have the same binning." << endl;
10729 cout <<
" h1 : nbins=" << nbins1 <<
" xmin=" << xmin1 <<
" xmax=" << xmax1 << endl;
10730 cout <<
" h2 : nbins=" << nbins2 <<
" xmin=" << xmin2 <<
" xmax=" << xmax2 << endl;
10738 pdf->SetRange(xmin1,xmax1);
10739 pdf->SetNpx(nbins1);
10740 h2=(TH1*)pdf->GetHistogram()->Clone();
10741 h2->SetName(
"hpdf");
10743 for (Int_t i=0; i<=nbins1+1; i++)
10745 h2->SetBinError(i,0);
10751 if (mode.Contains(
"U")) s+=
"U";
10752 if (mode.Contains(
"O")) s+=
"O";
10753 if (mode.Contains(
"N") && !pdf) s+=
"N";
10758 Double_t d0=h2->KolmogorovTest(h1,s2.Data());
10761 if (mode.Contains(
"M")) s+=
"M";
10762 if (mode.Contains(
"I")) s+=
"D";
10765 if (mode.Contains(
"I"))
10769 cout <<
" *" << ClassName() <<
"::KolmogorovTest* Single sample KS-test results for execution mode "<< mode.Data() << endl;
10770 if (mode.Contains(
"N")) cout <<
" === For a single sample KS-test the mode=N is suppressed ===" << endl;
10774 cout <<
" *" << ClassName() <<
"::KolmogorovTest* Two sample KS-test results for execution mode "<< mode.Data() << endl;
10777 value=h1->KolmogorovTest(h2,s.Data());
10780 if (ksh) ksh->SetBins(101,0,1.01);
10786 if (mode.Contains(
"P"))
10788 htemp=(TH1*)h1->Clone();
10789 for (jrep=0; jrep<nrep; jrep++)
10792 for (Int_t ien=0; ien<nen1; ien++)
10794 xval=h2->GetRandom();
10797 dist=htemp->KolmogorovTest(h2,s2.Data());
10798 if (ksh) ksh->Fill(dist);
10800 if (dist>=d0) sumd++;
10803 if (ncut && sumd>=ncut)
break;
10806 value=double(sumd)/sumrep;
10807 if (nrx) *nrx=sumrep;
10808 if (mode.Contains(
"I"))
10810 cout <<
" P-value = " << value <<
" after " << sumrep <<
" pseudo experiments." << endl;
10814 if (mode.Contains(
"I")) cout <<
" Returned value = " << value << endl;
10819 TString xlabel=
"Dmax";
10820 TString ylabel=
"Counts after ";
10822 ylabel+=
" pseudo experiments";
10824 ksh->SetTitle(
"KS-test Dmax distribution from pseudo experiments");
10825 ksh->SetXTitle(xlabel.Data());
10826 ksh->SetYTitle(ylabel.Data());
10834 Float_t ymax=ksh->GetMaximum();
10836 TLine* vline=
new TLine(x,ymin,x,ymax);
10837 vline->SetLineStyle(2);
10838 vline->SetLineWidth(2);
10839 vline->SetLineColor(4);
10841 TString title=
"P-value : %-10.3g";
10842 TString sh=title.Format(title.Data(),value);
10844 TLegend* leg=
new TLegend(0.6,0.8,0.8,0.9);
10845 leg->SetFillColor(0);
10846 leg->SetHeader(sh.Data());
10847 leg->AddEntry(vline,
"Observed Dmax",
"L");
10849 TList* hlist=ksh->GetListOfFunctions();
10862 if (htemp)
delete htemp;
10897 TString title=
"Cumulative Distribution of histogram ";
10898 hcd.SetNameTitle(name.Data(),title.Data());
10900 if (!h)
return hcd;
10902 TAxis* xaxis=h->GetXaxis();
10903 TAxis* yaxis=h->GetYaxis();
10904 Double_t xmin=xaxis->GetXmin();
10905 Double_t xmax=xaxis->GetXmax();
10906 Double_t range=xmax-xmin;
10907 Int_t nbins=h->GetNbinsX();
10908 Double_t nen=h->GetSumOfWeights();
10909 TString nameh=h->GetName();
10910 TString xtitle=xaxis->GetTitle();
10911 TString ytitle=yaxis->GetTitle();
10913 hcd.SetNameTitle(name.Data(),title.Data());
10914 hcd.SetXTitle(xtitle.Data());
10915 hcd.SetYTitle(ytitle.Data());
10917 if (nbins<=0 || nen<=0 || range<=0)
return hcd;
10919 if(!(mode.Contains(
"F") || mode.Contains(
"B")) || (mode.Contains(
"F") && mode.Contains(
"B")))
return hcd;
10921 hcd.SetBins(nbins,xmin,xmax);
10923 if (mode.Contains(
"N")) title=
"Normalized ";
10924 if (mode.Contains(
"F")) title+=
"Forward ";
10925 if (mode.Contains(
"B")) title+=
"Backward ";
10926 title+=
"Cumulative Distribution of histogram ";
10928 hcd.SetNameTitle(name.Data(),title.Data());
10929 hcd.SetXTitle(xtitle.Data());
10930 hcd.SetYTitle(ytitle.Data());
10933 if (mode.Contains(
"N")) norm=nen;
10937 if (mode.Contains(
"F"))
10939 for (Int_t ibin=1; ibin<=nbins; ibin++)
10941 y=h->GetBinContent(ibin);
10943 hcd.SetBinContent(ibin,sum);
10948 for (Int_t ibin=nbins; ibin>=1; ibin--)
10950 y=h->GetBinContent(ibin);
10952 hcd.SetBinContent(ibin,sum);
10989 TString title=
"Cumulative Distribution Histogram of function ";
10990 hcd.SetNameTitle(name.Data(),title.Data());
10992 if (!f)
return hcd;
10995 Double_t xminold=f->GetXmin();
10996 Double_t xmaxold=f->GetXmax();
10998 f->SetRange(xmin,xmax);
11000 TH1* hf=(TH1*)f->GetHistogram();
11004 if (hcd.GetEntries()>0)
11007 if (mode.Contains(
"N")) title=
"Normalized ";
11008 if (mode.Contains(
"F")) title+=
"Forward ";
11009 if (mode.Contains(
"B")) title+=
"Backward ";
11010 title+=
"Cumulative Distribution Histogram of function ";
11013 TString namef=f->GetName();
11016 hcd.SetTitle(title.Data());
11019 f->SetRange(xminold,xmaxold);
11053 if (!dir || (frame!=
"equ" && frame!=
"gal" && frame!=
"ecl" && frame!=
"hor" && frame!=
"icr" && frame!=
"loc") ||
11054 (mode!=
"M" && mode!=
"T" && mode!=
"B" && mode!=
"J"))
11057 cout <<
" *" << ClassName() <<
"::InitDataNames* Invalid input encountered." << endl;
11058 cout <<
" dir=" << dir <<
" frame=" << frame <<
" mode=" << mode << endl;
11069 TString sdir=
"arrival";
11070 if (dir<0) sdir=
"moving";
11074 if (mode==
"M") frame=
"mean";
11075 if (mode==
"T") frame=
"true";
11076 if (mode==
"B") frame=
"B1950";
11077 if (mode==
"J") frame=
"J2000";
11078 frame+=
" equatorial";
11080 if (frame==
"gal") frame=
"galactic";
11081 if (frame==
"ecl") frame=
"ecliptic";
11082 if (frame==
"hor") frame=
"horizontal";
11083 if (frame==
"icr") frame=
"ICRS";
11084 if (frame==
"loc") frame=
"local";
11087 cout <<
" *" << ClassName() <<
"::InitDataNames* Prepared for input of " << sdir <<
" directions in " << frame <<
" coordinates." << endl;
11180 Bool_t error=kFALSE;
11182 if (obsname!=
"Name" && obsname!=
"Run" && obsname!=
"Event" && obsname!=
"Eventb" && obsname!=
"VetoLevel"
11183 && obsname!=
"DetId" && obsname!=
"Date" && obsname!=
"Tobs" && obsname!=
"Tstart" && obsname!=
"Tend"
11184 && obsname!=
"d" && obsname!=
"a" && obsname!=
"b" && obsname!=
"z"
11185 && obsname!=
"E" && obsname!=
"L" && obsname!=
"S" && obsname!=
"F" && obsname!=
"I" && obsname!=
"J"
11186 && obsname!=
"T90" && obsname!=
"T100"
11187 && obsname!=
"dsigma" && obsname!=
"csigma" && obsname!=
"zsigma"
11188 && obsname!=
"Esigma" && obsname!=
"Lsigma" && obsname!=
"Ssigma" && obsname!=
"Fsigma" && obsname!=
"Isigma"
11189 && obsname!=
"T90sigma" && obsname!=
"T100sigma") error=kTRUE;
11190 if (obsname==
"Date" && (units!=
"ddmmyyyy" && units!=
"yyyymmdd" && units!=
"mmddyyyy" && units!=
"yyyyddmm")) error=kTRUE;
11191 if ((obsname==
"Tobs" || obsname==
"Tstart" || obsname==
"Tend")
11192 && (units!=
"JD" && units!=
"MJD" && units!=
"TJD" && units!=
"hms" && units!=
"hrs")) error=kTRUE;
11193 if ((obsname==
"a" || obsname==
"b" || obsname==
"csigma")
11194 && (units!=
"rad" && units!=
"deg" && units!=
"dms" && units!=
"hms" && units!=
"hrs")) error=kTRUE;
11195 if (func!=
"none" && func!=
"Log" && func!=
"Ln") error=kTRUE;
11199 cout <<
" *" << ClassName() <<
"::SetDataNames* Invalid input encountered." << endl;
11200 cout <<
" obsname=" << obsname <<
" units=" << units <<
" func=" << func << endl;
11205 TObjString* obs=
new TObjString(obsname);
11206 TObjString* var=
new TObjString(varname);
11207 TObjString* u=
new TObjString(units);
11208 TObjString* f=
new TObjString(func);
11209 TObjString* val=
new TObjString(
"");
11227 TString sdir=
"undefined";
11231 TString frame=
"undefined";
11238 frame+=
" equatorial";
11247 cout <<
" *" << ClassName() <<
"::ListDataNames* Settings for input of " << sdir <<
" directions in " << frame <<
" coordinates." << endl;
11253 cout <<
" *** No settings were specified ***" << endl;
11257 cout <<
" *** The following " << n <<
" settings were specified ***" << endl;
11264 for (Int_t i=1; i<=n; i++)
11270 cout <<
" obsname=" << obs->GetString() <<
" varname=" << var->GetString() <<
" units=" << u->GetString() <<
" func=" << f->GetString() << endl;
11405 fBurstParameters->SetNameTitle(
"BurstParameters",
"Parameter settings for transient burst investigations");
11411 if (name==
"ESigmax" || name==
"Emax") value+=1e-10;
11416 Double_t pi=acos(-1.);
11562 if (fTunits==0) Tfact=86400;
11563 if (fTunits==1) Tfact=3600;
11564 if (fTunits==3) Tfact=1e-9;
11565 if (fTunits==4) Tfact=1e-12;
11576 if (!fRecoangle) fAngresmin=fAngresfix;
11577 Float_t Minsigmatot=-1;
11578 if (fSumsigmas==-1) Minsigmatot=fAngresmin;
11579 if (fSumsigmas==0) Minsigmatot=fSigmamin;
11580 if (fSumsigmas==1) Minsigmatot=fSigmamin+fAngresmin;
11581 if (fSumsigmas==2) Minsigmatot= sqrt(fSigmamin*fSigmamin+fAngresmin*fAngresmin);
11582 name=
"Minsigmatot";
11587 if (!fRecoangle) fAngresmax=fAngresfix;
11588 Float_t Maxsigmatot=-1;
11589 if (fSumsigmas==-1) Maxsigmatot=fAngresmax;
11590 if (fSumsigmas==0) Maxsigmatot=fSigmamax;
11591 if (fSumsigmas==1) Maxsigmatot=fSigmamax+fAngresmax;
11592 if (fSumsigmas==2) Maxsigmatot= sqrt(fSigmamax*fSigmamax+fAngresmax*fAngresmax);
11593 name=
"Maxsigmatot";
11600 Float_t Dtwin=fTmax-fTmin;
11623 Float_t phimin=fRAmin;
11624 Float_t phimax=fRAmax;
11625 Float_t thmin=90.-fDeclmax;
11626 Float_t thmax=90.-fDeclmin;
11627 Float_t OmegaDecl=
GetSolidAngle(thmin,thmax,
"deg",phimin,phimax,
"deg");
11634 Float_t RbkgDecl=fBkgrate;
11637 RbkgDecl=fabs(fBkgrate)*OmegaDecl;
11644 Float_t NbkgHour=RbkgDecl*3600.;
11651 Float_t NbkgWin=RbkgDecl*fDtwin*Tfact;
11742 if (fTunits==1) tu=
"hours";
11743 if (fTunits==2) tu=
"sec";
11744 if (fTunits==3) tu=
"ns";
11745 if (fTunits==4) tu=
"ps";
11747 cout <<
" ========================= User provided source c.q. burst settings ===============================" << endl;
11750 printf(
" No limitation has been put on the number of sources to be accepted for analysis. \n");
11754 printf(
" Maximal number of sources to be accepted for analysis : %-i \n",fNmaxsrc);
11758 printf(
" No limitation has been put on the number of observed events to be accepted for analysis. \n");
11762 printf(
" Maximal number of observed events to be accepted for analysis : %-i \n",fNmaxevt);
11764 printf(
" Right ascension interval (J2000 in degrees) for source c.q. event position acceptance : [%-g,%-g] \n",fRAmin,fRAmax);
11765 printf(
" Declination interval (J2000 in degrees) for source c.q. event position acceptance : [%-g,%-g] \n",fDeclmin,fDeclmax);
11766 printf(
" Redshift interval for source acceptance : [%-g,%-g] \n",fabs(fZmin),fZmax);
11767 if (fZmin<0) printf(
" Random redshift values taken from z-distribution in case of unknown redshift \n");
11768 if (fAvgrbz>=0) printf(
" User defined average source redshift : %-g \n",fAvgrbz);
11769 printf(
" Event energy interval (in GeV) for event acceptance : [%-g,%-g] \n",fEmin,fEmax);
11770 printf(
" Position uncertainty interval (sigma in degrees) for source acceptance : [%-g,%-g] \n",fabs(fSigmamin),fSigmamax);
11771 if (fSigmamin<0) printf(
" Random sigma values taken from sigma-distribution when missing in loaded data \n");
11772 printf(
" Event angular resolution interval (sigma in degrees) for event acceptance : [%-g,%-g] \n",fAngresmin,fAngresmax);
11773 if (fDatype>0) printf(
" Sigma (combination) selection (-1=event sigma only 0=source sigma only 1=linear summation 2=quadratic summation) : %-i \n",fSumsigmas);
11776 if (fDatype<0) printf(
" Unrestricted angular search area. \n");
11777 if (!fDatype) printf(
" Fixed angular search circle around the source position : %-g degrees \n",fDawin);
11778 if (fDatype==1) printf(
" Fixed angular search circle (in combined max. source/event sigma) around the source position : %-g \n",fDawin);
11779 if (fDatype==2) printf(
" Variable angular search circle (in combined actual source/event sigma) around the source position : %-g \n",fDawin);
11783 if (fDatype<0) printf(
" Unrestricted angular search area. \n");
11784 if (!fDatype) printf(
" Fixed angular local zenith band above/below the source position : %-g degrees \n",fabs(fDawin));
11785 if (fDatype==1) printf(
" Fixed angular local zenith band (in combined max. source/event sigma) above/below the source position : %-g \n",fabs(fDawin));
11786 if (fDatype==2) printf(
" Variable angular local zenith band (in combined actual source/event sigma) above/below the source position : %-g \n",fabs(fDawin));
11788 printf(
" Number of requested background patches per source : %-i \n",fNbkg);
11791 printf(
" Duration interval (t90 in sec) for burst acceptance : [%-g,%-g] \n",fabs(fT90min),fT90max);
11792 if (fT90min<0) printf(
" Random values taken from T90-distribution in case T90 and T100 were missing \n");
11793 if (fAvgrbt90>0) printf(
" User defined average burst T90 duration : %-g sec. \n",fAvgrbt90);
11794 if (fTmax>fTmin) printf(
" Total search time window (in %-s) with the burst trigger at t=0 : [%-g,%-g] \n",tu.Data(),fTmin,fTmax);
11796 if (fTmax<=fTmin) printf(
" Search will be performed with no restrictions on the time window \n");
11797 if (fTbin<0) printf(
" Automatic time histogram binning with as mean number of bkg counts/bin : %-g \n",fabs(fTbin));
11798 if (!fTbin) printf(
" Variable time histogram binning with as size (in %-s) for the first time : %-g \n",tu.Data(),fVarTbin);
11803 printf(
" Time histogram bin size in average T90 units : %-g",fTbin);
11804 if (fAvgrbt90>0 || fNgrbs>0) printf(
" (=%-g sec)",fTbin*fabs(fAvgrbt90));
11809 printf(
" Time histogram bin size : %-g %-s \n",fTbin,tu.Data());
11814 printf(
" Automatic angular histogram binning with as mean number of bkg counts per bin : %-g \n",fabs(fAbin));
11818 printf(
" Angular histogram bin size : %-g degrees \n",fAbin);
11826 printf(
" Number of generated neutrinos per burst : %-g without statistical fluctuations \n",fabs(fGrbnu));
11830 printf(
" Maximum number of generated neutrinos per burst : %-g \n",fGrbnu);
11831 printf(
" The actual number of neutrinos may be less due to statistical fluctuations \n");
11835 printf(
" Neutrino production is assumed to be NOT coupled to the observed burst duration \n");
11836 printf(
" Mean decoupled time difference between burst gammas/GW and neutrinos : %-g sec. \n",fDtnu);
11840 printf(
" Neutrino production is assumed to be coupled to the observed burst duration \n");
11841 printf(
" Mean coupled time difference (in units of T90 w.r.t. trigger) between burst gammas/GW and neutrinos : %-g",fDtnu);
11845 printf(
" Sigma of mean time difference between burst gammas/GW flash and neutrinos : %-g sec. \n",fDtnus);
11849 printf(
" Sigma of mean time difference (in units of T90) between burst gammas/GW flash and neutrinos : %-g \n",fabs(fDtnus));
11854 str=
"Signal energy PDF at the source : dN/dE=";
11858 str=
"Signal energy profile at Earth : dN/dE";
11861 str.ReplaceAll(
"x",
"E");
11863 if (
fSigEmode==
"SigF") str+=
" cm^-2 s^-1";
11864 if (
fSigEmode==
"SigI") str+=
" cm^-2 s^-1 sr^-1";
11865 printf(
" %-s within [%-g,%-g] GeV \n",str.Data(),fESigmin,fESigmax);
11870 printf(
" The signal neutrino energy at Earth will be corrected for redshift \n");
11874 printf(
" No redshift correction will be applied on the generated signal neutrino energy \n");
11879 str=
"Background energy PDF at Earth : dN/dE=";
11883 str=
"Background energy profile at Earth : dN/dE=";
11886 str.ReplaceAll(
"x",
"E");
11888 if (
fBkgEmode==
"BkgF") str+=
" cm^-2 s^-1";
11889 if (
fBkgEmode==
"BkgI") str+=
" cm^-2 s^-1 sr^-1";
11890 printf(
" %-s within [%-g,%-g] GeV \n",str.Data(),fEmin,fEmax);
11891 printf(
" Fixed event reco angular resolution (sigma in degrees), also used when no distribution (value) is available : %-g \n",fAngresfix);
11892 printf(
" Event reconstruction angular uncertainty selection (0=use fixed value 1=mean 2=median 3=draw from distribution) : %-i \n",fRecoangle);
11893 printf(
" Neutrino-lepton kinematic opening angle selection for CC interactions (0=none 1=mean 2=median 3=draw from pdf) : %-i \n",fKinangle);
11897 printf(
" Time resolution of the neutrino detector : %-g sec. \n",fTimres);
11898 printf(
" Area covered c.q. overlooked by the neutrino detector : %-g m^2 \n",fSensarea);
11899 if (fBkgrate) printf(
" User defined mean rate of background events for the specified declination interval (<0 : rate per steradian) : %-g Hz \n",fBkgrate);
11902 printf(
" ============================== Derived parameters ==================================== \n");
11903 printf(
" Combined source position and event reco angular uncertainty interval (sigma in degrees) : [%-g,%-g] \n",fMinsigmatot,fMaxsigmatot);
11904 printf(
" Solid angle coverage corresponding to the selected declination band : %-g steradian \n",fOmegaDecl);
11907 printf(
" Background event rate (from user setting) for the selected declination band : %-g Hz \n",fRbkgDecl);
11908 printf(
" Mean number of background events (from user setting) per hour from the selected declination band : %-g \n",fNbkgHour);
11909 printf(
" Mean number of background events (from user setting) in the time window from the selected declination band : %-g \n",fNbkgWin);
11913 printf(
" Number of bursts accepted for analysis : %-i \n",fNgrbs);
11914 printf(
" Median source redshift from the data sample : %-g \n",fabs(fAvgrbz));
11915 if (fAvgrbt90) printf(
" Median burst T90 duration from the data sample : %-g sec. \n",fabs(fAvgrbt90));
11916 printf(
" Median souce position uncertainty (sigma in degrees) from the data sample : %-g \n",fAvgrbsigma);
11918 if (fNevts>0) printf(
" Number of observed events accepted for analysis : %-i \n",fNevts);
11919 printf(
" ====================================================================================== \n");
11983 if (type==
"-" && src) type=
"GRB";
11984 if (type==
"-" && !src) type=
"EVT";
11990 cout <<
" *" << ClassName() <<
"::LoadInputData* No variables were specified for " << type <<
" data."<< endl;
12022 if (src && fZmin<0) zdist=
GetBurstZdist(
"LoadInputData()",type);
12026 if (src && fT90min<0) t90dist=
GetBurstT90dist(
"LoadInputData()",type);
12029 TH1* sigmaposdist=0;
12033 TChain data(tree.Data());
12034 data.Add(file.Data());
12043 TObjString* pval=0;
12054 TString Name,
Date,Tobs,Tstart,Tend;
12056 Float_t z,csigma,T90,T100,E;
12075 Int_t nent=data.GetEntries();
12081 fRefs=
new TObjArray(nent);
12086 size=
fRefs->GetSize();
12087 fRefs->Expand(size+nent);
12094 fSigs=
new TObjArray(nent);
12099 size=
fSigs->GetSize();
12100 fSigs->Expand(size+nent);
12105 for (Int_t ient=0; ient<nent; ient++)
12107 if (nmax>=0 && nnew>=nmax)
break;
12108 if (src && fNmaxsrc>=0 && (fNgrbs+nnew)>=fNmaxsrc)
break;
12109 if (!src && fNmaxevt>=0 && (fNevts+nnew)>=fNmaxevt)
break;
12111 data.GetEntry(ient);
12130 for (Int_t ivar=1; ivar<=nvars; ivar++)
12132 obsname=((TObjString*)
fDataNames.GetObject(ivar,1))->GetString();
12133 varname=((TObjString*)
fDataNames.GetObject(ivar,2))->GetString();
12134 units=((TObjString*)
fDataNames.GetObject(ivar,3))->GetString();
12135 func=((TObjString*)
fDataNames.GetObject(ivar,4))->GetString();
12137 pval=(TObjString*)
fDataNames.GetObject(ivar,5);
12139 if (!pval)
continue;
12141 lx=data.GetLeaf(varname);
12146 pval->SetString(
"-999");
12150 if (obsname==
"Name")
12154 Name=lxc->GetValueString();
12158 value=lx->GetValue();
12161 if (func==
"Log") value=pow(10,value);
12162 if (func==
"Ln") value=exp(value);
12165 if (obsname==
"a" || obsname==
"b" || obsname==
"csigma") value=
ConvertAngle(value,units,
"deg");
12168 if (units.IsFloat())
12177 pval->SetString(val);
12180 if (obsname==
"Date")
12184 if (units==
"ddmmyyyy") dmode=0;
12185 if (units==
"yyyymmdd") dmode=1;
12186 if (units==
"mmddyyyy") dmode=2;
12187 if (units==
"yyyyddmm") dmode=3;
12189 if (obsname==
"Tobs")
12192 if (units==
"JD") tobs.
SetJD(value);
12193 if (units==
"MJD") tobs.
SetMJD(value);
12194 if (units==
"TJD") tobs.
SetTJD(value);
12204 value=s+double(100*m+10000*h);
12208 if (obsname==
"Tstart")
12211 if (units==
"JD") tstart.
SetJD(value);
12212 if (units==
"MJD") tstart.
SetMJD(value);
12213 if (units==
"TJD") tstart.
SetTJD(value);
12223 value=s+double(100*m+10000*h);
12227 if (obsname==
"Tend")
12230 if (units==
"JD") tend.
SetJD(value);
12231 if (units==
"MJD") tend.
SetMJD(value);
12232 if (units==
"TJD") tend.
SetTJD(value);
12242 value=s+double(100*m+10000*h);
12247 if (obsname==
"d") d=value;
12248 if (obsname==
"a") a=value;
12249 if (obsname==
"b") b=value;
12250 if (obsname==
"z") z=value;
12251 if (obsname==
"csigma") csigma=value;
12252 if (obsname==
"T90") T90=value;
12253 if (obsname==
"T100") T100=value;
12254 if (obsname==
"E") E=value;
12261 if (a<-900 || b<-900)
continue;
12264 if (
fDataFrame==
"equ" &&
fDataMode==
"J" && (a<fRAmin || a>fRAmax || b<fDeclmin || b>fDeclmax))
continue;
12267 if (Tobs!=
"none" && Tobs!=
"set" &&
Date!=
"none") tobs.
SetUT(
Date,Tobs,dmode);
12268 if (Tstart!=
"none" && Tstart!=
"set" &&
Date!=
"none") tstart.
SetUT(
Date,Tstart,dmode);
12269 if (Tend!=
"none" && Tend!=
"set" &&
Date!=
"none") tend.
SetUT(
Date,Tend,dmode);
12272 if (Tobs==
"none" || (Tobs!=
"set" &&
Date==
"none"))
continue;
12275 tobs.GetDate(kTRUE,0,&yyyy,&mm,&dd);
12276 idate=dd+100*mm+10000*yyyy;
12284 jdate=idate%1000000;
12286 if (jdate<100000) grbname+=
"0";
12290 if (date1 && idate<date1)
continue;
12291 if (date2 && idate>date2)
continue;
12295 if (T90<=0) T90=T100;
12296 if (fT90min<0 && T90<0 && t90dist) T90=t90dist->GetRandom();
12298 if (T90<fabs(fT90min) || T90>fT90max)
continue;
12300 if (fZmin<0 && z<0 && zdist) z=zdist->GetRandom();
12302 if (z<fabs(fZmin) || z>fZmax)
continue;
12304 if (fSigmamin<0 && csigma<0 && sigmaposdist) csigma=sigmaposdist->GetRandom();
12306 if (csigma<fabs(fSigmamin) || csigma>fSigmamax)
continue;
12310 if (E<fEmin || E>fEmax)
continue;
12311 if (csigma<fAngresmin || csigma>fAngresmax)
continue;
12315 sx=
SetSignal(d,a,
"deg",b,
"deg",
fDataFrame,&tobs,-1,
fDataMode,grbname,iobs);
12321 GetSignal(d,a,
"deg",b,
"deg",
"equ",&tobs,jlast,
"J",iobs);
12324 if (a<fRAmin || a>fRAmax || b<fDeclmin || b>fDeclmax)
12337 for (Int_t ivar=1; ivar<=nvars; ivar++)
12339 obsname=((TObjString*)
fDataNames.GetObject(ivar,1))->GetString();
12340 val=((TObjString*)
fDataNames.GetObject(ivar,5))->GetString();
12343 if (obsname==
"Name")
continue;
12349 if (obsname==
"a" || obsname==
"b")
continue;
12352 if (obsname==
"Date") value=idate;
12353 if (obsname==
"Tobs") value=tobs.
GetMJD();
12354 if (obsname==
"Tstart") value=tstart.
GetMJD();
12355 if (obsname==
"TEnd") value=tend.
GetMJD();
12358 if (obsname==
"z") value=z;
12359 if (obsname==
"csigma") value=csigma;
12360 if (obsname==
"T90") value=T90;
12366 if (!src)
continue;
12383 cout <<
" *" << ClassName() <<
"::LoadInputData* " << nnew <<
" new source(s) of type " << type
12384 <<
" stored from Tree:" << tree <<
" of file(s):" << file << endl;
12385 cout <<
" Total number of stored sources c.q. bursts : " << nstored << endl;
12392 cout <<
" *" << ClassName() <<
"::LoadInputData* " << nnew
12393 <<
" new observed event(s) were stored from Tree:" << tree <<
" of file(s):" << file << endl;
12394 cout <<
" Total number of stored events : " << nstored << endl;
12423 file=gSystem->ExpandPathName(file.Data());
12425 TFile f(file.Data());
12426 TH2* h=(TH2*)f.Get(hist.Data());
12430 printf(
"*%-s::LoadAeffData* No 2D histogram with Aeff data found with name : %-s \n",ClassName(),hist.Data());
12434 TH2* hAeffProfile=(TH2*)h->Clone(
"hAeffProfile");
12435 hAeffProfile->SetDirectory(0);
12439 printf(
"\n *%-s::LoadAeffData* 2D histogram hAeffProfile(log(E),cos(theta)) with effective area data stored. \n",ClassName());
12440 printf(
" The data were obtained from the file : %-s \n",file.Data());
12471 TH2* hAeffProfile=(TH2*)
fBurstHistos.FindObject(
"hAeffProfile");
12472 TH1* hSigEprofile=(TH1*)
fBurstHistos.FindObject(
"hSigEprofile");
12473 TH1* hBkgEprofile=(TH1*)
fBurstHistos.FindObject(
"hBkgEprofile");
12475 if (!hAeffProfile)
return;
12477 TAxis* xaxis=hAeffProfile->GetXaxis();
12478 TAxis* yaxis=hAeffProfile->GetYaxis();
12480 if (!xaxis || !yaxis)
return;
12482 Int_t nebins=xaxis->GetNbins();
12483 Double_t emin=xaxis->GetXmin();
12484 Double_t emax=xaxis->GetXmax();
12486 Int_t nabins=yaxis->GetNbins();
12487 Double_t amin=yaxis->GetXmin();
12488 Double_t amax=yaxis->GetXmax();
12490 TH2* hSigNuCountProfile=(TH2*)
fBurstHistos.FindObject(
"hSigNuCountProfile");
12491 TH2* hBkgNuCountProfile=(TH2*)
fBurstHistos.FindObject(
"hBkgNuCountProfile");
12492 TH1* hSigZenithProfile=(TH1F*)
fBurstHistos.FindObject(
"hSigZenithProfile");
12493 TH1* hBkgZenithProfile=(TH1F*)
fBurstHistos.FindObject(
"hBkgZenithProfile");
12496 Double_t integral=0;
12503 if (hSigEprofile && (mode==
"Aeff" || mode==
"SigS" || mode==
"SigF" || mode==
"SigI"))
12505 title=
"Contraction of hSigEprofile and hAeffProfile;Log(E) in GeV;Cosine of the Zenith angle (#theta);Counts";
12506 if (mode.Contains(
"F")) title+=
" s^{-1}";
12507 if (mode.Contains(
"I")) title+=
" s^{-1} sr^{ -1}";
12508 if (!hSigNuCountProfile)
12510 hSigNuCountProfile=(TH2*)hAeffProfile->Clone(
"hSigNuCountProfile");
12511 hSigNuCountProfile->Reset();
12512 hSigNuCountProfile->SetTitle(title);
12515 else if (mode.Contains(
"Sig"))
12517 hSigNuCountProfile->Reset();
12518 hSigNuCountProfile->SetBins(nebins,emin,emax,nabins,amin,amax);
12519 hSigNuCountProfile->SetTitle(title);
12522 for (Int_t abin=1; abin<=nabins; abin++)
12524 for (Int_t ebin=1; ebin<=nebins; ebin++)
12526 xlow=xaxis->GetBinLowEdge(ebin);
12527 xup=xaxis->GetBinUpEdge(ebin);
12530 if (xup<fESigmin || xlow>fESigmax)
continue;
12531 if (xlow<fESigmin && xup>fESigmin) xlow=fESigmin;
12532 if (xup>fESigmax && xlow<fESigmax) xup=fESigmax;
12533 aeff=hAeffProfile->GetBinContent(ebin,abin);
12535 count=aeff*integral;
12536 hSigNuCountProfile->SetBinContent(ebin,abin,count);
12541 title=
"Projection of hSigNuCountProfile;Cosine of the Zenith angle (#theta);Counts";
12542 if (mode.Contains(
"F")) title+=
" s^{-1}";
12543 if (mode.Contains(
"I")) title+=
" s^{-1} sr^{ -1}";
12545 if (!hSigZenithProfile)
12547 hSigZenithProfile=hSigNuCountProfile->ProjectionY(
"hSigZenithProfile");
12550 else if (mode.Contains(
"Sig"))
12552 delete hSigZenithProfile;
12553 hSigZenithProfile=hSigNuCountProfile->ProjectionY(
"hSigZenithProfile");
12555 hSigZenithProfile->SetTitle(title);
12559 if (hBkgEprofile && (mode==
"Aeff" || mode==
"BkgS" || mode==
"BkgF" || mode==
"BkgI"))
12561 title=
"Contraction of hBkgEprofile and hAeffProfile;Log(E) in GeV;Cosine of the Zenith angle (#theta);Counts";
12562 if (mode.Contains(
"F")) title+=
" s^{-1}";
12563 if (mode.Contains(
"I")) title+=
" s^{-1} sr^{ -1}";
12565 if (!hBkgNuCountProfile)
12567 hBkgNuCountProfile=(TH2*)hAeffProfile->Clone(
"hBkgNuCountProfile");
12568 hBkgNuCountProfile->Reset();
12569 hBkgNuCountProfile->SetTitle(title);
12572 else if (mode.Contains(
"Bkg"))
12574 hBkgNuCountProfile->Reset();
12575 hBkgNuCountProfile->SetBins(nebins,emin,emax,nabins,amin,amax);
12576 hBkgNuCountProfile->SetTitle(title);
12579 for (Int_t abin=1; abin<=nabins; abin++)
12581 for (Int_t ebin=1; ebin<=nebins; ebin++)
12583 xlow=xaxis->GetBinLowEdge(ebin);
12584 xup=xaxis->GetBinUpEdge(ebin);
12587 if (xup<fEmin || xlow>fEmax)
continue;
12588 if (xlow<fEmin && xup>fEmin) xlow=fEmin;
12589 if (xup>fEmax && xlow<fEmax) xup=fEmax;
12590 aeff=hAeffProfile->GetBinContent(ebin,abin);
12592 count=aeff*integral;
12593 hBkgNuCountProfile->SetBinContent(ebin,abin,count);
12598 title=
"Projection of hBkgNuCountProfile;Cosine of the Zenith angle (#theta);Counts";
12599 if (mode.Contains(
"F")) title+=
" s^{-1}";
12600 if (mode.Contains(
"I")) title+=
" s^{-1} sr^{ -1}";
12602 if (!hBkgZenithProfile)
12604 hBkgZenithProfile=hBkgNuCountProfile->ProjectionY(
"hBkgZenithProfile");
12607 else if (mode.Contains(
"Bkg"))
12609 delete hBkgZenithProfile;
12610 hBkgZenithProfile=hBkgNuCountProfile->ProjectionY(
"hBkgZenithProfile");
12612 hBkgZenithProfile->SetTitle(title);
12655 Double_t pi=acos(-1.);
12656 n=TMath::Nint(
double(n)*fOmegaDecl/(4.*pi));
12671 if (!zdist || !t90dist || !sigmaposdist)
12674 cout <<
" *" << ClassName() <<
"::GenBurstGCNdata* A distribution for random values is missing." << endl;
12679 Float_t thlow=90.-fDeclmax;
12680 Float_t thup=90.-fDeclmin;
12681 Float_t phimin=fRAmin;
12682 Float_t phimax=fRAmax;
12683 if (thlow<0) thlow=0;
12684 if (thup>180) thup=180;
12690 Float_t sigmagrb=0;
12692 Double_t thetagrb,phigrb,ragrb,decgrb;
12695 for (Int_t igrb=1; igrb<=n; igrb++)
12697 if (fNmaxsrc>=0 && (fNgrbs+ngen)>=fNmaxsrc)
break;
12700 if (fabs(fZmin)==fZmax) zgrb=fZmax;
12701 while (zgrb<fabs(fZmin) || zgrb>fZmax)
12703 zgrb=zdist->GetRandom();
12707 if (fabs(fT90min)==fT90max) t90grb=fT90max;
12708 while (t90grb<fabs(fT90min) || t90grb>fT90max)
12710 t90grb=t90dist->GetRandom();
12711 t90grb=pow(
float(10),t90grb);
12715 if (fabs(fSigmamin)==fSigmamax) sigmagrb=fSigmamax;
12716 while (sigmagrb<fabs(fSigmamin) || sigmagrb>fSigmamax)
12718 sigmagrb=sigmaposdist->GetRandom();
12723 thetagrb=rgrb.
GetX(2,
"sph",
"deg");
12724 phigrb=rgrb.
GetX(3,
"sph",
"deg");
12731 decgrb=90.-thetagrb;
12732 sx=
SetSignal(1,ragrb,
"deg",decgrb,
"deg",
"equ",0,-1,
"J",grbname);
12754 printf(
"\n *%-s::GenBurstGCNdata* %-i new generated bursts with name %-s were stored. \n",ClassName(),ngen,name.Data());
12755 printf(
" Total number of stored bursts : %-i \n",fNgrbs);
12770 TH2* hSigNuCountProfile=(TH2*)
fBurstHistos.FindObject(
"hSigNuCountProfile");
12771 TH2* hBkgNuCountProfile=(TH2*)
fBurstHistos.FindObject(
"hSigNuCountProfile");
12780 Double_t thetagrb=0;
12782 GetSignal(rgrb,thetagrb,
"rad",phigrb,
"rad",
"loc",ts,index,
"T",0);
12793 if (hSigNuCountProfile &&
fSigEmode!=
"SigE")
12795 axis=hSigNuCountProfile->GetYaxis();
12796 nbins=axis->GetNbins();
12797 jbin=axis->FindFixBin(cos(thetagrb));
12799 if (jbin<1 || jbin>nbins)
return;
12802 nbins=hSigNuCountProfile->GetNbinsX();
12803 for (Int_t ibin=1; ibin<=nbins; ibin++)
12805 nsig=hSigNuCountProfile->GetBinContent(ibin,jbin);
12806 if (nsig>nsigmax) nsigmax=nsig;
12810 if (
fSigEmode==
"SigF") nsigmax=nsigmax*dt;
12811 if (
fSigEmode==
"SigI") nsigmax=nsigmax*dt*fOmegaDecl;
12816 if (hBkgNuCountProfile &&
fBkgEmode!=
"BkgE")
12818 axis=hBkgNuCountProfile->GetYaxis();
12819 nbins=axis->GetNbins();
12820 jbin=axis->FindFixBin(cos(thetagrb));
12822 if (jbin<1 || jbin>nbins)
return;
12825 nbins=hBkgNuCountProfile->GetNbinsX();
12826 for (Int_t ibin=1; ibin<=nbins; ibin++)
12828 nsig=hBkgNuCountProfile->GetBinContent(ibin,jbin);
12829 if (nbkg>nbkgmax) nbkgmax=nsig;
12833 if (
fBkgEmode==
"BkgF") nbkgmax=nbkgmax*dt;
12834 if (
fBkgEmode==
"BkgI") nbkgmax=nbkgmax*dt*fOmegaDecl;
12875 TChain data(tree.Data());
12876 data.Add(file.Data());
12878 Int_t nen=data.GetEntries();
12879 TLeaf* lx=data.FindLeaf(name.Data());
12883 cout <<
" *" << ClassName() <<
"::MakeBurstZdist* Missing information for tree variable:" << name << endl;
12884 cout <<
" of Tree:" << tree <<
" with " << nen <<
" entries in file:" << file << endl;
12893 TH1F* hz=
new TH1F(
"hz",
"Archival data of observed burst redshifts",nb,zmin,zmax);
12895 hz->GetXaxis()->SetTitle(
"Burst redshift");
12896 hz->GetYaxis()->SetTitle(
"Counts");
12901 TH1F* hd=
new TH1F(
"hd",
"Burst distances derived from the archival redshift data",nb,dmin,dmax);
12903 hd->GetXaxis()->SetTitle(
"Burst physical distance in Mpc");
12904 hd->GetYaxis()->SetTitle(
"Counts");
12914 for (Int_t ien=0; ien<nen; ien++)
12916 data.GetEntry(ien);
12918 lx=data.GetLeaf(name.Data());
12922 if (z<zmin || z>zmax)
continue;
12931 cout <<
" *" << ClassName() <<
"::MakeBurstZdist* " << nz <<
" archival z-values have been obtained from tree variable:" << name
12932 <<
" of Tree:" << tree <<
" in file(s):" << file << endl;
12949 if (type.Contains(
"GRB"))
12952 cout <<
" *" << ClassName() <<
"::GetBurstZdist* Called from " << name << endl;
12953 cout <<
" *** Archival observed redshift distribution not found. ***" << endl;
12954 cout <<
" A Landau fit from Swift GRB redshift data will be used to provide missing c.q. random z values." << endl;
12959 TF1 fz(
"fz",
"59.54*TMath::Landau(x,1.092,0.5203)");
12962 TH1* hfz=fz.GetHistogram();
12963 zdist=(TH1*)hfz->Clone();
12964 zdist->SetNameTitle(
"hZpdf",
"Landau fit for Swift GRB z data");
12965 zdist->GetXaxis()->SetTitle(
"GRB redshift");
12966 zdist->GetYaxis()->SetTitle(
"Counts");
12973 cout <<
" *" << ClassName() <<
"::GetBurstZdist* Called from " << name << endl;
12974 cout <<
" *** No redshift fit is available for source class " << type <<
" ***" << endl;
13014 TChain data(tree.Data());
13015 data.Add(file.Data());
13017 Int_t nen=data.GetEntries();
13018 TLeaf* lx=data.FindLeaf(name.Data());
13022 cout <<
" *" << ClassName() <<
"::MakeBurstT90dist* Missing information for tree variable:" << name << endl;
13023 cout <<
" of Tree:" << tree <<
" with " << nen <<
" entries in file:" << file << endl;
13032 TH1F* ht90=
new TH1F(
"ht90",
"Archival data of observed burst durations",nb,xmin,xmax);
13034 ht90->GetXaxis()->SetTitle(
"Burst duration ^{10}log(T90) in sec.");
13035 ht90->GetYaxis()->SetTitle(
"Counts");
13043 for (Int_t ien=0; ien<nen; ien++)
13045 data.GetEntry(ien);
13047 lx=data.GetLeaf(name.Data());
13050 t90=lx->GetValue();
13053 ht90->Fill(log10(t90));
13058 cout <<
" *" << ClassName() <<
"::MakeBurstT90dist* " << nt90 <<
" archival T90 values have been obtained from variable:" << name
13059 <<
" of Tree:" << tree <<
" in file(s):" << file << endl;
13076 if (type.Contains(
"GRB"))
13079 cout <<
" *" << ClassName() <<
"::GetBurstT90dist* Called from " << name << endl;
13080 cout <<
" *** Observational T90 distribution not found. ***" << endl;
13081 cout <<
" A double Gaussian fit from Fermi GRB T90 data will be used to provide missing c.q. random T90 values." << endl;
13086 TF1 ft(
"ft",
"44.39*TMath::Gaus(x,-0.131,0.481)+193.8*TMath::Gaus(x,1.447,0.4752)");
13089 TH1* hft=ft.GetHistogram();
13090 t90dist=(TH1*)hft->Clone();
13091 t90dist->SetNameTitle(
"hT90pdf",
"Double Gauss fit for Fermi t90 data");
13092 t90dist->GetXaxis()->SetTitle(
"GRB duration ^{10}log(T90) in sec.");
13093 t90dist->GetYaxis()->SetTitle(
"Counts");
13100 cout <<
" *" << ClassName() <<
"::GetBurstT90dist* Called from " << name << endl;
13101 cout <<
" *** No T90 fit is available for source class " << type <<
" ***" << endl;
13150 TChain data(tree.Data());
13151 data.Add(file.Data());
13153 Int_t nen=data.GetEntries();
13154 TLeaf* lx=data.FindLeaf(name.Data());
13158 cout <<
" *" << ClassName() <<
"::MakeBurstSigmaPosdist* Missing information for tree variable:" << name << endl;
13159 cout <<
" of Tree:" << tree <<
" with " << nen <<
" entries in file:" << file << endl;
13164 TH1* sigmaposdist=(TH1*)
fBurstHistos.FindObject(
"hsigmapos");
13168 TH1F* hsigmapos=
new TH1F(
"hsigmapos",
"Archival data of observed 1-sigma burst position uncertainties",nb,xmin,xmax);
13170 hsigmapos->GetXaxis()->SetTitle(
"Burst position uncertainty (sigma in degrees)");
13171 hsigmapos->GetYaxis()->SetTitle(
"Counts");
13175 TH1* hsigmapos=(TH1*)
fBurstHistos.FindObject(
"hsigmapos");
13178 Double_t sigmapos=0;
13179 for (Int_t ien=0; ien<nen; ien++)
13181 data.GetEntry(ien);
13183 lx=data.GetLeaf(name.Data());
13186 sigmapos=lx->GetValue();
13191 if (sigmapos<xmin || sigmapos>xmax)
continue;
13193 hsigmapos->Fill(sigmapos);
13197 cout <<
" *" << ClassName() <<
"::MakeBurstSigmaPosdist* " << nsigmapos <<
" archival sigmapos values have been obtained from variable:" << name
13198 <<
" of Tree:" << tree <<
" in file(s):" << file << endl;
13212 TH1* sigmaposdist=(TH1*)
fBurstHistos.FindObject(
"hsigmapos");
13215 if (type.Contains(
"GRB"))
13218 cout <<
" *" << ClassName() <<
"::GetBurstSigmaPosdist* Called from " << name << endl;
13219 cout <<
" *** Archival observed GRB position uncertainty distribution not found. ***" << endl;
13220 cout <<
" A Landau fit from observed GRB data will be used to provide missing c.q. random 1-sigma uncertainty values." << endl;
13222 sigmaposdist=(TH1*)
fBurstHistos.FindObject(
"hSigmaSourcePDF");
13225 TF1 fsigmapos(
"fsigmapos",
"245.2*TMath::Landau(x,-2.209,0.6721,1)");
13226 fsigmapos.SetRange(0,90);
13227 fsigmapos.SetNpx(10000);
13228 TH1* hfsigmapos=fsigmapos.GetHistogram();
13229 sigmaposdist=(TH1*)hfsigmapos->Clone();
13230 sigmaposdist->SetNameTitle(
"hSigmaSourcePDF",
"Landau fit for burst 1-sigma position uncertainty data");
13231 sigmaposdist->GetXaxis()->SetTitle(
"Burst position uncertainty (sigma in degrees)");
13232 sigmaposdist->GetYaxis()->SetTitle(
"Counts");
13239 cout <<
" *" << ClassName() <<
"::GetBurstSigmaPosdist* Called from " << name << endl;
13240 cout <<
" *** No position uncertainty fit is available for source class " << type <<
" ***" << endl;
13244 return sigmaposdist;
13323 if (mode!=
"SigE" && mode!=
"SigS" && mode!=
"SigF" && mode!=
"SigI" && mode!=
"BkgE" && mode!=
"BkgS" && mode!=
"BkgF" && mode!=
"BkgI")
13325 printf(
"\n *%-s::MakeBurstEnergydist* Inconsistent mode : %-s \n",ClassName(),mode.Data());
13337 if (mode.Contains(
"Sig"))
13348 if (Emin<=0) Emin=1e-10;
13351 if (mode.Contains(
"Bkg") || mode==
"SigE") nsrc=1;
13353 if (Emax<=Emin || nbins<1 || nsrc<1)
13355 printf(
"\n *%-s::MakeBurstEnergydist* Inconsistent data : mode=%-s nsrc=%-i Emin=%-g Emax=%-g nbins=%-i \n",ClassName(),mode.Data(),nsrc,Emin,Emax,nbins);
13360 Double_t xmin=log10(Emin);
13361 Double_t xmax=log10(Emax);
13366 if (nsrc>1 && (mode==
"SigS" || mode==
"BkgS"))
13368 norm=1./float(nsrc);
13369 sf.Form(
"%-g*%-s",norm,(spec.GetExpFormula(
"p")).Data());
13373 sf=spec.GetExpFormula(
"p");
13377 TF1 spec2(
"spec2",sf);
13383 if (mode==
"SigE" || mode==
"BkgE")
13385 sf=
"PDF for dN/dE=";
13386 sf+=spec2.GetExpFormula(
"p");
13387 norm=spec2.Integral(xmin,xmax);
13391 sf=
"Counts cm^{-2}";
13392 if (mode.Contains(
"F")) sf+=
" s^{-1}";
13393 if (mode.Contains(
"I")) sf+=
" s^{-1} sr^{ -1}";
13395 sf+=spec2.GetExpFormula(
"p");
13397 sf.ReplaceAll(
"x",
"E");
13399 if (mode.Contains(
"Bkg")) sh=
"Isotropic background energy distribution at Earth";
13400 if (mode.Contains(
"Sig"))
13404 sh=
"Induced signal energy distribution at the source";
13408 sh=
"Average per source induced signal energy distribution at Earth";
13411 sh+=
";^{10}log(E) in GeV;";
13417 if (mode.Contains(
"Bkg")) dist=(TH1*)
fBurstHistos.FindObject(
"hBkgEprofile");
13418 if (mode.Contains(
"Sig")) dist=(TH1*)
fBurstHistos.FindObject(
"hSigEprofile");
13429 if (mode.Contains(
"Bkg"))
13432 TH1F* hBkgEprofile=(TH1F*)his.Clone(
"hBkgEprofile");
13433 if (mode==
"BkgE") hBkgEprofile->Scale(1./norm);
13438 if (mode.Contains(
"Sig"))
13441 TH1F* hSigEprofile=(TH1F*)his.Clone(
"hSigEprofile");
13442 if (mode==
"SigE") hSigEprofile->Scale(1./norm);
13448 printf(
"\n *%-s::MakeBurstEnergydist* Created a %-s profile %-s on [Emin,Emax]=[%-g,%-g] GeV \n",ClassName(),mode.Data(),sf.Data(),Emin,Emax);
13490 if (mode!=
"SigE" && mode!=
"BkgE")
13492 printf(
" *%-s::MakeBurstEnergydist* Unsupported mode : %-s for only spectral index specification \n",ClassName(),mode.Data());
13496 TF1 spec(
"spec",
"pow(x,[0])");
13497 spec.SetParameter(0,-alpha);
13581 if (Emin<=0) Emin=1e-10;
13583 if ((abs(mode)!=1 && abs(mode)!=2) || Emax<=Emin)
13585 printf(
" *%-s::MakeBurstEnergydist* Inconsistent data: mode=%-i Emin=%-g Emax=%-g \n",ClassName(),mode,Emin,Emax);
13590 Double_t xmin=log10(Emin);
13591 Double_t xmax=log10(Emax);
13594 TChain data(tree.Data());
13595 data.Add(file.Data());
13597 Int_t nen=data.GetEntries();
13599 if (!nen || !data.FindLeaf(name1.Data()) || !data.FindLeaf(name2.Data()))
13601 cout <<
" *" << ClassName() <<
"::MakeBurstEnergydist* Missing information for tree variable:" << name1
13602 <<
" and/or tree variable:" << name2 << endl;
13603 cout <<
" of Tree:" << tree <<
" with " << nen <<
" entries in file:" << file << endl;
13609 if (abs(mode)==1) flag=TMath::Nint(
fBurstParameters->GetSignal(
"PDFbkgE"));
13610 if (abs(mode)==2) flag=TMath::Nint(
fBurstParameters->GetSignal(
"PDFsigE"));
13612 if (flag) mode=abs(mode);
13616 if (abs(mode)==1) Edist=(TH1*)
fBurstHistos.FindObject(
"hBkgEprofile");
13617 if (abs(mode)==2) Edist=(TH1*)
fBurstHistos.FindObject(
"hSigEprofile");
13619 if (mode>0 && Edist)
13635 TH1F* hBkgEprofile=
new TH1F(
"hBkgEprofile",
"Archival data of observed background energies",nb,xmin,xmax);
13637 hBkgEprofile->GetXaxis()->SetTitle(
"^{10}log(Energy) in GeV");
13638 hBkgEprofile->GetYaxis()->SetTitle(
"Counts");
13646 TH1F* hSigEprofile=
new TH1F(
"hSigEprofile",
"Archival data of observed signal energies",nb,xmin,xmax);
13648 hSigEprofile->GetXaxis()->SetTitle(
"^{10}log(Energy) in GeV");
13649 hSigEprofile->GetYaxis()->SetTitle(
"Counts");
13657 if (abs(mode)==1) Edist=(TH1*)
fBurstHistos.FindObject(
"hBkgEprofile");
13658 if (abs(mode)==2) Edist=(TH1*)
fBurstHistos.FindObject(
"hSigEprofile");
13664 for (Int_t ien=0; ien<nen; ien++)
13666 data.GetEntry(ien);
13668 lx=data.GetLeaf(name1.Data());
13671 logE=lx->GetValue();
13673 lx=data.GetLeaf(name2.Data());
13676 dec=lx->GetValue();
13681 if (dec>=fDeclmin && dec<=fDeclmax)
13689 if (abs(mode)==1) smode=
"archival background";
13690 if (abs(mode)==2) smode=
"archival signal";
13694 cout <<
" *" << ClassName() <<
"::MakeBurstEnergydist* A new " << smode
13695 <<
" energy distribution has been created." << endl;
13699 cout <<
" *" << ClassName() <<
"::MakeBurstEnergydist* Statistics of the existing " << smode
13700 <<
" energy distribution have been increased." << endl;
13703 cout <<
" " << nE <<
" energy values have been obtained from variable:" << name1
13704 <<
" of Tree:" << tree <<
" in file(s):" << file << endl;
13707void NcAstrolab::MakeBurstRecoAngresdist(TString file,TString tree,TString name1,TString name2,TString ua,TString name3,TString ud,Double_t Emin,Double_t Emax,Int_t nbe,Int_t nba)
13760 if (Emin<=0) Emin=1e-10;
13764 cout <<
" *" << ClassName() <<
"::MakeBurstRecoAngresdist* Inconsistent data: Emin=" << Emin <<
" Emax=" << Emax << endl;
13769 Double_t xmin=log10(Emin);
13770 Double_t xmax=log10(Emax);
13773 TChain data(tree.Data());
13774 data.Add(file.Data());
13776 Int_t nen=data.GetEntries();
13778 if (!nen || !data.FindLeaf(name1.Data()) || !data.FindLeaf(name2.Data()) || !data.FindLeaf(name3.Data()))
13780 cout <<
" *" << ClassName() <<
"::MakeBurstRecoAngresdist* Missing information for tree variable:" << name1
13781 <<
" and/or tree variable:" << name2 <<
" and/or tree variable:" << name3 << endl;
13782 cout <<
" of Tree:" << tree <<
" with " << nen <<
" entries in file:" << file << endl;
13787 TH2* Angresdist=(TH2*)
fBurstHistos.FindObject(
"hAngresE");
13791 TH2F* hAngresE=
new TH2F(
"hAngresE",
"Archival data of observed reconstruction angle resolution vs. energy",
13792 nbe,xmin,xmax,nba,0,180.1);
13794 hAngresE->GetXaxis()->SetTitle(
"^{10}log(Energy) in GeV");
13795 hAngresE->GetYaxis()->SetTitle(
"Angular resolution in degrees");
13799 TH2* hAngresE=(TH2*)
fBurstHistos.FindObject(
"hAngresE");
13806 for (Int_t ien=0; ien<nen; ien++)
13808 data.GetEntry(ien);
13810 lx=data.GetLeaf(name1.Data());
13813 logE=lx->GetValue();
13815 lx=data.GetLeaf(name2.Data());
13818 dang=lx->GetValue();
13823 lx=data.GetLeaf(name3.Data());
13826 dec=lx->GetValue();
13831 if (dec>=fDeclmin && dec<=fDeclmax)
13833 hAngresE->Fill(logE,dang);
13838 cout <<
" *" << ClassName() <<
"::MakeBurstRecoAngresdist* " << nE <<
" archival entries have been obtained for variables:" << name2
13839 <<
" vs. " << name1 <<
" of Tree:" << tree <<
" in file(s):" << file << endl;
13865 TH1* hSigEprofile=(TH1*)
fBurstHistos.FindObject(
"hSigEprofile");
13867 if (!hSigEprofile)
return E;
13869 Int_t nbins=hSigEprofile->GetNbinsX();
13870 Int_t nentries=hSigEprofile->GetEntries();
13872 if (nbins<=0 || nentries<=0)
return E;
13874 TAxis* xaxis=hSigEprofile->GetXaxis();
13876 if (!xaxis)
return E;
13878 Double_t xlow=xaxis->GetBinLowEdge(1);
13879 Double_t xup=xaxis->GetBinUpEdge(nbins);
13881 Double_t logEmin=0;
13888 logEmin=log10(Emin);
13891 Double_t logEmax=0;
13898 logEmax=log10(Emax);
13901 if (logEmax<=logEmin || logEmin>=xup || logEmax<=xlow)
return E;
13903 while (E<logEmin || E>logEmax)
13905 E=hSigEprofile->GetRandom();
13908 E=pow(
float(10),E);
13936 TH1* hBkgEprofile=(TH1*)
fBurstHistos.FindObject(
"hBkgEprofile");
13938 if (!hBkgEprofile)
return E;
13940 Int_t nbins=hBkgEprofile->GetNbinsX();
13941 Int_t nentries=hBkgEprofile->GetEntries();
13943 if (nbins<=0 || nentries<=0)
return E;
13945 TAxis* xaxis=hBkgEprofile->GetXaxis();
13947 if (!xaxis)
return E;
13949 Double_t xlow=xaxis->GetBinLowEdge(1);
13950 Double_t xup=xaxis->GetBinUpEdge(nbins);
13952 Double_t logEmin=0;
13959 logEmin=log10(Emin);
13962 Double_t logEmax=0;
13969 logEmax=log10(Emax);
13972 if (logEmax<=logEmin || logEmin>=xup || logEmax<=xlow)
return E;
13974 while (E<logEmin || E>logEmax)
13976 E=hBkgEprofile->GetRandom();
13979 E=pow(
float(10),E);
14012 if (Amin<0) Amin=0;
14027 TH2* hAngresE=(TH2*)
fBurstHistos.FindObject(
"hAngresE");
14038 Int_t nbins=hAngresE->GetNbinsX();
14039 Int_t nentries=hAngresE->GetEntries();
14041 if (nbins<=0 || nentries<=0)
return dang;
14043 TAxis* xaxis=hAngresE->GetXaxis();
14045 if (!xaxis)
return dang;
14047 Double_t xlow=xaxis->GetBinLowEdge(1);
14048 Double_t xup=xaxis->GetBinUpEdge(nbins);
14050 Double_t logEmin=0;
14057 logEmin=log10(Emin);
14060 Double_t logEmax=0;
14067 logEmax=log10(Emax);
14070 if (logEmax<logEmin || logEmin>=xup || logEmax<=xlow)
return dang;
14072 Int_t ilow=xaxis->FindBin(logEmin);
14073 Int_t iup=xaxis->FindBin(logEmax);
14075 TH1D* hproj=hAngresE->ProjectionY(
"hproj",ilow,iup);
14077 if (!hproj)
return dang;
14079 nbins=hproj->GetNbinsX();
14080 nentries=hproj->GetEntries();
14082 if (nbins<=0 || nentries<=0)
return dang;
14084 if (fRecoangle==1) dang=hproj->GetMean();
14094 xaxis=hproj->GetXaxis();
14096 if (!xaxis)
return dang;
14098 xlow=xaxis->GetBinLowEdge(1);
14099 xup=xaxis->GetBinUpEdge(nbins);
14101 if (Amax<=Amin || Amin>=xup || Amax<=xlow)
return dang;
14104 while (dang<Amin || dang>Amax)
14106 dang=hproj->GetRandom();
14110 if (hproj)
delete hproj;
14141 printf(
"\n *%-s::GenBurstSignals* Error : [Tmin,Tmax]=[%-g,%-g] whereas Tmin<Tmax is required. \n",ClassName(),fTmin,fTmax);
14201 TH1* hSigmaReco=(TH1*)
fBurstHistos.FindObject(
"hSigmaReco");
14203 TH1* hSigEzcor=(TH1*)
fBurstHistos.FindObject(
"hSigEzcor");
14204 TH2* hAeffProfile=(TH2*)
fBurstHistos.FindObject(
"hAeffProfile");
14205 TH2* hSigNuCountProfile=(TH2*)
fBurstHistos.FindObject(
"hSigNuCountProfile");
14206 TH2* hBkgNuCountProfile=(TH2*)
fBurstHistos.FindObject(
"hBkgNuCountProfile");
14217 Float_t sigmagrb=0;
14224 Double_t thetagrb,phigrb;
14225 Double_t dmu,thetamu,phimu;
14231 Float_t dangmaxon=0;
14232 Float_t dangmaxoff=0;
14233 Float_t thlow,thup;
14234 Float_t ranlow,ranup;
14238 Float_t solidangle=0;
14239 Float_t ramu,decmu;
14242 Double_t sigmareco=0;
14243 Float_t sigmatot=0;
14245 Int_t fixedwinset=0;
14254 if (hAeffProfile) nbinsA=(hAeffProfile->GetNbinsX())*(hAeffProfile->GetNbinsY());
14256 if (hSigNuCountProfile) nbinsCsig=(hSigNuCountProfile->GetNbinsX())*(hSigNuCountProfile->GetNbinsY());
14258 if (hBkgNuCountProfile) nbinsCbkg=(hBkgNuCountProfile->GetNbinsX())*(hBkgNuCountProfile->GetNbinsY());
14261 Double_t Fluence=0;
14263 Double_t pi=acos(-1.);
14266 for (Int_t igrb=0; igrb<fNgrbs; igrb++)
14276 GetSignal(dgrb,thetagrb,
"deg",phigrb,
"deg",
"loc",tx,igrb+1);
14280 if (!fDatype) dangmax=fabs(fDawin);
14284 if (fMaxsigmatot>0) dangmax=fabs(fDawin*fMaxsigmatot);
14289 if (!fSumsigmas) dangmax=fabs(fDawin*sigmagrb);
14293 if (fSumsigmas==-1) sigmatot=fAngresfix;
14294 if (fSumsigmas==1) sigmatot=sigmagrb+fAngresfix;
14295 if (fSumsigmas==2) sigmatot=sqrt(sigmagrb*sigmagrb+fAngresfix*fAngresfix);
14296 if (sigmatot>=0) dangmax=fabs(fDawin*sigmatot);
14301 if (dangmax<0) fixedwinset=0;
14304 if (fDatype==1 && fMaxsigmatot<0) dangmax=-1;
14307 name=
"fixedwinset";
14324 if (fixedwinset && dangmax>=0)
14328 thlow=thetagrb-0.5*dangmax;
14329 thup=thetagrb+0.5*dangmax;
14341 sx->
SetSignal(solidangle*
float(fNbkg),
"OmegaOff");
14346 if (fSumsigmas==0 || fSumsigmas==1 || fSumsigmas==2) dangmaxon=fabs(fDawin*sigmagrb);
14347 dangmaxoff=dangmaxon;
14352 for (Int_t bkgpatch=0; bkgpatch<=fNbkg; bkgpatch++)
14358 nmu=int(
fRan->Poisson(nbkg));
14363 nmu=TMath::Nint(
fRan->Poisson(nbkgmax));
14364 if (!hBkgNuCountProfile) nmu=0;
14367 for (Int_t imu=0; imu<nmu; imu++)
14372 dt=
fRan->Uniform(ranlow,ranup);
14377 thlow=90.-fDeclmax;
14380 decmu=90.-rmu.
GetX(2,
"sph",
"deg");
14381 ramu=rmu.
GetX(3,
"sph",
"deg");
14384 SetSignal(1,ramu,
"deg",decmu,
"deg",
"equ",&tmu,fNgrbs+1,
"J",
"bkgtemp",0);
14385 GetSignal(dmu,thetamu,
"deg",phimu,
"deg",
"loc",&tmu,fNgrbs+1);
14390 dang=fabs(thetagrb-thetamu);
14398 if (fDatype>=0 && fixedwinset && dang>dangmax)
continue;
14403 if (E<0 || E<fEmin || E>fEmax)
continue;
14405 if (
fBkgEmode!=
"BkgE" && hBkgNuCountProfile)
14408 gbin=hBkgNuCountProfile->FindFixBin(log10(E),cos(thetagrb*pi/180.));
14409 if (gbin>0 && gbin<=nbinsCbkg) nbkg=hBkgNuCountProfile->GetBinContent(gbin);
14411 if (
fBkgEmode!=
"BkgS") nbkg=nbkg*fDtwin*fTfact;
14412 if (nbkg>0) nbkg=
fRan->Poisson(nbkg);
14413 if (nbkg<1)
continue;
14418 if (sigmareco<0) sigmareco=fAngresfix;
14420 if (sigmareco<fAngresmin || sigmareco>fAngresmax)
continue;
14422 if (hSigmaReco) hSigmaReco->Fill(sigmareco);
14425 if (fSumsigmas==-1) sigmatot=sigmareco;
14426 if (fSumsigmas==0) sigmatot=sigmagrb;
14427 if (fSumsigmas==1) sigmatot=sigmagrb+sigmareco;
14428 if (fSumsigmas==2) sigmatot=sqrt(sigmagrb*sigmagrb+sigmareco*sigmareco);
14434 if (sigmatot>=0) dangmax=fabs(fDawin*sigmatot);
14437 if (fDatype>=0 && dang>dangmax)
continue;
14441 if (dangmax>dangmaxon) dangmaxon=dangmax;
14447 thetamu=rmu.
GetX(2,
"sph",
"rad");
14448 gbin=hAeffProfile->FindFixBin(log10(E),cos(thetamu));
14449 if (gbin>0 && gbin<nbinsA+1)
14451 Aeff=hAeffProfile->GetBinContent(gbin);
14462 if (dangmax>dangmaxoff) dangmaxoff=dangmax;
14468 thetamu=rmu.
GetX(2,
"sph",
"rad");
14469 gbin=hAeffProfile->FindFixBin(log10(E),cos(thetamu));
14470 if (gbin>0 && gbin<nbinsA+1)
14472 Aeff=hAeffProfile->GetBinContent(gbin);
14492 if ((
fSigEmode==
"SigE" && (fGrbnu>=0 || nmugrb<
int(fabs(fGrbnu)*
float(fNgrbs)))) ||
fSigEmode!=
"SigE")
14500 nmu=int(fabs(fGrbnu));
14501 if (!nmu &&
fRan->Uniform()<fabs(fGrbnu)) nmu=1;
14506 nmu=TMath::Nint(
fRan->Poisson(nsigmax));
14507 if (!hSigNuCountProfile) nmu=0;
14510 for (Int_t imu=0; imu<nmu; imu++)
14516 dt=
fRan->Gauss(fDtnu,fabs(fDtnus)*t90grb);
14520 dt=
fRan->Gauss(fDtnu,fDtnus);
14528 dt=
fRan->Gauss(fDtnu*t90grb,fabs(fDtnus)*t90grb);
14532 dt=
fRan->Gauss(fDtnu*t90grb,fDtnus);
14535 if (fTimres>0) dt=
fRan->Gauss(dt,fTimres);
14547 if (
fSigEmode!=
"SigE" && hSigNuCountProfile)
14550 gbin=hSigNuCountProfile->FindFixBin(log10(E),cos(thetagrb*pi/180.));
14551 if (gbin>0 && gbin<=nbinsCsig) nsig=hSigNuCountProfile->GetBinContent(gbin);
14553 if (
fSigEmode!=
"SigS") nsig=nsig*fDtwin*fTfact;
14554 if (nsig>0) nsig=
fRan->Poisson(nsig);
14555 if (nsig<1)
continue;
14563 if (hSigE) hSigE->Fill(E);
14566 if (fEzcor) E=E/(zgrb+1.);
14569 if (hSigEzcor) hSigEzcor->Fill(E);
14571 if (E<0 || E<fEmin || E>fEmax)
continue;
14576 Int_t mode=fKinangle-1;
14583 if (sigmareco<0) sigmareco=fAngresfix;
14585 if (sigmareco<fAngresmin || sigmareco>fAngresmax)
continue;
14587 if (hSigmaReco) hSigmaReco->Fill(sigmareco);
14595 if (fSumsigmas==-1) sigmatot=sigmareco;
14596 if (fSumsigmas==0) sigmatot=sigmagrb;
14597 if (fSumsigmas==1) sigmatot=sigmagrb+sigmareco;
14598 if (fSumsigmas==2) sigmatot=sqrt(sigmagrb*sigmagrb+sigmareco*sigmareco);
14604 if (sigmatot>=0) dangmax=fabs(fDawin*sigmatot);
14607 if (fDatype>=0 && dang>dangmax)
continue;
14609 if (dangmax>dangmaxon) dangmaxon=dangmax;
14618 thetamu=rmu.
GetX(2,
"sph",
"rad");
14619 gbin=hAeffProfile->FindFixBin(log10(E),cos(thetamu));
14620 if (gbin>0 && gbin<nbinsA+1)
14622 Aeff=hAeffProfile->GetBinContent(gbin);
14634 if (fixedwinset)
continue;
14639 thlow=thetagrb-0.5*dangmaxon;
14640 thup=thetagrb+0.5*dangmaxon;
14644 thlow=thetagrb-0.5*dangmaxoff;
14645 thup=thetagrb+0.5*dangmaxoff;
14647 sx->
SetSignal(dangmaxoff,
"dangmaxOff");
14648 sx->
SetSignal(solidangle*
float(fNbkg),
"OmegaOff");
14659 sx->
SetSignal(dangmaxoff,
"dangmaxOff");
14660 sx->
SetSignal(solidangle*
float(fNbkg),
"OmegaOff");
14671 name=
"SolidangleOn";
14674 name=
"SolidangleOff";
14677 for (Int_t igrb=1; igrb<=fNgrbs; igrb++)
14710 Double_t pi=acos(-1.);
14731 Float_t fEnergyBkg=fEnergyOn-fEnergySig;
14735 if (fTunits==1) tu=
"hours";
14736 if (fTunits==2) tu=
"sec";
14737 if (fTunits==3) tu=
"ns";
14738 if (fTunits==4) tu=
"ps";
14743 Double_t TminOn=fTmin;
14744 Double_t TmaxOn=fTmax;
14745 Double_t TminOff=fTmin;
14746 Double_t TmaxOff=fTmax;
14762 Float_t DtwinOn=TmaxOn-TminOn;
14763 Float_t DtwinOff=TmaxOff-TminOff;
14764 Float_t NbkgWinOn=fRbkgDecl*DtwinOn*fTfact;
14765 Float_t NbkgWinOff=fRbkgDecl*DtwinOff*fTfact;
14774 Double_t binsize=0;
14775 Double_t binsizecos=0;
14777 Double_t abinsizeOn=0;
14779 Double_t abinsizeOff=0;
14782 TH1F* hOnSourceZ=0;
14783 TH1F* hOffSourceZ=0;
14784 TH1F* hOnSigSourceZ=0;
14785 TH1F* hOnSigmaSource=0;
14786 TH1F* hOffSigmaSource=0;
14787 TH1F* hOnSigSigmaSource=0;
14788 TH1F* hOnSigmaReco=0;
14789 TH1F* hOffSigmaReco=0;
14790 TH1F* hOnSigSigmaReco=0;
14791 TH1F* hOnSigmaComb=0;
14792 TH1F* hOffSigmaComb=0;
14793 TH1F* hOnSigSigmaComb=0;
14797 title.Form(
"On-Source object redshifts with matching event(s);Redshift;Counts");
14798 hOnSourceZ=
new TH1F(
"hOnSourceZ",title,nbins,1,0);
14799 hOnSourceZ->SetBuffer(non);
14801 title.Form(
"On-Source object position uncertainties with matching event(s);Object position angular uncertainty (sigma in degrees);Counts");
14802 hOnSigmaSource=
new TH1F(
"hOnSigmaSource",title,nbins,1,0);
14803 hOnSigmaSource->SetBuffer(non);
14805 title.Form(
"On-source event reconstruction uncertainties in the final sample;Event angular reconstruction uncertainty (sigma in degrees);Counts");
14806 hOnSigmaReco=
new TH1F(
"hOnSigmaReco",title,nbins,1,0);
14807 hOnSigmaReco->SetBuffer(non);
14809 title.Form(
"On-source combined object position and event reconstruction uncertainty;Combined object position and event reco angular uncertainty (sigma in degrees);Counts");
14810 hOnSigmaComb=
new TH1F(
"hOnSigmaComb",title,nbins,1,0);
14811 hOnSigmaComb->SetBuffer(non);
14816 title.Form(
"Off-Source object redshifts with matching event(s);Redshift;Counts");
14817 hOffSourceZ=
new TH1F(
"hOffSourceZ",title,nbins,1,0);
14818 hOffSourceZ->SetBuffer(noff);
14820 title.Form(
"Off-Source object position uncertainties with matching event(s);Object position angular uncertainty (sigma in degrees);Counts");
14821 hOffSigmaSource=
new TH1F(
"hOffSigmaSource",title,nbins,1,0);
14822 hOffSigmaSource->SetBuffer(noff);
14824 title.Form(
"Off-source event reconstruction uncertainties in the final sample;Event angular reconstruction uncertainty (sigma in degrees);Counts");
14825 hOffSigmaReco=
new TH1F(
"hOffSigmaReco",title,nbins,1,0);
14826 hOffSigmaReco->SetBuffer(noff);
14828 title.Form(
"Off-source combined object position and event reconstruction uncertainty;Combined object position and event reco angular uncertainty (sigma in degrees);Counts");
14829 hOffSigmaComb=
new TH1F(
"hOffSigmaComb",title,nbins,1,0);
14830 hOffSigmaComb->SetBuffer(noff);
14835 title.Form(
"On-Source object redshifts with matching simulated signal event(s);Redshift;Counts");
14836 hOnSigSourceZ=
new TH1F(
"hOnSigSourceZ",title,nbins,1,0);
14837 hOnSigSourceZ->SetBuffer(nsig);
14839 title.Form(
"On-Source object position uncertainties with matching simulated signal event(s);Object position angular uncertainty (sigma in degrees);Counts");
14840 hOnSigSigmaSource=
new TH1F(
"hOnSigSigmaSource",title,nbins,1,0);
14841 hOnSigSigmaSource->SetBuffer(nsig);
14843 title.Form(
"On-source simulated signal event reconstruction uncertainties in the final sample;Event angular reconstruction uncertainty (sigma in degrees);Counts");
14844 hOnSigSigmaReco=
new TH1F(
"hOnSigSigmaReco",title,nbins,1,0);
14845 hOnSigSigmaReco->SetBuffer(nsig);
14847 title.Form(
"On-source combined object position and simulated signal event reconstruction uncertainty;Combined object position and event reco angular uncertainty (sigma in degrees);Counts");
14848 hOnSigSigmaComb=
new TH1F(
"hOnSigSigmaComb",title,nbins,1,0);
14849 hOnSigSigmaComb->SetBuffer(nsig);
14859 title.Form(
"On-source reconstructed event energy in the final sample;Event energy in GeV;Counts");
14860 if (!mode) title.ReplaceAll(
"reconstructed",
"simulated");
14861 hOnE=
new TH1F(
"hOnE",title,nbins,1,0);
14865 title.Form(
"Off-source reconstructed event energy in the final sample;Event energy in GeV;Counts");
14866 if (!mode) title.ReplaceAll(
"reconstructed",
"simulated");
14867 hOffE=
new TH1F(
"hOffE",title,nbins,1,0);
14871 title.Form(
"On-source simulated signal event energy in the final sample;Event energy in GeV;Counts");
14872 hOnSigE=
new TH1F(
"hOnSigE",title,nbins,1,0);
14878 if (
fTscmode>0) scrt=
"(scrambled)";
14887 TH1F* hOnSigcosa=0;
14893 nbins=int((AmaxOn-AminOn)/binsize);
14897 nbins=int(((AmaxOn-AminOn)/180.)*NbkgWinOn*
float(fNgrbs)/fabs(fAbin));
14898 if (nbins) binsize=(AmaxOn-AminOn)/
float(nbins);
14902 title.Form(
"Reconstructed %-s opening angle of on-source events in time window;Opening angle (degrees);Counts per %-.3g degrees",scrp.Data(),binsize);
14903 hOna=
new TH1F(
"hOna",title,nbins+1,AminOn,AmaxOn+binsize);
14908 binsize=AmaxOn/float(nbins);
14909 title.Form(
"Reconstructed %-s opening angle of on-source events in time window;Opening angle (degrees);Counts per %-.3g degrees",scrp.Data(),binsize);
14910 hOna=
new TH1F(
"hOna",title,nbins+2,AminOn-binsize,AmaxOn+binsize);
14913 abinsizeOn=binsize;
14914 if (nbins) binsizecos=(cos(AminOn*pi/180.)-cos(AmaxOn*pi/180.))/
float(nbins);
14917 title.Form(
"Reconstructed %-s cos(opening angle) of on-source events in time window;cos(opening angle);Counts per %-.3g",scrp.Data(),binsizecos);
14918 hOnCosa=
new TH1F(
"hOnCosa",title,nbins+1,cos(AmaxOn*pi/180.),cos(AminOn*pi/180.)+binsizecos);
14923 binsizecos=fabs(cos(AmaxOn*pi/180.))/float(nbins);
14924 title.Form(
"Reconstructed %-s cos(opening angle) of on-source events in time window;cos(opening angle);Counts per %-.3g",scrp.Data(),binsizecos);
14925 hOnCosa=
new TH1F(
"hOnCosa",title,nbins+2,cos(AmaxOn*pi/180.)-binsizecos,cos(AminOn*pi/180.)+binsizecos);
14930 title.Form(
"Reconstructed opening angle of on-source simulated signal events in time window;Opening angle (degrees);Counts per %-.3g degrees",binsize);
14931 hOnSiga=
new TH1F(
"hOnSiga",title,nbins+2,AminOn-binsize,AmaxOn+binsize);
14932 title.Form(
"Reconstructed cos(opening angle) of on-source simulated signal events in time window;cos(opening angle);Counts per %-.3g",binsizecos);
14933 hOnSigcosa=
new TH1F(
"hOnSigcosa",title,nbins+2,cos(AmaxOn*pi/180.)-binsizecos,cos(AminOn*pi/180.)+binsizecos);
14943 nbins=int((AmaxOff-AminOff)/binsize);
14947 nbins=int(((AmaxOff-AminOff)/180.)*NbkgWinOff*
float(fNgrbs)*
float(fNbkg)/fabs(fAbin));
14948 if (nbins) binsize=(AmaxOff-AminOff)/
float(nbins);
14952 title.Form(
"Reconstructed opening angle of off-source events in time window;Opening angle (degrees);Counts per %-.3g degrees",binsize);
14953 hOffa=
new TH1F(
"hOffa",title,nbins+1,AminOff,AmaxOff+binsize);
14958 binsize=AmaxOff/float(nbins);
14959 title.Form(
"Reconstructed opening angle of off-source events in time window;Opening angle (degrees);Counts per %-.3g degrees",binsize);
14960 hOffa=
new TH1F(
"hOffa",title,nbins+2,AminOff-binsize,AmaxOff+binsize);
14963 abinsizeOff=binsize;
14964 if (nbins) binsizecos=(cos(AminOff*pi/180.)-cos(AmaxOff*pi/180.))/
float(nbins);
14967 title.Form(
"Reconstructed cos(opening angle) of off-source events in time window;cos(opening angle);Counts per %-.3g",binsizecos);
14968 hOffCosa=
new TH1F(
"hOffCosa",title,nbins+1,cos(AmaxOff*pi/180.),cos(AminOff*pi/180.)+binsizecos);
14973 binsizecos=fabs(cos(AmaxOff*pi/180.))/float(nbins);
14974 title.Form(
"Reconstructed cos(opening angle) of off-source events in time window;cos(opening angle);Counts per %-.3g",binsizecos);
14975 hOffCosa=
new TH1F(
"hOffCosa",title,nbins+2,cos(AmaxOff*pi/180.)-binsizecos,cos(AminOff*pi/180.)+binsizecos);
14998 addtitle.Form(
" (=%-g*<T90>)",fTbin);
14999 if (fTbin<0) addtitle.Form(
" (~%-g counts/bin)",fabs(fTbin));
15003 nbins=int(NbkgWinOn*
float(fNgrbs)/fabs(fTbin));
15004 Int_t temp=int(NbkgWinOff*
float(fNgrbs)*
float(fNbkg)/fabs(fTbin));
15005 if (temp>nbins) nbins=temp;
15006 if (nbins) binsize=DtwinOn/float(nbins);
15011 if (fTbint90) binsize=fTbin*fabs(fAvgrbt90)/fTfact;
15012 nbins=DtwinOn/binsize;
15016 title.Form(
"Arrival times %-s of on-source events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per %-.3g %-s",scrt.Data(),tu.Data(),binsize,tu.Data());
15017 if (fTbint90 || fTbin<0) title+=addtitle;
15018 hOnt=
new TH1F(
"hOnt",title,nbins+2,TminOn-binsize,TmaxOn+binsize);
15019 title.Form(
"Arrival time %-s vs. reconstructed %-s opening angle of on-source events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",scrt.Data(),scrp.Data(),tu.Data());
15020 hOnta=
new TH2F(
"hOnta",title,nabinsOn+2,AminOn-abinsizeOn,AmaxOn+abinsizeOn,nbins+2,TminOn-binsize,TmaxOn+binsize);
15021 title.Form(
"Redshift corrected arrival times %-s of on-source events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per %-.3g %-s",scrt.Data(),tu.Data(),binsize,tu.Data());
15022 if (fTbint90 || fTbin<0) title+=addtitle;
15023 hOnZt=
new TH1F(
"hOnZt",title,nbins+2,TminOn-binsize,TmaxOn+binsize);
15024 title.Form(
"Redshift corrected %-s arrival time vs. reconstructed %-s opening angle of on-source events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",scrt.Data(),scrp.Data(),tu.Data());
15025 hOnZta=
new TH2F(
"hOnZta",title,nabinsOn+2,AminOn-abinsizeOn,AmaxOn+abinsizeOn,nbins+2,TminOn-binsize,TmaxOn+binsize);
15029 title.Form(
"Arrival times of on-source simulated signal events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per %-.3g %-s",tu.Data(),binsize,tu.Data());
15030 if (fTbint90 || fTbin<0) title+=addtitle;
15031 hOnSigt=
new TH1F(
"hOnSigt",title,nbins+2,TminOn-binsize,TmaxOn+binsize);
15032 title.Form(
"Arrival time vs. reconstructed opening angle of on-source simulated signal events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",tu.Data());
15033 hOnSigta=
new TH2F(
"hOnSigta",title,nabinsOn+2,AminOn-abinsizeOn,AmaxOn+abinsizeOn,nbins+2,TminOn-binsize,TmaxOn+binsize);
15034 title.Form(
"Redshift corrected arrival times of on-source simulated signal events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per %-.3g %-s",tu.Data(),binsize,tu.Data());
15035 if (fTbint90 || fTbin<0) title+=addtitle;
15036 hOnSigZt=
new TH1F(
"hOnSigZt",title,nbins+2,TminOn-binsize,TmaxOn+binsize);
15037 title.Form(
"Redshift corrected arrival time vs. reconstructed opening angle of on-source simulated signal events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",tu.Data());
15038 hOnSigZta=
new TH2F(
"hOnSigZta",title,nabinsOn+2,AminOn-abinsizeOn,AmaxOn+abinsizeOn,nbins+2,TminOn-binsize,TmaxOn+binsize);
15044 if (fTbint90) binsize=fTbin*fabs(fAvgrbt90)/fTfact;
15045 nbins=DtwinOff/binsize;
15049 title.Form(
"Arrival times of off-source events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per %-.3g %-s",tu.Data(),binsize,tu.Data());
15050 if (fTbint90 || fTbin<0) title+=addtitle;
15051 hOfft=
new TH1F(
"hOfft",title,nbins+2,TminOff-binsize,TmaxOff+binsize);
15052 title.Form(
"Arrival time vs. reconstructed opening angle of off-source events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",tu.Data());
15053 hOffta=
new TH2F(
"hOffta",title,nabinsOff+2,AminOff-abinsizeOff,AmaxOff+abinsizeOff,nbins+2,TminOff-binsize,TmaxOff+binsize);
15054 title.Form(
"Redshift corrected arrival times of off-source events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per %-.3g %-s",tu.Data(),binsize,tu.Data());
15055 if (fTbint90 || fTbin<0) title+=addtitle;
15056 hOffZt=
new TH1F(
"hOffZt",title,nbins+2,TminOff-binsize,TmaxOff+binsize);
15057 title.Form(
"Redshift corrected arrival time vs. reconstructed opening angle of off-source events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",tu.Data());
15058 hOffZta=
new TH2F(
"hOffZta",title,nabinsOff+2,AminOff-abinsizeOff,AmaxOff+abinsizeOff,nbins+2,TminOff-binsize,TmaxOff+binsize);
15063 Double_t* binarr=0;
15064 Int_t nbx=int(DtwinOn/fVarTbin);
15065 Float_t gamma=fabs(fAvgrbz)+1.;
15066 Float_t* bins=
new Float_t[nbx];
15068 Float_t xlow=0,xup=0,size=fVarTbin;
15069 for (Int_t i=0; i<nbx-1; i++)
15072 if (xup>DtwinOn/2.)
15083 binarr=
new Double_t[2*nbins-1];
15084 for (Int_t j=nbins; j>0; j--)
15086 binarr[nbins-j]=-bins[j-1];
15087 binarr[nbins+j-2]=bins[j-1];
15092 title.Form(
"Arrival times %-s of on-source events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per time bin",scrt.Data(),tu.Data());
15093 hOnt=
new TH1F(
"hOnt",title,nbins,binarr);
15096 title.Form(
"Arrival time %-s vs. reconstructed %-s opening angle of on-source events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",scrt.Data(),scrp.Data(),tu.Data());
15097 hOnta=
new TH2F(
"hOnta",title,nabinsOn,AminOn,AmaxOn,nbins,binarr);
15102 title.Form(
"Arrival times of off-source events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per time bin",tu.Data());
15103 hOfft=
new TH1F(
"hOfft",title,nbins,binarr);
15106 title.Form(
"Arrival time vs. reconstructed opening angle of off-source events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",tu.Data());
15107 hOffta=
new TH2F(
"hOffta",title,nabinsOff,AminOff,AmaxOff,nbins,binarr);
15112 title.Form(
"Arrival times of on-source simulated signal events in time window;Event arrival time (in %-s) w.r.t. burst trigger;Counts per time bin",tu.Data());
15113 hOnSigt=
new TH1F(
"hOnSigt",title,nbins,binarr);
15116 title.Form(
"Arrival time vs. reconstructed opening angle of on-source simulated signal events in time window;Opening angle (degrees);Event arrival time (in %-s) w.r.t. burst trigger",tu.Data());
15117 hOnSigta=
new TH2F(
"hOnSigta",title,nabinsOn,AminOn,AmaxOn,nbins,binarr);
15137 if (hOnSourceZ) hOnSourceZ->Fill(value1);
15138 if (hOnSigmaSource) hOnSigmaSource->Fill(value2);
15139 if (hOnSigmaReco) hOnSigmaReco->Fill(value3);
15140 if (hOnSigmaComb) hOnSigmaComb->Fill(value4);
15149 if (hOnE) hOnE->Fill(value1);
15150 if (hOna) hOna->Fill(value2);
15151 if (hOnCosa) hOnCosa->Fill(cos(value2*pi/180.));
15152 if (hOnt) hOnt->Fill(value3);
15153 if (hOnta) hOnta->Fill(value2,value3);
15154 if (hOnZt) hOnZt->Fill(value4);
15155 if (hOnZta) hOnZta->Fill(value2,value4);
15165 if (hOffSourceZ) hOffSourceZ->Fill(value1);
15166 if (hOffSigmaSource) hOffSigmaSource->Fill(value2);
15167 if (hOffSigmaReco) hOffSigmaReco->Fill(value3);
15168 if (hOffSigmaComb) hOffSigmaComb->Fill(value4);
15177 if (hOffE) hOffE->Fill(value1);
15178 if (hOffa) hOffa->Fill(value2);
15179 if (hOffCosa) hOffCosa->Fill(cos(value2*pi/180.));
15180 if (hOfft) hOfft->Fill(value3);
15181 if (hOffta) hOffta->Fill(value2,value3);
15182 if (hOffZt) hOffZt->Fill(value4);
15183 if (hOffZta) hOffZta->Fill(value2,value4);
15193 if (hOnSigSourceZ) hOnSigSourceZ->Fill(value1);
15194 if (hOnSigSigmaSource) hOnSigSigmaSource->Fill(value2);
15195 if (hOnSigSigmaReco) hOnSigSigmaReco->Fill(value3);
15196 if (hOnSigSigmaComb) hOnSigSigmaComb->Fill(value4);
15205 if (hOnSigE) hOnSigE->Fill(value1);
15206 if (hOnSiga) hOnSiga->Fill(value2);
15207 if (hOnSigcosa) hOnSigcosa->Fill(cos(value2*pi/180.));
15208 if (hOnSigt) hOnSigt->Fill(value3);
15209 if (hOnSigta) hOnSigta->Fill(value2,value3);
15210 if (hOnSigZt) hOnSigZt->Fill(value4);
15211 if (hOnSigZta) hOnSigZta->Fill(value2,value4);
15221 title.Form(
"Bayesian blocks for on-source arrival times %-s;Event arrival time (in %-s) w.r.t. burst trigger;Event rate (%-s^{-1}) for %-i stacked time windows",scrt.Data(),tu.Data(),tu.Data(),fNgrbs);
15222 title.ReplaceAll(
"days^",
"day^");
15223 title.ReplaceAll(
"hours^",
"hour^");
15224 hOnBBt.SetNameTitle(
"hOnBBt",title);
15226 title.Form(
"Bayesian blocks for redshift corrected on-source arrival times %-s;Event arrival time (in %-s) w.r.t. burst trigger;Event rate (%-s^{-1}) for %-i stacked time windows",scrt.Data(),tu.Data(),tu.Data(),fNgrbs);
15227 title.ReplaceAll(
"days^",
"day^");
15228 title.ReplaceAll(
"hours^",
"hour^");
15229 hOnBBzt.SetNameTitle(
"hOnBBzt",title);
15236 title.Form(
"Bayesian blocks for off-source arrival times;Event arrival time (in %-s) w.r.t. burst trigger;Event rate (%-s^{-1}) for %-i stacked time windows",tu.Data(),tu.Data(),fNgrbs*fNbkg);
15237 title.ReplaceAll(
"days^",
"day^");
15238 title.ReplaceAll(
"hours^",
"hour^");
15239 hOffBBt.SetNameTitle(
"hOffBBt",title);
15241 title.Form(
"Bayesian blocks for redshift corrected off-source arrival times;Event arrival time (in %-s) w.r.t. burst trigger;Event rate (%-s^{-1}) for %-i stacked time windows",tu.Data(),tu.Data(),fNgrbs*fNbkg);
15242 title.ReplaceAll(
"days^",
"day^");
15243 title.ReplaceAll(
"hours^",
"hour^");
15244 hOffBBzt.SetNameTitle(
"hOffBBzt",title);
15252 axis=hOnBBt.GetXaxis();
15253 xmin=axis->GetXmin();
15254 xmax=axis->GetXmax();
15255 axis=hOffBBt.GetXaxis();
15256 temp=axis->GetXmin();
15257 if (temp<xmin) xmin=temp;
15258 temp=axis->GetXmax();
15259 if (temp>xmax) xmax=temp;
15264 title.Form(
"Event rate (%-s^{-1}) scaled per time window",tu.Data());
15265 title.ReplaceAll(
"days^",
"day^");
15266 title.ReplaceAll(
"hours^",
"hour^");
15267 nb1=BB.
Rebin(&hOnBBt,&hOnUBBt,kFALSE,0,xmin,xmax);
15268 nb2=BB.
Rebin(&hOffBBt,&hOffUBBt,kFALSE,0,xmin,xmax);
15269 if (nb2>nb1) BB.
Rebin(&hOnBBt,&hOnUBBt,kFALSE,nb2,xmin,xmax);
15270 hOnUBBt.SetName(
"hOnUBBt");
15271 hOffUBBt.SetName(
"hOffUBBt");
15272 if (fNgrbs>1) hOnUBBt.Scale(1./
float(fNgrbs));
15273 if (fNgrbs*fNbkg>1) hOffUBBt.Scale(1./
float(fNgrbs*fNbkg));
15274 hOnUBBt.SetYTitle(title);
15275 hOffUBBt.SetYTitle(title);
15276 BB.
Divide(&hOnUBBt,&hOffUBBt,&hRatUBBt,kFALSE,1);
15277 hRatUBBt.SetName(
"hRatUBBt");
15278 hRatUBBt.SetYTitle(
"Ratio");
15280 nbins=hOnBBzt.GetNbinsX();
15281 if (hOffBBzt.GetNbinsX()>nbins) nbins=hOffBBzt.GetNbinsX();
15282 axis=hOnBBzt.GetXaxis();
15283 xmin=axis->GetXmin();
15284 xmax=axis->GetXmax();
15285 axis=hOffBBzt.GetXaxis();
15286 temp=axis->GetXmin();
15287 if (temp<xmin) xmin=temp;
15288 temp=axis->GetXmax();
15289 if (temp>xmax) xmax=temp;
15294 nb1=BB.
Rebin(&hOnBBzt,&hOnUBBzt,kFALSE,0,xmin,xmax);
15295 nb2=BB.
Rebin(&hOffBBzt,&hOffUBBzt,kFALSE,0,xmin,xmax);
15296 if (nb2>nb1) BB.
Rebin(&hOnBBzt,&hOnUBBzt,kFALSE,nb2,xmin,xmax);
15297 hOnUBBzt.SetName(
"hOnUBBzt");
15298 hOffUBBzt.SetName(
"hOffUBBzt");
15299 if (fNgrbs>1) hOnUBBzt.Scale(1./
float(fNgrbs));
15300 if (fNgrbs*fNbkg>1) hOffUBBzt.Scale(1./
float(fNgrbs*fNbkg));
15301 hOnUBBzt.SetYTitle(title);
15302 hOffUBBzt.SetYTitle(title);
15303 BB.
Divide(&hOnUBBzt,&hOffUBBzt,&hRatUBBzt,kFALSE,1);
15304 hRatUBBzt.SetName(
"hRatUBBzt");
15305 hRatUBBzt.SetYTitle(
"Ratio");
15312 if (hOffSigmaSource)
fBurstHistos.Add(hOffSigmaSource);
15313 if (hOnSigSigmaSource)
fBurstHistos.Add(hOnSigSigmaSource);
15316 if (hOnSigSigmaReco)
fBurstHistos.Add(hOnSigSigmaReco);
15319 if (hOnSigSigmaComb)
fBurstHistos.Add(hOnSigSigmaComb);
15335 if (hOnt && hOnBBt.GetEntries())
fBurstHistos.Add(hOnBBt.Clone());
15336 if (hOfft && hOffBBt.GetEntries())
fBurstHistos.Add(hOffBBt.Clone());
15337 if (hOnt && hOnUBBt.GetEntries())
fBurstHistos.Add(hOnUBBt.Clone());
15338 if (hOfft && hOffUBBt.GetEntries())
fBurstHistos.Add(hOffUBBt.Clone());
15339 if (hOnt && hOfft && hRatUBBt.GetEntries())
fBurstHistos.Add(hRatUBBt.Clone());
15346 if (hOnZt && hOnBBzt.GetEntries())
fBurstHistos.Add(hOnBBzt.Clone());
15347 if (hOffZt && hOffBBzt.GetEntries())
fBurstHistos.Add(hOffBBzt.Clone());
15348 if (hOnZt && hOnUBBzt.GetEntries())
fBurstHistos.Add(hOnUBBzt.Clone());
15349 if (hOffZt && hOffUBBzt.GetEntries())
fBurstHistos.Add(hOffUBBzt.Clone());
15350 if (hOnZt && hOffZt && hRatUBBzt.GetEntries())
fBurstHistos.Add(hRatUBBzt.Clone());
15354 for (Int_t ih=0; ih<nh; ih++)
15358 hx->BufferEmpty(1);
15360 name=hx->GetName();
15362 if (name==
"hTdiff")
15364 binsize=hx->GetBinWidth(1);
15365 s.Form(
"Counts per %-.3g %-s",binsize,tu.Data());
15366 axis=hx->GetYaxis();
15367 if (axis) axis->SetTitle(s);
15370 if (name==
"hAdiff" || name.Contains(
"Sigma"))
15372 binsize=hx->GetBinWidth(1);
15373 s.Form(
"Counts per %-.3g degrees",binsize);
15374 axis=hx->GetYaxis();
15375 if (axis) axis->SetTitle(s);
15378 if (name==
"hOnE" || name==
"hOffE" || name==
"hOnSigE")
15380 binsize=hx->GetBinWidth(1);
15381 s.Form(
"Counts per %-.3g GeV",binsize);
15382 axis=hx->GetYaxis();
15383 if (axis) axis->SetTitle(s);
15390 Float_t nsigOn=nsig;
15391 Float_t nbkgOn=nOn-nsigOn;
15392 Float_t Ton=DtwinOn*fTfact*float(fNgrbs);
15393 Float_t Toff=DtwinOff*fTfact*float(fNgrbs)*float(fNbkg);
15394 Float_t rateOn=nOn/(DtwinOn*fTfact);
15395 Float_t rateOff=nOff/(DtwinOff*fTfact);
15398 Float_t TwinOn=DtwinOn*fTfact;
15399 Float_t TwinOff=DtwinOff*fTfact;
15400 Float_t AvSolidangleOn=0;
15401 Float_t AvSolidangleOff=0;
15408 Float_t AvNsigOn=0;
15409 Float_t AvNbkgOn=0;
15410 Float_t AvRsigOn=0;
15411 Float_t AvRbkgOn=0;
15412 Float_t AvEsigOn=0;
15413 Float_t AvEbkgOn=0;
15414 Float_t scale=fNgrbs;
15417 AvSolidangleOn=fSolidangleOn/scale;
15420 AvEon=fEnergyOn/scale;
15421 AvNsigOn=nsigOn/scale;
15422 AvNbkgOn=nbkgOn/scale;
15423 AvRsigOn=nsigOn/Ton;
15424 AvRbkgOn=nbkgOn/Ton;
15425 AvEsigOn=fEnergySig/scale;
15426 AvEbkgOn=fEnergyBkg/scale;
15428 scale=fNgrbs*fNbkg;
15431 AvSolidangleOff=fSolidangleOff/scale;
15434 AvEoff=fEnergyOff/scale;
15438 printf(
"\n *%-s::MakeBurstDataStats* Statistics of the stacked observed event samples. \n",ClassName());
15439 printf(
" Integrated on-source exposure time of the %-i stacked time windows : %-g %-s \n",fNgrbs,Ton/fTfact,tu.Data());
15440 printf(
" Integrated off-source exposure time of the %-i*%-i stacked time windows : %-g %-s \n",fNgrbs,fNbkg,Toff/fTfact,tu.Data());
15441 printf(
" Total accumulated on-source solid angle : %-g sr in %-i stacked patches --> Average per patch : %-g sr \n",fSolidangleOn,fNgrbs,AvSolidangleOn);
15442 printf(
" Total accumulated off-source solid angle : %-g sr in %-i*%-i stacked patches --> Average per patch : %-g sr \n",fSolidangleOff,fNgrbs,fNbkg,AvSolidangleOff);
15443 if (fSensarea>0) printf(
" Area covered c.q. overlooked by the detector sensors : %-g m^2. \n",fSensarea);
15446 printf(
" *On source* Total number of recorded on-source events : %-g --> Average per patch : %-g events. \n",nOn,AvNon);
15447 printf(
" --- Average recorded values per on-source patch --- \n");
15448 printf(
" Steady event rate during the time window : %-g Hz",AvRon);
15449 if (AvSolidangleOn) printf(
" --> %-g Hz sr^-1",AvRon/AvSolidangleOn);
15453 printf(
" Particle fluence : %-g cm^-2",AvNon/fSensarea);
15454 if (AvSolidangleOn) printf(
" --> %-g cm^-2 sr^-1",AvNon/(fSensarea*AvSolidangleOn));
15456 printf(
" Particle flux : %-g cm^-2 s^-1",AvRon/fSensarea);
15457 if (AvSolidangleOn) printf(
" --> Intensity : %-g cm^-2 s^-1 sr^-1",AvRon/(fSensarea*AvSolidangleOn));
15460 printf(
" Cumulated energy : %-g GeV",AvEon);
15461 if (AvSolidangleOn) printf(
" --> %-g GeV sr^-1",AvEon/AvSolidangleOn);
15463 printf(
" Power : %-g GeV/s",AvEon/TwinOn);
15464 if (AvSolidangleOn) printf(
" --> %-g GeV s^-1 sr^-1",AvEon/(TwinOn*AvSolidangleOn));
15468 printf(
" Energy fluence : %-g GeV cm^-2",AvEon/fSensarea);
15469 if (AvSolidangleOn) printf(
" --> %-g GeV cm^-2 sr^-1",AvEon/(fSensarea*AvSolidangleOn));
15471 printf(
" Energy flux : %-g GeV cm^-2 s^-1",AvEon/(fSensarea*TwinOn));
15472 if (AvSolidangleOn) printf(
" --> Intensity : %-g GeV cm^-2 s^-1 sr^-1",AvEon/(fSensarea*TwinOn*AvSolidangleOn));
15478 printf(
" *Off source* Total number of recorded off-source (background) events : %-g --> Average per patch : %-g events. \n",nOff,AvNoff);
15479 printf(
" --- Average recorded values per off-source patch --- \n");
15480 printf(
" Steady event rate during the time window : %-g Hz",AvRoff);
15481 if (AvSolidangleOff) printf(
" --> %-g Hz sr^-1",AvRoff/AvSolidangleOff);
15485 printf(
" Particle fluence : %-g cm^-2",AvNoff/fSensarea);
15486 if (AvSolidangleOff) printf(
" --> %-g cm^-2 sr^-1",AvNoff/(fSensarea*AvSolidangleOff));
15488 printf(
" Particle flux : %-g cm^-2 s^-1",AvRoff/fSensarea);
15489 if (AvSolidangleOff) printf(
" --> Intensity : %-g cm^-2 s^-1 sr^-1",AvRoff/(fSensarea*AvSolidangleOff));
15492 printf(
" Cumulated energy : %-g GeV",AvEoff);
15493 if (AvSolidangleOff) printf(
" --> %-g GeV sr^-1",AvEoff/AvSolidangleOff);
15495 printf(
" Power : %-g GeV/s",AvEoff/TwinOff);
15496 if (AvSolidangleOff) printf(
" --> %-g GeV s^-1 sr^-1",AvEoff/(TwinOn*AvSolidangleOff));
15500 printf(
" Energy fluence : %-g GeV cm^-2",AvEoff/fSensarea);
15501 if (AvSolidangleOff) printf(
" --> %-g GeV cm^-2 sr^-1",AvEoff/(fSensarea*AvSolidangleOff));
15503 printf(
" Energy flux : %-g GeV cm^-2 s^-1",AvEoff/(fSensarea*TwinOff));
15504 if (AvSolidangleOff) printf(
" --> Intensity : %-g GeV cm^-2 s^-1 sr^-1",AvEoff/(fSensarea*TwinOff*AvSolidangleOff));
15512 printf(
" -(Unknown)- Total number of injected on-source signal events : %-i",nmugrb);
15513 if (fNgrbs) printf(
" --> Average per patch : %-g events.",
float(nmugrb)/
float(fNgrbs));
15515 printf(
" Total number of recorded on-source signal events : %-g",nsigOn);
15516 if (fNgrbs) printf(
" --> Average per patch : %-g events.",nsigOn/
float(fNgrbs));
15518 printf(
" Total number of recorded on-source bkg events : %-g",nbkgOn);
15519 if (fNgrbs) printf(
" --> Average per patch : %-g events.",nbkgOn/
float(fNgrbs));
15522 printf(
" --- Average signal values per on-source patch --- \n");
15523 printf(
" Steady event rate during the time window : %-g Hz",AvRsigOn);
15524 if (AvSolidangleOn) printf(
" --> %-g Hz sr^-1",AvRsigOn/AvSolidangleOn);
15528 printf(
" Particle fluence : %-g cm^-2",AvNsigOn/fSensarea);
15529 if (AvSolidangleOn) printf(
" --> %-g cm^-2 sr^-1",AvNsigOn/(fSensarea*AvSolidangleOn));
15531 printf(
" Particle flux : %-g cm^-2 s^-1",AvRsigOn/fSensarea);
15532 if (AvSolidangleOn) printf(
" --> Intensity : %-g cm^-2 s^-1 sr^-1",AvRsigOn/(fSensarea*AvSolidangleOn));
15535 printf(
" Cumulated energy : %-g GeV",AvEsigOn);
15536 if (AvSolidangleOn) printf(
" --> %-g GeV sr^-1",AvEsigOn/AvSolidangleOn);
15538 printf(
" Power : %-g GeV/s",AvEsigOn/TwinOn);
15539 if (AvSolidangleOn) printf(
" --> %-g GeV s^-1 sr^-1",AvEsigOn/(TwinOn*AvSolidangleOn));
15543 printf(
" Energy fluence : %-g GeV cm^-2",AvEsigOn/fSensarea);
15544 if (AvSolidangleOn) printf(
" --> %-g GeV cm^-2 sr^-1",AvEsigOn/(fSensarea*AvSolidangleOn));
15546 printf(
" Energy flux : %-g GeV cm^-2 s^-1",AvEsigOn/(fSensarea*TwinOn));
15547 if (AvSolidangleOn) printf(
" --> Intensity : %-g GeV cm^-2 s^-1 sr^-1",AvEsigOn/(fSensarea*TwinOn*AvSolidangleOn));
15550 printf(
" --- Average background values per on-source patch --- \n");
15551 printf(
" Steady event rate during the time window : %-g Hz",AvRbkgOn);
15552 if (AvSolidangleOn) printf(
" --> %-g Hz sr^-1",AvRbkgOn/AvSolidangleOn);
15556 printf(
" Particle fluence : %-g cm^-2",AvNbkgOn/fSensarea);
15557 if (AvSolidangleOn) printf(
" --> %-g cm^-2 sr^-1",AvNbkgOn/(fSensarea*AvSolidangleOn));
15559 printf(
" Particle flux : %-g cm^-2 s^-1",AvRbkgOn/fSensarea);
15560 if (AvSolidangleOn) printf(
" --> Intensity : %-g cm^-2 s^-1 sr^-1",AvRbkgOn/(fSensarea*AvSolidangleOn));
15563 printf(
" Cumulated energy : %-g GeV",AvEbkgOn);
15564 if (AvSolidangleOn) printf(
" --> %-g GeV sr^-1",AvEbkgOn/AvSolidangleOn);
15566 printf(
" Power : %-g GeV/s",AvEbkgOn/TwinOn);
15567 if (AvSolidangleOn) printf(
" --> %-g GeV s^-1 sr^-1",AvEbkgOn/(TwinOn*AvSolidangleOn));
15571 printf(
" Energy fluence : %-g GeV cm^-2",AvEbkgOn/fSensarea);
15572 if (AvSolidangleOn) printf(
" --> %-g GeV cm^-2 sr^-1",AvEbkgOn/(fSensarea*AvSolidangleOn));
15574 printf(
" Energy flux : %-g GeV cm^-2 s^-1",AvEbkgOn/(fSensarea*TwinOn));
15575 if (AvSolidangleOn) printf(
" --> Intensity : %-g GeV cm^-2 s^-1 sr^-1",AvEbkgOn/(fSensarea*TwinOn*AvSolidangleOn));
15585 TString nameS,titleS,nameF,titleF,nameE2F,titleE2F;
15586 nameS=
"hSigFluence";
15587 titleS=
"Stacked simulated incoming signal Fluence;Event energy [GeV];dN/dE [GeV^{-1} cm^{-2}]";
15589 titleF=
"Simulated incoming signal Flux for a steady rate;Event energy [GeV];dN/dE [GeV^{-1} cm^{-2} s^{-1}]";
15590 nameE2F=
"hSigE2Flux";
15591 titleE2F=
"E-scaled simulated incoming signal Flux for a steady rate;Event energy [GeV];E^{2}dN/dE [GeV cm^{-2} s^{-1}]";
15598 hS=
new TH1F(nameS,titleS,100,0,-1);
15600 hF=
new TH1F(nameF,titleF,100,0,-1);
15602 hE2F=
new TH1F(nameE2F,titleE2F,100,0,-1);
15606 hS=
new TH1F(nameS,titleS,100,0,-1);
15608 hF=
new TH1F(nameF,titleF,100,0,-1);
15610 hE2F=
new TH1F(nameE2F,titleE2F,100,0,-1);
15620 for (Int_t i=1; i<=nsig; i++)
15626 hS->Fill(E,Fluence);
15627 hF->Fill(E,Fluence/Ton);
15628 hE2F->Fill(E,pow(E,2)*Fluence/Ton);
15634 hS->BufferEmpty(1);
15635 hF->BufferEmpty(1);
15636 hE2F->BufferEmpty(1);
15637 Float_t binwidth=hS->GetBinWidth(1);
15640 hS->Scale(1./binwidth);
15641 hF->Scale(1./binwidth);
15642 hE2F->Scale(1./binwidth);
15804 if (fTunits==1) tu=
"hrs";
15805 if (fTunits==2) tu=
"s";
15806 if (fTunits==3) tu=
"ns";
15807 if (fTunits==4) tu=
"ps";
15813 TString name=
"Matches";
15814 TString title=
"Space and time matchings of NcAstrolab stored signals";
15815 matches.SetNameTitle(name,title);
15817 if (tu==
"d") tux=
"days";
15818 if (tu==
"hrs") tux=
"hours";
15819 if (tu==
"s") tux=
"sec";
15820 TString namedamin=
"psimin in deg";
15821 TString namedtmin=
"dtmin in ";
15829 TString nameda=
"psi in deg";
15830 TString namedt=
"t2-t1 in ";
15839 if ((!itype || !jtype) && !
fRefs)
15841 printf(
" *%-s::MatchBurstData* Error: itype=%-i jtype=%-i but no reference signals are present. \n",ClassName(),itype,jtype);
15845 if ((itype || jtype) && !
fSigs)
15847 printf(
" *%-s::MatchBurstData* Error: itype=%-i jtype=%-i but no measurements are present. \n",ClassName(),itype,jtype);
15857 if (itype) itype=1;
15858 if (jtype) jtype=1;
15861 if (i2<1 || i2>nrefs) i2=nrefs;
15865 if (i2<1 || i2>nsigs) i2=nsigs;
15869 if (j2<1 || j2>nrefs) j2=nrefs;
15873 if (j2<1 || j2>nsigs) j2=nsigs;
15876 if (i1<1 || j1<1 || i1>i2 || j1>j2)
15878 printf(
" *%-s::MatchBurstData* Inconsistent parameters: i1=%-i i2=%-i itype=%-i j1=%-i j2=%-i jtype=%-i. \n",ClassName(),i1,i2,itype,j1,j2,jtype);
15882 if (fDatype==1 && fMaxsigmatot<0)
15884 printf(
" *%-s::MatchBurstData* Incompatible parameter settings Datype=%-i Maxsigmatot=%-g \n",ClassName(),fDatype,fMaxsigmatot);
15885 printf(
" === No matching analysis will be performed === \n");
15895 if (
fTscmode>0) scrt=
"(scrambled)";
15900 title.Form(
"Time difference %-s between events and bursts for the full selected dataset;Tevent-Tburst in %-s;Counts",scrt.Data(),tux.Data());
15901 TH1F* hTdiff=
new TH1F(
"hTdiff",title,nbins,1,0);
15902 if (ni && nj) hTdiff->SetBuffer(ni*nj);
15906 title.Form(
"Angular separation %-s between events and bursts for the full selected dataset;Opening angle in degrees;Counts",scrp.Data());
15907 TH1F* hAdiff=
new TH1F(
"hAdiff",title,nbins,1,0);
15908 if (ni && nj) hAdiff->SetBuffer(ni*nj);
15914 Double_t dang,dtime,diftheta;
15923 Float_t sigmagrb=0;
15924 Float_t sigmareco=0;
15925 Float_t sigmatot=0;
15927 Double_t dangmin=0;
15931 Bool_t first=kTRUE;
15932 Double_t dangmax=-1;
15936 Float_t thetagrb=0;
15937 Float_t solidangle=0;
15947 TH2* hAeffProfile=(TH2*)
fBurstHistos.FindObject(
"hAeffProfile");
15950 Double_t Fluence=0;
15951 for (Int_t bkgpatch=0; bkgpatch<=fNbkg; bkgpatch++)
15955 for (Int_t i=i1; i<=i2; i++)
15958 if (!sxi)
continue;
15962 if (itype && !fRecoangle) sigmai=fAngresfix;
15964 for (Int_t j=j1; j<=j2; j++)
15967 if (itype==jtype && i==j)
continue;
15970 if (!sxj)
continue;
15974 if (jtype && !fRecoangle) sigmaj=fAngresfix;
16008 if (fSumsigmas==-1) sigmatot=sigmareco;
16009 if (fSumsigmas==0) sigmatot=sigmagrb;
16010 if (fSumsigmas==1) sigmatot=sigmagrb+sigmareco;
16011 if (fSumsigmas==2) sigmatot=sqrt(sigmagrb*sigmagrb+sigmareco*sigmareco);
16014 if (!fDatype) dangmax=fabs(fDawin);
16018 if (fMaxsigmatot>0) dangmax=fabs(fDawin*fMaxsigmatot);
16022 if (sigmatot>=0) dangmax=fabs(fDawin*sigmatot);
16026 if (fDatype==1 && fMaxsigmatot<0) dangmax=-1;
16035 dang=
GetSeparation(ix,jx,
"deg",dtime,tu,1,bkgpatch,&diftheta);
16039 dang=
GetSeparation(ix,jx,
"deg",dtime,
"s",1,bkgpatch,&diftheta);
16046 if (hTdiff) hTdiff->Fill(dtime);
16049 if (hAdiff) hAdiff->Fill(dang);
16057 thlow=thetagrb-0.5*dangmax;
16058 thup=thetagrb+0.5*dangmax;
16067 sxgrb->
SetSignal(solidangle,
"OmegaOn");
16078 thlow=thetagrb-0.5*dangmax;
16079 thup=thetagrb+0.5*dangmax;
16088 sxgrb->
SetSignal(solidangle,
"OmegaOff");
16096 if (diftheta<thlow || diftheta>thup)
continue;
16100 if (fabs(dang)>dangmax)
continue;
16104 if (fTmax>fTmin && (dtime<fTmin || dtime>fTmax))
continue;
16117 name+=sxi->GetName();
16119 title+=sxj->GetName();
16121 data.SetNameTitle(name,title);
16122 data.SetUniqueID(
id);
16136 thlow=thetagrb-0.5*dangmax;
16137 thup=thetagrb+0.5*dangmax;
16163 thlow=thetagrb-0.5*dangmax;
16164 thup=thetagrb+0.5*dangmax;
16173 if (solidangle>sxgrb->
GetSignal(
"OmegaOff")) sxgrb->
SetSignal(solidangle,
"OmegaOff");
16187 nbins=(hAeffProfile->GetNbinsX())*(hAeffProfile->GetNbinsY());
16192 GetSignal(rmu,
"loc",
"T",tx,idx,evttype);
16193 thetamu=rmu.
GetX(2,
"sph",
"rad");
16194 gbin=hAeffProfile->FindFixBin(log10(Ereco),cos(thetamu));
16195 if (gbin>0 && gbin<nbins+1)
16197 Aeff=hAeffProfile->GetBinContent(gbin);
16208 if (first || fabs(dang)<dangmin)
16210 dangmin=fabs(dang);
16215 if (first || fabs(dtime)<fabs(dtmin))
16232 nbins=(hAeffProfile->GetNbinsX())*(hAeffProfile->GetNbinsY());
16237 GetSignal(rmu,
"loc",
"T",tx,idx,evttype);
16238 thetamu=rmu.
GetX(2,
"sph",
"rad");
16239 gbin=hAeffProfile->FindFixBin(log10(Ereco),cos(thetamu));
16240 if (gbin>0 && gbin<nbins+1)
16242 Aeff=hAeffProfile->GetBinContent(gbin);
16261 name=
"SolidangleOn";
16264 name=
"SolidangleOff";
16289 for (Int_t k=k1; k<=k2; k++)
16292 if (!sxgrb)
continue;
16294 solidangle=sxgrb->
GetSignal(
"OmegaOn");
16297 solidangle=sxgrb->
GetSignal(
"OmegaOff");
16423 printf(
" *%-s::MatchBurstData* Object %-s not found for itype=%-i. \n",ClassName(),name.Data(),itype);
16458 if (fTunits==1) tu=
"hours";
16459 if (fTunits==2) tu=
"sec";
16460 if (fTunits==3) tu=
"ns";
16461 if (fTunits==4) tu=
"ps";
16473 fBurstOnReco.SetNameTitle(
"BurstOnReco",
"On-source reco data");
16475 fBurstOnReco.SetNames(
"zburst",
"sigmaburst",
"sigmareco",
"sigmacomb");
16476 fBurstOnMatch.SetNameTitle(
"BurstOnMatch",
"On-source matching data");
16479 fBurstSigReco.SetNameTitle(
"BurstSigReco",
"Simulated signal reco data");
16481 fBurstSigReco.SetNames(
"zburst",
"sigmaburst",
"sigmareco",
"sigmacomb");
16482 fBurstSignal.SetNameTitle(
"BurstSignal",
"Simulated signal events");
16485 fBurstOffReco.SetNameTitle(
"BurstOffReco",
"Off-source reco data");
16487 fBurstOffReco.SetNames(
"zburst",
"sigmaburst",
"sigmareco",
"sigmacomb");
16488 fBurstOffMatch.SetNameTitle(
"BurstOffMatch",
"Off-source matching data");
16494 fBurstOnAeff.SetNameTitle(
"BurstOnAeff",
"On-source track Aeff, E and dang data");
16497 fBurstOffAeff.SetNameTitle(
"BurstOffAeff",
"Off-source track Aeff, E and dang data");
16500 fBurstSigAeff.SetNameTitle(
"BurstSigAeff",
"Simulated signal track Aeff, E and dang data");
16526 Int_t srcbufsize=10000;
16527 if (fNgrbs && fNgrbs<srcbufsize) srcbufsize=fNgrbs;
16528 Int_t evtbufsize=10000;
16529 if (fNevts && fNevts<evtbufsize) evtbufsize=fNevts;
16532 title.Form(
"Redshifts for the selected source sample;Redshift;Counts");
16533 TH1F* hSourceZ=
new TH1F(
"hSourceZ",title,nbins,1,0);
16534 hSourceZ->SetBuffer(srcbufsize);
16538 title.Form(
"Distances for the selected source sample derived from the redshifts;Physical distance in Mpc;Counts");
16539 TH1F* hSourceD=
new TH1F(
"hSourceD",title,nbins,xmin,xmax);
16540 hSourceD->SetBuffer(srcbufsize);
16544 if (fabs(fT90min)>0) xmin=log10(fabs(fT90min));
16546 if (fT90max>0) xmax=log10(fT90max);
16549 nbins=TMath::Nint(range/binsize);
16556 title.Form(
"Burst durations for the selected source sample;Burst duration ^{10}log(T90) in sec.;Counts");
16557 TH1F* hBurstT90=
new TH1F(
"hBurstT90",title,nbins,xmin,xmax);
16561 title.Form(
"Position uncertainties for the selected source sample;Position angular uncertainty (sigma in degrees);Counts");
16562 TH1F* hSigmaSource=
new TH1F(
"hSigmaSource",title,nbins,1,0);
16563 hSigmaSource->SetBuffer(srcbufsize);
16570 title.Form(
"Reconstructed energy for the full selected real event sample;Reconstructed event energy in GeV;Counts");
16571 hEreco=
new TH1F(
"hEreco",title,nbins,1,0);
16572 hEreco->SetBuffer(evtbufsize);
16581 title.Form(
"Injected signal energy at the source;Event energy in GeV;Counts");
16582 hSigE=
new TH1F(
"hSigE",title,nbins,1,0);
16584 title.Form(
"(Redshift corrected) injected signal energy arriving at Earth;Event energy in GeV;Counts");
16585 hSigEzcor=
new TH1F(
"hSigEzcor",title,nbins,1,0);
16590 TH1F* hSigmaReco=0;
16592 title.Form(
"Event reconstruction uncertainties for the full selected sample;Event angular reconstruction uncertainty (sigma in degrees);Counts");
16593 hSigmaReco=
new TH1F(
"hSigmaReco",title,nbins,1,0);
16594 hSigmaReco->SetBuffer(evtbufsize);
16601 Float_t sigmagrb=0;
16609 for (Int_t i=1; i<=nsig; i++)
16620 hSourceZ->Fill(zgrb);
16621 hSourceD->Fill(dgrb);
16622 if (t90grb>0) hBurstT90->Fill(log10(t90grb));
16623 hSigmaSource->Fill(sigmagrb);
16625 if (fAvgrbz<0) zsample.
Enter(zgrb);
16626 if (fAvgrbt90<0) t90sample.
Enter(t90grb);
16627 sigmasample.
Enter(sigmagrb);
16631 if (hSourceZ->GetEntries())
fBurstHistos.Add(hSourceZ);
16632 if (hSourceD->GetEntries())
fBurstHistos.Add(hSourceD);
16633 if (hBurstT90->GetEntries())
fBurstHistos.Add(hBurstT90);
16634 if (hSigmaSource->GetEntries())
fBurstHistos.Add(hSigmaSource);
16650 Float_t fAvgrbsigma=sigmasample.
GetMedian(1);
16653 Float_t sigmareco=0;
16656 for (Int_t i=1; i<=nsig; i++)
16665 if (hSigmaReco) hSigmaReco->Fill(sigmareco);
16666 if (hEreco) hEreco->Fill(Ereco);
16670 if (hSigmaReco->GetEntries())
fBurstHistos.Add(hSigmaReco);
16718 Int_t nmu=int(fabs(fGrbnu)*
float(fNgrbs));
16724 Float_t sigmagrb=0;
16729 Double_t thetagrb=0;
16733 Float_t dangmaxOn=0;
16736 Double_t sigmareco=0;
16737 Float_t sigmatot=0;
16741 Float_t solidangle=0;
16742 Int_t fixedwinset=0;
16745 TH1* hSigEzcor=(TH1*)
fBurstHistos.FindObject(
"hSigEzcor");
16746 TH2* hAeffProfile=(TH2*)
fBurstHistos.FindObject(
"hAeffProfile");
16750 if (hAeffProfile) nbins=(hAeffProfile->GetNbinsX())*(hAeffProfile->GetNbinsY());
16753 Double_t Fluence=0;
16754 Double_t thetamu=0;
16759 jgrb=int(
fRan->Uniform(0.,
float(fNgrbs)));
16760 if (jgrb==0) jgrb=1;
16766 GetSignal(dgrb,thetagrb,
"deg",phigrb,
"deg",
"loc",tx,jgrb);
16771 fixedwinset=TMath::Nint(sx->
GetSignal(
"fixedwinset"));
16787 dt=
fRan->Gauss(fDtnu,fabs(fDtnus)*t90grb);
16791 dt=
fRan->Gauss(fDtnu,fDtnus);
16799 dt=
fRan->Gauss(fDtnu*t90grb,fabs(fDtnus)*t90grb);
16803 dt=
fRan->Gauss(fDtnu*t90grb,fDtnus);
16806 if (fTimres>0) dt=
fRan->Gauss(dt,fTimres);
16817 if (hSigE) hSigE->Fill(E);
16820 if (fEzcor) E=E/(zgrb+1.);
16822 if (hSigEzcor) hSigEzcor->Fill(E);
16824 if (E<0 || E<fEmin || E>fEmax)
continue;
16829 Int_t mode=fKinangle-1;
16836 if (sigmareco<0) sigmareco=fAngresfix;
16838 if (sigmareco<fAngresmin || sigmareco>fAngresmax)
continue;
16846 if (fSumsigmas==-1) sigmatot=sigmareco;
16847 if (fSumsigmas==0) sigmatot=sigmagrb;
16848 if (fSumsigmas==1) sigmatot=sigmagrb+sigmareco;
16849 if (fSumsigmas==2) sigmatot=sqrt(sigmagrb*sigmagrb+sigmareco*sigmareco);
16855 if (sigmatot>=0) dangmax=fabs(fDawin*sigmatot);
16858 if (fDatype>=0 && dang>dangmax)
continue;
16868 thetamu=rmu.
GetX(2,
"sph",
"rad");
16869 gbin=hAeffProfile->FindFixBin(log10(E),cos(thetamu));
16870 if (gbin>0 && gbin<nbins+1)
16872 Aeff=hAeffProfile->GetBinContent(gbin);
16882 if (fixedwinset)
continue;
16887 thlow=thetagrb-0.5*dangmax;
16888 thup=thetagrb+0.5*dangmax;
16897 if (dangmax>dangmaxOn) sx->
SetSignal(dangmax,
"dangmaxOn");
16898 if (solidangle>OmegaOn) sx->
SetSignal(solidangle,
"OmegaOn");
16946 if (fNgrbs<=0 || fNbkg<=0 || Non<=0 || Noff<=0)
16948 printf(
" \n *%-s::GetBurstBayesianSignalRate* \n",ClassName());
16949 if (fNgrbs<=0 || Non<=0) printf(
" === No on-source data available === \n");
16950 if (fNbkg<=0 || Noff<=0) printf(
" === No off-source data available === \n");
16958 if (fTunits==1) tu=
"hours";
16959 if (fTunits==2) tu=
"sec";
16960 if (fTunits==3) tu=
"ns";
16961 if (fTunits==4) tu=
"ps";
16969 if (fAvSolidangleOff) Ra=fAvSolidangleOn/fAvSolidangleOff;
16979 Double_t rmode=fsigrpdf.GetMaximumX();
16980 Double_t bkgrmode=fbkgrpdf.GetMaximumX();
16987 fbkgrpdf.SetRange(0,3.*Noff/Toff);
16988 fbkgrpdf.SetNpx(n);
16989 TH1* hBkgRatePDF=(TH1*)fbkgrpdf.GetHistogram()->Clone();
16990 hBkgRatePDF->SetName(
"hBkgRatePDF");
16992 fsigrpdf.SetRange(0,3.*Non/Ton);
16993 fsigrpdf.SetNpx(n);
16994 TH1* hSigRatePDF=(TH1*)fsigrpdf.GetHistogram()->Clone();
16995 hSigRatePDF->SetName(
"hSigRatePDF");
16998 printf(
"\n *%-s::GetBurstBayesianSignalRate* Credible interval [rlow,rup] for p=%-g%% with a precision of 1/%-i \n",ClassName(),p,n);
17006 if (fRecoangle && fSumsigmas && fDatype==2)
17008 printf(
" === Warning: Variable angular cones based on actual track reconstruction sigmas were used. \n");
17009 printf(
" Large variations between the on-source and off-source background counts may be present. \n");
17012 printf(
" The %-g%% credible interval from the Bayesian posterior signal pdf : [%-g,%-g] Hz \n",100.*frac,rlow,rup);
17013 printf(
" Modes of the on-source posterior PDFs : Signal=%-g Hz Background=%-g Hz",rmode,bkgrmode);
17014 if (bkgrmode) printf(
" Signal/Background=%-g",rmode/bkgrmode);
17016 printf(
" The following signal and background rate PDF histograms have been generated : \n");
17017 printf(
" ... %-s : %-s \n",hSigRatePDF->GetName(),hSigRatePDF->GetTitle());
17018 printf(
" ... %-s : %-s \n",hBkgRatePDF->GetName(),hBkgRatePDF->GetTitle());
17024 printf(
" Integrated on-source exposure time of the %-i stacked time windows : %-g %-s \n",fNgrbs,Ton/fTfact,tu.Data());
17025 printf(
" Integrated off-source exposure time of the %-i*%-i stacked time windows : %-g %-s \n",fNgrbs,fNbkg,Toff/fTfact,tu.Data());
17026 printf(
" Total accumulated on-source solid angle : %-g sr in %-i stacked patches --> Average per patch : %-g sr \n",fSolidangleOn,fNgrbs,fAvSolidangleOn);
17027 printf(
" Total accumulated off-source solid angle : %-g sr in %-i*%-i stacked patches --> Average per patch : %-g sr \n",fSolidangleOff,fNgrbs,fNbkg,fAvSolidangleOff);
17028 if (fSensarea>0) printf(
" Area covered c.q. overlooked by the detector sensors : %-g cm^2. \n",fSensarea);
17030 printf(
" Total number of recorded on-source events : %-g --> Average per patch : %-g events. \n",Non,Non/
float(fNgrbs));
17031 printf(
" Total number of recorded off-source events : %-g --> Average per patch : %-g events. \n",Noff,Noff/
float(fNgrbs*fNbkg));
17034 for (Int_t i=1; i<3; i++)
17036 printf(
" ********************************************************************** \n");
17039 printf(
" * Accumulated (stacked) on-source values based on the posterior PDFs * \n");
17043 printf(
" * Average values per on-source patch based on the posterior PDFs * \n");
17045 printf(
" ********************************************************************** \n");
17049 printf(
" *Lower bound* Steady signal event rate during each time window : %-g Hz",rlow);
17050 if (fAvSolidangleOn) printf(
" --> %-g Hz sr^-1",rlow/fAvSolidangleOn);
17052 text.Form(
"CL%-iLower",TMath::Nint(p));
17055 printf(
" *Mode* Steady signal event rate during each time window : %-g Hz",rmode);
17056 if (fAvSolidangleOn) printf(
" --> %-g Hz sr^-1",rmode/fAvSolidangleOn);
17060 printf(
" *Upper bound* Steady signal event rate during each time window : %-g Hz",rup);
17061 if (fAvSolidangleOn) printf(
" --> %-g Hz sr^-1",rup/fAvSolidangleOn);
17063 text.Form(
"CL%-iUpper",TMath::Nint(p));
17066 printf(
" *Background* Steady background event rate during each time window : %-g Hz",bkgrmode);
17067 if (fAvSolidangleOn) printf(
" --> %-g Hz sr^-1",bkgrmode/fAvSolidangleOn);
17072 return hSigRatePDF;
17095 Double_t Fluence=-1;
17097 Int_t n=TMath::Nint(nsig);
17099 if (n<1 || Ton<=0)
return -1;
17110 TString nameS,titleS,nameF,titleF,nameE2F,titleE2F;
17111 nameS.Form(
"h%-sFluence",str.Data());
17112 titleS.Form(
"Stacked incoming signal Fluence for Bayesian %s rate;Event energy [GeV];dN/dE [GeV^{-1} cm^{-2}]",str.Data());
17113 nameF.Form(
"h%-sFlux",str.Data());
17114 titleF.Form(
"Incoming signal Flux for a steady Bayesian %s rate;Event energy [GeV];dN/dE [GeV^{-1} cm^{-2} s^{-1}]",str.Data());
17115 nameE2F.Form(
"h%-sE2Flux",str.Data());
17116 titleE2F.Form(
"E-Scaled incoming signal Flux for a steady Bayesian %s rate;Event energy [GeV];E^{2}dN/dE [GeV cm^{-2} s^{-1}]",str.Data());
17129 hS=
new TH1F(nameS,titleS,100,0,-1);
17131 hF=
new TH1F(nameF,titleF,100,0,-1);
17133 hE2F=
new TH1F(nameE2F,titleE2F,100,0,-1);
17137 hS=
new TH1F(nameS,titleS,100,0,-1);
17139 hF=
new TH1F(nameF,titleF,100,0,-1);
17141 hE2F=
new TH1F(nameE2F,titleE2F,100,0,-1);
17150 for (Int_t i=1; i<=n; i++)
17155 if (Fluence>0 && hS)
17157 hS->Fill(E,Fluence);
17158 hF->Fill(E,Fluence/Ton);
17159 hE2F->Fill(E,pow(E,2)*Fluence/Ton);
17167 hS->BufferEmpty(1);
17168 hF->BufferEmpty(1);
17169 hE2F->BufferEmpty(1);
17170 Float_t binwidth=hS->GetBinWidth(1);
17173 hS->Scale(1./binwidth);
17174 hF->Scale(1./binwidth);
17175 hE2F->Scale(1./binwidth);
17208 Float_t TwinOn=Ton/float(fNgrbs);
17220 Float_t Omega=fSolidangleOn;
17226 Omega=fAvSolidangleOn;
17230 Float_t Nevt=Rate*Time;
17232 Float_t Fluence=-1;
17240 Fluence=Fluence/float(fNgrbs);
17243 TString type=
"signal";
17244 if (mode<0) type=
"background";
17246 printf(
" Expected recorded number of %-s events : %-g",type.Data(),Nevt);
17247 if (Omega) printf(
" --> %-g events/sr",Nevt/Omega);
17251 printf(
" Expected recorded %-s particle fluence : %-g cm^-2",type.Data(),Nevt/fSensarea);
17252 if (Omega) printf(
" --> %-g cm^-2 sr^-1",Nevt/(fSensarea*Omega));
17254 printf(
" Expected recorded %-s particle flux : %-g cm^-2 s^-1",type.Data(),Rate/fSensarea);
17255 if (Omega) printf(
" --> Intensity : %-g cm^-2 s^-1 sr^-1",Rate/(fSensarea*Omega));
17260 printf(
" Expected incoming %-s particle fluence : %-g cm^-2",type.Data(),Fluence);
17261 if (Omega) printf(
" --> %-g cm^-2 sr^-1",Fluence/Omega);
17263 printf(
" Expected incoming %-s particle flux : %-g cm^-2 s^-1",type.Data(),Fluence/Time);
17264 if (Omega) printf(
" --> Intensity : %-g cm^-2 s^-1 sr^-1",Fluence/(Time*Omega));
17290 if (Non<=0 || Noff<=0)
17292 printf(
" \n *%-s::GetBurstLiMaSignificance* \n",ClassName());
17293 if (Non<=0) printf(
" === No on source data available === \n");
17294 if (Noff<=0) printf(
" === No off source data available === \n");
17302 if (fAvSolidangleOff) Ra=fAvSolidangleOn/fAvSolidangleOff;
17311 printf(
"\n *%-s::GetBurstLiMaSignificance* The Li-Ma signal significance is : %-g \n",ClassName(),sigma);
17319 if (fRecoangle && fSumsigmas && fDatype==2)
17321 printf(
" === Warning: Variable angular cones based on actual track reconstruction sigmas were used. \n");
17322 printf(
" Large variations between the on-source and off-source background counts may be present. \n");
17402 TString text=
"none";
17403 if (type==
"time") text=
"arrival time";
17404 if (type==
"BBtime") text=
"Bayesian Block event rate";
17405 if (type==
"BBrat") text=
"normalized On-source/Off-source Bayesian Block event rate ratio";
17406 if (type==
"angle") text=
"opening angle";
17407 if (type==
"cosa") text=
"cos(opening angle)";
17408 if (type==
"dt") text=
"arrival time interval";
17412 text.ReplaceAll(
"arrival time",
"redshift corrected arrival time");
17413 text.ReplaceAll(
"event rate",
"redshift corrected event rate");
17419 cout <<
" *" << ClassName() <<
"::GetBurstBayesianPsiStatistics* Unknown statistics type : " << type << endl;
17424 cout <<
" *" << ClassName() <<
"::GetBurstBayesianPsiStatistics* Analysis of " << text <<
" statistics" << endl;
17429 if (fTunits==1) tu=
"hours";
17430 if (fTunits==2) tu=
"sec";
17431 if (fTunits==3) tu=
"ns";
17432 if (fTunits==4) tu=
"ps";
17438 Double_t psitot=-1, psibkg=-1, psirat=-1;
17440 Float_t psimintot=-1, psimaxtot=-1, psifractot=0;
17441 Float_t psiminbkg=-1, psimaxbkg=-1, psifracbkg=0;
17442 Float_t psiminrat=-1, psimaxrat=-1, psifracrat=0;
17443 Double_t nrxtot=-1, nrxbkg=-1, nrxrat=-1;
17444 Double_t pvaluetot=-1, pvaluebkg=-1, pvaluerat=-1;
17469 if (!tot) printf(
" === No on source data available === \n");
17470 if (!bkg) printf(
" === No off source data available === \n");
17472 if (!tot && !bkg)
return;
17474 if (tot) psitot=math.
PsiValue(tot,0,0,freq);
17475 if (bkg) psibkg=math.
PsiValue(bkg,0,0,freq);
17476 psidif=psitot-psibkg;
17482 if (psitot<psimintot) psimintot=psitot;
17484 if (psimaxtot>psimintot) psifractot=(psimaxtot-psitot)/(psimaxtot-psimintot);
17489 if (psibkg<psiminbkg) psiminbkg=psibkg;
17491 if (psimaxbkg>psiminbkg) psifracbkg=(psimaxbkg-psibkg)/(psimaxbkg-psiminbkg);
17510 rtot=(TH1F*)hPsiOn->Clone();
17517 if (!zcor) rtot=
new TH1F(
"hPsiOnt",
"Psi distr. for bkg hypothesis of on-source arrival time data",100,psimintot-1.,psimaxtot+1.);
17518 if (zcor) rtot=
new TH1F(
"hPsiOnZt",
"Psi distr. for bkg hypothesis of redshift corrected on-source arrival time data",100,psimintot-1.,psimaxtot+1.);
17524 rbkg=(TH1F*)hPsiOff->Clone();
17531 if (!zcor) rbkg=
new TH1F(
"hPsiOfft",
"Psi distr. for bkg hypothesis of off-source arrival time data",100,psiminbkg-1.,psimaxbkg+1.);
17532 if (zcor) rbkg=
new TH1F(
"hPsiOffZt",
"Psi distr. for bkg hypothesis of redshift corrected off-source arrival time data",100,psiminbkg-1.,psimaxbkg+1.);
17538 pvaluetot=math.
PsiPvalue(-1,nr,tot,0,0,freq,0,rtot,ncut,&nrxtot);
17543 pvaluebkg=math.
PsiPvalue(-1,nr,bkg,0,0,freq,0,rbkg,ncut,&nrxbkg);
17547 cout <<
" The following randomised Psi histograms have been generated :" << endl;
17548 if (rtot) cout <<
" ... " << rtot->GetName() <<
" : " << rtot->GetTitle() << endl;
17549 if (rbkg) cout <<
" ... " << rbkg->GetName() <<
" : " << rbkg->GetTitle() << endl;
17556 if (type==
"BBtime")
17569 if (!tot) printf(
" === No on source data available === \n");
17570 if (!bkg) printf(
" === No off source data available === \n");
17572 if (!tot && !bkg)
return;
17577 for (Int_t i=1; i<=tot->GetNbinsX(); i++)
17579 tot->AddBinContent(i,1);
17585 for (Int_t i=1; i<=bkg->GetNbinsX(); i++)
17587 bkg->AddBinContent(i,1);
17591 if (tot) psitot=math.
PsiValue(tot,0,0,freq);
17592 if (bkg) psibkg=math.
PsiValue(bkg,0,0,freq);
17593 psidif=psitot-psibkg;
17599 if (psitot<psimintot) psimintot=psitot;
17601 if (psimaxtot>psimintot) psifractot=(psimaxtot-psitot)/(psimaxtot-psimintot);
17606 if (psibkg<psiminbkg) psiminbkg=psibkg;
17608 if (psimaxbkg>psiminbkg) psifracbkg=(psimaxbkg-psibkg)/(psimaxbkg-psiminbkg);
17622 hPsiOff=(TH1F*)
fBurstHistos.FindObject(
"hPsiOffBBzt");
17627 rtot=(TH1F*)hPsiOn->Clone();
17634 if (!zcor) rtot=
new TH1F(
"hPsiOnBBt",
"Psi distr. for bkg hypothesis of on-source event rate Bayesian Block data",100,psimintot-1.,psimaxtot+1.);
17635 if (zcor) rtot=
new TH1F(
"hPsiOnBBzt",
"Psi distr. for bkg hypothesis of redshift corrected on-source event rate Bayesian Block data",100,psimintot-1.,psimaxtot+1.);
17641 rbkg=(TH1F*)hPsiOff->Clone();
17648 if (!zcor) rbkg=
new TH1F(
"hPsiOffBBt",
"Psi distr. for bkg hypothesis of off-source event rate Bayesian Block data",100,psiminbkg-1.,psimaxbkg+1.);
17649 if (zcor) rbkg=
new TH1F(
"hPsiOffBBzt",
"Psi distr. for bkg hypothesis of redshift corrected off-source event rate Bayesian Block data",100,psiminbkg-1.,psimaxbkg+1.);
17655 pvaluetot=math.
PsiPvalue(-1,nr,tot,0,0,freq,0,rtot,ncut,&nrxtot);
17660 pvaluebkg=math.
PsiPvalue(-1,nr,bkg,0,0,freq,0,rbkg,ncut,&nrxbkg);
17664 cout <<
" The following randomised Psi histograms have been generated :" << endl;
17665 if (rtot) cout <<
" ... " << rtot->GetName() <<
" : " << rtot->GetTitle() << endl;
17666 if (rbkg) cout <<
" ... " << rbkg->GetName() <<
" : " << rbkg->GetTitle() << endl;
17672 for (Int_t i=1; i<=tot->GetNbinsX(); i++)
17674 tot->AddBinContent(i,-1);
17679 for (Int_t i=1; i<=bkg->GetNbinsX(); i++)
17681 bkg->AddBinContent(i,-1);
17702 printf(
" === No data available === \n");
17706 psirat=math.
PsiValue(rat,0,0,freq);
17707 psidif=psitot-psibkg;
17711 if (psirat<psiminrat) psiminrat=psirat;
17713 if (psimaxrat>psiminrat) psifracrat=(psimaxrat-psirat)/(psimaxrat-psiminrat);
17720 hPsiRat=(TH1F*)
fBurstHistos.FindObject(
"hPsiRatUBBt");
17724 hPsiRat=(TH1F*)
fBurstHistos.FindObject(
"hPsiRatUBBzt");
17729 rrat=(TH1F*)hPsiRat->Clone();
17734 if (!zcor) rrat=
new TH1F(
"hPsiRatUBBt",
"Psi distr. for bkg hypothesis of on/off source event rate Bayesian Block data",100,psiminrat-1.,psimaxrat+1.);
17735 if (zcor) rrat=
new TH1F(
"hPsiRatUBBzt",
"Psi distr. for bkg hypothesis of redshift corrected on/off source event rate Bayesian Block data",100,psiminrat-1.,psimaxrat+1.);
17738 pvaluerat=math.
PsiPvalue(-1,nr,rat,0,0,freq,0,rrat,ncut,&nrxrat);
17741 cout <<
" The following randomised Psi histograms have been generated :" << endl;
17742 if (rrat) cout <<
" ... " << rrat->GetName() <<
" : " << rrat->GetTitle() << endl;
17754 if (!tot) printf(
" === No on source data available === \n");
17755 if (!bkg) printf(
" === No off source data available === \n");
17757 if (!tot && !bkg)
return;
17759 TF1 pdfa(
"pdfa",
"sin(x*acos(-1.)/180.)");
17760 if (tot) psitot=math.
PsiValue(tot,0,&pdfa,freq);
17761 if (bkg) psibkg=math.
PsiValue(bkg,0,&pdfa,freq);
17762 psidif=psitot-psibkg;
17768 if (psitot<psimintot) psimintot=psitot;
17770 if (psimaxtot>psimintot) psifractot=(psimaxtot-psitot)/(psimaxtot-psimintot);
17775 if (psibkg<psiminbkg) psiminbkg=psibkg;
17777 if (psimaxbkg>psiminbkg) psifracbkg=(psimaxbkg-psibkg)/(psimaxbkg-psiminbkg);
17788 rtot=(TH1F*)hPsiOn->Clone();
17793 if (tot) rtot=
new TH1F(
"hPsiOna",
"Psi distr. for bkg hypothesis of on-source opening angle data",100,psimintot-1.,psimaxtot+1.);
17798 rbkg=(TH1F*)hPsiOff->Clone();
17803 if (bkg) rbkg=
new TH1F(
"hPsiOffa",
"Psi distr. for bkg hypothesis of off-source opening angle data",100,psiminbkg-1.,psimaxbkg+1.);
17808 pvaluetot=math.
PsiPvalue(-1,nr,tot,0,&pdfa,freq,0,rtot,ncut,&nrxtot);
17813 pvaluebkg=math.
PsiPvalue(-1,nr,bkg,0,&pdfa,freq,0,rbkg,ncut,&nrxbkg);
17817 cout <<
" The following randomised Psi histograms have been generated :" << endl;
17818 if (rtot) cout <<
" ... " << rtot->GetName() <<
" : " << rtot->GetTitle() << endl;
17819 if (rbkg) cout <<
" ... " << rbkg->GetName() <<
" : " << rbkg->GetTitle() << endl;
17831 if (!tot) printf(
" === No on source data available === \n");
17832 if (!bkg) printf(
" === No off source data available === \n");
17834 if (!tot && !bkg)
return;
17836 if (tot) psitot=math.
PsiValue(tot,0,0,freq);
17837 if (bkg) psibkg=math.
PsiValue(bkg,0,0,freq);
17838 psidif=psitot-psibkg;
17844 if (psitot<psimintot) psimintot=psitot;
17846 if (psimaxtot>psimintot) psifractot=(psimaxtot-psitot)/(psimaxtot-psimintot);
17851 if (psibkg<psiminbkg) psiminbkg=psibkg;
17853 if (psimaxbkg>psiminbkg) psifracbkg=(psimaxbkg-psibkg)/(psimaxbkg-psiminbkg);
17860 hPsiOff=(TH1F*)
fBurstHistos.FindObject(
"hPsiOffCosa");
17864 rtot=(TH1F*)hPsiOn->Clone();
17869 if (tot) rtot=
new TH1F(
"hPsiOnCosa",
"Psi distr. for bkg hypothesis of on-source cos(opening angle) data",100,psimintot-1.,psimaxtot+1.);
17874 rbkg=(TH1F*)hPsiOff->Clone();
17879 if (bkg) rbkg=
new TH1F(
"hPsiOffCosa",
"Psi distr. for bkg hypothesis of off-source cos(opening angle) data",100,psiminbkg-1.,psimaxbkg+1.);
17884 pvaluetot=math.
PsiPvalue(-1,nr,tot,0,0,freq,0,rtot,ncut,&nrxtot);
17889 pvaluebkg=math.
PsiPvalue(-1,nr,bkg,0,0,freq,0,rbkg,ncut,&nrxbkg);
17893 cout <<
" The following randomised Psi histograms have been generated :" << endl;
17894 if (rtot) cout <<
" ... " << rtot->GetName() <<
" : " << rtot->GetTitle() << endl;
17895 if (rbkg) cout <<
" ... " << rbkg->GetName() <<
" : " << rbkg->GetTitle() << endl;
17911 Int_t ntot=hOndt.GetEntries();
17912 Int_t nbkg=hOffdt.GetEntries();
17914 if (!ntot) printf(
" === No on source data available === \n");
17915 if (!nbkg) printf(
" === No off source data available === \n");
17917 if (!ntot && !nbkg)
return;
17919 if (ntot) psitot=math.
PsiValue(&hOndt,0,&pdfdttot,freq);
17920 if (nbkg) psibkg=math.
PsiValue(&hOffdt,0,&pdfdtbkg,freq);
17921 psidif=psitot-psibkg;
17925 psimintot=math.
PsiExtreme(&hOndt,0,&pdfdttot,-2);
17926 if (psitot<psimintot) psimintot=psitot;
17927 psimaxtot=math.
PsiExtreme(&hOndt,0,&pdfdttot,-1);
17928 if (psimaxtot>psimintot) psifractot=(psimaxtot-psitot)/(psimaxtot-psimintot);
17932 psiminbkg=math.
PsiExtreme(&hOffdt,0,&pdfdtbkg,-2);
17933 if (psibkg<psiminbkg) psiminbkg=psibkg;
17934 psimaxbkg=math.
PsiExtreme(&hOffdt,0,&pdfdtbkg,-1);
17935 if (psimaxbkg>psiminbkg) psifracbkg=(psimaxbkg-psibkg)/(psimaxbkg-psiminbkg);
17945 nametot.Form(
"hPsiOndt%-i",ndt);
17946 namebkg.Form(
"hPsiOffdt%-i",ndt);
17950 nametot.Form(
"hPsiOnZdt%-i",ndt);
17951 namebkg.Form(
"hPsiOffZdt%-i",ndt);
17955 TH1F* hPsiOff=(TH1F*)
fBurstHistos.FindObject(namebkg);
17960 rtot=(TH1F*)hPsiOn->Clone();
17965 if (!zcor) title.Form(
"Psi distr. for bkg hypothesis of on-source dt data for n=%-i",ndt);
17966 if (zcor) title.Form(
"Psi distr. for bkg hypothesis of redshift corrected on-source dt data for n=%-i",ndt);
17967 if (ntot) rtot=
new TH1F(nametot,title,100,psimintot-1.,psimaxtot+1.);
17972 rbkg=(TH1F*)hPsiOff->Clone();
17977 if (!zcor) title.Form(
"Psi distr. for bkg hypothesis of off-source dt data for n=%-i",ndt);
17978 if (zcor) title.Form(
"Psi distr. for bkg hypothesis of redshift corrected off-source dt data for n=%-i",ndt);
17979 if (nbkg) rbkg=
new TH1F(namebkg,title,100,psiminbkg-1.,psimaxbkg+1.);
17984 pvaluetot=math.
PsiPvalue(-1,nr,&hOndt,0,&pdfdttot,freq,0,rtot,ncut,&nrxtot);
17989 pvaluebkg=math.
PsiPvalue(-1,nr,&hOffdt,0,&pdfdtbkg,freq,0,rbkg,ncut,&nrxbkg);
17993 cout <<
" The following randomised Psi histograms have been (re)generated :" << endl;
17994 if (rtot) cout <<
" ... " << rtot->GetName() <<
" : " << rtot->GetTitle() << endl;
17995 if (rbkg) cout <<
" ... " << rbkg->GetName() <<
" : " << rbkg->GetTitle() << endl;
18000 cout <<
" *** Observed Psi values (in dB) for the hypothesis of no burst signal ***" << endl;
18001 if (psitot>=0) cout <<
" For the on-source stacked patches : psi = " << psitot << endl;
18002 if (psibkg>=0) cout <<
" For the off-source stacked patches : psi = " << psibkg << endl;
18003 if (psitot>=0 && psibkg>=0) cout <<
" --> Difference between observed on-source and off-source psi values : " << psidif << endl;
18004 if (psirat>=0) cout <<
" For the on/off source event rate Bayesian Blocks : psi = " << psirat << endl;
18005 cout <<
" *** Extreme Psi values for the case of pure background ***" << endl;
18006 if (psimintot>=0) cout <<
" For on-source psimin : " << psimintot <<
" psimax : " << psimaxtot;
18007 if (psifractot>0) printf(
" (psimax-psi)/range : %-g",psifractot);
18008 if (psimintot>=0 || psifractot>0) printf(
"\n");
18009 if (psiminbkg>=0) cout <<
" For off-source psimin : " << psiminbkg <<
" psimax : " << psimaxbkg;
18010 if (psifracbkg>0) printf(
" (psimax-psi)/range : %-g",psifracbkg);
18011 if (psiminbkg>=0 || psifracbkg>0) printf(
"\n");
18012 if (psiminrat>=0) cout <<
" For on/off source event rate Bayesian Blocks psimin : " << psiminrat <<
" psimax : " << psimaxrat;
18013 if (psifracrat>0) printf(
" (psimax-psi)/range : %-g",psifracrat);
18014 if (psiminrat>=0 || psifracrat>0) printf(
"\n");
18018 cout <<
" *** P-values of the observed on-source and off-source psi values ***" << endl;
18019 if (nrxtot>0) cout <<
" For the on-source stacked patches : P-value = " << pvaluetot <<
" Used number of randomisations : " << nrxtot << endl;
18020 if (nrxbkg>0) cout <<
" For the off-source stacked patches : P-value = " << pvaluebkg <<
" Used number of randomisations : " << nrxbkg << endl;
18021 if (nrxrat>0) cout <<
" For the on/off source event rate Bayesian Blocks : P-value = " << pvaluerat <<
" Used number of randomisations : " << nrxrat << endl;
18064 TString text=
"none";
18065 if (type==
"time") text=
"arrival time";
18066 if (type==
"BBtime") text=
"Bayesian Block event rate";
18067 if (type==
"BBrat") text=
"normalized On-source/Off-source Bayesian Block event rate ratio";
18068 if (type==
"angle") text=
"opening angle";
18069 if (type==
"cosa") text=
"cos(opening angle)";
18070 if (type==
"dt") text=
"arrival time interval";
18074 text.ReplaceAll(
"arrival time",
"redshift corrected arrival time");
18075 text.ReplaceAll(
"event rate",
"redshift corrected event rate");
18081 cout <<
" *" << ClassName() <<
"::GetBurstChi2Statistics* Unknown statistics type : " << type << endl;
18086 cout <<
" *" << ClassName() <<
"::GetBurstChi2Statistics* Analysis of " << text <<
" statistics" << endl;
18116 if (!tot) printf(
" === No on source data available === \n");
18117 if (!bkg) printf(
" === No off source data available === \n");
18119 if (!tot && !bkg)
return;
18121 if (tot) chitot=math.
Chi2Value(tot,0,0,&ndftot);
18122 if (bkg) chibkg=math.
Chi2Value(bkg,0,0,&ndfbkg);
18128 if (type==
"BBtime")
18141 if (!tot) printf(
" === No on source data available === \n");
18142 if (!bkg) printf(
" === No off source data available === \n");
18144 if (!tot && !bkg)
return;
18146 if (tot) chitot=math.
Chi2Value(tot,0,0,&ndftot);
18147 if (bkg) chibkg=math.
Chi2Value(bkg,0,0,&ndfbkg);
18166 printf(
" === No data available === \n");
18170 chirat=math.
Chi2Value(rat,0,0,&ndfrat);
18181 if (!tot) printf(
" === No on source data available === \n");
18182 if (!bkg) printf(
" === No off source data available === \n");
18184 if (!tot && !bkg)
return;
18186 TF1 pdf(
"pdf",
"sin(x*acos(-1.)/180.)");
18187 if (tot) chitot=math.
Chi2Value(tot,0,&pdf,&ndftot);
18188 if (bkg) chibkg=math.
Chi2Value(bkg,0,&pdf,&ndfbkg);
18199 if (!tot) printf(
" === No on source data available === \n");
18200 if (!bkg) printf(
" === No off source data available === \n");
18202 if (!tot && !bkg)
return;
18204 if (tot) chitot=math.
Chi2Value(tot,0,0,&ndftot);
18205 if (bkg) chibkg=math.
Chi2Value(bkg,0,0,&ndfbkg);
18220 Int_t ntot=hOndt.GetEntries();
18221 Int_t nbkg=hOffdt.GetEntries();
18223 if (!ntot) printf(
" === No on source data available === \n");
18224 if (!nbkg) printf(
" === No off source data available === \n");
18226 if (!ntot && !nbkg)
return;
18228 if (ntot) chitot=math.
Chi2Value(&hOndt,0,&pdfdttot,&ndftot);
18229 if (nbkg) chibkg=math.
Chi2Value(&hOffdt,0,&pdfdtbkg,&ndfbkg);
18233 Float_t chidif=chitot-chibkg;
18234 cout <<
" *** Observed Chi-squared values for the hypothesis of no burst signal ***" << endl;
18235 if (chitot>0) cout <<
" For the on-source stacked patches : chi2 = " << chitot <<
" ndf = " << ndftot << endl;
18236 if (chibkg>0) cout <<
" For the off-source stacked patches : chi2 = " << chibkg <<
" ndf = " << ndfbkg << endl;
18237 if (chitot>0 && chibkg>0) cout <<
" --> Difference between observed on-source and off-source chi2 values : " << chidif << endl;
18238 if (chirat>0) cout <<
" For the on/off source event rate Bayesian Blocks : chi2 = " << chirat <<
" ndf = " << ndfrat << endl;
18241 Float_t sigmatot=-1;
18243 Float_t sigmabkg=-1;
18245 Float_t sigmarat=-1;
18250 sigmatot=math.
Chi2Pvalue(chitot,ndftot,0,1);
18255 sigmabkg=math.
Chi2Pvalue(chibkg,ndfbkg,0,1);
18260 sigmarat=math.
Chi2Pvalue(chirat,ndfrat,0,1);
18263 cout <<
" *** P-values of the observed on-source and off-source chi2 values ***" << endl;
18264 if (ptot>=0) cout <<
" For the on-source stacked patches : P-value = " << ptot <<
" (" << sigmatot <<
" sigma)" << endl;
18265 if (pbkg>=0) cout <<
" For the off-source stacked patches : P-value = " << pbkg <<
" (" << sigmabkg <<
" sigma)" << endl;
18266 if (prat>=0) cout <<
" For the on/off source event rate Bayesian Blocks : P-value = " << prat <<
" (" << sigmarat <<
" sigma)" << endl;
18296 if (fTunits==1) tu=
"hours";
18297 if (fTunits==2) tu=
"sec";
18298 if (fTunits==3) tu=
"ns";
18299 if (fTunits==4) tu=
"ps";
18310 nametot.Form(
"hOndt%-i",ndt);
18311 namebkg.Form(
"hOffdt%-i",ndt);
18316 nametot.Form(
"hOnZdt%-i",ndt);
18317 namebkg.Form(
"hOffZdt%-i",ndt);
18324 Double_t deltatbin=0;
18331 nOndt=sOndt.
GetN();
18335 hOndt=
new TH1F(nametot,
"histo",10000,1,0);
18337 hOndt->SetBuffer(nOndt);
18339 for (Int_t i=1; i<=nOndt; i++)
18344 hOndt->BufferEmpty(1);
18347 deltatbin=hOndt->GetXaxis()->GetBinWidth(1);
18348 if (!zcor) title.Form(
"Time intervals between %-i consecutive events in the on-source time window;dt in %-s;Counts per %-.3g %-s",(ndt+1),tu.Data(),deltatbin,tu.Data());
18349 if (zcor) title.Form(
"Time intervals between %-i consecutive events in the redshift corrected on-source time window;dt in %-s;Counts per %-.3g %-s",(ndt+1),tu.Data(),deltatbin,tu.Data());
18350 hOndt->SetTitle(title);
18359 nOffdt=sOffdt.
GetN();
18363 hOffdt=
new TH1F(namebkg,
"histo",10000,1,0);
18365 hOffdt->SetBuffer(nOffdt);
18367 for (Int_t i=1; i<=nOffdt; i++)
18369 hOffdt->Fill(sOffdt.
GetEntry(i,1));
18372 hOffdt->BufferEmpty(1);
18375 deltatbin=hOffdt->GetXaxis()->GetBinWidth(1);
18376 if (!zcor) title.Form(
"Time intervals between %-i consecutive events in the off-source time window;dt in %-s;Counts per %-.3g %-s",(ndt+1),tu.Data(),deltatbin,tu.Data());
18377 if (zcor) title.Form(
"Time intervals between %-i consecutive events in the redshift corrected off-source time window;dt in %-s;Counts per %-.3g %-s",(ndt+1),tu.Data(),deltatbin,tu.Data());
18378 hOffdt->SetTitle(title);
18384 if (hOndt || hOffdt) cout <<
" The following arrival time interval (dt) histograms have been generated :" << endl;
18385 if (hOndt) cout <<
" ... " << hOndt->GetName() <<
" : " << hOndt->GetTitle() << endl;
18386 if (hOffdt) cout <<
" ... " << hOffdt->GetName() <<
" : " << hOffdt->GetTitle() << endl;
18388 if (hOndt) hisdtOn=*hOndt;
18389 if (hOffdt) hisdtOff=*hOffdt;
18405 Double_t twin=tmax-tmin;
18407 if (twin) rateOn=nevt/twin;
18413 if (twin) rateOff=nevt/twin;
18426 nametot.Form(
"hpdfOndt%-i",ndt);
18427 namebkg.Form(
"hpdfOffdt%-i",ndt);
18431 nametot.Form(
"hpdfOnZdt%-i",ndt);
18432 namebkg.Form(
"hpdfOffZdt%-i",ndt);
18435 TH1* hpdfOffdt=(TH1*)
fBurstHistos.FindObject(namebkg);
18437 Double_t xmaxfdt=1;
18438 Double_t deltatmax=0;
18441 deltatmax=hOndt->GetXaxis()->GetXmax();
18446 deltatmax=hOffdt->GetXaxis()->GetXmax();
18447 if (deltatmax>xmaxfdt) xmaxfdt=deltatmax;
18450 pdfdtOn.SetRange(0,xmaxfdt);
18451 pdfdtOn.SetNpx(npx);
18452 pdfdtOff.SetRange(0,xmaxfdt);
18453 pdfdtOff.SetNpx(npx);
18456 if (!hpdfOndt && nOndt)
18458 hpdfOndt=(TH1*)pdfdtOn.GetHistogram()->Clone();
18459 hpdfOndt->SetName(nametot.Data());
18460 title.Form(
"dt in %-s",tu.Data());
18461 hpdfOndt->GetXaxis()->SetTitle(title);
18465 if (!hpdfOffdt && nOffdt)
18467 hpdfOffdt=(TH1*)pdfdtOff.GetHistogram()->Clone();
18468 hpdfOffdt->SetName(namebkg.Data());
18469 hpdfOffdt->GetXaxis()->SetTitle(title);
18473 if (hpdfOndt || hpdfOffdt) cout <<
" The following arrival time interval (dt) PDFs have been generated :" << endl;
18474 if (hpdfOndt) cout <<
" ... " << hpdfOndt->GetName() <<
" : " << hpdfOndt->GetTitle() << endl;
18475 if (hpdfOffdt) cout <<
" ... " << hpdfOffdt->GetName() <<
" : " << hpdfOffdt->GetTitle() << endl;
18492 cout <<
" =============== The following " << nh <<
" histograms have been generated ===============" << endl;
18493 for (Int_t ih=0; ih<nh; ih++)
18497 if (!hx->GetEntries())
continue;
18498 cout <<
" " << hx->GetName() <<
" : " << hx->GetTitle() << endl;
18500 cout <<
" ===============================================================================" << endl;
18516 TFile fout(filename.Data(),
"RECREATE",
"NcAstrolab analysis results");
18520 for (Int_t ih=0; ih<nh; ih++)
18524 if (!hx->GetEntries())
continue;
18531 cout <<
" *" << ClassName() <<
"::WriteBurstHistograms* All generated histograms have been written to file " << filename << endl;
18546 if (gROOT->IsBatch())
18548 printf(
"\n *%-s::SkyMapPanel* GUI is not available in batch mode. \n",ClassName());
18567 GetDate(kTRUE,0,&year,&month,&day);
18569 fMapDate.Form(
"%02i-%02i-%-i",day,month,year);
18580 TString names[9]={
"User",
"IceCube",
"RNO-G",
"ARA",
"Amanda",
"WSRT",
"Astron",
"Greenwich",
"ARCA"};
18581 for (Int_t i=1; i<=9; i++)
18609 fSkyMapPanel->Connect(
"CloseWindow()",
"NcAstrolab",
this,
"MapClose()");
18612 TGCompositeFrame* frames[4]={0,0,0,0};
18613 TGLayoutHints* layouts[4]={0,0,0,0};
18616 frames[0]=
new TGCompositeFrame(
fSkyMapPanel,1,1,kHorizontalFrame|kSunkenFrame);
18617 layouts[0]=
new TGLayoutHints(kLHintsExpandX,border,border,0,0);
18622 frames[1]=
new TGCompositeFrame(
fSkyMapPanel,1,1,kHorizontalFrame|kSunkenFrame);
18623 layouts[1]=
new TGLayoutHints(kLHintsExpandX,border,border,0,0);
18628 frames[2]=
new TGCompositeFrame(
fSkyMapPanel,1,1,kHorizontalFrame|kSunkenFrame);
18629 layouts[2]=
new TGLayoutHints(kLHintsExpandX,border,border,0,0);
18633 frames[3]=
new TGCompositeFrame(
fSkyMapPanel,1,1,kHorizontalFrame|kSunkenFrame);
18634 layouts[3]=
new TGLayoutHints(kLHintsExpandX,border,border,0,0);
18639 for (Int_t i=0; i<4; i++)
18641 if (frames[i])
fSkyMapPanel->AddFrame(frames[i],layouts[i]);
18662 if (!frame)
return;
18664 TGGroupFrame* panel=
new TGGroupFrame(frame,
"Lab longitude, latitude, experiment site and detector ID",kHorizontalFrame);
18665 panel->SetTitlePos(TGGroupFrame::kCenter);
18666 frame->AddFrame(panel);
18671 fMapLabLBI[0]->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapLocl(const char*)");
18678 fMapLabLBI[1]->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapLocb(const char*)");
18684 fMapLabU->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapUloc(Int_t)");
18695 fMapLabE->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapExperiment(Int_t)");
18697 TString names[9]={
"User",
"IceCube",
"RNO-G",
"ARA",
"Amanda",
"WSRT",
"Astron",
"Greenwich",
"ARCA"};
18698 for (Int_t i=1; i<=9; i++)
18708 fMapLabLBI[2]=
new TGNumberEntryField(panel,-1,
fLabId,TGNumberFormat::kNESInteger);
18709 fMapLabLBI[2]->SetToolTipText(
"The (optional) detector element ID (0=global)");
18710 fMapLabLBI[2]->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapLocId(const char*)");
18715 TGTextButton* enter=
new TGTextButton(panel,
"Enter");
18716 enter->SetToolTipText(
"Enter the provided data");
18717 enter->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapLocEnter()");
18718 TGLayoutHints* Lenter=
new TGLayoutHints(kLHintsCenterX,10,0,0,0);
18719 panel->AddFrame(enter,Lenter);
18756 TString s[4]={
"deg",
"dms",
"hms",
"rad"};
18768 TString s[9]={
"User",
"IceCube",
"RNO-G",
"ARA",
"Amanda",
"WSRT",
"Astron",
"Greenwich",
"ARCA"};
18798 SetNameTitle(
"User",
"Virtual Lab for general use");
18800 printf(
"\n *** Settings adopted for a virtual lab for general use. *** \n");
18817 printf(
"\n *** Lab settings adopted for the %-s location. *** \n",
fMapLabExpName.Data());
18822 for (Int_t i=0; i<6; i++)
18824 val.Form(
"%-.2f",
fAxes[i]);
18837 if (!frame)
return;
18839 TGGroupFrame* panel=
new TGGroupFrame(frame,
"Timestamp to be used for Entries, List and Map",kHorizontalFrame);
18840 panel->SetTitlePos(TGGroupFrame::kCenter);
18841 frame->AddFrame(panel);
18845 fMapTSdatetime->SetToolTipText(
"Date/Time as dd-mm-yyyy/hh:mm:ss.sss or MJD");
18846 fMapTSdatetime->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapDateTime(const char*)");
18853 fMapTStimetype->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapTimeType(Int_t)");
18873 TGTextButton* labTS=
new TGTextButton(panel,
"Store as Lab TS");
18874 labTS->SetToolTipText(
"Store the current selection as Lab timestamp");
18875 labTS->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapLabTS()");
18876 TGLayoutHints* LlabTS=
new TGLayoutHints(kLHintsCenterX,10,0,0,0);
18877 panel->AddFrame(labTS,LlabTS);
18899 TString s[13]={
"UTC",
"LMT",
"UT1",
"MJD",
"JD",
"TJD",
"Unix",
"GPS",
"TAI",
"TT",
"SysClock",
"Lab",
"EntryName"};
18920 fMapTS.GetMJD(mjd,sec,ns);
18921 Int_t ps=
fMapTS.GetPs();
18922 this->
SetMJD(mjd,sec,ns,ps,
"U");
18924 printf(
"\n *** Lab timestamp modified *** \n");
18935 if (!frame)
return;
18937 TGGroupFrame* panel=
new TGGroupFrame(frame,
"Local frame axes orientations w.r.t. X0=South, Y0=East, Z0=Zenith)",kHorizontalFrame);
18938 panel->SetTitlePos(TGGroupFrame::kCenter);
18939 frame->AddFrame(panel);
18943 fMapLabLframe[0]->SetToolTipText(
"Local X-axis zenith angle in deg");
18949 fMapLabLframe[1]->SetToolTipText(
"Local X-axis phi angle in deg");
18955 fMapLabLframe[2]->SetToolTipText(
"Local Y-axis zenith angle in deg");
18961 fMapLabLframe[3]->SetToolTipText(
"Local Y-axis phi angle in deg");
18967 fMapLabLframe[4]->SetToolTipText(
"Local Z-axis zenith angle in deg");
18973 fMapLabLframe[5]->SetToolTipText(
"Local Z-axis phi angle in deg");
18980 TGTextButton* enter=
new TGTextButton(panel,
"Enter");
18981 enter->SetToolTipText(
"Enter the provided data");
18982 enter->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapLabLframeEnter()");
18983 TGLayoutHints* Lenter=
new TGLayoutHints(kLHintsLeft,10,0,0,0);
18984 panel->AddFrame(enter,Lenter);
19001 printf(
"\n *** Local frame will NOT be changed for experiment site %-s *** \n",
fMapLabExpName.Data());
19005 for (Int_t i=0; i<6; i++)
19007 val.Form(
"%-.2f",
fAxes[i]);
19013 for (Int_t i=0; i<6; i++)
19029 if (!frame)
return;
19031 TGGroupFrame* panel=
new TGGroupFrame(frame,
"Informative output",kHorizontalFrame);
19032 panel->SetTitlePos(TGGroupFrame::kCenter);
19033 frame->AddFrame(panel);
19036 TGComboBox* cinfo=
new TGComboBox(panel);
19037 cinfo->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapCinfo(Int_t)");
19038 cinfo->AddEntry(
"Lab",1);
19039 cinfo->AddEntry(
"TSbox",2);
19040 cinfo->AddEntry(
"Entry",3);
19041 cinfo->AddEntry(
"Nstore",4);
19042 cinfo->Resize(60,20);
19043 panel->AddFrame(cinfo);
19044 cinfo->Select(1,kTRUE);
19048 TGComboBox* tinfo=
new TGComboBox(panel);
19049 tinfo->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapTinfo(Int_t)");
19050 tinfo->AddEntry(
"LAT/LAST",1);
19051 tinfo->AddEntry(
"LMT/LMST",2);
19052 tinfo->AddEntry(
"Julian",3);
19053 tinfo->AddEntry(
"UT1",4);
19054 tinfo->AddEntry(
"UTC",5);
19055 tinfo->AddEntry(
"TAI",6);
19056 tinfo->AddEntry(
"GPS",7);
19057 tinfo->AddEntry(
"TT",8);
19058 tinfo->AddEntry(
"Unix",9);
19059 tinfo->Resize(85,20);
19060 panel->AddFrame(tinfo);
19061 tinfo->Select(1,kTRUE);
19065 TGComboBox* uinfo=
new TGComboBox(panel);
19066 uinfo->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapUinfo(Int_t)");
19067 uinfo->AddEntry(
"deg",1);
19068 uinfo->AddEntry(
"dms",2);
19069 uinfo->AddEntry(
"hms",3);
19070 uinfo->AddEntry(
"rad",4);
19071 uinfo->Resize(50,20);
19072 panel->AddFrame(uinfo);
19073 uinfo->Select(1,kTRUE);
19077 TGTextEntry* mapiname=
new TGTextEntry(panel,
"");
19078 mapiname->SetToolTipText(
"Stored entry name for info");
19079 mapiname->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapIname(const char*)");
19080 mapiname->SetAlignment(kTextRight);
19081 mapiname->Resize(100,20);
19082 panel->AddFrame(mapiname);
19085 TGTextButton* info=
new TGTextButton(panel,
"Info");
19086 info->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapInfo()");
19087 info->SetToolTipText(
"Provide info on the specified item");
19088 TGLayoutHints* Linfo=
new TGLayoutHints(kLHintsLeft,10,0,0,0);
19089 panel->AddFrame(info,Linfo);
19100 TString s[4]={
"Lab",
"TS box",
"EntryName",
"Nstore"};
19130 TString s[4]={
"deg",
"dms",
"hms",
"rad"};
19155 TString modes[9]={
"LAT/LAST",
"LMT/LMST",
"Julian",
"UT1",
"UTC",
"TAI",
"GPS",
"TT",
"Unix"};
19162 Int_t ntot=nref+nmeas;
19163 printf(
"\n *** Info about the stored entries *** \n");
19164 printf(
" Ntotal=%-i Nrefs=%-i Nmeas=%-i \n",ntot,nref,nmeas);
19170 printf(
"\n *** Info about the current Lab settings *** \n");
19175 printf(
"\n *** Info for the Lab timestamp *** \n");
19183 printf(
" %-s \n",datetime.Data());
19189 printf(
"\n *** Info for the timestamp in the user selection box *** \n");
19200 printf(
" Unix time : %-.12f \n",
fMapTS.GetUnixTime());
19205 printf(
" %-s \n",datetime.Data());
19217 printf(
"\n *** Info for entry : %-s *** \n",
fMapIname.Data());
19234 printf(
" Unix time : %-.12f \n",tx2.
GetUnixTime());
19239 printf(
" %-s \n",datetime.Data());
19246 printf(
"\n *** No entry found with name : %-s *** \n",
fMapIname.Data());
19259 if (!frame)
return;
19261 TGGroupFrame* panel=
new TGGroupFrame(frame,
"Entries in (a,b) coordinates",kHorizontalFrame);
19262 panel->SetTitlePos(TGGroupFrame::kCenter);
19263 frame->AddFrame(panel);
19266 TGNumberEntryField* ea=
new TGNumberEntryField(panel,-1,0);
19267 ea->SetToolTipText(
"Angle a");
19268 ea->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapEa(const char*)");
19269 ea->Resize(100,20);
19270 panel->AddFrame(ea);
19274 TGComboBox* ua=
new TGComboBox(panel);
19275 ua->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapUa(Int_t)");
19276 ua->AddEntry(
"deg",1);
19277 ua->AddEntry(
"dms",2);
19278 ua->AddEntry(
"hms",3);
19279 ua->AddEntry(
"rad",4);
19280 ua->AddEntry(
"hrs",5);
19282 panel->AddFrame(ua);
19283 ua->Select(1,kTRUE);
19287 TGNumberEntryField* eb=
new TGNumberEntryField(panel,-1,0);
19288 eb->SetToolTipText(
"Angle b");
19289 eb->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapEb(const char*)");
19290 eb->Resize(100,20);
19291 panel->AddFrame(eb);
19295 TGComboBox* ub=
new TGComboBox(panel);
19296 ub->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapUb(Int_t)");
19297 ub->AddEntry(
"deg",1);
19298 ub->AddEntry(
"dms",2);
19299 ub->AddEntry(
"hms",3);
19300 ub->AddEntry(
"rad",4);
19301 ub->AddEntry(
"hrs",5);
19303 panel->AddFrame(ub);
19304 ub->Select(1,kTRUE);
19307 TGComboBox* ecoords=
new TGComboBox(panel);
19308 ecoords->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapEcoord(Int_t)");
19309 ecoords->AddEntry(
"(ra,dec) (J2000)",1);
19310 ecoords->AddEntry(
"(ra,dec) (Mean)",2);
19311 ecoords->AddEntry(
"(ra,dec) (True)",3);
19312 ecoords->AddEntry(
"(ra,dec) (B1950)",4);
19313 ecoords->AddEntry(
"Galactic (l,b)",5);
19314 ecoords->AddEntry(
"Ecliptic (l,b)",6);
19315 ecoords->AddEntry(
"Horizon (azi,zen)",7);
19316 ecoords->AddEntry(
"ICR (l,b)",8);
19317 ecoords->AddEntry(
"Local (theta,phi)",9);
19318 ecoords->AddEntry(
"pdir (theta,phi)",10);
19319 ecoords->Resize(125,20);
19320 panel->AddFrame(ecoords);
19321 ecoords->Select(1,kTRUE);
19325 TGComboBox* etypes=
new TGComboBox(panel);
19326 etypes->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapEtype(Int_t)");
19327 etypes->AddEntry(
"Meas",1);
19328 etypes->AddEntry(
"Ref",2);
19329 etypes->Resize(55,20);
19330 panel->AddFrame(etypes);
19331 etypes->Select(1,kTRUE);
19335 TGTextEntry* ename=
new TGTextEntry(panel,
"");
19336 ename->SetToolTipText(
"The (optional) entry name");
19337 ename->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapEname(const char*)");
19338 ename->SetAlignment(kTextRight);
19339 ename->Resize(100,20);
19340 panel->AddFrame(ename);
19343 TGTextButton* enter=
new TGTextButton(panel,
"Enter");
19344 enter->SetToolTipText(
"Enter the provided entry");
19345 enter->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapEnter()");
19346 TGLayoutHints* Lenter=
new TGLayoutHints(kLHintsCenterX,10,0,0,0);
19347 panel->AddFrame(enter,Lenter);
19350 TGTextButton* remove=
new TGTextButton(panel,
"Remove");
19351 remove->SetToolTipText(
"Remove the entry specified by type and name pattern (name=* means all)");
19352 remove->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapRemove()");
19353 TGLayoutHints* Lremove=
new TGLayoutHints(kLHintsCenterX,10,0,0,0);
19354 panel->AddFrame(remove,Lremove);
19377 TString s[5]={
"deg",
"dms",
"hms",
"rad",
"hrs"};
19401 TString s[5]={
"deg",
"dms",
"hms",
"rad",
"hrs"};
19413 TString system[10]={
"equ",
"equ",
"equ",
"equ",
"gal",
"ecl",
"hor",
"icr",
"loc",
"pdir"};
19414 TString mode[4]={
"J",
"M",
"T",
"B"};
19456 SetSignal(1,
fMapEa,
fMapEua,
fMapEb,
fMapEub,
fMapEcoord,&
fMapTS,-1,
fMapEmode,
fMapEname,
fMapEtype);
19458 printf(
"\n *** Specified entry stored *** \n");
19476 printf(
"\n *** Number of specified entries have been removed : %-i *** \n",nrem);
19487 if (!frame)
return;
19489 TGGroupFrame* panel=
new TGGroupFrame(frame,
"Map/List options for the (a,b) coordinates",kHorizontalFrame);
19490 panel->SetTitlePos(TGGroupFrame::kCenter);
19491 frame->AddFrame(panel);
19494 TGVerticalFrame* render=
new TGVerticalFrame(panel,1,1);
19495 panel->AddFrame(render);
19498 TGGroupFrame* coordsys=
new TGGroupFrame(render,
"Coordinate system",kHorizontalFrame);
19499 coordsys->SetTitlePos(TGGroupFrame::kCenter);
19500 render->AddFrame(coordsys);
19501 TGComboBox* dcoords=
new TGComboBox(coordsys);
19502 dcoords->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapDcoord(Int_t)");
19503 dcoords->AddEntry(
"Equatorial (J2000)",1);
19504 dcoords->AddEntry(
"Equatorial (Mean)",2);
19505 dcoords->AddEntry(
"Equatorial (True)",3);
19506 dcoords->AddEntry(
"Equatorial (B1950)",4);
19507 dcoords->AddEntry(
"Galactic",5);
19508 dcoords->AddEntry(
"Ecliptic",6);
19509 dcoords->AddEntry(
"Horizon",7);
19510 dcoords->AddEntry(
"ICR",8);
19511 dcoords->AddEntry(
"Local",9);
19512 dcoords->Resize(140,20);
19513 coordsys->AddFrame(dcoords);
19514 dcoords->Select(1,kTRUE);
19518 TGGroupFrame* mapview=
new TGGroupFrame(render,
"Map representation",kHorizontalFrame);
19519 mapview->SetTitlePos(TGGroupFrame::kCenter);
19520 render->AddFrame(mapview);
19521 TGComboBox* projs=
new TGComboBox(mapview);
19522 projs->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapProj(Int_t)");
19523 projs->AddEntry(
"Hammer projection",1);
19524 projs->AddEntry(
"Aitoff projection",2);
19525 projs->AddEntry(
"Mercator projection",3);
19526 projs->AddEntry(
"sin(b) vs. a",4);
19527 projs->AddEntry(
"b vs. a",5);
19528 projs->AddEntry(
"b vs. UT (0-24 hrs)",6);
19529 projs->AddEntry(
"b vs. LT (0-24 hrs)",7);
19530 projs->AddEntry(
"b vs. GST (0-24 hrs)",8);
19531 projs->AddEntry(
"b vs. LST (0-24 hrs)",9);
19532 projs->AddEntry(
"b vs. Day at UT",10);
19533 projs->AddEntry(
"b vs. Day at LT",11);
19534 projs->AddEntry(
"b vs. Day at GST",12);
19535 projs->AddEntry(
"b vs. Day at LST",13);
19536 projs->Resize(150,20);
19537 mapview->AddFrame(projs);
19538 projs->Select(1,kTRUE);
19542 TGGroupFrame* meridian=
new TGGroupFrame(render,
"Meridian ordering",kHorizontalFrame);
19543 meridian->SetTitlePos(TGGroupFrame::kCenter);
19544 render->AddFrame(meridian);
19547 TGComboBox* mermode=
new TGComboBox(meridian);
19548 mermode->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapMerMode(Int_t)");
19549 mermode->AddEntry(
"Auto",1);
19550 mermode->AddEntry(
"---->",2);
19551 mermode->AddEntry(
"<----",3);
19552 mermode->Resize(55,20);
19553 meridian->AddFrame(mermode);
19554 mermode->Select(1,kTRUE);
19558 TGNumberEntryField* merc=
new TGNumberEntryField(meridian,-1,0);
19559 merc->SetToolTipText(
"Central meridian position");
19560 merc->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapMerC(const char*)");
19561 merc->Resize(65,20);
19562 meridian->AddFrame(merc);
19566 TGComboBox* meruc=
new TGComboBox(meridian);
19567 meruc->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapMerUc(Int_t)");
19568 meruc->AddEntry(
"deg",1);
19569 meruc->AddEntry(
"dms",2);
19570 meruc->AddEntry(
"hms",3);
19571 meruc->AddEntry(
"rad",4);
19572 meruc->Resize(50,20);
19573 meridian->AddFrame(meruc);
19574 meruc->Select(1,kTRUE);
19578 TGVButtonGroup* options=
new TGVButtonGroup(panel,
"Options");
19579 options->SetTitlePos(TGGroupFrame::kCenter);
19580 options->Connect(
"Clicked(Int_t)",
"NcAstrolab",
this,
"MapDoptions(Int_t)");
19581 TGCheckButton* bhist=
new TGCheckButton(options,
"Hist");
19582 bhist->SetToolTipText(
"Project data in a histogram");
19583 TGCheckButton* bclr=
new TGCheckButton(options,
"Clr");
19584 bclr->SetToolTipText(
"Clear display before drawing");
19585 TGCheckButton* bref=
new TGCheckButton(options,
"Ref");
19586 bref->SetToolTipText(
"Display reference signals");
19587 TGCheckButton* bmeas=
new TGCheckButton(options,
"Meas");
19588 bmeas->SetToolTipText(
"Display measured signals");
19589 TGCheckButton* brefts=
new TGCheckButton(options,
"RefTS");
19590 brefts->SetToolTipText(
"Display/list each reference signal using its actual recorded timestamp");
19591 panel->AddFrame(options);
19593 options->SetButton(1,kFALSE);
19594 options->SetButton(2,kTRUE);
19595 options->SetButton(3,kTRUE);
19596 options->SetButton(4,kTRUE);
19597 options->SetButton(5,kFALSE);
19605 TGNumberEntryField* nmax=
new TGNumberEntryField(options,-1,-1,TGNumberFormat::kNESInteger);
19606 nmax->SetToolTipText(
"Max. number of Drawn/Listed entries per type (-1=all)");
19607 nmax->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapNmax(const char*)");
19608 nmax->Resize(40,20);
19609 options->AddFrame(nmax);
19613 TGTextEntry* sname=
new TGTextEntry(options,
"*");
19614 sname->SetToolTipText(
"The requested entry name pattern (*=all)");
19615 sname->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapDname(const char*)");
19616 sname->SetAlignment(kTextRight);
19617 sname->Resize(100,20);
19618 TGLayoutHints* Lsname=
new TGLayoutHints(kLHintsLeft,0,0,5,0);
19619 options->AddFrame(sname,Lsname);
19623 TGNumberEntryField* ndigs=
new TGNumberEntryField(options,-1,1,TGNumberFormat::kNESInteger);
19624 ndigs->SetToolTipText(
"Number of digits for the listed entries");
19625 ndigs->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapNdigs(const char*)");
19626 ndigs->Resize(40,20);
19627 options->AddFrame(ndigs);
19631 TGVerticalFrame* others=
new TGVerticalFrame(panel,1,1);
19632 panel->AddFrame(others);
19635 TGGroupFrame* markers=
new TGGroupFrame(others,
"Marker settings",kHorizontalFrame);
19636 markers->SetTitlePos(TGGroupFrame::kCenter);
19637 others->AddFrame(markers);
19640 TGNumberEntryField* marksize=
new TGNumberEntryField(markers,-1,1);
19641 marksize->SetToolTipText(
"Marker size");
19642 marksize->Connect(
"TextChanged(const char*)",
"NcAstrolab",
this,
"MapMarkSize(const char*)");
19643 marksize->Resize(40,20);
19644 markers->AddFrame(marksize);
19648 TGComboBox* markstyle=
new TGComboBox(markers);
19649 markstyle->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapMarkStyle(Int_t)");
19650 markstyle->AddEntry(
"Dot",1);
19651 markstyle->AddEntry(
"Star",2);
19652 markstyle->AddEntry(
"Square",3);
19653 markstyle->AddEntry(
"Utriangle",4);
19654 markstyle->AddEntry(
"Dtriangle",5);
19655 markstyle->AddEntry(
"Diamond",6);
19656 markstyle->AddEntry(
"Cross",7);
19657 markstyle->AddEntry(
"Ast",8);
19658 markstyle->AddEntry(
"Plus",9);
19659 markstyle->AddEntry(
"Times",10);
19660 markstyle->AddEntry(
"Circle",11);
19661 markstyle->AddEntry(
"oStar",12);
19662 markstyle->AddEntry(
"oSquare",13);
19663 markstyle->AddEntry(
"oUtriangle",14);
19664 markstyle->AddEntry(
"oDtriangle",15);
19665 markstyle->AddEntry(
"oDiamond",16);
19666 markstyle->AddEntry(
"oCross",17);
19667 markstyle->Resize(90,20);
19668 markers->AddFrame(markstyle);
19669 markstyle->Select(1,kTRUE);
19673 TGComboBox* markcolor=
new TGComboBox(markers);
19674 markcolor->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapMarkColor(Int_t)");
19675 markcolor->AddEntry(
"Black",1);
19676 markcolor->AddEntry(
"Red",2);
19677 markcolor->AddEntry(
"Blue",3);
19678 markcolor->AddEntry(
"Green",4);
19679 markcolor->AddEntry(
"Yellow",5);
19680 markcolor->AddEntry(
"Magenta",6);
19681 markcolor->AddEntry(
"Cyan",7);
19682 markcolor->AddEntry(
"Orange",8);
19683 markcolor->AddEntry(
"Violet",9);
19684 markcolor->AddEntry(
"Pink",10);
19685 markcolor->AddEntry(
"Azure",11);
19686 markcolor->AddEntry(
"Spring",12);
19687 markcolor->AddEntry(
"Teal",13);
19688 markcolor->AddEntry(
"Gray",14);
19689 markcolor->AddEntry(
"White",15);
19690 markcolor->Resize(80,20);
19691 markers->AddFrame(markcolor);
19692 markcolor->Select(3,kTRUE);
19696 TGComboBox* marktype=
new TGComboBox(markers);
19697 marktype->Connect(
"Selected(Int_t)",
"NcAstrolab",
this,
"MapMarkType(Int_t)");
19698 marktype->AddEntry(
"Ref",1);
19699 marktype->AddEntry(
"Meas",2);
19700 marktype->AddEntry(
"GC",3);
19701 marktype->AddEntry(
"Grid",4);
19702 marktype->Resize(55,20);
19703 markers->AddFrame(marktype);
19704 marktype->Select(2,kTRUE);
19708 TGGroupFrame* solar=
new TGGroupFrame(others,
"Selection of Solar system reference objects",kHorizontalFrame);
19709 solar->SetTitlePos(TGGroupFrame::kCenter);
19710 others->AddFrame(solar);
19712 TGButtonGroup* Ssolar=
new TGButtonGroup(solar,0,3,5);
19713 Ssolar->SetTitlePos(TGGroupFrame::kCenter);
19714 Ssolar->Connect(
"Clicked(Int_t)",
"NcAstrolab",
this,
"MapSolar(Int_t)");
19715 TGCheckButton* bsun=
new TGCheckButton(Ssolar,
"Sun");
19716 bsun->SetToolTipText(
"Enter/Remove the Sun as a reference entry");
19717 TGCheckButton* bmoon=
new TGCheckButton(Ssolar,
"Moon");
19718 bmoon->SetToolTipText(
"Enter/Remove the Moon as a reference entry");
19719 TGCheckButton* bmercury=
new TGCheckButton(Ssolar,
"Mercury");
19720 bmercury->SetToolTipText(
"Enter/Remove Mercury as a reference entry");
19721 TGCheckButton* bvenus=
new TGCheckButton(Ssolar,
"Venus");
19722 bvenus->SetToolTipText(
"Enter/Remove Venus as a reference entry");
19723 TGCheckButton* bearth=
new TGCheckButton(Ssolar,
"Earth");
19724 bearth->SetToolTipText(
"Enter/Remove the Earth as a reference entry");
19725 TGCheckButton* bmars=
new TGCheckButton(Ssolar,
"Mars");
19726 bmars->SetToolTipText(
"Enter/Remove Mars as a reference entry");
19727 TGCheckButton* bjupiter=
new TGCheckButton(Ssolar,
"Jupiter");
19728 bjupiter->SetToolTipText(
"Enter/Remove Jupiter as a reference entry");
19729 TGCheckButton* bsaturn=
new TGCheckButton(Ssolar,
"Saturn");
19730 bsaturn->SetToolTipText(
"Enter/Remove Saturn as a reference entry");
19731 TGCheckButton* buranus=
new TGCheckButton(Ssolar,
"Uranus");
19732 buranus->SetToolTipText(
"Enter/Remove Uranus as a reference entry");
19733 TGCheckButton* bneptune=
new TGCheckButton(Ssolar,
"Neptune");
19734 bneptune->SetToolTipText(
"Enter/Remove Neptune as a reference entry");
19735 solar->AddFrame(Ssolar);
19737 Ssolar->SetButton(1,kFALSE);
19738 Ssolar->SetButton(2,kFALSE);
19739 Ssolar->SetButton(3,kFALSE);
19740 Ssolar->SetButton(4,kFALSE);
19741 Ssolar->SetButton(5,kFALSE);
19742 Ssolar->SetButton(6,kFALSE);
19743 Ssolar->SetButton(7,kFALSE);
19744 Ssolar->SetButton(8,kFALSE);
19745 Ssolar->SetButton(9,kFALSE);
19746 Ssolar->SetButton(10,kFALSE);
19747 for (Int_t i=0; i<10; i++)
19753 TGVerticalFrame* comms=
new TGVerticalFrame(solar,1,1);
19754 TGLayoutHints* Lcomms=
new TGLayoutHints(kLHintsLeft,10,0,15,0);
19755 solar->AddFrame(comms,Lcomms);
19758 TGTextButton* enter=
new TGTextButton(comms,
"Enter");
19759 enter->SetToolTipText(
"Enter the selected Solar system objects as reference signals");
19760 enter->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapEnterSolar()");
19761 TGLayoutHints* Lenter=
new TGLayoutHints(kLHintsCenterX,0,0,10,15);
19762 comms->AddFrame(enter,Lenter);
19765 TGTextButton* remove=
new TGTextButton(comms,
"Remove");
19766 remove->SetToolTipText(
"Remove the selected Solar system objects from the reference signals");
19767 remove->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapRemoveSolar()");
19768 TGLayoutHints* Lremove=
new TGLayoutHints(kLHintsCenterX,0,0,0,0);
19769 comms->AddFrame(remove,Lremove);
19780 TString system[9]={
"equ",
"equ",
"equ",
"equ",
"gal",
"ecl",
"hor",
"icr",
"loc"};
19781 TString mode[4]={
"J",
"M",
"T",
"B"};
19796 TString s[13]={
"ham",
"ait",
"mer",
"ang",
"cyl",
"UTh",
"LTh",
"GSTh",
"LSTh",
"UYh",
"LYh",
"GSYh",
"LSYh"};
19797 TString sh[13]={
"hamh",
"aith",
"merh",
"angh",
"cylh",
"UTh",
"LTh",
"GSTh",
"LSTh",
"UYh",
"LYh",
"GSYh",
"LSYh"};
19800 for (Int_t k=0; k<13; k++)
19815 Int_t modes[3]={0,1,-1};
19839 TString s[4]={
"deg",
"dms",
"hms",
"rad"};
19919 Int_t styles[17]={8,29,21,22,23,33,34,31,2,5,24,30,25,26,32,27,28};
19934 Int_t colors[15]={kBlack,kRed,kBlue,kGreen,kYellow,kMagenta,kCyan,kOrange,kViolet,kPink,kAzure,kSpring,kTeal,kGray,kWhite};
19980 TString names[10]={
"Sun",
"Moon",
"Mercury",
"Venus",
"Earth",
"Mars",
"Jupiter",
"Saturn",
"Uranus",
"Neptune"};
19986 for (Int_t i=0; i<10; i++)
19990 printf(
"\n *** Selected Solar system object(s) entered *** \n");
20001 TString names[10]={
"Sun",
"Moon",
"Mercury",
"Venus",
"Earth",
"Mars",
"Jupiter",
"Saturn",
"Uranus",
"Neptune"};
20009 for (Int_t i=0; i<10; i++)
20018 printf(
"\n *** Number of Solar system object that have been removed : %-i *** \n",nrem);
20029 if (!frame)
return;
20031 TGGroupFrame* panel=
new TGGroupFrame(frame,
"Commands",kVerticalFrame);
20032 panel->SetTitlePos(TGGroupFrame::kCenter);
20033 frame->AddFrame(panel);
20035 TGTextButton* list=
new TGTextButton(panel,
"List");
20036 list->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapList()");
20037 list->SetToolTipText(
"List the selected entries");
20038 TGLayoutHints* Llist=
new TGLayoutHints(kLHintsCenterX,0,0,10,10);
20039 panel->AddFrame(list,Llist);
20041 TGTextButton* map=
new TGTextButton(panel,
"Map");
20042 map->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapDraw()");
20043 map->SetToolTipText(
"Display the selected entries");
20044 TGLayoutHints* Lmap=
new TGLayoutHints(kLHintsCenterX,0,0,10,10);
20045 panel->AddFrame(map,Lmap);
20047 TGTextButton* close=
new TGTextButton(panel,
"Close");
20048 close->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapClose()");
20049 close->SetToolTipText(
"Close this panel window");
20050 TGLayoutHints* Lclose=
new TGLayoutHints(kLHintsCenterX,0,0,10,10);
20051 panel->AddFrame(close,Lclose);
20053 TGTextButton* exit=
new TGTextButton(panel,
"Exit");
20054 exit->Connect(
"Clicked()",
"NcAstrolab",
this,
"MapExit()");
20055 exit->SetToolTipText(
"Exit this ROOT session");
20056 TGLayoutHints* Lexit=
new TGLayoutHints(kLHintsCenterX,0,0,10,10);
20057 panel->AddFrame(exit,Lexit);
20145 gApplication->Terminate(0);
20189 fMapTS.SetUnixTime(val);
20203 tx->
GetMJD(imjd,isec,ins);
20205 fMapTS.SetMJD(imjd,isec,ins,ips);
20209 printf(
"\n *** No stored entry with name %-s found --> Lab TS will be used *** \n",name.Data());
20212 fMapTS.SetMJD(imjd,isec,ins,ips);
20261 if (strlen(name)) lab->SetName(name);
Handling of 3-vectors in various reference frames.
Double_t GetX(Int_t i, TString f, TString u="rad")
void GetErrors(Double_t *e, TString f, TString u="rad") const
void SetVector(Double_t *v, TString f, TString u="rad")
virtual void Load(Nc3Vector &q)
Nc3Vector Cross(Nc3Vector &q) const
void SetErrors(Double_t *e, TString f, TString u="rad")
virtual Double_t GetOpeningAngle(Nc3Vector &q, TString u="rad")
void GetVector(Double_t *v, TString f, TString u="rad") const
Nc3Vector GetPrimed(TRotMatrix *m) const
Nc3Vector GetUnprimed(TRotMatrix *m) const
Virtual lab to provide (astro)physical parameters, treat data and relate observations with astrophysi...
void Precess(Nc3Vector &r, NcTimestamp *ts1, NcTimestamp *ts2)
void MapEname(const char *text)
void Nutate(Nc3Vector &r, NcTimestamp *ts)
void MakeBurstRecoAngresdist(TString file, TString tree, TString name1, TString name2, TString ua, TString name3, TString ud, Double_t Emin, Double_t Emax, Int_t nbe=100, Int_t nba=1000)
Double_t fMapMerC
! The GUI entered central meridian location for the Map
void ProjectMercator(Double_t l, Double_t b, Double_t &x, Double_t &y)
Double_t fMeridian
! Central meridian (in rad) for the sky display
Double_t GetTargetThickness(Double_t prob, Double_t lambda) const
virtual void LabLocationPanel(TGCompositeFrame *frame)
void GetBurstBayesianPsiStatistics(TString type, Double_t nr=-1, Int_t ncut=10, Int_t ndt=2, Bool_t zcor=kFALSE, Int_t freq=0)
Double_t GetCredibleInterval(TF1 pdf, Double_t p, Double_t &xlow, Double_t &xup, Int_t n=1000)
void SetRandomiser(Int_t iseed, Int_t cnt1=0, Int_t cnt2=0, NcTimestamp *ts=0)
Double_t GetUpperLimit(TF1 pdf, Double_t p)
TH1F GetDxHistogram(TH1 *hx, Int_t nc, Double_t dxbin=-1, Double_t dxmin=-1, Double_t dxmax=-1, Int_t mode=1, Double_t fact=1)
Double_t fMapMarkSize
! The GUI entered marker size for the Map
void HelioToGeocentric(Double_t &R, Double_t &B, Double_t &L, NcTimestamp *ts, TString Bu="deg", TString Lu="deg")
void MapMarkType(Int_t i)
Int_t GetTimeScramble(Double_t *tmin=0, Double_t *tmax=0, TF1 *frndm=0)
TRotMatrix fP
! Matrix for precession correction
void MapEb(const char *text)
void MatchSignals(NcDevice &matches, Double_t da, TString au, Double_t dt, TString tu, Int_t mode=1, Int_t i1=1, Int_t i2=0, Int_t itype=0, Int_t j1=1, Int_t j2=0, Int_t jtype=1)
TString fMapEcoord
! The GUI entered coordinate system of the entry
Int_t SetSolarSystem(TString name, NcTimestamp *ts, Int_t type=0)
Double_t GetLightTravelDistance(Double_t z, TString u="Mpc") const
Double_t fMapLabLocB
! The GUI entered Lab latitude
TString fMapEua
! The GUI entered angular units of a
void SetBurstParameter(TString name, Double_t value)
void SmearPosition(Nc3Vector &v, Double_t sigma)
Double_t GetLightTravelTime(Double_t z) const
Int_t GetPositionScramble(Double_t *dmin=0, Double_t *dmax=0, TF1 *df=0, Double_t *thmin=0, Double_t *thmax=0, TF1 *thf=0, Double_t *phimin=0, Double_t *phimax=0, TF1 *phif=0)
void ProjectCylindrical(Double_t l, Double_t b, Double_t &x, Double_t &y)
void MapExperiment(Int_t i)
void MapMarkSize(const char *text)
TRotMatrix fG
! Matrix for conversion of equatorial to galactic coordinates
TString fMapTime
! The GUI entered time
Double_t GetBurstRecoAngres(Double_t Emin=-1, Double_t Emax=-1, Double_t Amin=0, Double_t Amax=999) const
TRotMatrix fB
! The frame bias matrix for conversion of ICRS to J2000 coordinates
virtual void EntriesPanel(TGCompositeFrame *frame)
TH1 * GetBurstBayesianSignalRate(Double_t p, Double_t &rlow, Double_t &rup, Int_t n=1000)
Double_t ConvertAngle(Double_t a, TString in, TString out) const
void GetBurstMaxEventCount(NcSignal *sx)
void SetNmatrix(NcTimestamp *ts)
void ProjectHammer(Double_t l, Double_t b, Double_t &x, Double_t &y)
Double_t GetDifference(Int_t jref, TString au, Double_t &dt, TString tu, Int_t mode=1, Int_t *ia=0, Int_t *it=0)
void ListSignals(TString frame, TString mode, Int_t ndig=1, TString emode="T", Int_t nmax=10, Int_t j=-1, Int_t type=-1, NcTimestamp *ts=0, TString name="*")
Double_t GetSourceAttributes(NcSignal *s, Float_t *z=0, Float_t *T90=0)
TString fProj
! Projection which is currently in use
Double_t GetLuminosityDistance(Double_t z, TString u="Mpc") const
NcDevice * fBurstParameters
TRotMatrix fH
! Matrix for conversion of equatorial to horizontal coordinates
Int_t RemoveSignal(Int_t j, Int_t type, Int_t compress)
Double_t GetBurstBackgroundEnergy(Double_t Emin=-1, Double_t Emax=-1) const
void SetLabPosition(Nc3Vector &r)
TString fMapTimeType
! The GUI entered time type
TString GetExperiment() const
void MapDoptions(Int_t i)
Double_t GetLabTimeOffset() const
void GenBurstGCNdata(Int_t n, TString name="GRB", Bool_t scale=kFALSE)
Double_t GetComovingDistance(Double_t z, TString u="Mpc") const
TH2 * fHist[2]
! Temp. histograms for the sky display
TGComboBox * fMapTStimetype
! The GUI TS time type selection box
TString fMapCinfo
! The GUI selected info category
TArrayI * fIndices
! Storage indices of the matching reference signals
TH1 * GetBurstSigmaPosdist(TString name, TString type)
TString fMapProj
! The GUI selected projection for the Map
Bool_t fMapLabTS
! The GUI selection to use the Lab timestamp for the List/Map
void GetLocalFrame(Float_t arr[6])
void LoadInputData(Bool_t src, TString file, TString tree, Int_t date1=0, Int_t date2=0, Int_t nmax=-1, TString type="-")
void InitBurstHistograms(Int_t mode)
TString fMapLabLocU
! The GUI entered Lab location angular units
TCanvas * fCanvas
! The canvas for the skymap
void MapDname(const char *text)
void MapIname(const char *text)
NcAstrolab(const char *name="User", const char *title="Virtual Lab for general use")
Double_t GetBurstLiMaSignificance() const
virtual void SkyMapPanel()
Int_t GetSignalIndex(TString name, Int_t type=0)
TGTextEntry * fMapTSdatetime
! The GUI TS date/time specification
void MapLocb(const char *text)
TRotMatrix fN
! Matrix for nutation correction
void ListBurstParameters() const
TGNumberEntryField * fMapLabLBI[3]
! The GUI number entries for the Lab location specification
void MapEa(const char *text)
Double_t GetMeanFreePath(Double_t sigma, Double_t rho, Int_t mode) const
NcPosition GetLabPosition() const
void SetPositionScramble(Int_t mode, Double_t dmin, Double_t dmax, TF1 *df=0, Double_t thmin=0, Double_t thmax=0, TF1 *thf=0, Double_t phimin=0, Double_t phimax=0, TF1 *phif=0)
void InitDataNames(Int_t dir, TString frame, TString mode="J")
Double_t GetHubbleParameter(Double_t z, TString u="Mpc") const
void LoadAeffData(TString file, TString hist)
Int_t fMapMarkStyle
! The GUI selected marker style for the Map
Int_t SetSourceAttributes(NcSignal *s, Double_t sigmapos, TString u, Double_t z=-999, Double_t T90=-999)
Double_t GetMaxDt() const
void SetTimeScramble(Int_t mode, Double_t tmin, Double_t tmax, TF1 *frndm=0)
TString fMapDcoord
! The GUI selected coordinate system for the Map/List
void SetPmatrix(NcTimestamp *ts)
void MakeBurstNuCountProfile(TString mode)
Double_t fMapEb
! The GUI entered b coordinate of an entry
TString fMapDate
! The GUI entered date
TF1 GetSignalRatePDF(Double_t Non, Double_t Ton, Double_t Noff, Double_t Toff, Double_t Ra=1, Double_t Re=1, Double_t smax=-1, Double_t bmax=-1, Double_t prec=709)
Double_t fMapLabLocL
! The GUI entered Lab longitude
Int_t fMapMarkType
! The GUI selected entry type to apply the marker attributes on
void MapMarkStyle(Int_t i)
void Project(Double_t l, Double_t b, TString proj, Double_t &x, Double_t &y)
void MapDateTime(const char *text)
Double_t GetBurstTotalFluence(Double_t nsig, TString str)
TString fMapDmode
! The GUI selected coordinate system mode for the Map/List
Double_t GetShieldingThickness(Double_t prob, Double_t lambda) const
TString fMapEub
! The GUI entered angular units of b
void MapMarkColor(Int_t i)
Double_t GetBackgroundRateProb(Double_t *vars, Double_t *pars)
Double_t GetInteractionProbability(Double_t x, Double_t lambda) const
void MakeBurstSigmaPosdist(TString file, TString tree, TString name, TString u, Int_t nb=900, Float_t xmin=0, Float_t xmax=90)
void MapNdigs(const char *text)
Int_t GetNRefSignals(Int_t mode=0) const
TH1F GetDifHistogram(TH1 *hin, Int_t mode, TString s="", TF1 *f=0) const
Int_t fMapEtype
! The GUI entered entry type
TGComboBox * fMapLabU
! The GUI Lab location angular unit selection box
void SetDataNames(TString obsname, TString varname, TString units="1", TString func="none")
TString fMapDname
! The GUI entered name pattern for entries to be shown in the Map/List
TGNumberEntryField * fMapLabLframe[6]
! The GUI number entries for the local frame specification
void SetGmatrix(TString mode)
Double_t GetNeutrinoXsection(Int_t mode, Int_t type, Double_t egev, Double_t xscale=1, Double_t *eprimgev=0, Double_t *alpha=0) const
TH1 * GetBurstT90dist(TString name, TString type)
NcDevice * GetBurstParameters()
void ListBurstHistograms() const
void MakeBurstEnergydist(Int_t mode, TString file, TString tree, TString name1, TString name2, TString u, Int_t nb=1000)
void SetLT(Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns=0, Int_t ps=0)
void MapLocl(const char *text)
void MakeBurstDataStats(Int_t mode, Int_t nmugrb=0)
void SetCentralMeridian(Int_t mode=0, Double_t phi=0, TString u="deg")
Int_t fGal
! Type indicator for fG values (0=uninitialised 1=B1950 2=J2000)
Int_t fMapLabId
! The GUI entered Lab detector Id
void ListBurstSignalStats(Double_t rate, Int_t mode, TString str="-")
void SetEmatrix(NcTimestamp *ts)
Int_t RemoveRefSignal(Int_t j, Int_t compress)
Int_t fMapMarkColor
! The GUI selected marker color for the Map
void MakeBurstT90dist(TString file, TString tree, TString name, Int_t nb=50, Float_t xmin=-5, Float_t xmax=5)
void DisplaySignal(TString frame, TString mode, NcTimestamp *ts, Int_t j=-1, TString proj="ham", Int_t clr=0, TString name="")
virtual void TimestampPanel(TGCompositeFrame *frame)
void SetHmatrix(NcTimestamp *ts)
void PrintSignal(TString frame, TString mode, NcTimestamp *ts, Int_t ndig, Int_t jref=0, TString emode="T", Int_t type=0, Bool_t align=kFALSE)
void SetLabTimeOffset(Double_t dt)
TH1F GetCumulHistogram(TH1 *h, TString name, TString mode="F") const
virtual void MapListOptionsPanel(TGCompositeFrame *frame)
TObjArray * fMarkers
! Temp. array to hold the markers for the signal display
TString fMapDateTime
! The GUI entered datetime
Double_t GetSolidAngle(Double_t thetamin, Double_t thetamax, TString tu, Double_t phimin, Double_t phimax, TString pu) const
void SetMarkerColor(Int_t color, Int_t type)
Int_t fMapNdigs
! The GUI selected number of digits for the List output
TRotMatrix fE
! Matrix for conversion of equatorial to ecliptic coordinates
Double_t GetProperDistance(Double_t z, TString u="Mpc", Int_t t=1) const
TString fMapIname
! The GUI selected entry name for the info
Double_t fMapEa
! The GUI entered a coordinate of an entry
Bool_t fMapSolar[10]
! The GUI selection of solar system objects
void GetBurstChi2Statistics(TString type, Int_t ndt=2, Bool_t zcor=kFALSE)
Double_t GetBurstSignalEnergy(Double_t Emin=-1, Double_t Emax=-1) const
void MapLocId(const char *text)
Bool_t fMapDoptions[5]
! The GUI Map/List options (histo, clr, ref, meas, refTS)
Int_t RemoveSignals(TString name, Int_t type, Int_t compress)
void SetPhysicalParameter(TString name, Double_t value)
void MatchBurstData(NcDevice &matches, Int_t i1=1, Int_t i2=0, Int_t itype=0, Int_t j1=1, Int_t j2=0, Int_t jtype=1)
void ShiftPosition(Nc3Vector &v, Double_t angle)
void MakeBurstZdist(TString file, TString tree, TString name, Int_t nb=200, Float_t zmin=0, Float_t zmax=20)
TArrayI * MatchRefSignal(Double_t da, TString au, Double_t dt, TString tu, Int_t mode=1)
void WriteBurstHistograms(TString filename)
void GeoToHeliocentric(Double_t &R, Double_t &B, Double_t &L, NcTimestamp *ts, TString Bu="deg", TString Lu="deg")
Double_t GetSignalRateProb(Double_t *vars, Double_t *pars)
Double_t GetNuclearMass(Int_t Z, Int_t N, Int_t mode=1) const
virtual void InfoPanel(TGCompositeFrame *frame)
void BurstCompensate(Int_t &nmugrb)
void SetLocalFrame(Double_t t1, Double_t p1, Double_t t2, Double_t p2, Double_t t3, Double_t p3)
void Data(Int_t mode=1, TString u="deg", Bool_t utc=kTRUE)
void ProjectAitoff(Double_t l, Double_t b, Double_t &x, Double_t &y)
void SetMarkerSize(Float_t size, Int_t type)
void DisplaySignals(TString frame, TString mode, NcTimestamp *ts, TString proj="ham", Int_t clr=0, Int_t nmax=-1, Int_t j=-1, Int_t type=-1, TString name="*")
NcSignal * GetSignal(Double_t &d, Double_t &a, TString au, Double_t &b, TString bu, TString frame, NcTimestamp *ts, Int_t jref, TString mode="T", Int_t type=0)
virtual void LabLocalFramePanel(TGCompositeFrame *frame)
TString fMapMerUc
! The GUI selected angular units for the central meridian location
void SetExperiment(TString name, Int_t id=0)
TH1 * GetBurstZdist(TString name, TString type)
TString fMapUinfo
! The GUI selected angular units for the Lab info
TString fMapEname
! The GUI entered name of the entry
Int_t GetLabDetectorId() const
Double_t GetPhysicalParameter(TString name) const
virtual TObject * Clone(const char *name="") const
Double_t GetNeutrinoAngle(Double_t E, TString u, Int_t mode, TF1 *f=0)
TGMainFrame * fSkyMapPanel
! The main frame for the SkyMapPanel GUI
Int_t GetNsignals(Int_t type, Int_t mode=0) const
void SetMarkerStyle(Int_t style, Int_t type)
NcSignal * SetSignal(Double_t d, Double_t a, TString au, Double_t b, TString bu, TString frame, NcTimestamp *ts, Int_t jref, TString mode="T", TString name="", Int_t type=0)
Int_t fMapMerMode
! The GUI selected meridian orientation for the Map
void PrintAngle(Double_t a, TString in, TString out, Int_t ndig=1, Bool_t align=kFALSE) const
void MapMerC(const char *text)
Int_t fMapTinfo
! The GUI selected mode for the timestamp info
void SetMaxDt(Double_t s)
TH1F GetLogHistogram(TH1 *hin, Int_t mode, TString s="") const
NcTimestamp fMapTS
! The GUI entered timestamp to be used for the List/Map
Double_t GetPhysicalDistance(Double_t z, TString u="Mpc", Int_t t=1) const
void MapTimeType(Int_t i)
Double_t KolmogorovTest(TString mode, TH1 *h1, TH1 *h2=0, TF1 *pdf=0, Double_t nr=1000, TH1F *ksh=0, Int_t ncut=0, Double_t *nrx=0, Int_t mark=1)
TGComboBox * fMapLabE
! The GUI Lab experiment site selection box
virtual void CommandPanel(TGCompositeFrame *frame)
Double_t GetSurvivalProbability(Double_t x, Double_t lambda) const
Double_t GetHourAngle(TString mode, NcTimestamp *ts, Int_t jref=0, Int_t type=0)
Double_t GetRadiationLength(Double_t Z, Double_t A, Double_t rho=-1) const
Int_t fMapNmax
! The GUI selected max. number of signals of each type to Map/List
Int_t fBias
! Initialisation flag for fB values (0=uninitialised 1=initialised)
void RandomPosition(Nc3Vector &v, Double_t thetamin, Double_t thetamax, Double_t phimin, Double_t phimax)
TString fMapLabExpName
! The GUI entered Lab experimental site
TF1 GetBackgroundRatePDF(Double_t Noff, Double_t Toff, Double_t bmax=-1, Double_t prec=709)
TString fMapEmode
! The GUI entered coordinate system mode of the entry
NcRandom * GetRandomiser(Int_t &iseed, Int_t &cnt1, Int_t &cnt2) const
void GetBurstDtDistributions(Int_t ndt, TH1F &hisdtOn, TF1 &pdfdtOn, TH1F &hisdtOff, TF1 &pdfdtOff, Bool_t zcor)
void MapNmax(const char *text)
TH1F GetCountsHistogram(TF1 &spec, Int_t nbins, Double_t xmin, Double_t xmax, Int_t mode, TString s="") const
Double_t GetSeparation(TString name1, TString name2, TString au, Double_t *dt=0, TString tu="s", Int_t mode=1, Double_t *diftheta=0, Double_t *difphi=0)
void AddNamedSlot(TString s)
Int_t GetSlotIndex(TString name, Int_t opt=0) const
(Bayesian) Block treatment of sequential data.
Int_t Rebin(TH1 *hin, TH1 *hout, Bool_t scale, Int_t nbins=0, Double_t xmin=0, Double_t xmax=-1)
Int_t Divide(TH1 *h1, TH1 *h2, TH1 *hout, Bool_t scale, Double_t c, Double_t d=0)
Double_t GetBlocks(TH1 *hin, Double_t fpr, TH1 *hout, Int_t ntrig=0)
Signal (Hit) handling of a generic device.
virtual TObject * Clone(const char *name="") const
NcSignal * GetHit(Int_t j) const
virtual void Reset(Int_t mode=0)
Various mathematical tools for scientific analysis.
Double_t PsiValue(Int_t m, Int_t *n, Double_t *p=0, Int_t f=0) const
Double_t LnGamma(Double_t z) const
Double_t Chi2Pvalue(Double_t chi2, Int_t ndf, Int_t sides=0, Int_t sigma=0, Int_t mode=1) const
Double_t LiMaSignificance(Double_t Non, Double_t Ton, Double_t Noff, Double_t Toff, Double_t Ra=1, Double_t Re=1) const
Double_t Gamma(Double_t z) const
Double_t PsiExtreme(Double_t n, Int_t m, Double_t *p=0, Int_t k=0) const
Double_t PsiPvalue(Double_t psi0, Double_t nr, Double_t n, Int_t m, Double_t *p=0, Int_t f=0, Double_t *na=0, TH1F *psih=0, Int_t ncut=0, Double_t *nrx=0, Int_t mark=1)
TF1 PoissonDtDist(Double_t r, Int_t n) const
Double_t Chi2Value(Int_t m, Int_t *n, Double_t *p=0, Int_t *ndf=0) const
Handling of positions (with timestamps) in various reference frames.
void GetPosition(Double_t *r, TString f, TString u="rad", Float_t s=-1) const
void SetPosition(Double_t *r, TString f, TString u="rad")
NcTimestamp * GetTimestamp()
void SetTimestamp(NcTimestamp &t)
Generate universal random numbers and sequences on all common machines.
Sampling and statistics tools for various multi-dimensional data samples.
Double_t GetMedian(Int_t i)
void SetStoreMode(Int_t mode=1, Int_t nmax=0, Int_t i=0)
Double_t GetEntry(Int_t i, Int_t j, Int_t mode=0, Int_t k=0)
Generic handling of (extrapolated) detector signals.
virtual void Reset(Int_t mode=0)
virtual void SetSignal(Double_t sig, Int_t j=1)
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
virtual void Data(TString f="car", TString u="rad") const
Double_t GetEpoch(TString mode)
Double_t GetMJD(Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns) const
void SetLT(Double_t dt, Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns=0, Int_t ps=0, TString utc="A", Int_t leap=0, Double_t dut=0)
Double_t GetJD(Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns) const
void GetUT(Int_t &hh, Int_t &mm, Int_t &ss, Int_t &ns, Int_t &ps)
TString GetDayTimeString(TString mode, Int_t ndig=0, Double_t offset=0, TString *date=0, TString *time=0, Bool_t full=kTRUE)
Double_t Almanac(Double_t *dpsi=0, Double_t *deps=0, Double_t *eps=0, Double_t *dl=0, TString name="", Double_t *el=0, Double_t *eb=0, Double_t *dr=0, Double_t *value=0, Int_t j=0)
Double_t GetLMST(Double_t offset)
Double_t GetLT(Double_t offset)
void GetGMST(Int_t &hh, Int_t &mm, Int_t &ss, Int_t &ns, Int_t &ps)
void SetEpoch(Double_t e, TString mode, TString utc="U", Int_t leap=0, Double_t dut=0)
void SetUT(Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns=0, Int_t ps=0, TString utc="A", Int_t leap=0, Double_t dut=0)
void PrintTime(Double_t h, Int_t ndig=1) const
Double_t GetLAST(Double_t offset)
TTree * LoadUTCparameterFiles(TString leapfile="$(NCFS)/IERS/leap.txt", TString dutfile="$(NCFS)/IERS/dut.txt")
void SetTJD(Int_t tjd, Int_t sec, Int_t ns, Int_t ps=0, TString utc="U", Int_t leap=0, Double_t dut=0)
void SetMJD(Int_t mjd, Int_t sec, Int_t ns, Int_t ps=0, TString utc="U", Int_t leap=0, Double_t dut=0)
void SetJD(Int_t jd, Int_t sec, Int_t ns, Int_t ps=0, TString utc="U", Int_t leap=0, Double_t dut=0)
void Add(Int_t d, Int_t s, Int_t ns, Int_t ps=0)
void Convert(Double_t date, Int_t &days, Int_t &secs, Int_t &ns) const
Int_t GetDifference(NcTimestamp *t, Int_t &days, Int_t &sec, Int_t &ns, Int_t &ps, TString type="UT")
void AddSec(Double_t seconds)
void Date(Int_t mode=3, Double_t offset=0)