15std::vector<Acts::Experimental::GbtsLayerConnectionTool::LayerDescription>
16geometryParser(
const std::string& geometryInformation) {
18 std::ifstream inStream(geometryInformation);
21 throw std::runtime_error(
"File does not exist or could not be opened: " +
25 std::vector<Acts::Experimental::GbtsLayerConnectionTool::LayerDescription>
34 std::int32_t gbtsId{};
36 while (inStream >> minR >> maxR >> minZ >> maxZ >> gbtsId) {
37 detectorGeometry.emplace_back(minR, maxR, minZ, maxZ, gbtsId);
43 throw std::runtime_error(
"I/O error while reading geometry file: " +
47 if (!inStream.eof()) {
48 throw std::runtime_error(
"Malformed record in geometry file: " +
52 return detectorGeometry;
57bool writeOldConnectionTable(
58 const std::string& outputFileLocation,
59 const Acts::Experimental::GbtsLayerConnectionTool::LayerIdPairs&
68 outputFile << tempTable.size() <<
" " << 0.2 <<
"\n";
69 for (
const auto& layerPair : tempTable) {
70 outputFile << 0 <<
" " << 1 <<
" " << layerPair.second <<
" "
71 << layerPair.first <<
" " << 1 <<
" " << 1 <<
" " << 100 <<
"\n"
82bool writeConnectionTable(
83 const std::string& outputFileLocation,
84 const Acts::Experimental::GbtsLayerConnectionTool::LayerIdPairs& layerTable,
85 const bool useOldFormatting) {
87 if (useOldFormatting) {
88 return writeOldConnectionTable(outputFileLocation, layerTable);
99 for (
const auto& layerPair : layerTable) {
102 outputFile << layerPair.second <<
" " << layerPair.first <<
"\n";
122 m_layerConnectionTool.emplace(
m_config,
123 logger().cloneWithSuffix(
"gbtsLayerTool"));
125 return StatusCode::SUCCESS;
139 for (
auto& [truthParticle, truthClusters] : truthTracks) {
141 std::vector<Acts::Experimental::GbtsLayerConnectionTool::HitCoordinates>
143 for (
const auto& cluster : truthClusters) {
146 std::hypot(cluster.globalPosition.x(), cluster.globalPosition.y());
148 hits.push_back({
r, cluster.globalPosition.z()});
154 m_layerConnectionTool->addTrack(hits);
158 return StatusCode::SUCCESS;
163 const auto layerTable = m_layerConnectionTool->createConnectionTable();
171 return StatusCode::FAILURE;
174 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Acts::Experimental::GbtsLayerConnectionTool::Config m_config
std::unique_ptr< const Acts::Logger > m_logger
StatusCode initialize() override
Gaudi::Property< float > m_zMinTol
Gaudi::Property< float > m_zMaxTol
Gaudi::Property< std::string > m_outputConnectionTable
Gaudi::Property< float > m_rMinTol
ToolHandle< TruthTrackBuilderTool > m_truthTrackBuilderTool
Gaudi::Property< std::string > m_geometryFile
std::mutex m_gbtsTrainingToolMutex
void applyConfiguration()
Gaudi::Property< float > m_rMaxTol
StatusCode execute(const EventContext &ctx) const override
StatusCode finalize() override
Gaudi::Property< bool > m_useOldFormatting
const Acts::Logger & logger() const
private member functions
Gaudi::Property< bool > m_doSymmetrization
Gaudi::Property< float > m_probThreshold
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...