29 #include "G4LogicalVolume.hh"
30 #include "G4UnitsTable.hh"
31 #include "G4Version.hh"
35 #include "SToGSConfig.hh"
49 G4String result(
""), tmp = path_in_factory;
50 if ( !tmp.contains(
"$") ) {
55 G4int start = tmp.last(
'$'); tmp.remove(0,start+1);
63 G4VUserDetectorConstruction *theConstructor = 0x0; G4VPhysicalVolume *theDetector = 0x0; G4String conffile;
66 for (
size_t i = 0; i < fLoadedPhysical.size(); i++) {
67 if ( fLoadedPhysical[i].first == basename ) {
68 theDetector = fLoadedPhysical[i].second;
76 conffile = GetConf(basename);
79 if ( basename.contains(
"/TwoShells") ) {
80 if ( conffile ==
"" ) {
84 theDetector = theConstructor->Construct();
86 if ( basename.contains(
"/AGATA") ) {
88 theDetector = theConstructor->Construct();
92 if ( basename.contains(MYDET_) ) {
93 if ( conffile ==
"" ) {
94 theConstructor =
new MYDET_CLASSTYPE();
96 else theConstructor =
new MYDET_CLASSTYPE(conffile);
97 theDetector = theConstructor->Construct();
101 std::pair < G4String, G4VPhysicalVolume *> p1(basename,theDetector);
102 fLoadedPhysical.push_back(p1);
103 std::pair < G4String, G4VUserDetectorConstruction *> p2(basename,theConstructor);
104 fLoadedUserDetectorConstruction.push_back(p2);
107 GetAttributes(basename,
true,
true);
115 #if G4VERSION_NUMBER < 1000
118 for (
size_t i = 0; i < fLoadedUserDetectorConstruction.size(); i++) {
119 if ( fLoadedUserDetectorConstruction[i].first == basename ) {
120 fLoadedUserDetectorConstruction[i].second->ConstructSDandField();
G4String GetConf(G4String path_in_factory) const
return from the full path in the factory the configuration file which is following $ ...
Class to build AGATA from the same configuration files [asolid, acluster, aeuler] that the ones in th...
Factory which is an interface to G4VUserDetectorConstruction.
G4String GetFactoryName() const
virtual void GetAttributes(G4String basename, G4bool do_amap=true, G4bool do_dmap=false)
Read attrbiutes by calling COnstructSDandFileds.
Detector composed of a set of concentric shells with two (possibly one) active shells.
virtual G4VPhysicalVolume * Get(G4String basename)
overwrite the Get method to retrieve the detector from the standard G4 way i.e. by calling Construct ...