21 #include <utl/ErrorLogger.h>
22 #include <utl/Reader.h>
24 #include <evt/Event.h>
25 #include <evt/ShowerRecData.h>
26 #include <evt/ShowerFRecData.h>
27 #include <evt/GaisserHillas4Parameter.h>
29 #include <fevt/FEvent.h>
31 #include <fevt/Telescope.h>
32 #include <fevt/EyeRecData.h>
34 #include <det/Detector.h>
35 #include <fdet/FDetector.h>
36 #include <fdet/Telescope.h>
38 #include <fdet/Pixel.h>
39 #include <fdet/Channel.h>
41 #include <utl/PhysicalConstants.h>
42 #include <utl/PhysicalFunctions.h>
43 #include <utl/UTMPoint.h>
44 #include <utl/Transformation.h>
46 #include <fwk/LocalCoordinateSystem.h>
47 #include <fwk/CoordinateSystemRegistry.h>
48 #include <fwk/CentralConfig.h>
50 #include <atm/Atmosphere.h>
51 #include <atm/ProfileResult.h>
52 #include <atm/AttenuationResult.h>
53 #include <atm/InclinedAtmosphericProfile.h>
55 #include <boost/io/ios_state.hpp>
63 using namespace FdProfileReconstructorKG;
70 using namespace oBLAS;
82 fInclinedModelDepthBinning(10*
g/
cm2),
84 fAlwaysGuessXMaxFromAperture(false),
85 fIsMultiEyeEvent(false),
129 double inclinedModelMinZenith;
130 profCalcB.
GetChild(
"inclinedModelMinZenith").
GetData(inclinedModelMinZenith);
137 std::string fluoLDF, dirCherLDF, scatCherLDF, multscatLDF, haloType;
146 if ( fluoLDF ==
"eNone")
148 else if ( fluoLDF ==
"eGora")
151 ERROR(
"unknown fluorescence LDF");
155 if ( dirCherLDF ==
"eNone")
157 else if ( dirCherLDF ==
"eGora")
160 ERROR(
"unknown direct Cherenkov LDF");
164 if ( scatCherLDF ==
"eNone")
166 else if ( scatCherLDF ==
"eGora")
168 else if ( scatCherLDF ==
"eExponential")
170 else if ( scatCherLDF ==
"eGiller")
173 ERROR(
"unknown scattered Cherenkov LDF");
177 if ( multscatLDF ==
"eNone")
179 else if ( multscatLDF ==
"eRoberts")
181 else if ( multscatLDF ==
"ePekala")
184 ERROR(
"unknown multiple scattering model");
188 if ( haloType ==
"eNone")
190 else if ( haloType ==
"eFlasher2005" )
192 else if ( haloType ==
"eFlasher2008" )
194 else if ( haloType ==
"eSpotGroup" )
196 else if ( haloType ==
"eSpotGroup2" )
199 ERROR(
"unknown optical halo type");
220 string compositionOption;
224 (compositionOption ==
"data") ?
226 (compositionOption ==
"mixed") ?
228 (compositionOption ==
"proton") ?
231 string interactionOption;
233 if (interactionOption ==
"SIBYLL21") {
235 }
else if (interactionOption ==
"QGSJET01") {
237 }
else if (interactionOption ==
"DATA") {
241 err <<
"Unknown hadronic interaction model used: " << interactionOption;
247 ERROR(
"inconsistent invisible energy options (data options cannot "
248 "be mixed with other options)");
254 std::string idstr(
"$Id$");
256 std::istringstream
is(idstr);
258 is >> version >> version >> version;
260 std::ostringstream info;
261 info <<
" Version: " << version
262 <<
"\n Parameters:\n"
263 <<
"\t energy cutoff: "
265 <<
"\t yield scale factors: F="
267 <<
"\t using inclined profile model above "
268 << inclinedModelMinZenith/
degree <<
" deg. (dX="
270 <<
"\t geometric error propagation is "
272 <<
"\t atmospheric error propagation is "
274 <<
"\t lateral fluorescence light model: " << fluoLDF <<
"\n"
275 <<
"\t lateral direct Cherenkov light model: " << dirCherLDF <<
"\n"
276 <<
"\t lateral scattered Cherenkov light model: " << scatCherLDF
278 (
fCherenkovCone?
" (with Cherenkov cone)":
" (without Cherenkov cone)"):
280 <<
"\t optical halo: " << haloType <<
"\n"
281 <<
"\t multiple scattering model: " << multscatLDF <<
"\n"
282 <<
"\t invisible energy model: "
283 << interactionOption <<
"/"
284 << compositionOption <<
"\n";
334 WARNING(
"############################################################################\n"
335 "############################################################################\n"
336 "# really reconstruct simulated shower with\n"
337 "# multiple scattering and/or spot halo ???\n"
338 "# note: none of these effects is currently simulated,\n"
339 "# i.e. unless you know what you are doing, the profile reconstruction\n"
340 "# will be probably wrong...)\n"
341 "############################################################################\n"
342 "############################################################################");
353 boost::io::ios_all_saver save(cout);
354 cout.flags(std::ios::scientific);
361 cout <<
"\n --[FdProfileReconstructor]--> " << endl;
367 eyeIter != fdEvent.
EyesEnd(ComponentSelector::eHasData);
379 cout <<
"\n calculating profile for eye " << eye.
GetId() << endl;
473 namespace ublas = boost::numeric::ublas;
476 cout <<
" current shower maximum is " <<
fXmax/(
g/
cm2) << endl;
479 const Point& eyepos =
480 det::Detector::GetInstance().GetFDetector().GetEye(eye).GetPosition();
486 const unsigned int nF =
fDepth.size();
488 const unsigned int kMinPoints = 5;
491 cout <<
" too few points for fit: nF="
497 ublas::vector<double> n(nF);
499 for (
unsigned int i = 0; i < nF ; ++i) {
505 n(i) = lightflux.
GetY(j);
506 const double en = lightflux.
GetYErr(j);
512 if (zeta <= 1.e-12) {
514 msg <<
"############################################################################\n"
515 "# Eye " << eye.
GetId() <<
"'s Zeta angle is " << zeta <<
". There was likely a problem\n"
516 "# in the aperture-light finding. Check your configuration! Skipping Eye...\n"
517 "############################################################################";
522 double fluoScaleFac =
fFfac;
523 double cherScaleFac =
fCfac;
524 if (fluoScaleFac < 0) {
534 cherScaleFac, fluoScaleFac,
540 std::map<int, CherenkovFluorescenceMatrix*>::iterator currentCFMatrix =
546 cout <<
" could not find CFM for eye " << eye.
GetId()
549 for (std::map<int, CherenkovFluorescenceMatrix*>::iterator iter =
fChFlPtrMap.begin();
551 cout<< iter->first <<
" ";
560 cout <<
" inverting (" <<
fDepth.size() <<
"x" <<
fDepth.size()
561 <<
") CherenkovFluorescenceMatrix ... " << endl;
568 cerr <<
" FdProfileReconstructor::CalculateProfiles - Error:"
569 <<
" SingularMatrixException for CF" << endl;
577 cout <<
" covariance matrix ... " << endl;
581 std::vector<double> covdEdX(nF);
582 for (
unsigned int i = 0; i < nF; ++i) {
584 for (
unsigned int k = i; k < nF; ++k)
585 sum += CFinv(k, i) * CFinv(k, i) * Vn(i, i);
592 cout <<
" profiles at aperture ... \n" << endl;
606 ublas::vector<double> dEdX = ublas::prod(CFinv, n);
610 for (
unsigned int i = 0; i < nF-
fOutSideFOV; ++i) {
612 const double eDep = dEdX(j);
613 const double eDepErr =
sqrt(covdEdX[j]);
615 const double Ne = eDep / dEdXperElectron;
616 const double NeErr = eDepErr / dEdXperElectron;
617 const double time = lightflux.
GetX(i);
620 dirCher.
PushBack(time, 0, vChDir[j], 0);
621 scatMCher.
PushBack(time, 0, vChMScat[j], 0);
622 scatRCher.
PushBack(time, 0, vChRScat[j], 0);
627 ublas::vector<double> dEdX = ublas::prod(CFinv, n);
628 for (
unsigned int i = 0; i < nF-
fOutSideFOV; ++i) {
630 const double eDep = dEdX(j);
631 const double eDepErr =
sqrt(covdEdX[j]);
659 fRelEff = det::Detector::GetInstance().GetFDetector().GetEye(eye).GetTelescope(1).GetMeasuredRelativeEfficiency();
688 const double coreEyeDistance = coreEyeVec.
GetMag();
694 if (flatEarth && cosTheta < 0.1) {
695 cerr <<
" FdProfileReconstructor::CalculateGeometryAndDepth() - "
696 " skipping upward/horizontal track\n"
697 " please use inclined model for these tracks" << endl;
707 const double minHeight = verticalDepthProfile.
MinX();
708 const double maxHeight = verticalDepthProfile.
MaxX();
711 verticalDepthProfile :
715 unsigned int nSkip = 0;
719 const unsigned int nAperturePoints = lightflux.
GetNPoints();
721 vector<Point> trackBin(2);
724 for (
unsigned int i = 0; i < nAperturePoints; ++i) {
729 double Xdepth[2] = { 0, 0 };
731 bool skipThisPoint =
false;
732 for (
int j = 0; j < 2; ++j) {
735 double l = coreEyeDistance * sin(chi_i) / sin(
fChi0 - chi_i);
736 double distance = -l;
743 trackBin[j] = chi_i_point;
745 if (distance<minDistance || distance>maxDistance ||
746 height < minHeight || height > maxHeight )
747 skipThisPoint =
true;
749 Xdepth[j] = (flatEarth ?
750 depthProfile.
Y(height)/cosTheta :
751 depthProfile.
Y(distance));
754 if (!skipThisPoint) {
755 fDepth.push_back(0.5*(Xdepth[0] + Xdepth[1]));
763 if (nSkip == nAperturePoints)
769 cout <<
" CalculateGeometryAndDepth: " << nSkip
770 <<
" points outside atmosphere! -> "
771 <<
" refilling light at aperture" << endl;
779 for (
unsigned int i = 0; i < newLightFlux.
GetNPoints(); ++i) {
780 const double x = newLightFlux.
GetX(i);
781 const double ex = newLightFlux.
GetXErr(i);
782 const double y = newLightFlux.
GetY(i);
783 const double ey = newLightFlux.
GetYErr(i);
810 const Atmosphere& atmo = det::Detector::GetInstance().GetAtmosphere();
818 double minDepth = distProfile.
MinX();
819 double maxDepth = distProfile.
MaxX();
821 const double dX = 25.*(
g/
cm2);
822 const double xInit = 50.*(
g/
cm2);
824 double lastDepth = 0.;
826 const double lastHeight =
828 lastDepth = depthProfile.
Y(lastHeight)/cosTheta;
833 lastDepth = depthProfile.
Y(lastDistance);
836 vector<Point> trackBin(2);
840 while (
fDepth[0] > xInit &&
844 const double Xdepth=lastDepth-dX;
848 if (Xdepth> minDepth && Xdepth<maxDepth) {
849 const double distance = distProfile.
Y(Xdepth);
851 trackBin[0] = pDistance;
852 fDepth.push_front(Xdepth+dX/2.);
863 const double verticalDepth = Xdepth*cosTheta;
864 if (verticalDepth>minDepth &&
865 verticalDepth<maxDepth ) {
866 const double h = distProfile.
Y(verticalDepth) - coreHeight;
867 const double l = h/cosTheta;
869 fDepth.push_front(Xdepth+dX/2.);
881 <<
" points outside FoV" << endl;
951 double xMax=700.*(
g/
cm/
cm);
955 && event.
HasRecShower()&&
event.GetRecShower().HasFRecShower()
956 &&
event.GetRecShower().GetFRecShower().HasGHParameters()) {
957 xMax=
event.GetRecShower().GetFRecShower().GetGHParameters().GetXMax();
971 for (
unsigned int i=0; i<lightflux.
GetNPoints() ; i++) {
972 double flux=lightflux.
GetY(i)/lightflux.
GetXErr(i);
982 const double kxMaxMin= 400.*(
g/
cm/
cm);
983 const double kxMaxMax= 1100.*(
g/
cm/
cm);
986 else if (xMax>kxMaxMax)
1009 const double calEnergy2 =
pow(calEnergy, 2);
1015 scaleFac =
sqrt(chisq/ndof);
1017 const double calEnergyErr =
1019 const double calEnergyStatVar = calEnergyErr * calEnergyErr;
1021 double calEnergyGeomVar=0.;
1026 calEnergyGeomVar = calEnergy2;
1030 double calEnergyAtmVar=0.;
1035 calEnergyAtmVar = calEnergy2;
1049 const double logE = log10(calEnergy);
1054 const double fE =
max(fp0+fp1*(logE -18.)+fp2*(logE -18.)*(logE -18.),0.);
1055 const double fEs = fp0+fp1*(logEs-18.)+fp2*(logEs-18.)*(logEs-18.);
1056 const double gHorizontalUniformityError_E = dEr*fE/fEs;
1058 const double additionalAtmVar =
1059 calEnergy2 * (
pow(gHorizontalUniformityError_E, 2) +
1066 calEnergyAtmVar += additionalAtmVar;
1069 const double calorEnergyConexMissingVar =
1082 double cosZenithAngle = fAxis.
GetCosTheta(coreCS);
1086 const double invEnergyFac =
1090 const double invEnergyFacDeriv =
1095 double totEnergy = invEnergyFac * calEnergy;
1105 const double deriv = invEnergyFacDeriv * calEnergy + invEnergyFac;
1106 const double deriv2 = deriv * deriv;
1107 const double statVar = deriv2 * calEnergyStatVar;
1108 const double geomVar = deriv2 * calEnergyGeomVar;
1109 const double atmVar = deriv2 * calEnergyAtmVar;
1113 const double ResolutionConexMissingFactorVar = deriv2 * calorEnergyConexMissingVar;
1114 const double totEnergyStatErr =
sqrt(invEVar + geomVar + statVar + ResolutionConexMissingFactorVar);
1121 recShower.
SetEmEnergy(calEnergy,
sqrt(calEnergyGeomVar+calEnergyStatVar+calorEnergyConexMissingVar),
1122 ShowerFRecData::eStatistical);
1124 recShower.
SetTotalEnergy(totEnergy, totEnergyStatErr,ShowerFRecData::eStatistical);
1132 ERROR(
"No 4par GH structure????");
1136 const double dEdXmax = gh4->
GetNMax();
1137 const double dEdXmax_err = scaleFac * gh4->
GetNMaxError();
1138 const double xmax = gh4->
GetXMax();
1139 const double xmax_err = scaleFac * gh4->
GetXMaxError();
1147 double x0_tot_err, xmax_tot_err, nmax_tot_err, lambda_tot_err;
1155 recShower.
SetXmaxError(xmax_err, ShowerFRecData::eStatistical);
1158 xmax_tot_err = xmax;
1159 nmax_tot_err = dEdXmax;
1160 lambda_tot_err = lambda;
1161 recShower.
SetXmaxError(xmax, ShowerFRecData::eStatistical);
1164 gh4->
SetXMax(xmax, xmax_tot_err);
1165 gh4->
SetNMax(dEdXmax, nmax_tot_err,
true);
1170 gh4->
SetNMax(dEdXmax, dEdXmax_err,
true);
1177 cout <<
"\n E [EeV] = " << totEnergy/
EeV
1178 <<
" +/- " <<
sqrt(statVar)/
EeV <<
" (stat.) "
1179 <<
" +/- " <<
sqrt(geomVar)/
EeV <<
" (geom.) "
1180 <<
" +/- " <<
sqrt(invEVar)/
EeV <<
" (inv.) "
1181 <<
" +/- " <<
sqrt(atmVar)/
EeV <<
" (atm.) "
1183 cout <<
" Xmax [g/cm^2] = " << xmax/(
g/
cm/
cm)
1184 <<
" +/- " << xmax_err/(
g/
cm/
cm) <<
" (stat.) ";
1220 std::vector<std::vector<double> > fitResults;
1222 const bool haveDefault =
ReFitProfile(eye, 0., 0., 0., 0., 0., fitResults);
1226 const unsigned int kNGeomVars = 5;
1229 cout <<
"\n propagating geometry uncertainties ";
1231 cout <<
"...\n" << endl;
1237 if(!
ReFitProfile(eye, 1., 0., 0., 0., 0., fitResults))
break;
1238 if(!
ReFitProfile(eye,-1., 0., 0., 0., 0., fitResults))
break;
1242 if(!
ReFitProfile(eye, 0., 1., 0., 0., 0., fitResults))
break;
1243 if(!
ReFitProfile(eye, 0.,-1., 0., 0., 0., fitResults))
break;
1247 if(!
ReFitProfile(eye, 0., 0., 1., 0., 0., fitResults))
break;
1248 if(!
ReFitProfile(eye, 0., 0.,-1., 0., 0., fitResults))
break;
1252 if(!
ReFitProfile(eye, 0., 0., 0., 1., 0., fitResults))
break;
1253 if(!
ReFitProfile(eye, 0., 0., 0.,-1., 0., fitResults))
break;
1257 if(!
ReFitProfile(eye, 0., 0., 0., 0., 1., fitResults))
break;
1258 if(!
ReFitProfile(eye, 0., 0., 0., 0.,-1., fitResults))
break;
1265 const bool geomSuccess = ( fitResults.size() == (kNGeomVars*2 +1) );
1270 if ( geomSuccess ) {
1298 x0=fitResults[0][i];
1300 double err[kNGeomVars];
1302 for (
unsigned int j=0;j<kNGeomVars;j++) {
1303 x1=fitResults[2*j+1][i]; x2=fitResults[2*j+2][i];
1311 fGeomVariance.push_back(err[0]*err[0] + err[1]*err[1] + err[2]*err[2]
1312 + 2. * err[0] * err[2] * rhoRT
1313 + 2. * err[0] * err[1] * rhoRC
1314 + 2. * err[1] * err[2] * rhoCT);
1320 + 2. * err[3] * err[4] * rhoPT;
1328 if(
fErrPropVerb>-1) cout <<
" propagating atmospheric uncertainties ";
1331 const unsigned int kNAtmVars = 1;
1333 fitResults.resize(1);
1335 const Atmosphere& atmo = det::Detector::GetInstance().GetAtmosphere();
1339 if (
ReFitProfile(eye, 0., 0., 0., 0., 0., fitResults) ) {
1348 const bool atmSuccess = ( fitResults.size() == (kNAtmVars*2 +1) );
1354 x0=fitResults[0][i];
1357 for (
unsigned int j=0;j<kNAtmVars;j++) {
1358 x1=fitResults[2*j+1][i]; x2=fitResults[2*j+2][i];
1359 const double e1=(x1-x0);
1360 const double e2=(x0-x2);
1361 const double err=0.5*(e1+e2);
1392 std::vector<std::vector<double> >& fitResults)
1397 cout <<
"." << std::flush;
1408 std::vector<double> x,y,ex,ey;
1409 std::vector<double> dEx,dEy,dEex,dEey;
1410 for (
unsigned int i = 0; i < lightFlux.
GetNPoints(); i++) {
1411 x.push_back(lightFlux.
GetX(i));
1412 y.push_back(lightFlux.
GetY(i));
1413 ex.push_back(lightFlux.
GetXErr(i));
1414 ey.push_back(lightFlux.
GetYErr(i));
1415 dEx.push_back(dedxProf.
GetX(i));
1416 dEy.push_back(dedxProf.
GetY(i));
1417 dEex.push_back(dedxProf.
GetXErr(i));
1418 dEey.push_back(dedxProf.
GetYErr(i));
1428 double t1=x[0]-ex[0];
1432 for (
unsigned int i=0;i<x.size();i++) {
1437 if(t1==0.) t1=x[i]-ex[i];
1441 if ( i<x.size()-1 && x[i]+ex[i] != x[i+1]-ex[i+1] )
1444 if(combined>=nCombi||i==x.size()-1||timeGap) {
1445 double dt = x[i]-t1+ex[i];
1447 sum=0.; sum2=0.; t1=0.; combined=0.;
1453 SetGeometry(eye,nSigRp,nSigChi0, nSigT0, nSigPhi, nSigTheta);
1467 fitResults.push_back(result);
1478 for (
unsigned int i=0;i<x.size(); i++ ) {
1479 lightFlux.
PushBack(x[i],ex[i],y[i],ey[i]);
1480 dedxProf.
PushBack(dEx[i],dEex[i],dEy[i],dEey[i]);
1505 const fdet::Eye& detEye = det::Detector::GetInstance().GetFDetector().GetEye(eye);
1513 const double sdpPhi = eyeRecData.
GetSDP().
GetPhi (eyeCS)+
1515 Vector sdp =
Vector(1,sdpTheta,sdpPhi,eyeCS, Vector::kSpherical);
1517 Vector vertical(0,0,1,eyeCS);
1529 Vector axis (rot* horizontalInSDP);
1533 const double core_distance =
fRp / sin(
kPi -
fChi0);
1534 const Vector coreEyeVec = core_distance * horizontalInSDP;
1535 fCore = eyepos + coreEyeVec;
1542 std::map<int, CherenkovFluorescenceMatrix *>::iterator iter;
1544 delete iter->second;
1557 std::cerr <<
" FdProfileReconstructor::SetYieldRefit() "
1558 <<
" - EnergyFitter can not be set! " << std::endl;
1586 std::cerr <<
" FdProfileReconstructor::GetEnergyFitterVerbosity() "
1587 <<
" - EnergyFitter not initialized! " << std::endl;
1600 double& minDistance,
1601 double& maxDistance)
1603 const Atmosphere& atmo = det::Detector::GetInstance().GetAtmosphere();
1612 const double maxHeight = depthProfile.
MaxX();
1613 const double minHeight = depthProfile.
MinX();
1615 const double coreHeight =
1617 minDistance = (coreHeight-maxHeight)/cosTheta + 1*
mm;
1618 maxDistance = (coreHeight-minHeight)/cosTheta - 1*
mm;
1632 cout <<
" CalculateGeometryAndDepth - "
1633 "error initializing InclinedAtmosphericProfile " << endl;
1639 minDistance = slantDepthProfile.
MinX() + 1*
mm;
1640 maxDistance = slantDepthProfile.
MaxX() - 1*
mm;
AxialVector cross(const Vector &l, const Vector &r)
vector cross product
CherenkovFluorescenceMatrix::eDirectCherenkovLDF fDirCherLDF
double GetShapeParameter(const gh::EShapeParameter par) const
access to all variants of shape parameters (see GaisserHillasTypes.h)
unsigned int GetId() const
bool CalculateGeometryAndDepth(fevt::Eye &eye)
double Factor(const double energyEM, const EInteractionModel intMod, const ECompositionModel compMod, const double cosTheta)
invisible energy factor, finv=Etot/Eem, given Eem. CosTheta only needed when using data driven estima...
const oBLAS::lowerTriangularMatrix * GetMieScatteredCherenkovMatrix() const
returns Mie scattered Cherenkov light matrix
void Write(const evt::Event &event, const fevt::Eye &eye, CherenkovFluorescenceMatrix chfl)
unsigned int GetNPoints() const
Top of the interface to Atmosphere information.
void CalculateDetEff(const fevt::Eye &eye)
double GetChi0TZeroCorrelation() const
bool HasLightFlux(const FdConstants::LightSource source=FdConstants::eTotal) const
Check that light profile for source /par source is present.
const oBLAS::diagonalMatrix * GetDirectCherenkovMatrix() const
returns direct Cherenkov light matrix
double GetRpError() const
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
void InitSlantProfileModel(const utl::Point &core, const utl::Vector &dir, const double deltaX) const
Report success to RunController.
void SetEnergyFitterVerbosity(int verbosity)
Fluorescence Detector Eye Event.
CherenkovFluorescenceMatrix * fChFlPtr
bool HasFluorescencePhotons() const
void SetEmEnergyError(const double energyError, const EUncertaintyType type)
void InitProfiles(fevt::Eye &eye)
bool HasRecShower() const
unsigned int GetNEyes() const
std::vector< double > fGeomVariance
void MakeLongitudinalProfile()
double GetTheta(const CoordinateSystemPtr &coordinateSystem) const
zenith (theta) angle in spherical coordinates
double GetChiZero() const
utl::InvisibleEnergy::ECompositionModel fComposition
double FactorDerivative(const double energyEM, const EInteractionModel intMod, const ECompositionModel compMod, const double cosTheta)
derivative of invisible energy factor dfinv/dEem given Eem. CosTheta only needed when using data driv...
Skip remaining modules in the current loop and continue with next iteration of the loop...
bool ReFitProfile(fevt::Eye &eye, double nSigRp, double nSigChi0, double nSigT0, double nSigPhi, double nSigTheta, std::vector< std::vector< double > > &results)
double GetCosTheta(const CoordinateSystemPtr &coordinateSystem) const
cos of zenith (theta) angle
const oBLAS::lowerTriangularMatrix * GetRayleighScatteredCherenkovMatrix() const
returns Rayleigh scattered Cherenkov light matrix
bool is(const double a, const double b)
bool HasSimShower() const
void MakeFluorescencePhotons()
EyeIterator EyesEnd(const ComponentSelector::Status status)
unsigned int GetTimeFitNDof() const
const atm::ProfileResult & EvaluateDistanceVsSlantDepth() const
Table of distance as a function of slant depth.
double GetRpTZeroCorrelation() const
void SetXMax(const double xMax, const double error)
#define INFO(message)
Macro for logging informational messages.
void SetTotalEnergyError(const double energyError, const EUncertaintyType type)
bool InitializeAtmosphere(const bool flatEarth, double &minDist, double &maxDist)
void SetShapeParameter(const gh::EShapeParameter par, const double value, const double error)
Setters.
double fInclinedModelDepthBinning
Base class for exceptions trying to access non-existing components.
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
Detector description interface for Eye-related data.
boost::filter_iterator< ComponentSelector, AllEyeIterator > EyeIterator
selective Eye iterators
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
EnergyFitter * fEnergyFitter
double pow(const double x, const unsigned int i)
std::deque< std::vector< utl::Point > > fTrackPositions
utl::TabulatedFunction fRelEff
const lowerTriangularMatrix * GetInverse() const
double GetSDPPhiError() const
void SetYieldRefit(bool what)
double GetEmEnergy() const
double GetTZeroError() const
void SetGeometry(fevt::Eye &eye, double nSigRp, double nSigChi0, double nSigT0, double nSigPhi, double nSigTheta)
double GetChiZeroError() const
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
double GetXMaxError() const
int fPropagateAtmUncertainties
void AddPointsOutsideFOV()
const atm::Atmosphere & GetAtmosphere() const
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
std::deque< double > fDepth
int GetEnergyFitterVerbosity() const
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
OpticalHalo::EHaloType fOpticalHalo
const double & GetYErr(const unsigned int idx) const
Reference ellipsoids for UTM transformations.
evt::ShowerFRecData * fShowerFRecData
bool HasLongitudinalProfile() const
void SetVerbosity(const int iv)
bool PropagateUncertainties(fevt::Eye &eye)
utl::CoordinateSystemPtr GetEyeCoordinateSystem() const
Returns the Eye Coordinate system.
Class describing the Atmospheric profile.
int fPropagateGeometryErrors
Top of the hierarchy of the detector description interface.
bool HasFRecShower() const
Check if reconstructed shower info has been allocated.
evt::ShowerFRecData & GetFRecShower()
Reconstructed shower info for this eye.
EyeIterator EyesBegin(const ComponentSelector::Status status)
Triple PointToLatitudeLongitudeHeight(const Point &thePoint) const
Convert Point to Lat/Long/Height.
const atm::ProfileResult & EvaluateDepthVsHeight() const
Tabulated function giving Y=depth as a function of X=height.
const fdet::FDetector & GetFDetector() const
double GetSDPCorrThetaPhi() const
bool GetShowerFRecData(evt::Event &event, fevt::Eye &eye)
bool fAlwaysGuessXMaxFromAperture
void PushBack(const double x, const double xErr, const double y, const double yErr)
#define WARNING(message)
Macro for logging warning messages.
double GetEmEnergy() const
retrieve electromagnetic energy and its uncertainty
void GetData(bool &b) const
Overloads of the GetData member template function.
Top of Fluorescence Detector event hierarchy.
void SetEmEnergy(const double energy, const double energyError, const EUncertaintyType type=eTotal)
void CalculateTotalErrors(fevt::Eye &eye)
const double & GetXErr(const unsigned int idx) const
const oBLAS::lowerTriangularMatrix * GetCherenkovFluorescenceMatrix() const
returns total light matrix (not const as we eventually want to invert it ...)
Eye-specific shower reconstruction data.
double GetNMaxError() const
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
RootCFMatrixOutput * fRootCFMOutput
double GetEmEnergyError(const EUncertaintyType type=eTotal) const
const double & GetY(const unsigned int idx) const
void SetNMax(const double nMax, const double error, const bool isEnergyDeposit=false)
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
const utl::AxialVector & GetSDP() const
double GetTimeFitChiSquare() const
void SetYieldRefit(const bool what)
void SetYieldFactors(const double fluoFac, const double chkovFac)
set yield factors
double GetRpChi0Correlation() const
bool HasGHParameters() const
Base class for exceptions arising because required info not present in the Event. ...
constexpr double kSpeedOfLight
double MinX() const
Return the minimum value for X (ordinate) stored in the profile.
ResultFlag
Flag returned by module methods to the RunController.
void SetEnergyCutoff(const double energy)
double GuessShowerMaximum(evt::Event &event, const fevt::Eye &eye)
utl::TabulatedFunctionErrors & GetLongitudinalProfile()
retrieve longitudinal profile information (size vs depth)
bool Run(fevt::Eye &eye, CherenkovFluorescenceMatrix *const chfl)
utl::TabulatedFunctionErrors & GetFluorescencePhotons()
retrieve number of fluorescence photons versus depth
CherenkovFluorescenceMatrix::eMultipleScatteringLDF fMultScatLDF
~FdProfileReconstructor()
void SetXmaxError(const double xmaxError, const EUncertaintyType type)
std::vector< double > fAtmVariance
Calculation of Cherenkov and Fluorescence matrix.
double EnergyDeposit(const double age, const double enCut)
Parametrization for the average energy deposit per particle.
execption handling for calculation/access for inclined atmosphere model
const double & GetX(const unsigned int idx) const
Interface class to access to Fluorescence reconstruction of a Shower.
Report failure to RunController, causing RunController to terminate execution.
bool CalculateProfiles(fevt::Eye &eye)
void SetCherenkovEnergyCutoff(const double eCut) const
Main configuration utility.
CherenkovFluorescenceMatrix::eFluorescenceLDF fFluoLDF
const atm::ProfileResult & EvaluateHeightVsDepth() const
Tabulated function giving Y=height as a function of X=depth.
utl::TabulatedFunctionErrors & GetLightFlux(const FdConstants::LightSource source=fevt::FdConstants::eTotal)
Light flux at diaphragm, photons/m^2 versus time in ns.
double GetShapeParameterError(const gh::EShapeParameter par) const
Gaisser Hillas with 4 parameters.
void SetTotalEnergy(const double energy, const double energyError, const EUncertaintyType type=eTotal)
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
double GetdEdXmax() const
const atm::ProfileResult & EvaluateSlantDepthVsDistance() const
#define ERROR(message)
Macro for logging error messages.
double FactorVariance(const double eCal, const double eTot)
CherenkovFluorescenceMatrix::eScatteredCherenkovLDF fScatCherLDF
const utl::Point & GetCorePosition() const
Shower core as reconstructed by the FD or FD eye.
void SetUncertaintyBound(const ModelWithUncertainty model, const double nSigma) const
alter Model "model" by "nSigma" standard deviations
bool HasEnergyDeposit() const
utl::Point GetPosition() const
Eye position.
void MakeLightFlux(const FdConstants::LightSource source=FdConstants::eTotal)
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
module to fit Gaisser-Hillas function to energy deposit profile and to derive total shower energy ...
double MaxX() const
Return the maximum value for X (ordinate) stored in the profile.
utl::TabulatedFunctionErrors & GetEnergyDeposit()
retrieve dE/dX
std::map< int, CherenkovFluorescenceMatrix * > fChFlPtrMap
double fInclinedModelMaxCosZenith
utl::InvisibleEnergy::EInteractionModel fInvisibleEnergyModel
bool ReFitProfile(const fevt::Eye &eye, CherenkovFluorescenceMatrix *const chfl)
fevt::EyeRecData & GetRecData()
Reconstructed data for this eye.
double GetSDPThetaError() const
const utl::Vector & GetAxis() const
Shower Axis as reconstructed by the FD or FD eye.