Import Geant4 10.5.0.beta source tree
This commit is contained in:
@@ -71,6 +71,18 @@
|
||||
|
||||
#include "G4StepLimiter.hh"
|
||||
|
||||
// Constructors
|
||||
#include "G4EmStandardPhysics_option3.hh"
|
||||
#include "G4EmStandardPhysics_option4.hh"
|
||||
#include "G4RadioactiveDecayPhysics.hh"
|
||||
#include "G4HadronPhysicsQGSP_BERT.hh"
|
||||
#include "G4HadronPhysicsQGSP_BERT_HP.hh"
|
||||
#include "G4HadronElasticPhysics.hh"
|
||||
#include "G4HadronElasticPhysicsHP.hh"
|
||||
#include "G4IonElasticPhysics.hh"
|
||||
#include "G4IonBinaryCascadePhysics.hh"
|
||||
#include "G4DecayPhysics.hh"
|
||||
|
||||
#include <set>
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -87,26 +99,17 @@ TSPhysicsList* TSPhysicsList::Instance()
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
TSPhysicsList::TSPhysicsList()
|
||||
: fEmPhysics_opt4(new G4EmStandardPhysics_option4),
|
||||
fDecayPhysics(new G4DecayPhysics),
|
||||
fRadDecayPhysics(new G4RadioactiveDecayPhysics),
|
||||
fHadronInelasticPhysics(new G4HadronPhysicsQGSP_BERT_HP),
|
||||
fHadronElasticPhysics(new G4HadronElasticPhysicsHP),
|
||||
fIonElasticPhysics(new G4IonElasticPhysics),
|
||||
fIonBinaryCascadePhysics(new G4IonBinaryCascadePhysics),
|
||||
fDefaultCutValue(1.*CLHEP::mm)
|
||||
: fDefaultCutValue(1.*CLHEP::mm)
|
||||
{
|
||||
fgInstance = this;
|
||||
|
||||
fConstructors.push_back(fEmPhysics_opt4);
|
||||
fConstructors.push_back(fDecayPhysics);
|
||||
fConstructors.push_back(fRadDecayPhysics);
|
||||
fConstructors.push_back(fHadronInelasticPhysics);
|
||||
fConstructors.push_back(fHadronElasticPhysics);
|
||||
fConstructors.push_back(fIonElasticPhysics);
|
||||
fConstructors.push_back(fIonBinaryCascadePhysics);
|
||||
|
||||
|
||||
fConstructors.push_back(new G4EmStandardPhysics_option4);
|
||||
fConstructors.push_back(new G4DecayPhysics);
|
||||
fConstructors.push_back(new G4RadioactiveDecayPhysics);
|
||||
fConstructors.push_back(new G4HadronPhysicsQGSP_BERT_HP);
|
||||
fConstructors.push_back(new G4HadronElasticPhysicsHP);
|
||||
fConstructors.push_back(new G4IonElasticPhysics);
|
||||
fConstructors.push_back(new G4IonBinaryCascadePhysics);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4TiMemory.hh"
|
||||
|
||||
using namespace CLHEP;
|
||||
|
||||
@@ -76,6 +77,7 @@ TSPrimaryGeneratorAction::~TSPrimaryGeneratorAction()
|
||||
|
||||
void TSPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER();
|
||||
static TSDetectorConstruction* detector
|
||||
= TSDetectorConstruction::Instance();
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4MultiFunctionalDetector.hh"
|
||||
#include "G4VPrimitiveScorer.hh"
|
||||
#include "G4TiMemory.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -153,43 +154,50 @@ void TSRun::RecordEvent(const G4Event* aEvent)
|
||||
{
|
||||
G4Run::RecordEvent(aEvent);
|
||||
|
||||
//=============================
|
||||
// HitsCollection of This Event
|
||||
//============================
|
||||
G4HCofThisEvent* HCE = aEvent->GetHCofThisEvent();
|
||||
if (!HCE) return;
|
||||
//=============================
|
||||
// HitsCollection of This Event
|
||||
//============================
|
||||
G4HCofThisEvent* HCE = aEvent->GetHCofThisEvent();
|
||||
if (!HCE) return;
|
||||
|
||||
for(unsigned i = 0; i < fCollIDs.size(); ++i)
|
||||
{
|
||||
G4int fCollID = fCollIDs.at(i);
|
||||
//=======================================================
|
||||
// Sum up HitsMap of this Event into HitsMap of this RUN
|
||||
//=======================================================
|
||||
G4THitsMap<G4double>* EvtMap = 0;
|
||||
if ( fCollID >= 0 ) // Collection is attached to HCE
|
||||
EvtMap = static_cast<G4THitsMap<G4double>*>(HCE->GetHC(fCollID));
|
||||
else
|
||||
G4cout <<" Error EvtMap Not Found " << G4endl;
|
||||
|
||||
if ( EvtMap )
|
||||
for(unsigned i = 0; i < fCollIDs.size(); ++i)
|
||||
{
|
||||
//=== Sum up HitsMap of this event to HitsMap of RUN.===
|
||||
*fRunMaps[fCollID] += *EvtMap;
|
||||
// atomic run map
|
||||
*fAtomicRunMaps[fCollID] += *EvtMap;
|
||||
// mutex run map
|
||||
static G4Mutex mtx = G4MUTEX_INITIALIZER;
|
||||
{
|
||||
G4AutoLock lock(&mtx);
|
||||
for(const auto& itr : *EvtMap)
|
||||
{
|
||||
fMutexRunMaps[fCollNames[fCollID]][itr.first] += *itr.second;
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------//
|
||||
}
|
||||
G4int fCollID = fCollIDs.at(i);
|
||||
//=======================================================
|
||||
// Sum up HitsMap of this Event into HitsMap of this RUN
|
||||
//=======================================================
|
||||
G4THitsMap<G4double>* EvtMap = 0;
|
||||
if ( fCollID >= 0 ) // Collection is attached to HCE
|
||||
EvtMap = static_cast<G4THitsMap<G4double>*>(HCE->GetHC(fCollID));
|
||||
else
|
||||
G4cout <<" Error EvtMap Not Found " << G4endl;
|
||||
|
||||
}
|
||||
if ( EvtMap )
|
||||
{
|
||||
//=== Sum up HitsMap of this event to HitsMap of RUN.===
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("[standard_run_map]");
|
||||
*fRunMaps[fCollID] += *EvtMap;
|
||||
}
|
||||
// atomic run map
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("[atomic_run_map]");
|
||||
*fAtomicRunMaps[fCollID] += *EvtMap;
|
||||
}
|
||||
TIMEMORY_AUTO_TIMER("[mutex_run_map]");
|
||||
// mutex run map
|
||||
static G4Mutex mtx = G4MUTEX_INITIALIZER;
|
||||
{
|
||||
G4AutoLock lock(&mtx);
|
||||
for(const auto& itr : *EvtMap)
|
||||
{
|
||||
fMutexRunMaps[fCollNames[fCollID]][itr.first]
|
||||
+= *itr.second;
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------//
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,13 @@ void TSRunAction::EndOfRunAction(const G4Run* aRun)
|
||||
} else {
|
||||
valid = false;
|
||||
}
|
||||
if(!valid)
|
||||
{
|
||||
G4Exception("TSRunAction", "000", JustWarning,
|
||||
G4String(primScorerNames.at(i) +
|
||||
" HitsMap is either not "
|
||||
"created or the HitsMap was empty").c_str());
|
||||
}
|
||||
} else {
|
||||
G4TAtomicHitsMap<G4double>* hitmap
|
||||
= tsRun->GetAtomicHitsMap(fName + "/" +
|
||||
@@ -176,7 +183,7 @@ void TSRunAction::EndOfRunAction(const G4Run* aRun)
|
||||
}
|
||||
if(!valid)
|
||||
{
|
||||
G4Exception("TSRunAction", "000", JustWarning,
|
||||
G4Exception("TSRunAction", "001", JustWarning,
|
||||
G4String(primScorerNames.at(i) +
|
||||
" HitsMap is either not "
|
||||
"created or the HitsMap was empty").c_str());
|
||||
|
||||
Reference in New Issue
Block a user