Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:10

0001 #ifndef TRACKBASE_SPHENIXACTSDETECTORELEMENT_H
0002 #define TRACKBASE_SPHENIXACTSDETECTORELEMENT_H
0003 
0004 #include <Acts/Geometry/GeometryIdentifier.hpp>
0005 #include <Acts/Plugins/Identification/Identifier.hpp>
0006 #include <Acts/Plugins/TGeo/TGeoDetectorElement.hpp>
0007 
0008 /**
0009  * This class implements an sphenix detector element to build
0010  * the Acts geometry with. Relevant info on how to handle alignment
0011  * information from the GeometryContext is logically processed here
0012  */
0013 
0014 class ActsGeometry;
0015 
0016 class sPHENIXActsDetectorElement : public Acts::TGeoDetectorElement
0017 {
0018  public:
0019   sPHENIXActsDetectorElement() = delete;
0020 
0021   sPHENIXActsDetectorElement(const Identifier& identifier,
0022                              const TGeoNode& tGeoNode,
0023                              const TGeoMatrix& tGeoMatrix = TGeoIdentity(),
0024                              const std::string& axes = "XYZ",
0025                              double scalor = 10.,
0026                              std::shared_ptr<const Acts::ISurfaceMaterial> material = nullptr)
0027     : Acts::TGeoDetectorElement(identifier, tGeoNode, tGeoMatrix,
0028                                 axes, scalor, material)
0029   {
0030   }
0031 
0032   sPHENIXActsDetectorElement(const Identifier& identifier,
0033                              const TGeoNode& tGeoNode,
0034                              Acts::Transform3& tgTransform,
0035                              std::shared_ptr<const Acts::PlanarBounds> tgBounds,
0036                              double tgThickness = 0.)
0037     : Acts::TGeoDetectorElement(identifier, tGeoNode, tgTransform,
0038                                 tgBounds, tgThickness)
0039   {
0040   }
0041 
0042   sPHENIXActsDetectorElement(const Identifier& identifier,
0043                              const TGeoNode& tGeoNode,
0044                              Acts::Transform3& tgTransform,
0045                              std::shared_ptr<const Acts::DiscBounds> tgBounds,
0046                              double tgThickness = 0.)
0047     : Acts::TGeoDetectorElement(identifier, tGeoNode, tgTransform, tgBounds,
0048                                 tgThickness)
0049   {
0050   }
0051 
0052   ~sPHENIXActsDetectorElement() override;
0053 
0054   const Acts::Transform3& transform(const Acts::GeometryContext& ctxt) const override;
0055 
0056  private:
0057   std::map<unsigned int, unsigned int> base_layer_map = {{10, 0}, {12, 3}, {14, 7}, {16, 55}};
0058 };
0059 
0060 std::shared_ptr<sPHENIXActsDetectorElement> sPHENIXElementFactory(
0061     const Identifier& identifier, const TGeoNode& tGeoNode,
0062     const TGeoMatrix& tGeoMatrix, const std::string& axes, double scalor,
0063     std::shared_ptr<const Acts::ISurfaceMaterial> material)
0064 {
0065   return std::make_shared<sPHENIXActsDetectorElement>(identifier, tGeoNode, tGeoMatrix,
0066                                                       axes, scalor, material);
0067 }
0068 
0069 #endif