329 NcJob* parent=(
NcJob*)(gROOT->GetListOfTasks()->FindObject(name.Data()));
341 if (seldev->
GetSignal(
"Select") < 0.1)
return;
345 fParams.SetNameTitle(
"IcePandel",
"IcePandel processor parameters");
360 cout <<
" *IcePandel* No input tracks have been specified." << endl;
361 cout <<
" *** No IcePandel processing will be performed ***." << endl;
365 cout <<
" *IcePandel* First guess selections to be processed (-1=all)." << endl;
366 for (Int_t i=0; i<nclasses; i++)
370 str=strx->GetString();
372 cout <<
" Maximally " << ntkmax <<
" track(s) per event for procedure : " << str.Data() << endl;
374 cout <<
" *IcePandel* Hit selection mode : " <<
fSelhits << endl;
375 cout <<
" *IcePandel* Penalty value for minimiser : " <<
fPenalty <<
" dB." << endl;
383 const Double_t pi=acos(-1.);
384 const Double_t e=exp(1.);
387 Double_t arglist[100];
391 Int_t ntkreco=
fEvt->GetNtracks(1);
395 fHits=
new TObjArray();
410 TObjArray* hits=
fEvt->GetHits(
"IceGOM");
412 tracktitle=
" Pandel fit result using all event hits";
413 for (Int_t ih=0; ih<hits->GetEntries(); ih++)
419 if (om->InheritsFrom(
"IceTDOM"))
continue;
421 (om->InheritsFrom(
"IceDCDOM") &&
fCleanDC))
437 fFitstats->SetNameTitle(
"Fitstats",
"TFitter stats for Pandel fit");
449 Float_t x,y,z,theta,phi,t0;
450 Double_t amin,edm,errdef;
451 Int_t ierfit,iererr,nvpar,nparx;
457 Int_t amanda,inice,icecube,deepcore;
461 for (Int_t iclass=0; iclass<nclasses; iclass++)
465 str=strx->GetString();
467 TObjArray* tracks=
fEvt->GetTracks(str);
469 if (tracks) ntk=tracks->GetEntries();
470 if (ntkmax>0 && ntk>ntkmax) ntk=ntkmax;
474 for (Int_t i=0; i<ntk; i++)
476 mytracks.Add(tracks->At(i));
479 for (Int_t jtk=0; jtk<ntk; jtk++)
481 track=(
NcTrack*)mytracks.At(jtk);
482 if (!track)
continue;
485 trackname=track->GetName();
486 trackname.ReplaceAll(
"Ice",
"");
493 if (
fSelhits==1) tracktitle=
" Pandel fit result for assoc.";
494 if (
fSelhits==2) tracktitle=
" Pandel fit result for full";
506 for (Int_t is=1; is<=nsig; is++)
511 if (!om->InheritsFrom(
"IceGOM"))
continue;
513 if (om->InheritsFrom(
"IceAOM"))
518 if (om->InheritsFrom(
"IceICDOM"))
523 if (om->InheritsFrom(
"IceDCDOM"))
532 inice=icecube*deepcore;
536 if (amanda && !icecube && !deepcore)
538 hits=
fEvt->GetHits(
"IceAOM");
539 tracktitle+=
" Amanda hits";
543 hits=
fEvt->GetHits(
"IceIDOM");
544 tracktitle+=
" InIce hits";
546 if (icecube && !deepcore)
548 hits=
fEvt->GetHits(
"IceICDOM");
549 tracktitle+=
" standard IceCube hits";
551 if (deepcore && !icecube)
553 hits=
fEvt->GetHits(
"IceDCDOM");
554 tracktitle+=
" DeepCore hits";
560 for (Int_t is2=0; is2<hits->GetEntries(); is2++)
566 if (om->InheritsFrom(
"IceTDOM"))
continue;
568 (om->InheritsFrom(
"IceDCDOM") &&
fCleanDC))
578 nah=
fHits->GetEntries();
580 if (!amanda && !icecube && !deepcore)
585 if (amanda && !icecube && !deepcore)
595 if (icecube && !deepcore)
600 if (deepcore && !icecube)
619 t0=
fEvt->GetDifference(tt0,
"ns");
626 if (
fPrint==-2) arglist[0]=-1;
627 fFitter->ExecuteCommand(
"SET PRINT",arglist,1);
628 if (
fPrint==-2)
fFitter->ExecuteCommand(
"SET NOWARNINGS",arglist,0);
630 fFitter->SetFitMethod(
"loglikelihood");
633 arglist[0]=5.*log10(e);
634 fFitter->ExecuteCommand(
"SET ERRORDEF",arglist,1);
636 fFitter->SetParameter(0,
"r0x",x,0.1,0,0);
637 fFitter->SetParameter(1,
"r0y",y,0.1,0,0);
638 fFitter->SetParameter(2,
"r0z",z,0.1,0,0);
639 fFitter->SetParameter(3,
"theta",theta,0.001,0,pi);
640 fFitter->SetParameter(4,
"phi",phi,0.001,0,2.*pi);
641 fFitter->SetParameter(5,
"t0",t0,1.,0,32000);
648 ierfit=
fFitter->ExecuteCommand(
"SIMPLEX",arglist,0);
650 fFitter->GetStats(amin,edm,errdef,nvpar,nparx);
664 iererr=
fFitter->ExecuteCommand(
"HESSE",arglist,0);
668 vec[0]=
fFitter->GetParameter(0);
669 vec[1]=
fFitter->GetParameter(1);
670 vec[2]=
fFitter->GetParameter(2);
671 err[0]=
fFitter->GetParError(0);
672 err[1]=
fFitter->GetParError(1);
673 err[2]=
fFitter->GetParError(2);
678 vec[1]=
fFitter->GetParameter(3);
679 vec[2]=
fFitter->GetParameter(4);
681 err[1]=
fFitter->GetParError(3);
682 err[2]=
fFitter->GetParError(4);
688 t0fit.
Add(0,0,
int(t0));
705 for (Int_t ihit=0; ihit<
fHits->GetEntries(); ihit++)
712 if (newname==
"") newname=ClassName();
715 trk->SetNameTitle(newname.Data(),tracktitle.Data());
735 const Float_t c=0.299792458;
736 const Float_t npice=1.31768387;
737 const Float_t ngice=1.35075806;
738 const Float_t thetac=acos(1./npice);
739 const Float_t cice=c/ngice;
740 const Float_t tau=557;
741 const Double_t pi=acos(-1.);
763 fTkfit->SetReferencePoint(r0);
766 Int_t nhits=
fHits->GetEntries();
770 Float_t d,dist,thit,tgeo,proj;
772 Float_t zhit,lambda,labs;
774 Double_t tres,ksi,rho,eta,pandel;
775 Double_t cpandel1,cpandel2,cpandel3,cpandel;
776 Double_t z,k,alpha,beta,phi,n1,n2,n3,u;
780 for (Int_t i=0; i<nhits; i++)
789 if (omx->InheritsFrom(
"IceAOM"))
791 if (
fVgroupA) alphac=atan((1.-npice/ngice)/sqrt(npice*npice-1.));
794 if (omx->InheritsFrom(
"IceICDOM"))
799 if (omx->InheritsFrom(
"IceDCDOM"))
806 if (omx->InheritsFrom(
"IceAOM"))
815 zhit=omx->
GetX(3,
"car");
829 d=
fTkfit->GetDistance(rhit);
830 ksi=d/(sin(thetac)*lambda);
833 dist=fabs(proj)+d/tan(pi/2.-thetac-alphac);
834 if (proj<0) dist=-dist;
862 rho=((1./tau)+(cice/labs));
863 eta=(rho*sigma)-(tres/sigma);
867 cpandel=exp(-tres*tres/(2.*sigma*sigma))/(sigma*sqrt(2.*pi));
869 else if (ksi<=5 && tres>=-5.*sigma && tres<=30.*sigma)
871 cpandel1=pow(rho,ksi)*pow(sigma,ksi-1.)*exp(-tres*tres/(2.*sigma*sigma))/pow(2.,0.5*(1.+ksi));
872 cpandel2=ROOT::Math::conf_hyperg(ksi/2.,0.5,eta*eta/2.)/TMath::Gamma((ksi+1.)/2.);
873 cpandel3=sqrt(2.)*eta*ROOT::Math::conf_hyperg((ksi+1.)/2.,1.5,eta*eta/2.)/TMath::Gamma(ksi/2.);
875 cpandel=cpandel1*(cpandel2-cpandel3);
877 else if (ksi<=1 && tres>30.*sigma && tres<=3500)
879 pandel=pow(rho,ksi)*pow(tres,(ksi-1.))*exp(-rho*tres)/TMath::Gamma(ksi);
881 cpandel=exp(rho*rho*sigma*sigma/2.)*pandel;
883 else if (ksi<=1 && tres<-5.*sigma && tres>=-25.*sigma)
885 cpandel=pow(rho*sigma,ksi)*pow(eta,-ksi)*exp(-tres*tres/(2.*sigma*sigma))/(sigma*sqrt(2.*pi));
887 else if (ksi<=50 && eta<=0 && tres<=3500)
889 z=-eta/sqrt(4.*ksi-2.);
890 k=0.5*(z*sqrt(1.+z*z)+log(z+sqrt(1.+z*z)));
891 alpha=-tres*tres/(2.*sigma*sigma)+eta*eta/4.-ksi/2.+0.25+k*(2.*ksi-1.);
892 alpha+=-log(1.+z*z)/4.-ksi*log(2.)/2.+(ksi-1.)*log(2.*ksi-1.)/2.+ksi*log(rho)+(ksi-1.)*log(sigma);
893 beta=0.5*(z/sqrt(1.+z*z)-1.);
894 n1=beta*(20.*beta*beta+30.*beta+9.)/12.;
895 n2=pow(beta,2.)*(6160.*pow(beta,4.)+18480.*pow(beta,3.)+19404.*pow(beta,2.)+8028.*beta+945.)/288.;
896 n3=27227200.*pow(beta,6.)+122522400.*pow(beta,5.)+220540320.*pow(beta,4.);
897 n3+=200166120.*pow(beta,3.)+94064328.*pow(beta,2.)+20546550.*beta+1403325.;
898 n3*=pow(beta,3.)/51840.;
899 phi=1.-n1/(2.*ksi-1.)+n2/pow(2.*ksi-1.,2.)-n3/pow(2.*ksi-1.,3.);
900 cpandel=exp(alpha)*phi/TMath::Gamma(ksi);
902 else if (ksi<=50 && eta>=0 && tres>=-25.*sigma)
904 z=eta/sqrt(4.*ksi-2.);
905 k=0.5*(z*sqrt(1.+z*z)+log(z+sqrt(1.+z*z)));
906 u=exp(ksi/2.-0.25)*pow(2.*ksi-1.,-ksi/2.)*pow(2.,(ksi-1.)/2.);
907 beta=0.5*(z/sqrt(1.+z*z)-1.);
908 n1=beta*(20.*beta*beta+30.*beta+9.)/12.;
909 n2=pow(beta,2.)*(6160.*pow(beta,4.)+18480.*pow(beta,3.)+19404.*pow(beta,2.)+8028.*beta+945.)/288.;
910 n3=27227200.*pow(beta,6.)+122522400.*pow(beta,5.)+220540320.*pow(beta,4.);
911 n3+=200166120.*pow(beta,3.)+94064328.*pow(beta,2.)+20546550.*beta+1403325.;
912 n3*=pow(beta,3.)/51840.;
913 phi=1.+n1/(2.*ksi-1.)+n2/pow(2.*ksi-1.,2.)+n3/pow(2.*ksi-1.,3.);
914 cpandel=pow(rho,ksi)*pow(sigma,ksi-1.)*exp(-pow(tres,2.)/(2.*pow(sigma,2.))+pow(eta,2.)/4.)/sqrt(2.*pi);
915 cpandel*=u*phi*exp(-k*(2.*ksi-1.))*pow(1.+z*z,-0.25);
920 cout <<
" *IcePandel::FitFCN* Outside rectangle. We should never get here." << endl;
926 if (cpandel>0) psihit=-10.*log10(cpandel);