#ifndef _evt_ShowerRRecData_h_ #define _evt_ShowerRRecData_h_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BeamMap.h" #include "BeamQuantities.h" #include #include #include "TF1.h" #include "TVector3.h" #include "TFitResult.h" namespace evt { class ShowerRecData; /** \class ShowerRRecData ShowerRRecData.h "evt/ShowerRRecData.h" \brief Interface class to access to the RD Reconstruction of a Shower \author Harm \date 23 - Jul - 2009 \version $Id$ \ingroup shower */ class ShowerRRecData { public: // Parameters Storage double GetParameter(const revt::ShowerRRecDataQuantities eIndex) const { return fShowerQuantities.GetParameter(eIndex); } double GetParameterError(const revt::ShowerRRecDataQuantities eIndex) const { return std::sqrt(fShowerQuantities.GetParameterCovariance(eIndex, eIndex)); } double GetParameterCovariance(const revt::ShowerRRecDataQuantities eIndex1, const revt::ShowerRRecDataQuantities eIndex2) const { return fShowerQuantities.GetParameterCovariance(eIndex1, eIndex2); } bool HasParameter(const revt::ShowerRRecDataQuantities eIndex) const { return fShowerQuantities.HasParameter(eIndex); } bool HasParameterCovariance(const revt::ShowerRRecDataQuantities eIndex1, const revt::ShowerRRecDataQuantities eIndex2) const { return fShowerQuantities.HasParameterCovariance(eIndex1, eIndex2); } bool HasParameterError(const revt::ShowerRRecDataQuantities eIndex) const { return fShowerQuantities.HasParameterCovariance(eIndex, eIndex); } void SetParameter(const revt::ShowerRRecDataQuantities eIndex, const double value) { fShowerQuantities.SetParameter(eIndex, value); } void SetParameterError(const revt::ShowerRRecDataQuantities eIndex, const double value) { fShowerQuantities.SetParameterCovariance(eIndex, eIndex, value * value); } void SetParameterCovariance(const revt::ShowerRRecDataQuantities eIndex1, const revt::ShowerRRecDataQuantities eIndex2, const double value) { fShowerQuantities.SetParameterCovariance(eIndex1, eIndex2, value); } void DeleteParameter(const revt::ShowerRRecDataQuantities eIndex1) { fShowerQuantities.DeleteParameter(eIndex1); } void DeleteParameterCovariance(const revt::ShowerRRecDataQuantities eIndex1, const revt::ShowerRRecDataQuantities eIndex2) { fShowerQuantities.DeleteParameterCovariance(eIndex1, eIndex2); } std::vector GetEnumVector() const { return fShowerQuantities.GetEnumVector(); } std::vector > GetCovarianceEnumVector() const { return fShowerQuantities.GetCovarianceEnumVector(); } void SetRdLDF(const std::vector& ldf) { fRdLDF = ldf; } const std::vector& GetRdLDF() const { return fRdLDF; } void SetRdLDFFitResult(const std::vector& fitresult) { fRdLDFFitResult = fitresult; } const std::vector& GetRdLDFFitResult() const { return fRdLDFFitResult; } void Set2dLDFFitResult(const TFitResult& ldf) { f2dLDFFitResult = ldf; } const TFitResult& Get2dLDFFitResult() const { return f2dLDFFitResult; } void SetScintLDF(const TF1& ldf) { fScintLDF = ldf; } const TF1& GetScintLDF() const { return fScintLDF; } /// returns the radius (from the spherical wave fit) double GetRadius() const; /// returns the error of the radius (from the spherical wave fit) double GetRadiusError() const; /// returns the azimuth angle (from the wave fit) double GetAzimuth() const; /// returns the error of the azimuth angle (from the wave fit) double GetAzimuthError() const; /// returns the zenith angle (from the wave fit) double GetZenith() const; /// returns the error of the zenith angle (from the wave fit) double GetZenithError() const; /// returns the azimuth angle (from the pre wave fit -> on voltage level) double GetAzimuthPreFit() const; /// returns the error of the azimuth angle (from the pre wave fit -> on voltage level) double GetAzimuthPreFitError() const; /// returns the zenith angle (from the pre wave fit -> on voltage level) double GetZenithPreFit() const; /// returns the error of the zenith angle (from the pre wave fit -> on voltage level) double GetZenithPreFitError() const; utl::Point GetCoordinateOrigin() const { const utl::CoordinateSystemPtr referenceCS = det::Detector::GetInstance().GetReferenceCoordinateSystem(); if (HasParameter(revt::eCoordinateOriginX) && HasParameter(revt::eCoordinateOriginY) && HasParameter(revt::eCoordinateOriginZ)) { return utl::Point(GetParameter(revt::eCoordinateOriginX), GetParameter(revt::eCoordinateOriginY), GetParameter(revt::eCoordinateOriginZ), referenceCS); } else { WARNING("ShowerRRecData::GetCoordinateOrigin(): Parameter eCoordinateOrigin was not set. Throwing exception..."); throw utl::NonExistentComponentException("Tried to get an unset parameter (eCoordinateOriginX/Y/Z) from ParameterStorage."); } } utl::Point GetCorePosition() const { const utl::CoordinateSystemPtr referenceCS = det::Detector::GetInstance().GetReferenceCoordinateSystem(); if (HasParameter(revt::eCoreX) && HasParameter(revt::eCoreY) && HasParameter(revt::eCoreZ)) { return utl::Point(GetParameter(revt::eCoreX), GetParameter(revt::eCoreY), GetParameter(revt::eCoreZ), referenceCS); } else { WARNING("ShowerRRecData::GetCorePosition(): Parameter eCore was not set. Throwing exception..."); throw utl::NonExistentComponentException("Tried to get an unset parameter (eCoreX/Y/Z) from ParameterStorage."); } } utl::Vector GetAxis() const { const utl::CoordinateSystemPtr fgLocalCS = fwk::LocalCoordinateSystem::Create(GetCoordinateOrigin()); if (HasParameter(revt::eShowerAxisX) && HasParameter(revt::eShowerAxisY) && HasParameter(revt::eShowerAxisZ)) { return utl::Vector(GetParameter(revt::eShowerAxisX), GetParameter(revt::eShowerAxisY), GetParameter(revt::eShowerAxisZ), fgLocalCS); } else { WARNING("ShowerRRecData::GetAxis(): Parameter eShowerAxis was not set. Throwing exception..."); throw utl::NonExistentComponentException("Tried to get an unset parameter (eShowerAxisX/Y/Z) from ParameterStorage."); } } /// returns the magnetic field vector from the components stored in the parameter storage utl::Vector GetMagneticFieldVector() const { const utl::CoordinateSystemPtr fgLocalCS = fwk::LocalCoordinateSystem::Create(GetCoordinateOrigin()); if (HasParameter(revt::eMagneticFieldVectorX) && HasParameter(revt::eMagneticFieldVectorY) && HasParameter(revt::eMagneticFieldVectorZ)) { return utl::Vector(GetParameter(revt::eMagneticFieldVectorX), GetParameter(revt::eMagneticFieldVectorY), GetParameter(revt::eMagneticFieldVectorZ), fgLocalCS); } else { WARNING("ShowerRRecData::GetMagneticFieldVector(): Parameter eMagneticFieldVector was not set. Throwing exception..."); throw utl::NonExistentComponentException("Tried to get an unset parameter (eMagneticFieldVectorX/Y/Z) from ParameterStorage."); } } /// returns the reference direction which has been set in the event initializer /// if the reference direction has been set to radio, the current radio shower axis is returned utl::Vector GetReferenceDirection() const { if (fReferenceDirectionIsRD) { return GetAxis(); } else { return fReferenceDirection; } } /// returns the reference core position which has been set in the event initializer /// if the reference core position has been set to radio, the current radio core position is returned utl::Point GetReferenceCorePosition() const { if (fReferenceCorePositionIsRD) { return GetCorePosition(); } else { return fReferenceCorePosition; } } void SetReferenceDirection(const utl::Vector& direction) { fReferenceDirection = direction; fReferenceDirectionIsRD = false; } void SetReferenceCorePosition(const utl::Point& core) { fReferenceCorePosition = core; fReferenceCorePositionIsRD = false; } /******************************************************************* */ /* Beam quantities */ /******************************************************************* */ bool HasCurrentBeamMap() const { return !fBeamMaps.empty(); } BeamMap& GetCurrentBeamMap() { return fBeamMaps.back(); } void AddBeamMap(const BeamMap& m) { fBeamMaps.push_back(m); } bool HasBeamResultQuantities() const { return fBeamResultQuantities; } bool HasBeamResultCCTrace() const { return fBeamResultCCTrace; } bool HasBeamResultPowerTrace() const { return fBeamResultPowerTrace; } bool HasBeamResultXTrace() const { return fBeamResultXTrace; } const BeamQuantities& GetBeamResultQuantities() const { return *fBeamResultQuantities; } const utl::TraceD& GetBeamResultCCTrace() const { return *fBeamResultCCTrace; } const utl::TraceD& GetBeamResultPowerTrace() const { return *fBeamResultPowerTrace; } const utl::TraceD& GetBeamResultXTrace() const { return *fBeamResultXTrace; } void SetBeamResultQuantities(const BeamQuantities& quants) { if (fBeamResultQuantities) *fBeamResultQuantities = quants; else fBeamResultQuantities = new BeamQuantities(quants); } void SetBeamResultCCTrace(const utl::TraceD& trace) { if (fBeamResultCCTrace) *fBeamResultCCTrace = trace; else fBeamResultCCTrace = new utl::TraceD(trace); } void SetBeamResultPowerTrace(const utl::TraceD& trace) { if (fBeamResultPowerTrace) *fBeamResultPowerTrace = trace; else fBeamResultPowerTrace = new utl::TraceD(trace); } void SetBeamResultXTrace(const utl::TraceD& trace) { if (fBeamResultXTrace) *fBeamResultXTrace = trace; else fBeamResultXTrace = new utl::TraceD(trace); } private: ShowerRRecData(); utl::ParameterStorage fShowerQuantities; std::vector fBeamMaps; utl::LameShadowPtr fBeamResultQuantities; utl::LameShadowPtr fBeamResultCCTrace; utl::LameShadowPtr fBeamResultPowerTrace; utl::LameShadowPtr fBeamResultXTrace; std::vector fRdLDF; std::vector fRdLDFFitResult; TFitResult f2dLDFFitResult; TF1 fScintLDF; utl::Vector fReferenceDirection; bool fReferenceDirectionIsRD; utl::Point fReferenceCorePosition; bool fReferenceCorePositionIsRD; friend class evt::ShowerRecData; friend class utl::LameShadowPtr; public: static const double kBary; static const double kPrePlaneFit; static const double kPlaneFitLinear; static const double kPlaneFitLinear2; static const double kPlaneFit3d; static const double kSphericalWaveFit; static const double kSphericalWaveFitVarC; static const double kConicalWaveFit; static const double kLDFFit1D; static const double kHyperbolicWaveFit; static const double k2DLDF; static const double k2DLDFWithCore; static const double kAirShowerParameters; /*static const double kLDFEstimate; static const double kLDFEstimateAndCurvature; static const double kLDF; static const double kLDFAndCurvature; static const double kLDFSilents; static const double kLDFSilentsAndCurvature; static const double kLDFBeta; static const double kLDFGamma;*/ }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. -k" // End: