Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sPHENIXActsDetectorElement.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file sPHENIXActsDetectorElement.cc
1 #include "ActsGeometry.h"
4 
5 #include <phool/phool.h>
6 
8 
10 {
11 
13  {
15 
16  unsigned int volume = id.volume();
17  unsigned int layer = id.layer();
18  unsigned int sphlayer = base_layer_map.find(volume)->second + layer / 2 -1;
19  unsigned int sensor = id.sensitive() - 1; // Acts sensor ID starts at 1
20 
21  const alignmentTransformationContainer* transformContainer
22  = ctxt.get<alignmentTransformationContainer*>();
23 
24  const auto& transformVec = transformContainer->getMap();
25  auto& layerVec = transformVec[sphlayer]; // get the vector of transforms for this layer
26 
27  if(layerVec.size() > sensor)
28  {
29  //std::cout << "sPHENIXActsDetectorElement: return transform: volume " << volume <<" Acts layer " << layer << " sensor " << sensor
30  // << " sphenix layer " << sphlayer << " layerVec size " << layerVec.size() << std::endl;
31 
32  return layerVec[sensor];
33  }
34 
35  // if we are still here, it was not found
36  std::cout << PHWHERE << " Alignment transform not found, for identifier " << id << " continuing on with ideal geometry is not ideal so we exit" << std::endl;
37 
38  exit(1);
39 
40  }
41  else
42  {
43  // return the construction transform
44  const Acts::Transform3& transform = TGeoDetectorElement::transform(ctxt); // ctxt is unused here
45  return transform;
46  }
47 
48 }
49 
50