Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Code developed by:
0027 //  S.Larsson
0028 //
0029 //    ********************************
0030 //    *                              *
0031 //    *    PurgMagPhysicsList.cc     *
0032 //    *                              *
0033 //    ********************************
0034 //
0035 
0036 #include "PurgMagPhysicsList.hh"
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4ParticleDefinition.hh"
0039 #include "G4ParticleWithCuts.hh"
0040 #include "G4ProcessManager.hh"
0041 #include "G4ParticleTypes.hh"
0042 #include "G4ParticleTable.hh"
0043 #include "G4Material.hh"
0044 #include "G4UnitsTable.hh"
0045 #include "G4ios.hh"              
0046 #include "G4EmStandardPhysics_option4.hh"
0047 #include "G4VPhysicsConstructor.hh"
0048 #include "G4DecayPhysics.hh"
0049 
0050 PurgMagPhysicsList::PurgMagPhysicsList():  G4VUserPhysicsList()
0051 {
0052   defaultCutValue = 1*micrometer;
0053   cutForGamma     = defaultCutValue;
0054   cutForElectron  = defaultCutValue;
0055   cutForPositron  = defaultCutValue;
0056   cutForProton    = defaultCutValue;
0057 
0058   fEmPhysicsList = new G4EmStandardPhysics_option4();
0059   fDecPhysicsList = new G4DecayPhysics();
0060   SetVerboseLevel(1);
0061 }
0062 
0063 PurgMagPhysicsList::~PurgMagPhysicsList()
0064 {
0065  delete fDecPhysicsList;
0066  delete fEmPhysicsList;
0067 }
0068 
0069 void PurgMagPhysicsList::ConstructParticle()
0070 {
0071  fDecPhysicsList -> ConstructParticle();
0072 } 
0073 
0074 void PurgMagPhysicsList::ConstructProcess()
0075 {
0076   AddTransportation();
0077   fEmPhysicsList -> ConstructProcess();
0078   
0079 // Deexcitation
0080 // Both Fluorescence and Auger e- emission activated
0081 //G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
0082 //G4LossTableManager::Instance()->SetAtomDeexcitation(de);
0083 //de -> SetFluo(true);
0084 //de -> SetAuger(true);
0085 }
0086 
0087 void PurgMagPhysicsList::SetCuts()
0088 {
0089   if (verboseLevel >0){
0090     G4cout << "PurgMagPhysicsList::SetCuts:";
0091     G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
0092   }  
0093   
0094   // set cut values for gamma at first and for e- second and next for e+,
0095   // because some processes for e+/e- need cut values for gamma 
0096   SetCutValue(cutForGamma, "gamma");
0097   SetCutValue(cutForElectron, "e-");
0098   SetCutValue(cutForPositron, "e+");
0099   
0100   // set cut values for proton and anti_proton before all other hadrons
0101   // because some processes for hadrons need cut values for proton/anti_proton 
0102   SetCutValue(cutForProton, "proton");
0103   SetCutValue(cutForProton, "anti_proton");
0104   
0105   //  SetCutValueForOthers(defaultCutValue);
0106   
0107   if (verboseLevel>0) DumpCutValuesTable();
0108 }
0109 
0110 void PurgMagPhysicsList::SetGammaLowLimit(G4double lowcut)
0111 {
0112   if (verboseLevel >0){
0113     G4cout << "PurgMagPhysicsList::SetCuts:";
0114     G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0115   }  
0116 
0117   // G4Gamma::SetEnergyRange(lowcut,1e5); 
0118   SetGELowLimit(lowcut);
0119 }
0120 
0121 void PurgMagPhysicsList::SetElectronLowLimit(G4double lowcut)
0122 {
0123   if (verboseLevel >0){
0124     
0125     G4cout << "PurgMagPhysicsList::SetCuts:";
0126     G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0127   }  
0128 
0129   // G4Electron::SetEnergyRange(lowcut,1e5);
0130   SetGELowLimit(lowcut);
0131 }
0132 
0133 void PurgMagPhysicsList::SetPositronLowLimit(G4double lowcut)
0134 {
0135   if (verboseLevel >0){
0136     
0137     G4cout << "PurgMagPhysicsList::SetCuts:";
0138     G4cout << "Positron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0139   }  
0140 
0141   G4cerr << "PurgMagPhysicsList::SetPositronLowLimit: Not currently able to set Positron LowLimit." << G4endl;
0142   G4Exception("PurgMagPhysicsList::SetPositronLowLimit()","PurMag001",
0143           FatalException,"Positron Low Limit: not implemented in PurgMagPhysicsList"); 
0144   //
0145   // G4Positron::SetEnergyRange(lowcut,1e5);
0146 }
0147 
0148 
0149 void PurgMagPhysicsList::SetProtonLowLimit(G4double lowcut)
0150 {
0151   if (verboseLevel >0){
0152     
0153     G4cout << "PurgMagPhysicsList::SetCuts:";
0154     G4cout << "Proton cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;  
0155   }  
0156 
0157   G4cerr << "PurgMagPhysicsList::SetProtonLowLimit: Not currently able to set Proton LowLimit." << G4endl;
0158   G4Exception("PurgMagPhysicsList::SetProtonLowLimit()","PurMag002",
0159           FatalException,"Proton Low Limit: not implemented in PurgMagPhysicsList"); 
0160   //
0161   // G4Proton::SetEnergyRange(lowcut,1e5);
0162   // G4AntiProton::SetEnergyRange(lowcut,1e5);
0163 }
0164 
0165 void PurgMagPhysicsList::SetGEPLowLimit(G4double lowcut)
0166 {
0167   if (verboseLevel >0){
0168     G4cout << "PurgMagPhysicsList::SetGEPLowLimit:";
0169     G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0170   }  
0171 
0172   // G4Gamma::SetEnergyRange(lowcut,1e5);
0173   // G4Electron::SetEnergyRange(lowcut,1e5);
0174   // G4Positron::SetEnergyRange(lowcut,1e5);
0175   this->SetGELowLimit(lowcut); 
0176 
0177   G4cerr << " SetGEPLowLimit : Uncertain whether setting Positron low limit " << G4endl;
0178 }
0179 
0180 void PurgMagPhysicsList::SetGELowLimit(G4double lowcut)
0181 {
0182   if (verboseLevel >0){
0183     G4cout << "PurgMagPhysicsList::SetGELowLimit:";
0184     G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0185   }  
0186  
0187   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5);
0188 }
0189 void PurgMagPhysicsList::SetGammaCut(G4double val)
0190 {
0191   cutForGamma = val;
0192 }
0193 
0194 void PurgMagPhysicsList::SetElectronCut(G4double val)
0195 {
0196   cutForElectron = val;
0197 }
0198 
0199 void PurgMagPhysicsList::SetPositronCut(G4double val)
0200 {
0201   cutForPositron = val;
0202 }
0203 
0204 void PurgMagPhysicsList::SetProtonCut(G4double val)
0205 {
0206   cutForProton = val;
0207 }
0208 
0209 
0210 
0211 
0212 
0213