ATLAS Offline Software
Loading...
Searching...
No Matches
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
8#include "GeoModelKernel/GeoLogVol.h"
11#include "G4LogicalVolume.hh"
12#include "G4Material.hh"
13
17
18typedef std::map<std::string, G4LogicalVolume*, std::less<std::string> > vMap;
19
20G4LogicalVolume *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}
std::map< std::string, AGDDVolume * > volumeList
Definition AGDDSection.h:14
#define ATH_MSG_DEBUG(x)
std::map< std::string, G4LogicalVolume *, std::less< std::string > > vMap
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
G4Material * Build(const GeoMaterial *)