5 #include <utl/Vector.h>
6 #include <utl/CoordinateSystemPtr.h>
7 #include <utl/Transformation.h>
8 #include <utl/TimeInterval.h>
9 #include <utl/AugerUnits.h>
10 #include <utl/PhysicalConstants.h>
11 #include <utl/TabulatedFunctionErrors.h>
13 #include <fevt/FEvent.h>
15 #include <fevt/EyeRecData.h>
16 #include <fevt/EyeHeader.h>
17 #include <fevt/Pixel.h>
19 #include <fevt/Telescope.h>
20 #include <fevt/TelescopeRecData.h>
22 #include <det/Detector.h>
23 #include <fdet/FDetector.h>
25 #include <fdet/Pixel.h>
27 #include <fwk/LocalCoordinateSystem.h>
28 #include <fwk/CentralConfig.h>
34 #include "../../General/RecDataWriterNG/ConversionUtil.h"
38 #define PCGF_DEBUGLOG(x) { cerr << "DEBUGLOG " << x << endl;}
45 namespace FdProfileConstrainedGeometryFitPG {
54 fApLightMethod = (apLightOption==
"eExternal") ?
56 (apLightOption==
"eInternal")?
57 eInternal : eCallForEach;
70 topBranch.
GetChild(
"emissionPointCorrection").
GetData(fEmissionPointCorrection);
73 "\t apLightMethod is " << apLightOption <<
"\n"
74 "\t checkUnderground is " << (fCheckUnderground?
"on":
"off") <<
"\n"
75 "\t prescan is " << (fPrescan?
"on":
"off") <<
"\n"
76 "\t scanOnly is " << (fScanOnly?
"on":
"off") <<
"\n"
77 "\t scanStep: " << fScanStep/
degree <<
" deg\n"
78 "\t scanStart: " << fScanStart/
degree <<
" deg\n"
79 "\t scanStop: " << fScanStop/
degree <<
" deg\n"
80 "\t delZeroLightFlux is " << (fDelZeroFlux?
"on":
"off") <<
"\n"
81 "\t useLightFlux is " << (fUseLightFlux?
"on":
"off") <<
"\n"
82 "\t skipNegativeT0 is " << (fSkipNegativeT0?
"on":
"off") <<
"\n"
83 "\t emissionPointCorrection is " << (fEmissionPointCorrection?
"on":
"off") <<
"\n"
84 "\t TimeFitModel is " << (fRealAtm?
"RealisticAtm":
"VacuumAtm") <<
"\n"
85 "\t TimeFitDeexcitation is " << (fDeex?
"on":
"off") <<
"\n";
89 if (fApLightMethod == eCallForEach) {
90 fApertureLightFinder.Init();
92 }
else if (fApLightMethod == eInternal) {
98 fProfileFit.SetUseLightFlux(fUseLightFlux);
104 PCGFitter::Underground(
const double chi0,
const double rp,
const Eye &eye)
106 if (!fCheckUnderground)
111 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
116 const Vector vertical(0,0,1, telCS);
119 const Transformation rot = Transformation::Rotation(-chi0, sdp, telCS);
122 const double coreDistance = rp / sin(chi0);
123 const Vector coreTelVec = coreDistance * horizontalInSDP;
124 const Point core = telPos + coreTelVec;
129 int telId = pix->GetTelescopeId();
136 const Point core_in_curtel = core-axis*core.
GetZ(curtelCS)/cos(axis.
GetTheta(curtelCS));
138 const Vector curtel_to_core = core_in_curtel-curtelPos;
139 double chi0_in_curtel =
Angle(curtel_to_core, axis);
141 chi0_in_curtel = -(
kPi-chi0_in_curtel);
145 const Vector vertical_in_curtel(0,0,1, curtelCS);
148 const Vector pixelDirection = curTel.
GetPixel(pix->GetId()).GetDirection();
149 const Vector pixelDirInSDP = pixelDirection - (SDP_in_curtel * pixelDirection)*SDP_in_curtel;
150 const double chii =
Angle(pixelDirInSDP, horizontalInSDP_in_curtel);
156 if (sin(chi0_in_curtel - chii) < 0) {
167 PCGFitter::operator()(
const vector<double>& par)
169 const double chi0 = par[0];
175 const double chi2 = CombinedChi2(chi0, rp, rpErr, t0, t0Err,
PCGFData::eFit,
true);
181 PCGFitter::CombinedChi2(
const double chi0,
double &rp,
double &rpErr,
double &t0,
double &t0Err,
185 const Eye& eye = (*fEye);
188 if (fabs(chi0-180*
deg) < 1e-4*
deg || fabs(chi0+180*
deg) < 1e-4*
deg || fabs(chi0-0*
deg) < 1e-4*
deg || fabs(chi0-360*
deg) < 1e-4*
deg)
189 return numeric_limits<double>::infinity();
193 chi0reg(chi0, chi2timing, rp, t0);
195 if (fSkipNegativeT0 && (t0 < 0))
196 return numeric_limits<double>::infinity();
199 cout <<
"Chi0: " << chi0/
degree <<
"\t"
200 "Rp: " << rp/
m <<
"\t"
201 "T0: " << t0/
ns <<
"\t "
202 "Chi^2_t: " << chi2timing <<
"\n";
205 if (Underground(chi0, rp, eye))
206 return numeric_limits<double>::infinity();
209 Eye& eyeCopy = CopyEye(eye, eventCopy);
211 FillParams(eyeCopy, chi0, rp, t0);
212 if (!AdjustGeometry(eyeCopy)) {
214 return numeric_limits<double>::infinity();
217 if (fApLightMethod == eCallForEach) {
218 const bool haveLight =
221 return numeric_limits<double>::infinity();
227 vector<double> phX, phXerr, phY, phYerr;
228 vector<double> bgX, bgXerr, bgY, bgYerr;
229 for (
unsigned int i = 0; i < photonTrace.
GetNPoints(); ++i) {
230 if ((photonTrace.
GetY(i)-photonTrace.
GetYErr(i)) > 0.) {
231 phX.push_back(photonTrace.
GetX(i));
232 phXerr.push_back(photonTrace.
GetXErr(i));
233 phY.push_back(photonTrace.
GetY(i));
234 phYerr.push_back(photonTrace.
GetYErr(i));
235 bgX.push_back(bgTrace.
GetX(i));
236 bgXerr.push_back(bgTrace.
GetXErr(i));
237 bgY.push_back(bgTrace.
GetY(i));
238 bgYerr.push_back(bgTrace.
GetYErr(i));
243 for (
unsigned int i = 0; i < phX.size(); ++i) {
244 photonTrace.
PushBack(phX[i], phXerr[i], phY[i], phYerr[i]);
245 bgTrace.
PushBack(bgX[i], bgXerr[i], bgY[i], bgYerr[i]);
252 if (!telIter->HasRecData())
continue;
257 vector<double> phX, phXerr, phY, phYerr;
258 vector<double> bgX, bgXerr, bgY, bgYerr;
259 for (
unsigned int i = 0; i < photonTrace.
GetNPoints(); ++i) {
260 if (photonTrace.
GetY(i)-photonTrace.
GetYErr(i) > 0.) {
261 phX.push_back(photonTrace.
GetX(i));
262 phXerr.push_back(photonTrace.
GetXErr(i));
263 phY.push_back(photonTrace.
GetY(i));
264 phYerr.push_back(photonTrace.
GetYErr(i));
265 bgX.push_back(bgTrace.
GetX(i));
266 bgXerr.push_back(bgTrace.
GetXErr(i));
267 bgY.push_back(bgTrace.
GetY(i));
268 bgYerr.push_back(bgTrace.
GetYErr(i));
273 for (
unsigned int i = 0; i < phX.size(); ++i) {
274 photonTrace.
PushBack(phX[i], phXerr[i], phY[i], phYerr[i]);
275 bgTrace.
PushBack(bgX[i], bgXerr[i], bgY[i], bgYerr[i]);
282 Eye& eyeCopy2 = CopyEye(eyeCopy, eventCopy2);
283 if (std::isfinite(fProfileFit(eyeCopy2, fPrecise))) {
285 chi0reg(chi0, chi2timing, rp, rpErr, t0, t0Err, Xmax);
287 FillParams(eyeCopy, chi0, rp, t0);
288 if (!AdjustGeometry(eyeCopy)) {
289 return numeric_limits<double>::infinity();
293 const double chi2profile = fProfileFit(eyeCopy, fPrecise);
294 const double constraint1 = fProfileFit.GetShapeConstraint1Chi2();
295 const double constraint2 = fProfileFit.GetShapeConstraint2Chi2();
296 const double constraint3 = fProfileFit.GetShapeConstraint3Chi2();
298 cout <<
"Chi^2_prof: " << chi2profile <<
", including constraints 1/2/3: " << constraint1 <<
"/" << constraint2 <<
"/" << constraint3 <<
'\n';
299 if (fEmissionPointCorrection)
300 cout <<
"Chi^2_time after emission point correction: " << chi2timing <<
'\n';
303 map<string, double> mapchi2;
304 mapchi2[
"time"] = chi2timing;
305 mapchi2[
"prof"] = chi2profile-constraint1-constraint2-constraint3;
306 mapchi2[
"constraint1"] = constraint1;
307 mapchi2[
"constraint2"] = constraint2;
308 mapchi2[
"constraint3"] = constraint3;
309 map<string, double> mapNDof;
310 mapNDof[
"time"] = chi0reg.
GetNDof();
311 mapNDof[
"prof"] = fProfileFit.GetNDof();
312 mapNDof[
"constraint1"] = 1;
313 mapNDof[
"constraint2"] = 1;
314 mapNDof[
"constraint3"] = 1;
315 fPCGFData.push_back(
PCGFData(chi0, rp, t0, status, mapchi2, mapNDof));
317 return chi2profile+chi2timing;
327 fProfileFit.SetFitterPars();
334 const double t0 = eyeRecData.
GetTZero();
336 const double rp = eyeRecData.
GetRp();
338 map<string, double> mapchi2;
340 map<string, double> mapNDof;
348 fPCGFData.push_back(
PCGFData(chi0, rp, t0, PCGFData::ePreFit, mapchi2, mapNDof));
356 chi0reg.
SetRealAtm(fRealAtm, fDeex, fEmissionPointCorrection);
357 fChi0Regression = &chi0reg;
367 Eye& eyeCopy1 = CopyEye(eye, eventCopy1);
369 if (fApLightMethod == eInternal) {
370 fApLight.SetStripMode(
true);
373 fProfileFit.UnSetFitterPars();
380 double from=fScanStart, to=fScanStop;
381 if ((fPrescan?(!Prescan(fScanStep, from, to)):
false)
382 || !ScanChi0(eyeCopy1, fScanStep, from, to)) {
383 fProfileFit.UnSetFitterPars();
389 chi0Par.
fValue = startchi0;
390 chi0Par.
fStep = 0.5*fScanStep;
395 double chi0 = startchi0;
396 double chi0Err = fScanStep;
404 Eye& eyeCopy2 = CopyEye(eye, eventCopy2);
406 if (fApLightMethod == eInternal) {
407 CombinedChi2(chi0, rp, rpErr, t0, t0Err, PCGFData::eScan,
false);
408 FillParams(eyeCopy2, chi0, rp, t0);
409 if (!AdjustGeometry(eyeCopy2)) {
410 fProfileFit.UnSetFitterPars();
413 fApLight.SetStripMode(
false);
416 fProfileFit.UnSetFitterPars();
426 ERROR (
"MIGRAD failed.");
427 fProfileFit.UnSetFitterPars();
431 const auto result = min.GetParameterAndError(0);
436 if (!ScanChi0(eyeCopy2, fScanStep/10., startchi0-3*fScanStep, startchi0+3*fScanStep, 1)) {
437 fProfileFit.UnSetFitterPars();
444 if (std::isnan(chi0Err) || chi0Err > 180*
degree
446 cerr <<
"FIT RESULT:\n\tchi0 = (" << chi0 /
degree
447 <<
" +/- " << chi0Err /
degree <<
") degree\n";
448 ERROR (
"Fit result not regarded sane.");
449 fProfileFit.UnSetFitterPars();
453 CombinedChi2(chi0, rp, rpErr, t0, t0Err, PCGFData::eFinal,
true);
456 info <<
"FIT RESULT:\n\tchi0 = (" << chi0 /
degree
457 <<
" +/- " << chi0Err /
degree <<
") degree\n"
458 <<
"\trp = ( " << rp /
km
459 <<
" +/- " << rpErr/
km <<
" ) km\n"
464 FillParams(eye, chi0, chi0Err, rp, rpErr, t0, t0Err);
469 CombinedChi2(chi0, rp, rpErr, t0, t0Err, PCGFData::eFinal,
true);
472 eyeRecWrite.
SetPCGF(fPCGFData);
475 fProfileFit.UnSetFitterPars();
482 PCGFitter::Prescan(
const double step,
double &from,
double &to){
484 const double bigstep=4*step;
485 const double inf = numeric_limits<double>::infinity();
487 double rp=0, t0=0, rpErr=0, t0Err=0;
488 for (;; from+=bigstep) {
490 PCGF_DEBUGLOG(
"Pescan failed leave: All profile fits failed.");
494 if (CombinedChi2(from, rp, rpErr, t0, t0Err, PCGFData::eScan,
true) < inf) {
501 for (;; to-=bigstep) {
503 PCGF_DEBUGLOG(
"Pescan failed leave: All profile fits failed backwards. This should not happen.");
507 if (CombinedChi2(to, rp, rpErr, t0, t0Err, PCGFData::eScan,
true) < inf) {
512 PCGF_DEBUGLOG(
"Prescan: chi^2 finite for chi0 from : "<< from <<
"\t to: " << to);
521 PCGFitter::ScanChi0(
Eye &eye,
const double step,
double from,
double to,
int level)
523 const double inf = numeric_limits<double>::infinity();
532 vector<double> chi0s;
533 vector<double> chi2s;
537 for (
double chi0 = from; chi0 <= to; chi0 += step) {
538 double rp = 0, rpErr = 0;
539 double t0 = 0, t0Err = 0;
540 double chi2 = CombinedChi2(chi0, rp, rpErr, t0, t0Err, PCGFData::eScan,
true);
542 chi0s.push_back(chi0);
543 chi2s.push_back(chi2);
548 unsigned int min_i = TMath::LocMin(chi2s.size(), &chi2s[0]);
550 PCGF_DEBUGLOG(
"ScanChi0: min i:" << min_i <<
"\t size: " << chi2s.size());
553 if (!(chi2s[min_i] < inf)) {
554 PCGF_DEBUGLOG(
"ScanChi0 failed leave: All profile fits failed.");
558 if (level > 0 && level < 10) {
561 return ScanChi0(eye, fScanStep/10., chi0s[min_i]-3*fScanStep, chi0s[min_i]+4*fScanStep/10., level+1);
562 }
else if (min_i == chi2s.size()-1) {
563 return ScanChi0(eye, fScanStep/10., chi0s[min_i]-4*fScanStep/10., chi0s[min_i]+3*fScanStep, level+1);
588 vector<double> chi2s_copy(chi2s);
589 chi2s_copy[0] = tooMuch;
590 chi2s_copy[chi2s_copy.size()-1] = tooMuch;
591 min_i = TMath::LocMin(chi2s_copy.size(), &chi2s_copy[0]);
593 while (level>0 && chi2s_copy[min_i] < tooMuch) {
594 vector<double> chi2s_trial(chi2s_copy);
595 chi2s_trial[min_i] = tooMuch;
596 int min_i_trial1 = TMath::LocMin(chi2s_trial.size(), &chi2s_trial[0]);
597 chi2s_trial[min_i_trial1] = tooMuch;
598 int min_i_trial2 = TMath::LocMin(chi2s_trial.size(), &chi2s_trial[0]);
599 chi2s_trial[min_i_trial2] = tooMuch;
600 if ((chi2s_trial[min_i-1] == tooMuch) && (chi2s_trial[min_i+1] == tooMuch)) {
603 chi2s_copy[min_i] = tooMuch;
604 min_i = TMath::LocMin(chi2s_copy.size(), &chi2s_copy[0]);
608 if (!(chi2s_copy[min_i] < tooMuch)) {
614 double xmin = chi0s[min_i];
615 double ymin = chi2s[min_i];
622 for (
unsigned int i = 1; i < 5; ++i) {
624 unsigned int k = min_i+i;
625 if ((j > 0) && std::isfinite(chi2s[j]) && (chi2s[j] != tooMuch)) {
626 x.push_back(
abs(chi0s[j]-xmin));
627 y.push_back(((chi2s[j]-ymin)>0.) ?
sqrt(chi2s[j]-ymin) : 0.);
631 if ((k < chi0s.size()) && std::isfinite(chi2s[k]) && (chi2s[k] != tooMuch)) {
632 x.push_back(
abs(chi0s[k]-xmin));
633 y.push_back(((chi2s[k]-ymin)>0.) ?
sqrt(chi2s[k]-ymin) : 0.);
642 double chi0err = (b!=0) ? (1./b) : 90*
deg;
647 cout <<
"calculating result geometry\n";
654 cout <<
"chi0: " << chi0s[min_i]/
degree <<
" deg "
655 "rp: " << rps[min_i] /
meter <<
" m "
679 PCGFitter::FillParams(
Eye& eyeCopy,
680 const double chi0,
const double chi0Err,
681 const double rp,
const double rpErr,
682 const double t0,
const double t0Err)
692 telRecData.
SetRp(rp,rpErr);
700 PCGFitter::FillParams(
Eye& eyeCopy,
711 PCGFitter::AdjustGeometry(
Eye& eyeCopy)
716 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
729 const double rp = telRecData.
GetRp();
737 const double sdpPhi = telRecData.
GetSDP().
GetPhi(telCS);
739 const Vector sdp =
Vector(1, sdpTheta, sdpPhi, telCS, Vector::kSpherical);
740 const Vector vertical(0,0,1, telCS);
743 const Transformation rot = Transformation::Rotation(-chi0, sdp, telCS);
746 const double coreDistance = rp / sin(chi0);
747 const Vector coreTelVec = coreDistance * horizontalInSDP;
748 const Point core = telPos + coreTelVec;
757 const int curtelId = detTelIt->GetId();
759 const Point curtelPos = detTelIt->GetPosition();
762 const Point core_in_curtel = core-axis*core.
GetZ(curtelCS)/cos(axis.
GetTheta(curtelCS));
764 const Vector curtel_to_core = core_in_curtel-curtelPos;
765 double chi0_in_curtel =
Angle(curtel_to_core, axis);
767 chi0_in_curtel = -(
kPi-chi0_in_curtel);
769 double rp_in_curtel = curtel_to_core.GetMag()*sin(chi0_in_curtel);
775 const Vector Pt_to_Pct = P_in_curtel - P_in_tel;
776 const double t0_in_curtel = t0 + ((Pt_to_Pct*axis > 0.) ? -1. : 1.)*Pt_to_Pct.
GetMag()/
kSpeedOfLight;
785 telRecData.
SetSDP(SDP_in_curtel);
786 telRecData.
SetChiZero(chi0_in_curtel, chi0Err);
787 telRecData.
SetTZero(t0_in_curtel, t0Err);
788 telRecData.
SetRp(rp_in_curtel, rpErr);
795 if ((curtelPos - eyePos).GetMag() < 1e-3) {
796 eyeRecData.
SetChiZero(chi0_in_curtel, chi0Err);
797 eyeRecData.
SetTZero(t0_in_curtel, t0Err);
798 eyeRecData.
SetRp(rp_in_curtel, rpErr);
799 eyeRecData.
SetSDP(SDP_in_curtel);
805 double tCore = t0_in_curtel;
806 tCore -= (rp_in_curtel / tan(chi0_in_curtel)) /
kSpeedOfLight;
821 unsigned int telId = pixelIter->GetTelescopeId();
824 const Point telPos = det::Detector::GetInstance().GetFDetector().GetEye(eyeCopy).GetTelescope(telId).GetPosition();
827 const double sdpPhi = telRecData.
GetSDP().
GetPhi(telCS);
829 const Vector sdp =
Vector(1, sdpTheta, sdpPhi, telCS, Vector::kSpherical);
830 const Vector vertical(0,0,1, telCS);
834 const Vector pixelDirInSDP = pixelDirection - (sdp * pixelDirection)*sdp;
835 const double pixelChi =
Angle(pixelDirInSDP, horizontalInSDP);
837 pixelIter->GetRecData().SetChi_i(pixelChi);
Telescope & GetTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Telescope by Id, throw exception if not existent.
AxialVector Cross(const Vector &l, const Vector &r)
unsigned int GetId() const
const utl::Vector & GetDirection() const
pointing direction of this pixel
unsigned int GetNPoints() const
void SetChiZero(const double chiZero, const double error)
bool HasLightFlux(const FdConstants::LightSource source=FdConstants::eTotal) const
Check that light profile for source /par source is present.
double Angle(const double theta1, const double phi1, const double theta2, const double phi2)
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
Report success to RunController.
fevt::EyeHeader & GetHeader()
Header for this Eye Event.
Fluorescence Detector Eye Event.
PixelIterator PulsedPixelsEnd()
void SetPCGF(const std::vector< PCGFData > &pcgf)
const Pixel & GetPixel(const fevt::Pixel &eventPixel) const
Get fdet::Pixel from fevt::Channel.
double GetRpError() const
double GetTheta(const CoordinateSystemPtr &coordinateSystem) const
zenith (theta) angle in spherical coordinates
double GetChiZero() const
void SetUseLightFlux(bool use=true)
void SetCorePosition(const utl::Point &core)
unsigned int GetTimeFitNDof() const
void SetTimeFitCorrelations(double rRpT0, double rRpChi0, double rChi0T0)
#define INFO(message)
Macro for logging informational messages.
void MakeEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
void SetRp(const double rp, const double error)
void Init()
Initialise the registry.
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
Detector description interface for Eye-related data.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
fevt::TelescopeRecData & GetRecData()
Reconstructed data for this telescope.
PixelIterator PulsedPixelsBegin()
int Migrad(const int n=500)
void SetRealAtm(bool realAtm, bool deex, bool emissionPointCorrection)
Detector description interface for FDetector-related data.
A TimeStamp holds GPS second and nanosecond for some event.
boost::indirect_iterator< ConstInternalPixelIterator, const Pixel & > ConstPixelIterator
Const iterator over pixels used in reconstruction.
Exception for reporting variable out of valid range.
const Pixel & GetPixel(const unsigned int pixelId) const
Get Pixel by id, throw utl::NonExistentComponentException if n.a.
void SetSDP(const utl::AxialVector &vec)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
utl::TabulatedFunctionErrors & GetLightFlux(const FdConstants::LightSource source=fevt::FdConstants::eTotal)
Light flux at diaphragm, photons/m^2 versus time in ns.
Class representing a document branch.
const double & GetYErr(const unsigned int idx) const
void SetCoreTime(const utl::TimeStamp &coreTime, const utl::TimeInterval &coreTimeErr)
TelescopeIterator TelescopesEnd()
first available tel of status eHasData (DEPRECATED)
bool HasLightFlux(const FdConstants::LightSource source=FdConstants::eTotal) const
Check that light profile for source /par source is present.
TelescopeIterator TelescopesBegin() const
Beginning of the collection of telescopes.
void SetAxis(const utl::Vector &axis)
double abs(const SVector< n, T > &v)
const Telescope & GetTelescope(const unsigned int telescopeId) const
Find Telescope by numerical Id.
evt::ShowerFRecData & GetFRecShower()
Reconstructed shower info for this eye.
double GetChiZeroError() const
void SetChiZero(const double chiZero, const double error)
Telescope-specific shower reconstruction data.
boost::filter_iterator< ComponentSelector, AllTelescopeIterator > TelescopeIterator
selective Telescope iterators
void PushBack(const double x, const double xErr, const double y, const double yErr)
void GetData(bool &b) const
Overloads of the GetData member template function.
const double & GetXErr(const unsigned int idx) const
Eye-specific shower reconstruction data.
AxialVector Normalized(const AxialVector &v)
Eye & GetEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
return Eye by id
TelescopeIterator TelescopesBegin()
first available tel of status eHasData (DEPRECATED)
const double & GetY(const unsigned int idx) const
double GetTimeFitChiSquare() const
boost::filter_iterator< TelIsCommissioned, InternalConstTelescopeIterator > TelescopeIterator
An iterator over telescopes.
fevt::FEvent & GetFEvent()
boost::indirect_iterator< InternalPixelIterator, fevt::Pixel & > PixelIterator
Iterator over pixels used in reconstruction.
constexpr double kSpeedOfLight
Detector description interface for Telescope-related data.
A TimeInterval is used to represent time elapsed between two events.
void SetTZero(const double tzero, const double error)
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
bool HasTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData) const
Check if the telescope is in the event.
unsigned int GetNDof() const
utl::Point GetPosition() const
void SetTimeFitChiSquare(const double tfitChi2, const unsigned int ndof)
PixelIterator TimeFitPixelsEnd()
constexpr double kilometer
const double & GetX(const unsigned int idx) const
Interface class to access to Fluorescence reconstruction of a Shower.
void SetRp(const double rp, const double error)
TelescopeIterator TelescopesEnd() const
End of the collection of telescopes.
void SetSDP(const utl::AxialVector &vec)
void SetTZero(const double tzero, const double error)
Fluorescence Detector Telescope Event.
utl::TabulatedFunctionErrors & GetLightFlux(const FdConstants::LightSource source=fevt::FdConstants::eTotal)
Light flux at diaphragm, photons/m^2 versus time in ns.
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
double GetChiZero() const
void LinearFit(const vector< double > &x, const vector< double > &y, const vector< double > &ey, double &a0, double &a1, double &chi2)
Do a linear fit and return coefficients and chi2.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
const utl::AxialVector & GetSDP() const
PixelIterator TimeFitPixelsBegin()
#define ERROR(message)
Macro for logging error messages.
constexpr double microsecond
const utl::Point & GetCorePosition() const
Shower core as reconstructed by the FD or FD eye.
double GetTZeroError() const
const std::string & GetMessage() const
Retrieve the message from the exception.
utl::Point GetPosition() const
Eye position.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
fevt::EyeRecData & GetRecData()
Reconstructed data for this eye.
const utl::Vector & GetAxis() const
Shower Axis as reconstructed by the FD or FD eye.