ATLAS Offline Software
SingleLogicalVolumeFactory.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "Geo2G4SolidFactory.h"
8 #include "GeoModelKernel/GeoLogVol.h"
11 #include "G4LogicalVolume.hh"
12 #include "G4Material.hh"
13 
15 {
16 }
17 
18 typedef std::map<std::string, G4LogicalVolume*, std::less<std::string> > vMap;
19 
20 G4LogicalVolume *SingleLogicalVolumeFactory::Build ATLAS_NOT_THREAD_SAFE (const GeoLogVol* theLog)
21 {
22  static Geo2G4SolidFactory theSolidFactory;
23  static Geo2G4MaterialFactory theMaterialFactory;
24  static vMap volumeList;
25  //
26  // Get Material from GeoModel
27  //
28  const std::string& n= theLog->getName();
29  if (volumeList.find(n) == volumeList.end()) {
30  G4LogicalVolume *theG4Log=0;
31  G4Material* theG4Mat=theMaterialFactory.Build(theLog->getMaterial());
32 
33  G4VSolid * theG4Solid = theSolidFactory.Build(theLog->getShape());
34 
35  ATH_MSG_DEBUG("Building logical volume (single) "<<theLog->getName()<< " " << theG4Mat);
36  theG4Log = new G4LogicalVolume(theG4Solid,
37  theG4Mat,
38  theLog->getName(),
39  0,0,0);
40  volumeList[n] = theG4Log;
41  return theG4Log;
42  }
43  return volumeList[n];
44 }
AthMsgStreamMacros.h
ServiceAccessor.h
vMap
std::map< std::string, G4LogicalVolume *, std::less< std::string > > vMap
Definition: SingleLogicalVolumeFactory.cxx:18
Geo2G4MaterialFactory.h
SingleLogicalVolumeFactory.h
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
makeDTCalibBlob_pickPhase.theLog
theLog
Definition: makeDTCalibBlob_pickPhase.py:316
Geo2G4SolidFactory.h
volumeList
std::map< std::string, AGDDVolume * > volumeList
Definition: AGDDSection.h:9
Geo2G4SolidFactory
Definition: Geo2G4SolidFactory.h:23
Geo2G4MaterialFactory
Definition: Geo2G4MaterialFactory.h:15
SingleLogicalVolumeFactory::SingleLogicalVolumeFactory
SingleLogicalVolumeFactory()
Definition: SingleLogicalVolumeFactory.cxx:14
ATLAS_NOT_THREAD_SAFE
G4LogicalVolume *SingleLogicalVolumeFactory::Build ATLAS_NOT_THREAD_SAFE(const GeoLogVol *theLog)
Definition: SingleLogicalVolumeFactory.cxx:20
Geo2G4MaterialFactory::Build
G4Material * Build(const GeoMaterial *)
Definition: Geo2G4MaterialFactory.cxx:29