Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
+49 -1
View File
@@ -24,13 +24,17 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4VUserParallelWorld.cc 69917 2013-05-17 13:28:02Z gcosmo $
//
#include "G4VUserParallelWorld.hh"
#include "G4TransportationManager.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4VSensitiveDetector.hh"
#include "G4SDManager.hh"
G4VUserParallelWorld::G4VUserParallelWorld(G4String worldName)
{ fWorldName = worldName; }
@@ -38,6 +42,9 @@ G4VUserParallelWorld::G4VUserParallelWorld(G4String worldName)
G4VUserParallelWorld::~G4VUserParallelWorld()
{ ; }
void G4VUserParallelWorld::ConstructSD()
{ ; }
G4VPhysicalVolume* G4VUserParallelWorld::GetWorld()
{
G4VPhysicalVolume* pWorld
@@ -47,4 +54,45 @@ G4VPhysicalVolume* G4VUserParallelWorld::GetWorld()
return pWorld;
}
void G4VUserParallelWorld::SetSensitiveDetector
(const G4String& logVolName, G4VSensitiveDetector* aSD, G4bool multi)
{
G4bool found = false;
G4LogicalVolumeStore* store = G4LogicalVolumeStore::GetInstance();
for(G4LogicalVolumeStore::iterator pos=store->begin(); pos!=store->end(); pos++)
{
if((*pos)->GetName()==logVolName)
{
if(found && !multi)
{
G4String eM = "More than one logical volumes of the name <";
eM += (*pos)->GetName();
eM += "> are found and thus the sensitive detector <";
eM += aSD->GetName();
eM += "> cannot be uniquely assigned.";
G4Exception("G4VUserParallelWorld::SetSensitiveDetector",
"Run5052",FatalErrorInArgument,eM);
}
found = true;
SetSensitiveDetector(*pos,aSD);
}
}
if(!found)
{
G4String eM2 = "No logical volume of the name <";
eM2 += logVolName;
eM2 += "> is found. The specified sensitive detector <";
eM2 += aSD->GetName();
eM2 += "> couldn't be assigned to any volume.";
G4Exception("G4VUserParallelWorld::SetSensitiveDetector",
"Run5053",FatalErrorInArgument,eM2);
}
}
void G4VUserParallelWorld::SetSensitiveDetector
(G4LogicalVolume* logVol, G4VSensitiveDetector* aSD)
{
G4SDManager::GetSDMpointer()->AddNewDetector(aSD);
logVol->SetSensitiveDetector(aSD);
}