//////////////////////////////////////////////////////////////////// /// \class RAT::DU::PMTInfo /// /// \brief This class holds all information taken from database concerning /// PMTs. /// /// \author Carsten B Krauss /// \author Aleksandra Bialek /// \author P G Jones /// \author Christopher Jackson -- contact person /// /// REVISION HISTORY:\n /// 15 Apr 2010 : Gabriel Orebi Gann - remove fixed crate/card/channel /// and CCCnumber arrays, and calculate instead from /// logical channel number (RAT PMT ID)\n /// 24 Feb 2011 : Gabriel Orebi Gann - Remove duplicate PMT type arrays /// (eg IsNormal, IsInvalid etc) /// and calc all required info from "type" array\n /// 03 Mar 2011 : Gabriel Orebi Gann - Add methods for butt, neck, fecd /// (==calib) channels\n /// 20 Jul 2011 : Andy Mastbaum - Substantial refactoring so that this /// DS class doesn't contain logic \n /// 2014-03-01 : P G Jones - Refactor to move to DS::Utilities library. /// 2016-04-05 : J R Wilson - Adding in petal status type /// /// \details This class loads PMT information from the database and /// provides accessors to that information in a more convenient /// format. /// It can be used in RAT, ROOT or external programs that link to /// the libRATEvent library. /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_DU_PMTInfo__ #define __RAT_DU_PMTInfo__ #include #include #include namespace RAT { namespace DU { class PMTInfo : public TObject { public: /// The possible PMT types in SNO+ enum EPMTType { NORMAL = 1, OWL = 2, LOWGAIN = 3, BUTT = 4, NECK = 5, CALIB = 6, HQE = 7, SPARE = 10, INVALID = 11 }; /// The possible petal status values /// At this point these are just stored for information but not simulated differently /// Probably want to add more types over time enum EPetalStatus { STANDARD = 1, NONE = 0, UNAVAILABLE = -9999}; /// Called at the start of a run, loads from the database void BeginOfRun(); /// Get the PMT Type /// /// @param[in] id of the pmt /// @return the PMT type of pmt id /// @throws out_of_range if the index is out of range EPMTType GetType( const size_t id ) const { return fTypes.at( id ); } /// Get the Petal Status /// /// @param[in] id of the pmt /// @return the Petal status for pmt id /// @throws out_of_range if the index is out of range EPetalStatus GetPetalStatus( const size_t id ) const { return fPetalStatus.at( id ); } /// Get the PMT panel number /// /// @param[in] id of the pmt /// @return the Panel number for the pmt, or -1 if the PMT isn't in a panel /// @throws out_of_range if the index is out of range int GetPanelNumber( const size_t id ) const { return fPanels.at( id ); } /// Get the PMT position /// /// Is the position of the centre of front face of the concentrator or the PMT origin if not a panel PMT /// /// @param[in] id of the pmt /// @return the PMT position /// @throws out_of_range if the index is out of range TVector3 GetPosition( const size_t id ) const { return fPositions.at( id ); } /// Get the PMT direction /// /// Points from the PMT front face to the PMT base (i.e. is backwards) /// /// @param[in] id of the pmt /// @return the PMT direction /// @throws out_of_range if the index is out of range TVector3 GetDirection( const size_t id ) const { return fDirections.at( id ); } /// Get the total number of PMTs in database /// /// @return the number of PMTs size_t GetCount() const { return fTypes.size(); } // This ROOT macro adds dictionary methods to this class. // The number is 0 as this class is never, and should never be written to disc. // It assumes this class has no virtual methods, use ClassDef if change this. ClassDefNV( PMTInfo, 0 ); private: std::vector fPositions; ///< The PMT positions std::vector fDirections; ///< The PMT Directions std::vector fTypes; ///< The pmt types std::vector fPetalStatus; ///< The petal status types std::vector fPanels; ///< The pmt panel numbers }; } // ::DU } // ::RAT #endif