File indexing completed on 2025-08-06 08:18:10
0001 #include "sPHENIXActsDetectorElement.h"
0002 #include "ActsGeometry.h"
0003 #include "alignmentTransformationContainer.h"
0004
0005 #include <phool/phool.h>
0006
0007 sPHENIXActsDetectorElement::~sPHENIXActsDetectorElement() = default;
0008
0009 const Acts::Transform3& sPHENIXActsDetectorElement::transform(const Acts::GeometryContext& ctxt) const
0010 {
0011 if (alignmentTransformationContainer::use_alignment)
0012 {
0013 Acts::GeometryIdentifier id = surface().geometryId();
0014
0015 unsigned int volume = id.volume();
0016 unsigned int layer = id.layer();
0017 unsigned int sphlayer = base_layer_map.find(volume)->second + layer / 2 - 1;
0018 unsigned int sensor = id.sensitive() - 1;
0019
0020 const alignmentTransformationContainer* transformContainer = ctxt.get<alignmentTransformationContainer*>();
0021
0022 const auto& transformVec = transformContainer->getMap();
0023 auto& layerVec = transformVec[sphlayer];
0024
0025 if (layerVec.size() > sensor)
0026 {
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 return layerVec[sensor];
0037 }
0038
0039
0040 std::cout << PHWHERE << " Alignment transform not found, for identifier " << id << " continuing on with ideal geometry is not ideal so we exit" << std::endl;
0041
0042 exit(1);
0043 }
0044 else
0045 {
0046
0047 const Acts::Transform3& transform = TGeoDetectorElement::transform(ctxt);
0048 return transform;
0049 }
0050 }