1 #include <utl/config.h>
6 #include <adst/RecEvent.h>
8 #include <fwk/CentralConfig.h>
9 #include <fwk/LocalCoordinateSystem.h>
10 #include <fwk/CoordinateSystemRegistry.h>
12 #include <det/VManager.h>
13 #include <det/Detector.h>
14 #include <det/ManagerRegister.h>
16 #include <fdet/FDetector.h>
17 #include <fdet/Pixel.h>
18 #include <fdet/Camera.h>
20 #include <fdet/Telescope.h>
22 #include <sdet/SDetector.h>
23 #include <sdet/Station.h>
25 #include <evt/Event.h>
26 #include <evt/ShowerRecData.h>
27 #include <evt/ShowerSimData.h>
28 #include <evt/ShowerFRecData.h>
29 #include <evt/ShowerSRecData.h>
30 #include <evt/RiseTime1000.h>
32 #include <evt/GaisserHillas4Parameter.h>
33 #include <evt/GaisserHillas6Parameter.h>
35 #include <fevt/FEvent.h>
36 #include <fevt/Header.h>
38 #include <fevt/EyeHeader.h>
39 #include <fevt/EyeRecData.h>
40 #include <fevt/EyeTriggerData.h>
41 #include <fevt/Telescope.h>
42 #include <fevt/TelescopeTriggerData.h>
43 #include <fevt/TelescopeRecData.h>
44 #include <fevt/TelescopeSimData.h>
45 #include <fevt/TelescopeRecData.h>
46 #include <fevt/Pixel.h>
47 #include <fevt/PixelRecData.h>
48 #include <fevt/FdComponentSelector.h>
50 #include <atm/MeasuredDBMieModel.h>
51 #include <atm/GDASProfileModel.h>
52 #include <atm/InclinedAtmosphericProfile.h>
53 #include <atm/ProfileResult.h>
55 #include <utl/Vector.h>
56 #include <utl/Point.h>
57 #include <utl/ReferenceEllipsoid.h>
60 #include <AugerEvent.h>
61 #include <EyeEvent.hh>
62 #include <EyeEventHeader.hh>
79 std::map<int, bool> hasTLT;
82 teliter != eye.
TelescopesEnd(ComponentSelector::eHasData); ++teliter) {
83 const int telID = teliter->GetId();
84 if (teliter->HasTriggerData()) {
88 hasTLT[telID] =
false;
94 std::map<int, std::string>
97 std::map<int, std::string> label;
100 teliter != eye.
TelescopesEnd(ComponentSelector::eHasData); ++teliter) {
101 const int telID = teliter->GetId();
102 if (teliter->HasTriggerData()) {
106 label[telID] =
" --- ";
115 unsigned long long telBits = 0;
116 bool telHasData =
false;
118 teliter != eye.
TelescopesEnd(ComponentSelector::eHasData); ++teliter) {
120 for (
auto iPixel = teliter->PixelsBegin(ComponentSelector::eHasData);
121 iPixel != teliter->PixelsEnd(ComponentSelector::eHasData); ++iPixel) {
122 if (!iPixel->HasRecData())
128 const int bit = teliter->GetId() - 1;
129 telBits += 1ULL << bit;
139 unsigned long long telBits = 0;
142 const int bit = iTel->GetId() - 1;
143 telBits += 1ULL << bit;
149 std::map<UShort_t, Int_t>
152 std::map<UShort_t, Int_t> timeOffset;
154 teliter != eye.
TelescopesEnd(ComponentSelector::eHasData); ++teliter)
155 timeOffset[teliter->GetId()] = teliter->GetTimeOffset();
170 mieModel.
GetData(mieModelName);
173 if (mieModelName ==
"Super" || mieModelName ==
"MeasuredDB") {
175 return measuredMieModel.
HasData();
189 string profileModelName;
190 profileModel.
GetData(profileModelName);
193 if (profileModelName ==
"Super" || profileModelName ==
"GDAS") {
195 return gdasProfileModel.
HasData();
208 const double deltaX = 10*
g/
cm2;
215 if (distVsSlantDepth.
MinX() < x && x < distVsSlantDepth.
MaxX())
216 distance = -distVsSlantDepth.
Y(x);
220 const utl::Point& xPoint = core + distance*axis;
223 const Vector vertical(0, 0, 1, eyeCS);
226 double angle =
Angle((xPoint-eyePos), horizontal);
246 const double deltaX = 10*
g/
cm2;
254 if (distVsSlantDepth.
MinX() < x && x < distVsSlantDepth.
MaxX())
255 distance = -distVsSlantDepth.
Y(x);
259 const utl::Point& xPoint = core + distance*axis;
264 const Vector vertical(0, 0, 1, localCS);
267 double angle =
Angle((xPoint-telPos), horizontal);
283 const vector<double>& edep = recShower.GetEnergyDeposit();
284 const vector<double>& edep_err = recShower.GetEnergyDepositError();
285 const vector<double>& ne = recShower.GetElectrons();
286 const vector<double>& ne_err = recShower.GetElectronsError();
288 const vector<double>& y = edep.empty() ? ne : edep;
289 const vector<double>& ye = edep_err.empty() ? ne_err : edep_err;
297 return std::isnan(chi2) ? 0 : chi2;
304 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
308 const int eyeid = detPixel.
GetEyeId();
309 const int pixelid = detPixel.
GetId();
316 err <<
"Could not find calibration for eye " << eyeid
317 <<
" tel " << telid <<
" pix " << pixelid;
325 warn <<
" bad calibration data for eye " << eyeid
326 <<
" tel " << telid <<
" pix " << pixelid
332 const double bestCalibConst =
335 return bestCalibConst;
AxialVector cross(const Vector &l, const Vector &r)
vector cross product
Status GetStatus() const
Get the pixel status flag.
unsigned int GetId() const
By default from 1..440.
unsigned int GetNPoints() const
Molecular profile taken from GDAS database.
double ConvertXToChi(const double x, const fdet::Eye &detEye, const utl::Point &core, const utl::Vector &axis, const utl::Vector &sdp)
double Angle(const double theta1, const double phi1, const double theta2, const double phi2)
unsigned int GetTelescopeId() const
1..6 for normal FD, 1..3 for HEAT
Fluorescence Detector Eye Event.
const utl::TabulatedFunction & GetEndToEndCalibrationConstant() const
end to end calibration function
double GetCalibrationConstant(const fevt::Pixel &evtpixel)
Fetches the calibration constant for the given pixel.
const Pixel & GetPixel(const fevt::Pixel &eventPixel) const
Get fdet::Pixel from fevt::Channel.
Class to hold collection (x,y) points and provide interpolation between them.
double GetEndToEndCalibrationAtReferenceWavelength() const
Detector description interface for Eye-related data.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Class for computing aerosol scattering and attenuation using database measurements.
Detector description interface for FDetector-related data.
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
Exception for reporting variable out of valid range.
std::string GetTLTLabel() const
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
std::map< int, bool > CalcMirrorTLTMap(const fevt::Eye &eye)
Class representing a document branch.
Reference ellipsoids for UTM transformations.
std::map< int, std::string > CalcMirrorTLTLabelMap(const fevt::Eye &eye)
Fluorescence Detector Pixel event.
utl::CoordinateSystemPtr GetEyeCoordinateSystem() const
Returns the Eye Coordinate system.
Class describing the Atmospheric profile.
TelescopeIterator TelescopesEnd()
first available tel of status eHasData (DEPRECATED)
bool HasData() const
True if a data source is for the given model.
bool HasData() const
Determine if the DB tables are full or if an update is needed.
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
double LinearProfileFitChiSquare(const FdRecShower &recShower)
Calculates the chi2 of a linear fit to the fd profile.
TelescopeIterator TelescopesBegin()
first available tel of status eHasData (DEPRECATED)
Provides translational services for inclined profile.
bool UsingMieAttenuationDatabase()
Returns whether the Mie DB was used for the current event (i.e. current Detector...?)
Detector description interface for Telescope-related data.
double MinX() const
Return the minimum value for X (ordinate) stored in the profile.
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
unsigned long long CalcMirrorsInDAQBitField(const fevt::Eye &eye)
bool UsingGDASProfileDatabase()
Returns whether GDAS data was used for the current event (i.e. current Detector...?)
utl::Point GetPosition() const
execption handling for calculation/access for inclined atmosphere model
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
Description of trigger data for one Telescope.
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.
unsigned long long CalcMirrorsInEventBitField(const fevt::Eye &eye)
const atm::ProfileResult & EvaluateDistanceVsSlantDepth() const
Table of distance as a function of slant depth.
#define ERROR(message)
Macro for logging error messages.
bool IsTLTAccepted() const
unsigned int GetEyeId() const
1..5 (4x normal FD, 1x HEAT)
utl::Point GetPosition() const
Eye position.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
double MaxX() const
Return the maximum value for X (ordinate) stored in the profile.
std::map< UShort_t, Int_t > CalcMirrorTimeOffsetMap(const fevt::Eye &eye)