Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/xray_telescope/src/XrayTelPhysicsList.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 // *                                                                    *
0029 // *                    GEANT 4 xray_telescope advanced example         *
0030 // *                                                                    *
0031 // * MODULE:            XrayTelPhysicsList.cc                           *
0032 // * -------                                                            *
0033 // *                                                                    *
0034 // * Version:           0.4                                             *
0035 // * Date:              06/11/00                                        *
0036 // * Author:            R Nartallo                                      *
0037 // * Organisation:      ESA/ESTEC, Noordwijk, THe Netherlands           *
0038 // *                                                                    *
0039 // **********************************************************************
0040 // 
0041 // CHANGE HISTORY
0042 // --------------
0043 //
0044 // 06.11.2000 R.Nartallo
0045 // - First implementation of xray_telescope Physics list
0046 // - Based on Chandra and XMM models 
0047 // 
0048 //
0049 // **********************************************************************
0050 
0051 #include "XrayTelPhysicsList.hh"
0052 
0053 #include "globals.hh"
0054 #include "G4SystemOfUnits.hh"
0055 #include "G4ParticleDefinition.hh"
0056 #include "G4ParticleWithCuts.hh"
0057 #include "G4ProcessManager.hh"
0058 #include "G4ProcessVector.hh"
0059 #include "G4ParticleTypes.hh"
0060 #include "G4ParticleTable.hh"
0061 #include "G4ShortLivedConstructor.hh"
0062 #include "G4Material.hh"
0063 #include "G4MaterialTable.hh"
0064 #include "G4ios.hh"
0065 // Hadrons
0066 #include "G4MesonConstructor.hh"
0067 #include "G4BaryonConstructor.hh"
0068 #include "G4IonConstructor.hh"
0069 
0070 XrayTelPhysicsList::XrayTelPhysicsList():  G4VUserPhysicsList()
0071 {
0072   // Default cut values
0073   defaultCutValue = 2.0*mm;
0074   cutForGamma     = 1.0*m;
0075   cutForElectron  = 1.0*m;
0076 
0077   SetVerboseLevel(1);
0078 }
0079 
0080 XrayTelPhysicsList::~XrayTelPhysicsList()
0081 {}
0082 
0083 void XrayTelPhysicsList::ConstructParticle()
0084 {
0085   // Here are constructed all particles
0086   ConstructBosons();
0087   ConstructLeptons();
0088   ConstructMesons();
0089   ConstructBaryons();
0090   ConstructIons();
0091   ConstructAllShortLiveds();
0092 }
0093 
0094 // In this method, static member functions should be called for ALL particles to be used.
0095 
0096 void XrayTelPhysicsList::ConstructBosons()
0097 {
0098   // pseudo-particles
0099   G4Geantino::GeantinoDefinition();
0100   G4ChargedGeantino::ChargedGeantinoDefinition();
0101 
0102   // gamma
0103   G4Gamma::GammaDefinition();
0104 
0105   // optical photon
0106   G4OpticalPhoton::OpticalPhotonDefinition();
0107 }
0108 void XrayTelPhysicsList::ConstructLeptons()
0109 {
0110   // leptons
0111   G4Electron::ElectronDefinition();
0112   G4Positron::PositronDefinition();
0113 
0114   G4NeutrinoE::NeutrinoEDefinition();
0115   G4AntiNeutrinoE::AntiNeutrinoEDefinition();
0116   G4NeutrinoMu::NeutrinoMuDefinition();
0117   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
0118 
0119   G4MuonPlus::Definition();
0120   G4MuonMinus::Definition();
0121 }
0122 void XrayTelPhysicsList::ConstructMesons()
0123 {
0124   // mesons
0125   G4MesonConstructor mConstructor;
0126   mConstructor.ConstructParticle();
0127 }
0128 
0129 void XrayTelPhysicsList::ConstructBaryons()
0130 {
0131   //  barions
0132   G4BaryonConstructor bConstructor;
0133   bConstructor.ConstructParticle();
0134 }
0135 
0136 void XrayTelPhysicsList::ConstructIons()
0137 {
0138   // ions
0139   G4IonConstructor iConstructor;
0140   iConstructor.ConstructParticle();
0141 }
0142 
0143 void XrayTelPhysicsList::ConstructAllShortLiveds()
0144 {
0145   //Short-lived
0146   G4ShortLivedConstructor slConstructor;
0147   slConstructor.ConstructParticle();
0148 }
0149 
0150 
0151 void XrayTelPhysicsList::ConstructProcess()
0152 {
0153   // Transportation, electromagnetic and general processes 
0154   AddTransportation();
0155   ConstructEM();
0156   ConstructGeneral();
0157 }
0158 
0159 // Here are respective header files for chosen processes
0160 
0161 #include "G4ComptonScattering.hh"
0162 #include "G4GammaConversion.hh"
0163 #include "G4PhotoElectricEffect.hh"
0164 
0165 #include "G4eMultipleScattering.hh"
0166 #include "G4hMultipleScattering.hh"
0167 
0168 #include "G4eIonisation.hh"
0169 #include "G4eBremsstrahlung.hh"
0170 #include "G4eplusAnnihilation.hh"
0171 
0172 #include "G4MuIonisation.hh"
0173 #include "G4MuBremsstrahlung.hh"
0174 #include "G4MuPairProduction.hh"
0175 
0176 #include "G4hIonisation.hh"
0177 #include "G4hBremsstrahlung.hh"
0178 #include "G4hPairProduction.hh"
0179 
0180 #include "G4ionIonisation.hh"
0181 
0182 void XrayTelPhysicsList::ConstructEM()
0183 {
0184   auto particleIterator=GetParticleIterator();
0185   particleIterator->reset();
0186 
0187   while( (*particleIterator)() )
0188     {
0189       G4ParticleDefinition* particle = particleIterator->value();
0190       G4ProcessManager* pmanager = particle->GetProcessManager();
0191       G4String particleName = particle->GetParticleName();
0192 
0193       if (particleName == "gamma")
0194     {
0195       //gamma
0196       pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
0197       pmanager->AddDiscreteProcess(new G4ComptonScattering());
0198       pmanager->AddDiscreteProcess(new G4GammaConversion());
0199     }
0200       else if (particleName == "e-")
0201     {
0202       //electron
0203       pmanager->AddProcess(new G4eMultipleScattering(),-1, 1,1);
0204       pmanager->AddProcess(new G4eIonisation(),       -1, 2,2);
0205       pmanager->AddProcess(new G4eBremsstrahlung(),   -1, 3,3);
0206 
0207     } else if (particleName == "e+") {
0208 
0209       //positron
0210       pmanager->AddProcess(new G4eMultipleScattering(),-1, 1,1);
0211       pmanager->AddProcess(new G4eIonisation(),       -1, 2,2);
0212       pmanager->AddProcess(new G4eBremsstrahlung(),   -1, 3,3);
0213       pmanager->AddProcess(new G4eplusAnnihilation(),  0,-1,4);
0214 
0215     } else if( particleName == "mu-" || 
0216            particleName == "mu+" ) {
0217 
0218       //muon  
0219       pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0220       pmanager->AddProcess(new G4MuIonisation,        -1, 2, 2);
0221       pmanager->AddProcess(new G4MuBremsstrahlung,    -1, 3, 3);
0222       pmanager->AddProcess(new G4MuPairProduction,    -1, 4, 4);
0223       
0224     } else if( particleName == "pi-" ||
0225            particleName == "pi+" ) {
0226 
0227       //pions
0228       pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0229       pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
0230       pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
0231       pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
0232      
0233     } else if( particleName == "proton" ) {
0234 
0235       //proton  
0236       pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0237       pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
0238       pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
0239       pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
0240      
0241     } else if( particleName == "alpha" || 
0242            particleName == "He3" || 
0243            particleName == "GenericIon" ) {
0244 
0245       //Ions 
0246       pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0247       pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
0248       
0249     } else if ((!particle->IsShortLived()) &&
0250            (particle->GetPDGCharge() != 0.0) &&
0251            (particle->GetParticleName() != "chargedgeantino")) {
0252 
0253       //all others charged particles except geantino
0254       pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0255       pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
0256 
0257     }
0258     }
0259 }
0260 
0261 #include "G4Decay.hh"
0262 
0263 void XrayTelPhysicsList::ConstructGeneral()
0264 {
0265   G4Decay* theDecayProcess = new G4Decay();
0266   auto particleIterator=GetParticleIterator();
0267   particleIterator->reset();
0268   while( (*particleIterator)() ){
0269     G4ParticleDefinition* particle = particleIterator->value();
0270     G4ProcessManager* pmanager = particle->GetProcessManager();
0271     if (theDecayProcess->IsApplicable(*particle)) {
0272       pmanager ->AddProcess(theDecayProcess);
0273       pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
0274       pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
0275     }
0276   }
0277 }
0278 
0279 void XrayTelPhysicsList::SetCuts()
0280 {
0281   // defaultCutValue you have typed in is used
0282 
0283   if (verboseLevel >1){
0284     G4cout << "XrayTelPhysicsList::SetCuts:" << G4endl;
0285   }
0286 
0287   // set cut values for gamma at first and for e- second
0288   SetCutValue(cutForGamma, "gamma");
0289   SetCutValue(cutForElectron, "e-");
0290   SetCutValue(cutForElectron, "e+");
0291 
0292   // SetCutValueForOthers(defaultCutValue); 
0293  
0294   if (verboseLevel >1) { 
0295     DumpCutValuesTable(); 
0296   } 
0297 }
0298 
0299 void XrayTelPhysicsList::SetCutForGamma(G4double cut)
0300 {
0301   cutForGamma = cut;
0302 }
0303 
0304 void XrayTelPhysicsList::SetCutForElectron(G4double cut)
0305 {
0306   cutForElectron = cut;
0307 }
0308 
0309 G4double XrayTelPhysicsList::GetCutForGamma() const
0310 {
0311   return cutForGamma;
0312 }
0313 
0314 G4double XrayTelPhysicsList::GetCutForElectron() const
0315 {
0316   return cutForElectron;
0317 }
0318 
0319 
0320 
0321 
0322