Import Geant4 10.5.0.beta source tree
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt 110058 2018-05-15 09:02:41Z gcosmo $
|
||||
# $Id: CMakeLists.txt 109568 2018-05-02 07:05:10Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile 110058 2018-05-15 09:02:41Z gcosmo $
|
||||
# $Id: GNUmakefile 109568 2018-05-02 07:05:10Z gcosmo $
|
||||
# ------------------------------------------------------------
|
||||
# GNUmakefile for events library. Makoto Asai, 5/9/95.
|
||||
# ------------------------------------------------------------
|
||||
|
||||
+21
-10
@@ -1,4 +1,4 @@
|
||||
$Id: History 110058 2018-05-15 09:02:41Z gcosmo $
|
||||
$Id: History 110273 2018-05-17 14:43:43Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,29 +17,40 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
April 30, 2018 M. Asai (event-V10-03-06)
|
||||
- Change the default stack to
|
||||
G4TrackStack. Addressing to bug report #2040.
|
||||
May 17th, 2018 J. Madsen (event-V10-04-07)
|
||||
- updated "thread-local-static-var" model to
|
||||
"function-returning-thread-local-static-reference" model
|
||||
which fixes Windows DLL + MT
|
||||
|
||||
March 16, 2018 M. Asai
|
||||
- Change the default stack to G4TrackStack. Addressing to bug
|
||||
April 30, 2018 M. Asai (event-V10-04-06)
|
||||
- Re-tagging event-V10-04-04 : Change the default stack to
|
||||
G4TrackStak. Addressing to bug report #2040.
|
||||
|
||||
April 2, 2018 M. Asai (event-V10-04-05)
|
||||
- Tag event-V10-04-04 is removed for the time being.
|
||||
- G4StackManager.cc : code clean up.
|
||||
|
||||
March 16, 2018 M. Asai (event-V10-04-04)
|
||||
- Change the default stack to G4TrackStak. Addressing to bug
|
||||
report #2040.
|
||||
|
||||
February 8, 2018 Dennis Wright (event-V10-03-05)
|
||||
February 8, 2018 Dennis Wright (event-V10-04-03)
|
||||
- add deprecation warning for /gun/ionL in
|
||||
G4ParticleGunMessenger::SetNewValue()
|
||||
|
||||
January 9, 2018, M.Asai
|
||||
January 9, 2018, M.Asai (event-V10-04-02)
|
||||
- G4GeneralParticleSourceMessenger :
|
||||
UI command returns an error message if a command is refused due
|
||||
to incorrect parameter(s).
|
||||
- This tag requires intercoms-V10-04-01 tag.
|
||||
|
||||
December 26, 2017, M.Asai
|
||||
December 26, 2017, M.Asai (event-V10-04-01)
|
||||
- G4ParticleGunMessenger :
|
||||
UI command returns an error message if a command is refused due
|
||||
to incorrect parameter(s).
|
||||
- This tag requires intercoms-V10-04-01 tag.
|
||||
|
||||
December 19, 2017, G.Cosmo
|
||||
December 19, 2017, G.Cosmo (event-V10-04-00)
|
||||
- Fixed self-consistency in G4SPSRandomGenerator header (missing #include).
|
||||
Thanks to Raphael Isemann for reporting this.
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Event.hh 94950 2016-01-07 11:53:14Z gcosmo $
|
||||
// $Id: G4Event.hh 110273 2018-05-17 14:43:43Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class description:
|
||||
@@ -217,17 +217,17 @@ class G4Event
|
||||
}
|
||||
};
|
||||
|
||||
extern G4EVENT_DLL G4ThreadLocal G4Allocator<G4Event> *anEventAllocator;
|
||||
extern G4EVENT_DLL G4Allocator<G4Event>*& anEventAllocator();
|
||||
|
||||
inline void* G4Event::operator new(size_t)
|
||||
{
|
||||
if (!anEventAllocator) anEventAllocator = new G4Allocator<G4Event>;
|
||||
return (void*)anEventAllocator->MallocSingle();
|
||||
if (!anEventAllocator()) anEventAllocator() = new G4Allocator<G4Event>;
|
||||
return (void*)anEventAllocator()->MallocSingle();
|
||||
}
|
||||
|
||||
inline void G4Event::operator delete(void* anEvent)
|
||||
{
|
||||
anEventAllocator->FreeSingle((G4Event*)anEvent);
|
||||
anEventAllocator()->FreeSingle((G4Event*)anEvent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HEPEvtParticle.hh 69010 2013-04-15 09:34:16Z gcosmo $
|
||||
// $Id: G4HEPEvtParticle.hh 110273 2018-05-17 14:43:43Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class desccription:
|
||||
@@ -76,18 +76,18 @@ class G4HEPEvtParticle
|
||||
{ return JDAHEP2; }
|
||||
};
|
||||
|
||||
extern G4EVENT_DLL G4ThreadLocal G4Allocator<G4HEPEvtParticle> *aHEPEvtParticleAllocator;
|
||||
extern G4EVENT_DLL G4Allocator<G4HEPEvtParticle>*& aHEPEvtParticleAllocator();
|
||||
|
||||
inline void * G4HEPEvtParticle::operator new(size_t)
|
||||
{
|
||||
if (!aHEPEvtParticleAllocator)
|
||||
aHEPEvtParticleAllocator = new G4Allocator<G4HEPEvtParticle>;
|
||||
return (void *) aHEPEvtParticleAllocator->MallocSingle();
|
||||
if (!aHEPEvtParticleAllocator())
|
||||
aHEPEvtParticleAllocator() = new G4Allocator<G4HEPEvtParticle>;
|
||||
return (void *) aHEPEvtParticleAllocator()->MallocSingle();
|
||||
}
|
||||
|
||||
inline void G4HEPEvtParticle::operator delete(void * aHEPEvtParticle)
|
||||
{
|
||||
aHEPEvtParticleAllocator->FreeSingle((G4HEPEvtParticle *) aHEPEvtParticle);
|
||||
aHEPEvtParticleAllocator()->FreeSingle((G4HEPEvtParticle *) aHEPEvtParticle);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoryContainer.hh 69010 2013-04-15 09:34:16Z gcosmo $
|
||||
// $Id: G4TrajectoryContainer.hh 110273 2018-05-17 14:43:43Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4TrajectoryContainer
|
||||
@@ -82,18 +82,18 @@ class G4TrajectoryContainer
|
||||
TrajectoryVector* vect;
|
||||
};
|
||||
|
||||
extern G4EVENT_DLL G4ThreadLocal G4Allocator<G4TrajectoryContainer> *aTrajectoryContainerAllocator;
|
||||
extern G4EVENT_DLL G4Allocator<G4TrajectoryContainer>*& aTrajectoryContainerAllocator();
|
||||
|
||||
inline void* G4TrajectoryContainer::operator new(size_t)
|
||||
{
|
||||
if (!aTrajectoryContainerAllocator)
|
||||
aTrajectoryContainerAllocator = new G4Allocator<G4TrajectoryContainer>;
|
||||
return (void*)aTrajectoryContainerAllocator->MallocSingle();
|
||||
if (!aTrajectoryContainerAllocator())
|
||||
aTrajectoryContainerAllocator() = new G4Allocator<G4TrajectoryContainer>;
|
||||
return (void*)aTrajectoryContainerAllocator()->MallocSingle();
|
||||
}
|
||||
|
||||
inline void G4TrajectoryContainer::operator delete(void* aTrajectoryContainer)
|
||||
{
|
||||
aTrajectoryContainerAllocator->FreeSingle((G4TrajectoryContainer*)aTrajectoryContainer);
|
||||
aTrajectoryContainerAllocator()->FreeSingle((G4TrajectoryContainer*)aTrajectoryContainer);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Event.cc 99158 2016-09-07 08:10:46Z gcosmo $
|
||||
// $Id: G4Event.cc 110273 2018-05-17 14:43:43Z gcosmo $
|
||||
//
|
||||
|
||||
// G4Event
|
||||
@@ -37,7 +37,11 @@
|
||||
#include "G4VDigiCollection.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
G4ThreadLocal G4Allocator<G4Event> *anEventAllocator = nullptr;
|
||||
G4Allocator<G4Event>*& anEventAllocator()
|
||||
{
|
||||
G4ThreadLocalStatic G4Allocator<G4Event>* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
G4Event::G4Event()
|
||||
:eventID(0),
|
||||
|
||||
@@ -24,13 +24,17 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HEPEvtParticle.cc 69010 2013-04-15 09:34:16Z gcosmo $
|
||||
// $Id: G4HEPEvtParticle.cc 110273 2018-05-17 14:43:43Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
#include "G4HEPEvtParticle.hh"
|
||||
|
||||
G4ThreadLocal G4Allocator<G4HEPEvtParticle> *aHEPEvtParticleAllocator = 0;
|
||||
G4Allocator<G4HEPEvtParticle>*& aHEPEvtParticleAllocator()
|
||||
{
|
||||
G4ThreadLocalStatic G4Allocator<G4HEPEvtParticle>* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
G4HEPEvtParticle::G4HEPEvtParticle()
|
||||
: theParticle(0), ISTHEP(1), JDAHEP1(1), JDAHEP2(1)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleGunMessenger.cc 108473 2018-02-15 14:15:09Z gcosmo $
|
||||
// $Id: G4ParticleGunMessenger.cc 108396 2018-02-12 10:19:18Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4ParticleGunMessenger.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4StackManager.cc 106992 2017-10-31 10:14:18Z gcosmo $
|
||||
// $Id: G4StackManager.cc 109173 2018-04-03 06:51:03Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Last Modification : 09/Dec/96 M.Asai
|
||||
@@ -94,114 +94,23 @@ G4int G4StackManager::PushOneTrack(G4Track *newTrack,G4VTrajectory *newTrajector
|
||||
const G4ParticleDefinition* pd = newTrack->GetParticleDefinition();
|
||||
if(pd->GetParticleDefinitionID() < 0)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
G4ExceptionDescription ED;
|
||||
if(verboseLevel>0) {
|
||||
ED << "A track without proper process manager is pushed into the track stack.\n"
|
||||
<< " Particle name : " << pd->GetParticleName() << " -- ";
|
||||
if(newTrack->GetParentID()<0)
|
||||
{ ED << "created by a primary particle generator."; }
|
||||
else
|
||||
{
|
||||
const G4VProcess* vp = newTrack->GetCreatorProcess();
|
||||
if(vp)
|
||||
{ ED << "created by " << vp->GetProcessName() << "."; }
|
||||
else
|
||||
{ ED << "creaded by unknown process."; }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//// Temporal care of setting process manager for general ion.
|
||||
if(pd->IsGeneralIon())
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if( verboseLevel > 0 ) {
|
||||
ED << "\n Process manager is temporally set, but this operation is thread-unsafe\n"
|
||||
<< "and will be replaced with other methods at version 10.0.";
|
||||
G4Exception("G4StackManager::PushOneTrack","Event10051",JustWarning,ED);
|
||||
}
|
||||
#endif
|
||||
G4ParticleDefinition* genericIon = G4ParticleTable::GetParticleTable()->GetGenericIon();
|
||||
G4ProcessManager* pman=0;
|
||||
if (genericIon!=0) pman = genericIon->GetProcessManager();
|
||||
if ((genericIon ==0) || (pman==0)){
|
||||
G4Exception( "G4IonTable::AddProcessManager()","PART10052", FatalException,
|
||||
"Can not define process manager. GenericIon is not available.");
|
||||
}
|
||||
G4ParticleDefinition* ion = const_cast<G4ParticleDefinition*>(pd);
|
||||
ion->SetParticleDefinitionID(genericIon->GetParticleDefinitionID());
|
||||
#ifdef G4VERBOSE
|
||||
if( verboseLevel > 1 )
|
||||
{
|
||||
G4ProcessManager* ionPman = ion->GetProcessManager();
|
||||
G4cout << "Now " << ion->GetParticleName() << " has a process manaegr at " << ionPman
|
||||
<< " that is equivalent to " << pman << G4endl;
|
||||
G4ProcessVector* ionPvec = ionPman->GetProcessList();
|
||||
for(G4int ip1=0;ip1<ionPvec->size();ip1++)
|
||||
{
|
||||
G4cout << " " << ip1 << " - " << (*ionPvec)[ip1]->GetProcessName()
|
||||
<< " AtRest " << ionPman->GetAtRestIndex((*ionPvec)[ip1])
|
||||
<< ", AlongStep " << ionPman->GetAlongStepIndex((*ionPvec)[ip1])
|
||||
<< ", PostStep " << ionPman->GetPostStepIndex((*ionPvec)[ip1])
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//// End of temporal care of setting process manager
|
||||
#ifdef G4MUATOMS_INUSE
|
||||
//// Setting process manager for muonic atom (a temporary solution)
|
||||
if(pd->IsMuonicAtom())
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if( verboseLevel > 0 ) {
|
||||
ED << "\n Process manager is temporally set, but this operation is thread-unsafe\n"
|
||||
<< "and will be replaced with other methods at version 10.0.";
|
||||
G4Exception("G4StackManager::PushOneTrack","Event10051",JustWarning,ED);
|
||||
}
|
||||
#endif
|
||||
G4ParticleDefinition* genericMA =
|
||||
G4ParticleTable::GetParticleTable()->GetGenericMuonicAtom();
|
||||
G4ProcessManager* pman=nullptr;
|
||||
if (genericMA!=nullptr) pman = genericMA->GetProcessManager();
|
||||
if ((genericMA == nullptr) || (pman== nullptr)){
|
||||
G4Exception( "G4IonTable::AddProcessManager()","PART10052", FatalException,
|
||||
"Can not define process manager. GenericIon is not available.");
|
||||
}
|
||||
G4ParticleDefinition* muAtom = const_cast<G4ParticleDefinition*>(pd);
|
||||
muAtom->SetParticleDefinitionID(genericMA->GetParticleDefinitionID());
|
||||
#ifdef G4VERBOSE
|
||||
if( verboseLevel > 1 )
|
||||
{
|
||||
G4ProcessManager* muAtomPman = muAtom->GetProcessManager();
|
||||
G4cout << "Now " << muAtom->GetParticleName() << " has a process manager at " << muAtomPman
|
||||
<< " that is equivalent to " << pman << G4endl;
|
||||
G4ProcessVector* muAtomPvec = muAtomPman->GetProcessList();
|
||||
for(G4int ip1=0;ip1<muAtomPvec->size();ip1++)
|
||||
{
|
||||
G4cout << " " << ip1 << " - " << (*muAtomPvec)[ip1]->GetProcessName()
|
||||
<< " AtRest " << muAtomPman->GetAtRestIndex((*muAtomPvec)[ip1])
|
||||
<< ", AlongStep " << muAtomPman->GetAlongStepIndex((*muAtomPvec)[ip1])
|
||||
<< ", PostStep " << muAtomPman->GetPostStepIndex((*muAtomPvec)[ip1])
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//// End of Setting process manager for muonic atom (a temporary solution)
|
||||
#endif
|
||||
ED << "A track without proper process manager is pushed into the track stack.\n"
|
||||
<< " Particle name : " << pd->GetParticleName() << " -- ";
|
||||
if(newTrack->GetParentID()<0)
|
||||
{ ED << "created by a primary particle generator."; }
|
||||
else
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if( verboseLevel > 0 ) {
|
||||
ED << "\nThis track is deleted.";
|
||||
G4Exception("G4StackManager::PushOneTrack","Event10051",
|
||||
JustWarning,ED);
|
||||
}
|
||||
#endif
|
||||
delete newTrack;
|
||||
return GetNUrgentTrack();
|
||||
{
|
||||
const G4VProcess* vp = newTrack->GetCreatorProcess();
|
||||
if(vp)
|
||||
{ ED << "created by " << vp->GetProcessName() << "."; }
|
||||
else
|
||||
{ ED << "creaded by unknown process."; }
|
||||
}
|
||||
G4Exception("G4StackManager::PushOneTrack","Event10051",
|
||||
FatalException,ED);
|
||||
delete newTrack;
|
||||
return GetNUrgentTrack();
|
||||
}
|
||||
|
||||
G4ClassificationOfNewTrack classification = DefaultClassification( newTrack );
|
||||
|
||||
@@ -24,12 +24,16 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoryContainer.cc 69010 2013-04-15 09:34:16Z gcosmo $
|
||||
// $Id: G4TrajectoryContainer.cc 110273 2018-05-17 14:43:43Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
|
||||
G4ThreadLocal G4Allocator<G4TrajectoryContainer> *aTrajectoryContainerAllocator = 0;
|
||||
G4Allocator<G4TrajectoryContainer>*& aTrajectoryContainerAllocator()
|
||||
{
|
||||
G4ThreadLocalStatic G4Allocator<G4TrajectoryContainer>* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
G4TrajectoryContainer::G4TrajectoryContainer()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user