Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:51:38

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //----------------------------------------------------------------------------//
0028 // This physics list *must* be set with a *reference* physics list.
0029 //   These provide a full set of models (both electromagnetic and hadronic).
0030 //
0031 //   The reference physics list must be set by issuing its command in a macro
0032 //   file (see messenger class). No other action is required.
0033 //   Examples of physics list names: QGSP_BIC_HP_EMZ or QGSP_BERT_HP
0034 //----------------------------------------------------------------------------//
0035 //
0036 
0037 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0038 
0039 #include "PhysicsList.hh"
0040 #include "PhysicsListMessenger.hh"
0041 
0042 #include "globals.hh"
0043 #include "G4SystemOfUnits.hh"
0044 #include "G4PhysListFactory.hh"
0045 #include "G4VModularPhysicsList.hh"
0046 #include "G4VPhysicsConstructor.hh"
0047 
0048 #include "G4BosonConstructor.hh"
0049 #include "G4LeptonConstructor.hh"
0050 #include "G4MesonConstructor.hh"
0051 #include "G4BaryonConstructor.hh"
0052 #include "G4IonConstructor.hh"
0053 #include "G4ShortLivedConstructor.hh"
0054 
0055 
0056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0057 
0058 PhysicsList::PhysicsList(): G4VModularPhysicsList()
0059 {
0060   SetDefaultCutValue(1.0*mm);
0061 
0062   // This is to force setting the physics list with macro command
0063   fPhysListIsSet = false;
0064 
0065   fVerbose = 1;
0066   fMessenger = new PhysicsListMessenger(this);
0067 }
0068 
0069 
0070 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0071 
0072 PhysicsList::~PhysicsList()
0073 {
0074   delete fMessenger;
0075 }
0076 
0077 
0078 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0079 
0080 void PhysicsList::ConstructParticle()
0081 {
0082   if(fVerbose > 0) {
0083     G4cout << "### PhysicsList Construct Particles" << G4endl;
0084   }
0085   // This method is invoked when the Geant4 application starts
0086   // (do not mix with run initialization).
0087 
0088   // (Taken from G4DecayPhysics)
0089   G4BosonConstructor  pBosonConstructor;
0090   pBosonConstructor.ConstructParticle();
0091 
0092   G4LeptonConstructor pLeptonConstructor;
0093   pLeptonConstructor.ConstructParticle();
0094 
0095   G4MesonConstructor pMesonConstructor;
0096   pMesonConstructor.ConstructParticle();
0097 
0098   G4BaryonConstructor pBaryonConstructor;
0099   pBaryonConstructor.ConstructParticle();
0100 
0101   G4IonConstructor pIonConstructor;
0102   pIonConstructor.ConstructParticle();
0103 
0104   G4ShortLivedConstructor pShortLivedConstructor;
0105   pShortLivedConstructor.ConstructParticle();
0106 }
0107 
0108 
0109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0110 
0111 void PhysicsList::ConstructProcess()
0112 {
0113   if(fVerbose > 0) {
0114     G4cout << "### PhysicsList Construct Processes" << G4endl;
0115   }
0116 
0117   if (fPhysListIsSet)
0118     G4VModularPhysicsList::ConstructProcess();
0119   else
0120     G4Exception("PhysicsList::ConstructProcess()", "PhysList001",
0121         FatalException, "No PHYSICS LIST has been set!");
0122 }
0123 
0124 
0125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0126 
0127 void PhysicsList::SetPhysicsList(const G4String& name)
0128 {
0129   if(fVerbose > 0)
0130     G4cout << "### PhysicsList set physics list <" << name
0131            << "> " << G4endl;
0132 
0133   if (!fPhysListIsSet) {
0134     G4PhysListFactory factory;
0135     G4VModularPhysicsList* phys = factory.GetReferencePhysList(name);
0136 
0137     size_t ii = 0;
0138     const G4VPhysicsConstructor* elem = phys->GetPhysics(ii);
0139     G4VPhysicsConstructor* tmp = const_cast<G4VPhysicsConstructor*> (elem);
0140     while (elem) {
0141       RegisterPhysics(tmp);
0142       G4cout << "PhysicsList Type: " << elem->GetPhysicsType() << G4endl;
0143       G4cout << "PhysicsList Name: " << elem->GetPhysicsName() << G4endl;
0144       elem = phys->GetPhysics(++ii);
0145       tmp = const_cast<G4VPhysicsConstructor*> (elem);
0146     }
0147 
0148     G4cout << name << " reference physics List has been ACTIVATED."
0149        << G4endl;
0150 
0151     // Update the flag, the physics list is set
0152     fPhysListIsSet = true;
0153   }
0154 }
0155 
0156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......