Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-07 08:10:34

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2022-2024 CERN for the benefit of the Acts project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "ActsExamples/Geant4/DetectorConstructionFactory.hpp"
0012 #include "ActsExamples/Geant4/RegionCreator.hpp"
0013 #include "ActsExamples/TelescopeDetector/TelescopeDetector.hpp"
0014 
0015 #include "G4VUserDetectorConstruction.hh"
0016 
0017 class G4VPhysicalVolume;
0018 class G4LogicalVolume;
0019 
0020 namespace ActsExamples::Telescope {
0021 
0022 class TelescopeG4DetectorConstruction final
0023     : public G4VUserDetectorConstruction {
0024  public:
0025   TelescopeG4DetectorConstruction(
0026       const TelescopeDetector::Config& cfg,
0027       std::vector<std::shared_ptr<RegionCreator>> regionCreators = {});
0028 
0029   G4VPhysicalVolume* Construct() final;
0030 
0031  private:
0032   /// The configuration of the telescope detector
0033   TelescopeDetector::Config m_cfg;
0034   /// Region creators
0035   std::vector<std::shared_ptr<RegionCreator>> m_regionCreators;
0036   /// The world volume
0037   G4VPhysicalVolume* m_world{};
0038 };
0039 
0040 class TelescopeG4DetectorConstructionFactory final
0041     : public DetectorConstructionFactory {
0042  public:
0043   TelescopeG4DetectorConstructionFactory(
0044       const TelescopeDetector::Config& cfg,
0045       std::vector<std::shared_ptr<RegionCreator>> regionCreators = {});
0046 
0047   std::unique_ptr<G4VUserDetectorConstruction> factorize() const override;
0048 
0049  private:
0050   /// The configuration of the telescope detector
0051   TelescopeDetector::Config m_cfg;
0052   /// Region creators
0053   std::vector<std::shared_ptr<RegionCreator>> m_regionCreators;
0054 };
0055 
0056 }  // namespace ActsExamples::Telescope