8 #include <boost/lexical_cast.hpp>
10 #include <det/VManager.h>
11 #include <det/Detector.h>
13 #include <fdet/Pixel.h>
14 #include <fdet/Camera.h>
16 #include <fdet/Telescope.h>
17 #include <fdet/FDetector.h>
19 #include <utl/CoordinateSystem.h>
20 #include <utl/AugerException.h>
21 #include <utl/MathConstants.h>
24 #include <fwk/CoordinateSystemRegistry.h>
33 Pixel::Pixel(
const unsigned int eyeId,
const unsigned int telescopeId,
34 const unsigned int pixelId,
35 const std::string& physEyeIdString,
36 const std::string& physTelIdString) :
41 fPixelStatus(
Pixel::eUnknown),
42 fPixelOpticalEfficiencyStatus(
Pixel::eUnknown),
43 fSimulatedEndToEnd(0),
47 fPhysicalEyeIdString(physEyeIdString),
48 fPhysicalTelescopeIdString(physTelIdString),
112 const double pixelVertex = 26.34*
mm;
116 const double fat =
sqrt (
Sqr(rFocal-heightMercedes) -
Sqr(pixelVertex));
121 const double phi_rot = direction.
GetPhi(backCS);
122 const double theta_rot = direction.
GetTheta(backCS);
148 const double refWl = Detector::GetInstance().GetFDetector().GetReferenceLambda();
157 const double refWl = Detector::GetInstance().GetFDetector().GetReferenceLambda();
166 const double refWl = Detector::GetInstance().GetFDetector().GetReferenceLambda();
200 double opticalEfficiencyCorrection = 0;
210 if (wavelength < wavelengthFront) {
218 if (wavelength > wavelengthBack) {
237 if (wavelength < wavelengthFront) {
245 if (wavelength > wavelengthBack) {
282 if (configSignature.empty())
306 "simulated pixel calibration", configSignature);
379 vector<double> tmpSolidAngleList;
380 GetPixelData(tmpSolidAngleList,
"pixelSolidAngle",
"camera",
"PMT solid angle");
392 std::ostringstream err;
393 err <<
"no cloud index present (try with HasCloudFraction())";
410 const float indexToFraction[6] = {
446 const std::string& property,
447 const std::string& component,
448 const std::string& errorMsg,
449 const std::string& extraIndex)
452 if (!requestedData) {
453 requestedData =
new T;
454 GetPixelData(*requestedData, property, component, errorMsg, extraIndex);
456 return *requestedData;
462 const std::string& property,
463 const std::string& component,
464 const std::string& errorMsg,
465 const std::string& extraIndex)
468 const det::VManager& manager = det::Detector::GetInstance().GetFManagerRegister();
473 if (!extraIndex.empty())
474 indexMap[
"signature"] = extraIndex;
477 manager.
GetData(requestedData, property, component, indexMap);
481 std::ostringstream err;
482 err <<
"Did not find requested component for " << errorMsg<<
"; "
493 const std::string& property,
494 const std::string& component,
495 const std::string& errorMsg)
498 if (!requestedData) {
499 requestedData =
new T;
502 return *requestedData;
509 const std::string& property,
510 const std::string& component,
511 const std::string& errorMsg)
514 const det::VManager& manager = det::Detector::GetInstance().GetFManagerRegister();
520 const bool hasCorrectorRing =
522 indexMap[
"correctorId"] = (hasCorrectorRing ?
"large" :
"small");
525 manager.
GetData(requestedData, property, component, indexMap);
530 std::ostringstream err;
531 err <<
"Did not find requested component for " << errorMsg<<
"; "
double GetModelRelativeEfficiency(const double wl) const
Status GetStatus() const
Get the pixel status flag.
utl::Vector GetCameraPixelDirection(const unsigned int pixelId) const
unsigned int GetId() const
By default from 1..440.
const utl::Vector & GetDirection() const
pointing direction of this pixel
constexpr T Sqr(const T &x)
unsigned int GetRow() const
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
utl::CoordinateSystemPtr fCoordinateSystem
ArrayConstReference XBack() const
read-only reference to back of array of X
const T & GetPixelDataDiaphragm(T *&requestedData, const std::string &property, const std::string &component, const std::string &errorMsg) const
const utl::TabulatedFunction & GetEndToEndCalibrationConstant() const
end to end calibration function
double GetElectronicsGain() const
unsigned int GetFirstPixelId() const
double GetTheta(const CoordinateSystemPtr &coordinateSystem) const
zenith (theta) angle in spherical coordinates
void CachePixelCalibrations() const
Cache calibration constants for pixels in one go (minimize DB access)
Class to hold collection (x,y) points and provide interpolation between them.
utl::TabulatedFunction fWavelengthOpticalEfficiencyCorrection
bool HasCloudFraction() const
double GetCosTheta(const CoordinateSystemPtr &coordinateSystem) const
cos of zenith (theta) angle
const std::string & GetConfigSignature(const std::string &module) const
double GetSimulatedEndToEndCalibration(const std::string &configSignature) const
for the simulated end-to-end calibration constant
double GetMeasuredRelativeEfficiency(const double wl) const
Status fPixelOpticalEfficiencyStatus
bool CachePixelCloudData() const
Cache cloud coverage for pixels in one go (minimize DB access)
std::string fPhysicalTelescopeIdString
double GetEndToEndCalibration(const double wavelength) const
multiplication of calA(+drum) constant and optical efficiency correction is returned ...
double GetEndToEndCalibrationAtReferenceWavelength() const
int GetCloudIndex() const
Cloud index in strange units. To access please use GetCloudFraction()
utl::TabulatedFunction fWavelengthCalib
double GetMercedesHeight() const
Height of the Mercedes.
det::ValidityStamp fCloudValidityStamp
Base class for exceptions trying to access non-existing components.
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
std::string fPhysicalEyeIdString
Interface for detector managers.
double GetEndToEndCalibrationConstantAtReferenceWavelength() const
calA(+drum) constant is returned
const Camera & GetCamera() const
Get the Camera object that belongs to the telescope.
unsigned int GetFirstColumn() const
Detector description interface for FDetector-related data.
bool HasCorrectorRing() const
flag for corrector ring presence
std::string fPixelIdString
utl::TabulatedFunction * fQEfficiency
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
double GetSolidAngle() const
The solid angle viewed by this pixel.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
void CachePixelOpticalEfficiencyCorrections() const
Cache optical efficiency corrections for pixels in one go (minimize DB access)
Exception to use in case requested data not found in the database with detailed printout.
utl::CoordinateSystemPtr GetTelescopeCoordinateSystem() const
ArrayConstReference XFront() const
read-only reference to front of array of X
unsigned int GetChannelId() const
const utl::TabulatedFunction & GetQEfficiency() const
Average quantum efficiency as a function of the wavelength.
unsigned int fTelescopeId
static std::string QueryInfoMessage(const Handle &returnData, const std::string &component)
Pixel(const unsigned int eyeId, const unsigned int telescopeId, const unsigned int pixelId, const std::string &physEyeIdString, const std::string &physTelIdString)
const Telescope & GetTelescope(const unsigned int telescopeId) const
Find Telescope by numerical Id.
ArrayConstReference YFront() const
read-only reference to front of array of Y
bool IsValid() const
True if detector time is between start and end validity times.
unsigned int GetLastRow() const
const Telescope & GetTelescope() const
Access the telescope this Pixel belongs to.
fTelescopeId(t.GetTelescopeId())
unsigned int GetChannelId(const unsigned int pixelId) const
const utl::CoordinateSystemPtr & GetPixelCoordinateSystem() const
double * fSimulatedEndToEnd
float GetCloudFraction() const
how much of pixel is obscured by clouds
Detector description interface for Telescope-related data.
ArrayConstReference YBack() const
read-only reference to back of array of Y
unsigned int GetColumn() const
std::map< std::string, std::string > IndexMap
const utl::TabulatedFunction & GetOpticalEfficiencyCorrection() const
optical efficiency correction is returned as a function of wavelength
double GetTimeOffset() const
pixel time offset
double GetSimulatedDiaPhoton2ADC(const std::string &configSignature, const double wavelength) const
const T & GetPixelData(T *&requestedData, const std::string &property, const std::string &component, const std::string &errorMsg, const std::string &extraIndex="") const
double GetRadiusFocal() const
Radius of focal surface of the camera.
double GetDiaPhoton2PEFactor(const double wavelength, const std::string &configSignature="") const
#define ERROR(message)
Macro for logging error messages.
unsigned int GetFirstRow() const
Status
Specifies success or (eventually) various possible failure modes.
Status GetOpticalEfficiencyStatus() const
double GetOpticalEfficiencyCorrectionAtReferenceWavelength() const
optical efficiency correction is returned