Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:15:18

0001 /**
0002  *  @file   PandoraSDK/include/Managers/GeometryManager.h
0003  * 
0004  *  @brief  Header file for the geometry manager class.
0005  * 
0006  *  $Log: $
0007  */
0008 #ifndef PANDORA_GEOMETRY_MANAGER_H
0009 #define PANDORA_GEOMETRY_MANAGER_H 1
0010 
0011 #include "Pandora/ObjectCreation.h"
0012 #include "Pandora/PandoraEnumeratedTypes.h"
0013 
0014 namespace pandora
0015 {
0016 
0017 /**
0018  *  @brief  GeometryManager class
0019  */
0020 class GeometryManager
0021 {
0022 public:
0023     /**
0024      *  @brief  Constructor
0025      * 
0026      *  @param  pPandora address of the associated pandora object
0027      */
0028     GeometryManager(const Pandora *const pPandora);
0029 
0030     /**
0031      *  @brief  Destructor
0032      */
0033     ~GeometryManager();
0034 
0035     /**
0036      *  @brief  Get the sub detector corresponding to a specified name
0037      * 
0038      *  @param  subDetectorName the sub detector name
0039      * 
0040      *  @return the sub detector
0041      */
0042     const SubDetector &GetSubDetector(const std::string &subDetectorName) const;
0043 
0044     /**
0045      *  @brief  Get the sub detector corresponding to a specified type.
0046      *          Will throw exception if there is not exactly one subdetector registered with the specified type.
0047      * 
0048      *  @param  subDetectorType the sub detector type
0049      * 
0050      *  @return the sub detector
0051      */
0052     const SubDetector &GetSubDetector(const SubDetectorType subDetectorType) const;
0053 
0054     /**
0055      *  @brief  Get the map from name to sub detector parameters
0056      * 
0057      *  @return the map from name to sub detector parameters
0058      */
0059     const SubDetectorMap &GetSubDetectorMap() const;
0060 
0061     /**
0062      *  @brief  If there is exactly one registered lar tpc instance, return it; else raise an exception
0063      * 
0064      *  @return the lar tpc instance
0065      */
0066     const LArTPC &GetLArTPC() const;
0067 
0068     /**
0069      *  @brief  Get the map from name to lar tpc parameters
0070      * 
0071      *  @return the map from name to lar tpc paramters
0072      */
0073     const LArTPCMap &GetLArTPCMap() const;
0074 
0075     /**
0076      *  @brief  Get the list of gaps in the active detector volume
0077      * 
0078      *  @return the list of gaps in the active detector volume
0079      */
0080     const DetectorGapList &GetDetectorGapList() const;
0081 
0082     /**
0083      *  @brief  Get the granularity level specified for a given calorimeter hit type
0084      * 
0085      *  @param  hitType the calorimeter hit type
0086      * 
0087      *  @return the granularity
0088      */
0089     Granularity GetHitTypeGranularity(const HitType hitType) const;
0090 
0091 private:
0092     /**
0093      *  @brief  Create sub detector
0094      * 
0095      *  @param  parameters the sub detector parameters
0096      *  @param  factory the factory that performs the object allocation
0097      */
0098     StatusCode CreateSubDetector(const object_creation::Geometry::SubDetector::Parameters &parameters,
0099         const ObjectFactory<object_creation::Geometry::SubDetector::Parameters, object_creation::Geometry::SubDetector::Object> &factory);
0100 
0101     /**
0102      *  @brief  Create lar tpc
0103      * 
0104      *  @param  parameters the lar tpc parameters
0105      *  @param  factory the factory that performs the object allocation
0106      */
0107     StatusCode CreateLArTPC(const object_creation::Geometry::LArTPC::Parameters &parameters,
0108         const ObjectFactory<object_creation::Geometry::LArTPC::Parameters, object_creation::Geometry::LArTPC::Object> &factory);
0109 
0110     /**
0111      *  @brief  Create gap
0112      * 
0113      *  @param  parameters the gap parameters
0114      *  @param  factory the factory that performs the object allocation
0115      */
0116     template <typename PARAMETERS, typename OBJECT>
0117     StatusCode CreateGap(const PARAMETERS &parameters, const ObjectFactory<PARAMETERS, OBJECT> &factory);
0118 
0119     /**
0120      *  @brief  Erase all geometry manager content
0121      */
0122     StatusCode EraseAllContent();
0123 
0124     typedef std::map<HitType, Granularity> HitTypeToGranularityMap;
0125 
0126     /**
0127      *  @brief  Get the default hit type to granularity map
0128      * 
0129      *  @return the default hit type to granularity map
0130      */
0131     HitTypeToGranularityMap GetDefaultHitTypeToGranularityMap() const;
0132 
0133     /**
0134      *  @brief  Set the granularity level to be associated with a specified hit type
0135      * 
0136      *  @param  hitType the specified hit type
0137      *  @param  granularity the specified granularity
0138      */
0139     StatusCode SetHitTypeGranularity(const HitType hitType, const Granularity granularity);
0140 
0141     typedef std::multimap<SubDetectorType, const SubDetector*> SubDetectorTypeMap;
0142 
0143     SubDetectorMap              m_subDetectorMap;           ///< Map from sub detector name to sub detector
0144     SubDetectorTypeMap          m_subDetectorTypeMap;       ///< Map from sub detector type to sub detector
0145     LArTPCMap                   m_larTPCMap;                ///< Map from lar tpc volume id to lar tpc
0146     DetectorGapList             m_detectorGapList;          ///< List of gaps in the active detector volume
0147     HitTypeToGranularityMap     m_hitTypeToGranularityMap;  ///< The hit type to granularity map
0148 
0149     const Pandora *const        m_pPandora;                 ///< The associated pandora object
0150 
0151     friend class PandoraApiImpl;
0152 };
0153 
0154 //------------------------------------------------------------------------------------------------------------------------------------------
0155 
0156 inline const SubDetectorMap &GeometryManager::GetSubDetectorMap() const
0157 {
0158     return m_subDetectorMap;
0159 }
0160 
0161 //------------------------------------------------------------------------------------------------------------------------------------------
0162 
0163 inline const LArTPCMap &GeometryManager::GetLArTPCMap() const
0164 {
0165     return m_larTPCMap;
0166 }
0167 
0168 //------------------------------------------------------------------------------------------------------------------------------------------
0169 
0170 inline const DetectorGapList &GeometryManager::GetDetectorGapList() const
0171 {
0172     return m_detectorGapList;
0173 }
0174 
0175 } // namespace pandora
0176 
0177 #endif // #ifndef PANDORA_GEOMETRY_MANAGER_H