PhysicsList.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file PhysicsList.h
3 /// \brief Create the physics lists to be used by Geant4.
4 ///
5 /// \version $Id: PhysicsList.cxx,v 1.3 2010/07/26 15:16:35 bjpjones Exp $
6 /// \author seligman@nevis.columbia.edu
7 ////////////////////////////////////////////////////////////////////////
8 //
9 // Don't be too confused by the names. PhysicsList.h and
10 // PhysicsList.cxx define what the name "garg4::PhysicList" means.
11 // However, that definition is mainly in terms of
12 // garg4::ModularPhysicsList, a class that inherits from
13 // G4VModularPhysicsList.
14 
15 #include "GArG4/PhysicsList.h"
16 
17 #include "Geant4/G4VUserPhysicsList.hh"
18 #include "Geant4/G4VModularPhysicsList.hh"
19 #include "Geant4/G4ParallelWorldScoringProcess.hh"
20 #include "Geant4/G4ParticleDefinition.hh"
21 #include "Geant4/G4ProcessManager.hh"
22 #include "Geant4/G4ChargeExchange.hh"
23 #include "Geant4/G4ChargeExchangeProcess.hh"
24 #include "nug4/G4Base/G4PhysListFactorySingleton.hh"
25 
26 namespace gar {
27 
28  PHYSLISTREG3(garg4,PhysicsList,garg4::PhysicsList)
29 #define G4MT_physicsVector ((G4VMPLsubInstanceManager.offset[g4vmplInstanceID]).physicsVector)
30 
31  namespace garg4 {
32 
33  // Constructor: call the G4 constructor.
35  : G4VModularPhysicsList()
36  {}
37 
38  // Destructor; C++ will automatically call the G4VModulePhysicsList
39  // destructor, so we need do nothing here.
41  {}
42 
43  // This is the method we have to modify to use the Geant4 parallel geometries.
45  {
46  // We don't need to modify G4VModularPhysicsList's
47  // AddTransportation method. Just invoke it directly.
48  G4VModularPhysicsList::AddTransportation();
49 
50  // This code is also unchanged from
51  // G4VModularPhysicsList::ConstructProcess(); it means "activate
52  // the physics processes and particle combinations we've specified
53  // in physicsVector." The physicsVector is built up by the
54  // pre-supplied Geant4 physics list; see PhysicsList.h for the
55  // name of that list. "physicsVector" is defined in
56  // G4VModularPhysicsList.hh.
58  for (itr = G4MT_physicsVector->begin(); itr!= G4MT_physicsVector->end(); ++itr) {
59  (*itr)->ConstructProcess();
60  }
61  }// end ConstructProcess
62 
63  } // namespace garg4
64 } // namespace gar
intermediate_table::iterator iterator
TConfigurablePhysicsList< ModularPhysicsList > PhysicsList
Definition: PhysicsList.h:86
#define G4MT_physicsVector
Definition: PhysicsList.cxx:29
General GArSoft Utilities.