#ifndef _sdet_PMT_h_ #define _sdet_PMT_h_ #include #include #include #include #include #include #include namespace sdet { /** \class PMT \brief Detector description interface for PMT-related data \author T. Paul \date 4 March 2003 \version $Id: PMT.h 21027 2012-04-26 00:33:11Z paul $ \ingroup sdet */ class PMT { private: static const int kSaturationValue = 0x3FF; public: enum PMTGain { eHighGain = 0, eLowGain }; // ----------------- // Static quantities // ----------------- /// return ID of the PMT // int GetId() const { return fPMTId; } /// PMT position relative to center of the tank const utl::Point& GetPosition() const; /// Collection efficiency double GetCollectionEfficiency() const; /// Quantum efficiency const utl::TabulatedFunction& GetQuantumEfficiency() const; /// Refraction index for the PMT face const utl::TabulatedFunction& GetFaceRefractionIndex() const; /// Refraction index for the interface between PMT face and dome (RTV) const utl::TabulatedFunction& GetRTVRefractionIndex() const; /// Refraction index for the PMT dome const utl::TabulatedFunction& GetDomeRefractionIndex() const; /// Effective area of the PMT photocathode /// NOTE: We set effective area and not radius /// because different simulations may use /// different geometries. /// For instance, G4 uses a hemipsherical geometry; /// SDSim used a flat cylinder. double GetEffectiveArea() const; /// Value of saturation of FADC trace static int GetSaturationValue() { return kSaturationValue; } // -------------------- // Sim calibration info // -------------------- /** @name Simulation calibration data for a particular simulation scheme */ //@{ /// Get VEM peak for the PMT (for simulations) double GetVEMPeak(const std::string simulationIdentifier) const; /// Get VEM change for the PMT (for simulations) double GetVEMCharge(const std::string simulationIdentifier) const; /// Get baseline level for the PMT (for simulations) double GetBaseline(sdet::PMT::PMTGain channel) const; /// Get baseline noise for the PMT (for simulations) double GetBaselineRMS(sdet::PMT::PMTGain channel) const; /// Get dynode to anode ratio for the PMT (for simulations) double GetDA() const; /// Get RMS of dynode anode ration for the PMT (for simulations) //* This is not actually used at present, but it's included here to mimic CDAS. *// double GetDARMS() const; //@} private: PMT(const int stationId, const int PMTId); ~PMT(); PMT(const PMT&); PMT& operator=(const PMT&); void Update() const; private: std::string fStationIdString; std::string fPMTIdString; int fPMTId; // Static quantities pertaining to the PMT // (use lazy evaluation) // --------------------------------------- mutable double* fCollectionEfficiency; mutable utl::TabulatedFunction* fQuantumEfficiency; mutable utl::Point* fPosition; mutable utl::TabulatedFunction* fFaceRefractionIndex; mutable utl::TabulatedFunction* fRTVRefractionIndex; mutable utl::TabulatedFunction* fDomeRefractionIndex; mutable double* fEffectiveArea; mutable std::map* fVEMPeak; mutable std::map* fVEMCharge; mutable double* fBaselineLG; mutable double* fBaselineHG; mutable double* fBaselineRMSLG; mutable double* fBaselineRMSHG; mutable double* fDA; mutable double* fDARMS; friend class Station; // Helper method to do the redundant work of preparing requests for PMT data, // sending it to the manager and reporting any errors. template inline const T& GetPMTData(T*& requestedData, const std::string& property, const std::string& component, const std::string& errorMsg) const { if (!requestedData) { requestedData = new T; det::VManager::IndexMap indexMap; indexMap["stationId"] = fStationIdString; indexMap["PMTId"] = fPMTIdString; const det::VManager& manager = det::Detector::GetInstance().GetSManagerRegister(); const det::VManager::Status foundFlag = manager.GetData(*requestedData, property, component, indexMap); if (foundFlag == det::VManager::eNotFound) NotFoundAndThrow(errorMsg); } return *requestedData; } void NotFoundAndThrow(const std::string& msg) const; }; } // namespace sdet #endif // _sdet_PMT_h_