Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:03

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 /// \file FlashPhysicsList.cc
0028 /// \brief Implementation of the FlashPhysicsList class
0029 
0030 #include "FlashPhysicsList.hh"
0031 #include "FlashPhysicsListMessenger.hh"
0032 #include "G4DecayPhysics.hh"
0033 #include "G4EmLivermorePhysics.hh"
0034 #include "G4EmPenelopePhysics.hh"
0035 #include "G4EmStandardPhysics.hh"
0036 #include "G4EmStandardPhysics_option4.hh"
0037 #include "G4EmStandardPhysics_option3.hh"
0038 #include "G4PhysListFactory.hh"
0039 #include "G4ProductionCuts.hh"
0040 #include "G4RadioactiveDecayPhysics.hh"
0041 #include "G4Region.hh"
0042 #include "G4RegionStore.hh"
0043 #include "G4SystemOfUnits.hh"
0044 
0045 FlashPhysicsList::FlashPhysicsList() : G4VModularPhysicsList() {
0046 
0047 
0048 
0049     pMessenger = new FlashPhysicsListMessenger(this);
0050       SetVerboseLevel(2);
0051   
0052 // EM physics
0053   emPhysicsList = new G4EmStandardPhysics_option4(1);
0054   emName = G4String("emstandard_opt4");
0055 
0056    // Decay physics and all particles
0057   decPhysicsList = new G4DecayPhysics();
0058 
0059      // Radioactive physics and all particles
0060   radPhysicsList=new G4RadioactiveDecayPhysics();
0061 
0062 
0063 }
0064 
0065 FlashPhysicsList::~FlashPhysicsList() {
0066 
0067 delete pMessenger;
0068   delete emPhysicsList;
0069   delete    decPhysicsList;
0070  delete radPhysicsList;
0071   
0072 }
0073 
0074 
0075 void FlashPhysicsList::AddPackage(const G4String& name)
0076 {
0077   G4PhysListFactory factory;
0078   G4VModularPhysicsList* phys =factory.GetReferencePhysList(name);
0079   G4int i=0;
0080   const G4VPhysicsConstructor* elem= phys->GetPhysics(i);
0081   G4VPhysicsConstructor* tmp = const_cast<G4VPhysicsConstructor*> (elem);
0082   while (elem !=0)
0083     {
0084       RegisterPhysics(tmp);
0085       elem= phys->GetPhysics(++i) ;
0086       tmp = const_cast<G4VPhysicsConstructor*> (elem);
0087     }
0088 }
0089 
0090 
0091 
0092 
0093 void FlashPhysicsList::ConstructParticle()
0094 {
0095   decPhysicsList->ConstructParticle();
0096 }
0097 
0098 void FlashPhysicsList::ConstructProcess()
0099 {
0100   // transportation
0101   //
0102    AddTransportation();
0103 
0104   // electromagnetic physics list
0105   //
0106   emPhysicsList->ConstructProcess();
0107   em_config.AddModels();
0108 
0109    decPhysicsList->ConstructProcess();
0110   radPhysicsList->ConstructProcess();
0111   
0112   }
0113 
0114 void FlashPhysicsList::AddPhysicsList(const G4String& name)
0115 {
0116 
0117   if (verboseLevel>1) {
0118     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0119   }
0120   if (name == emName) return;
0121 
0122   /////////////////////////////////////////////////////////////////////////////
0123   //   ELECTROMAGNETIC MODELS
0124   /////////////////////////////////////////////////////////////////////////////
0125 
0126   if (name == "standard_opt3") {
0127     emName = name;
0128     delete emPhysicsList;
0129     emPhysicsList = new G4EmStandardPhysics_option3();
0130     G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
0131   }
0132   else if (name == "standard_opt4") {
0133     emName = name;
0134     delete emPhysicsList;
0135     emPhysicsList = new G4EmStandardPhysics_option4();
0136     G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option4" << G4endl;
0137     
0138 
0139   } else if (name == "Livermore") {
0140     emName = name;
0141     delete emPhysicsList;
0142     emPhysicsList = new G4EmLivermorePhysics();
0143     G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
0144 
0145   } else if (name == "Penelope") {
0146     emName = name;
0147     delete emPhysicsList;
0148     emPhysicsList = new G4EmPenelopePhysics();
0149     G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmPenelopePhysics" << G4endl;
0150 
0151   }
0152      
0153 }
0154 void FlashPhysicsList::SetCuts() {//set cuts based on region name defined in detector construction
0155 
0156   SetCutsWithDefault();
0157   G4Region *region;
0158   G4String regName;
0159   G4ProductionCuts *cuts;
0160 
0161 
0162 
0163   regName = "Phantom_reg";
0164   region = G4RegionStore::GetInstance()->GetRegion(regName);
0165   cuts = new G4ProductionCuts;
0166   cuts->SetProductionCut(0.1 * mm, G4ProductionCuts::GetIndex("gamma"));
0167   cuts->SetProductionCut(0.1 * mm, G4ProductionCuts::GetIndex("e-"));
0168   cuts->SetProductionCut(0.1 * mm, G4ProductionCuts::GetIndex("e+"));
0169   region->SetProductionCuts(cuts);
0170   
0171  
0172 }
0173 
0174  
0175