LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArVoxelReadoutGeometry.h
Go to the documentation of this file.
1 
26 #ifndef LArG4_LArVoxelReadoutGeometry_h
27 #define LArG4_LArVoxelReadoutGeometry_h
28 
29 #include "Geant4/G4String.hh"
30 #include "Geant4/G4Transform3D.hh"
31 #include "Geant4/G4UserLimits.hh"
32 #include "Geant4/G4VUserParallelWorld.hh"
35 
36 // Forward declarations
37 class G4PhysicalVolume;
38 
39 namespace larg4 {
40 
41  class LArVoxelReadoutGeometry : public G4VUserParallelWorld {
42  public:
44  struct Setup_t {
45 
48 
49  }; // struct Setup_t
50 
52  LArVoxelReadoutGeometry(const G4String& name, Setup_t const& setupData);
53 
57  class Sentry;
58 
62  void Construct() override;
63 
64  private:
65  G4VPhysicalVolume* FindNestedVolume(G4VPhysicalVolume* mother,
66  G4Transform3D& motherTransform,
67  G4Transform3D& daughterTransform,
68  std::string const& daughterName,
69  unsigned int expectedNum);
70 
72  std::unique_ptr<G4UserLimits> fStepLimit;
73 
78  };
79 
80  // This is dirty, dirty. Sigh. Due to the limited interface of G4
81  // and the prevalent use of services in LArSoft, there isn't a much
82  // better alternative.
84  public:
86  detinfo::DetectorClocksData const& clockData,
87  detinfo::DetectorPropertiesData const& detProp) noexcept
88  : readout_{readout}
89  {
90  readout_->flarVoxelReadout->SetClockData(&clockData);
91  readout_->flarVoxelReadout->SetPropertiesData(&detProp);
92  }
93  ~Sentry() noexcept
94  {
95  readout_->flarVoxelReadout->SetClockData(nullptr);
96  readout_->flarVoxelReadout->SetPropertiesData(nullptr);
97  }
98 
99  private:
101  };
102 
103 } // namespace larg4
104 
105 #endif // LArG4_LArVoxelReadoutGeometry_h
Collection of all it takes to set up this object.
Collection of what it takes to set a LArVoxelReadout up.
larg4::LArVoxelReadout::Setup_t fReadoutSetupData
G4VPhysicalVolume * FindNestedVolume(G4VPhysicalVolume *mother, G4Transform3D &motherTransform, G4Transform3D &daughterTransform, std::string const &daughterName, unsigned int expectedNum)
Geant4 interface.
larg4::LArVoxelReadout::Setup_t readoutSetup
Set up data for LArVoxelReadout.
larg4::LArVoxelReadout * flarVoxelReadout
Data for LArVoxelReadout setup.
std::unique_ptr< G4UserLimits > fStepLimit
Sentry(LArVoxelReadoutGeometry *const readout, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp) noexcept
art::ServiceHandle< geo::Geometry const > fGeo
Handle to the geometry.
A Geant4 sensitive detector that accumulates voxel information.
LArVoxelReadoutGeometry(const G4String &name, Setup_t const &setupData)
Constructor: sets up all its LArVoxelReadout instances.
Contains all timing reference information for the detector.
Transports energy depositions from GEANT4 to TPC channels.
art framework interface to geometry description