/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/geo/include/RAT/GeoFactory.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/geo/include/RAT/GeoFactory.hh Source File
Ratpac-two
GeoFactory.hh
1 #ifndef __RAT_GeoFactory__
2 #define __RAT_GeoFactory__
3 
4 #include <G4LogicalVolume.hh>
5 #include <G4VPhysicalVolume.hh>
6 #include <G4VSolid.hh>
7 #include <RAT/DB.hh>
8 #include <string>
9 
10 namespace RAT {
11 
13  public:
14  GeoFactoryNotFoundError(const std::string &name) : fName(name){};
15  std::string fName;
16 };
17 
18 class GeoFactory {
19  public:
20  static void Register(const std::string &name, GeoFactory *factory);
21  static G4VPhysicalVolume *ConstructWithFactory(const std::string &name, DBLinkPtr table);
22 
23  protected:
24  static std::map<std::string, GeoFactory *> fFactoryMap;
25 
26  public:
27  GeoFactory(const std::string &name);
28  virtual G4VPhysicalVolume *Construct(DBLinkPtr table) = 0;
29 
30  static G4LogicalVolume *FindMother(const std::string mother_name);
31  static G4VPhysicalVolume *FindPhysMother(std::string mother_name);
32 
33  protected:
34  // Utility methods
35  virtual void SetSensitive(G4LogicalVolume *logi, DBLinkPtr table);
36 
37  virtual G4VPhysicalVolume *ConstructPhysicalVolume(G4LogicalVolume *logi, G4LogicalVolume *mother, DBLinkPtr table);
38  virtual G4VPhysicalVolume *ConstructPhysicalReplica(G4LogicalVolume *logi, G4LogicalVolume *mother, DBLinkPtr table);
39 };
40 
41 } // namespace RAT
42 
43 #endif
Definition: GeoFactory.hh:12
Definition: GeoFactory.hh:18
Definition: CCCrossSecMessenger.hh:29