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] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 // Author: F. Poignant, floriane.poignant@gmail.com
 27 //
 28 
 29 #include "STCyclotronPhysicsList.hh"
 30 #include "G4Proton.hh"
 31 #include "G4Neutron.hh"
 32 #include "G4Electron.hh"
 33 #include "G4Positron.hh"
 34 #include "G4Gamma.hh"
 35 #include "G4Deuteron.hh"
 36 
 37 //Physic Lists (contained inside the Geant 4 distribution)
 38 #include "G4EmStandardPhysics_option3.hh"
 39 #include "G4DecayPhysics.hh"
 40 #include "G4Decay.hh"
 41 #include "G4StepLimiter.hh"
 42 #include "G4LossTableManager.hh"
 43 #include "G4UnitsTable.hh"
 44 #include "G4SystemOfUnits.hh"
 45 #include "G4ProcessManager.hh"
 46 #include "G4Region.hh"
 47 #include "G4RegionStore.hh"
 48 
 49 #include "G4EmExtraPhysics.hh"
 50 #include "G4EmParameters.hh"
 51 #include "G4NuclideTable.hh"
 52 
 53 #include "G4HadronPhysicsQGSP_BERT.hh"
 54 #include "G4HadronPhysicsQGSP_BIC.hh"
 55 #include "G4HadronPhysicsQGSP_BIC_HP.hh"
 56 #include "G4HadronPhysicsQGSP_BIC_AllHP.hh"
 57 #include "G4RadioactiveDecayPhysics.hh"
 58 //#include "QGSP_BIC_HP.hh"
 59 #include "G4PhysListFactory.hh"
 60 #include "G4DeexPrecoParameters.hh"
 61 #include "G4NuclideTable.hh"
 62 
 63 STCyclotronPhysicsList::STCyclotronPhysicsList(STCyclotronDetectorConstruction* det)
 64   : G4VModularPhysicsList()
 65 {
 66   // Mandatory for G4NuclideTable
 67   // Half-life threshold must be set small or many short-lived isomers 
 68   // will not be assigned life times (default to 0) 
 69   G4NuclideTable::GetInstance()->SetThresholdOfHalfLife(0.1*second);
 70   G4NuclideTable::GetInstance()->SetLevelTolerance(1.0*eV);
 71 
 72   //---
 73   fDetector = det;
 74   
 75   G4LossTableManager::Instance();
 76  
 77   defaultCutValue = 0.1*mm;
 78   fCutForGamma     = defaultCutValue;
 79   fCutForElectron  = defaultCutValue;
 80   fCutForPositron  = defaultCutValue;
 81 
 82   fThickness_foil = defaultCutValue;
 83   fThickness_target = defaultCutValue;
 84 
 85   fCutTargetProton  = fThickness_target;
 86   fCutTargetElectron = fThickness_target;
 87   fCutTargetPositron = fThickness_target;
 88   fCutTargetGamma = fThickness_target;
 89 
 90   fCutFoilProton = fThickness_foil;
 91   fCutFoilElectron = fThickness_foil;
 92   fCutFoilPositron = fThickness_foil;
 93   fCutFoilGamma = fThickness_foil;
 94   
 95   //EM physics
 96   fEmPhysicsList = new G4EmStandardPhysics_option3(0);
 97   fEmName = G4String("emstandard_opt3");
 98 
 99   //Decay physics and all particles
100   fDecPhysicsList = new G4DecayPhysics(0);
101   fRaddecayList = new G4RadioactiveDecayPhysics(0);
102   
103   //Hadron physics
104   fHadPhysicsList = new G4HadronPhysicsQGSP_BIC_AllHP(0);
105   //fHadPhysicsList = new G4HadronPhysicsQGSP_BIC(0);
106 
107 
108   
109   
110 
111 }
112 
113 STCyclotronPhysicsList::~STCyclotronPhysicsList()
114 {
115 
116   delete fEmPhysicsList ;
117   delete fDecPhysicsList;
118   delete fRaddecayList;
119   delete fHadPhysicsList;
120 
121   
122 }
123 
124 void STCyclotronPhysicsList::ConstructParticle()
125 {
126 
127   G4Proton::ProtonDefinition();
128   G4Gamma::GammaDefinition();
129   G4Electron::ElectronDefinition();
130   G4Positron::PositronDefinition();
131   G4Neutron::NeutronDefinition();
132   G4Deuteron::DeuteronDefinition();
133 
134   fDecPhysicsList->ConstructParticle();
135   
136 
137 }
138 
139 void STCyclotronPhysicsList::ConstructProcess()
140 {
141   // Define transportation process
142   
143 
144   AddTransportation();
145   
146   //electromagnetic physics list
147   fEmPhysicsList->ConstructProcess();
148   //em_config.AddModels();
149   
150   //decay physics list
151   fDecPhysicsList->ConstructProcess();
152   fRaddecayList->ConstructProcess();
153 
154   //hadronic physics lists
155   fHadPhysicsList->ConstructProcess();
156 
157   //Get the value of the fThickness of foil and target
158   fThickness_foil = fDetector->GetFoilThickness()*mm;
159   fThickness_target = fDetector->GetTargetThickness()*mm;
160 
161   //Update the cuts with the 1/2 of the thickness of the foil/target
162   //SetCuts();
163 
164   SetCutTarget(0.01,fThickness_target/2.,fThickness_target/2.,fThickness_target/2.);
165   
166   
167 
168 }
169 
170 void STCyclotronPhysicsList::SetCuts()
171 {
172 
173   if (verboseLevel >0){
174     G4cout << "PhysicsList::SetCuts:";
175     G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
176   }
177 
178   // set cut values for gamma at first and for e- second and next for e+,
179   // because some processes for e+/e- need cut values for gamma
180   SetCutValue(fCutForGamma, "gamma");
181   SetCutValue(fCutForElectron, "e-");
182   SetCutValue(fCutForPositron, "e+");
183 
184   // Set cuts for detector
185   SetCutFoil(0.1,fThickness_foil/2.,fThickness_foil/2.,fThickness_foil/2.);
186   SetCutTarget(0.01,fThickness_target/2.,fThickness_target/2.,fThickness_target/2.);
187   if (verboseLevel>0) DumpCutValuesTable();
188 }
189 
190 void STCyclotronPhysicsList::SetCutForGamma(G4double cut)
191 {
192   fCutForGamma = cut;
193   SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
194 }
195 
196 void STCyclotronPhysicsList::SetCutForElectron(G4double cut)
197 {
198   fCutForElectron = cut;
199   SetParticleCuts(fCutForElectron, G4Electron::Electron());
200 }
201 
202 void STCyclotronPhysicsList::SetCutForPositron(G4double cut)
203 {
204   fCutForPositron = cut;
205   SetParticleCuts(fCutForPositron, G4Positron::Positron());
206 }
207 
208 void STCyclotronPhysicsList::SetCutTarget(G4double cutProton, G4double cutElectron, G4double cutPositron, G4double cutGamma){
209   
210   fCutTargetProton = cutProton*mm;
211   fCutTargetElectron = cutElectron*mm;
212   fCutTargetPositron = cutPositron*mm;
213   fCutTargetGamma = cutGamma*mm;
214 
215   G4String regionNameTarget = "Target";
216   G4Region* regionTarget = G4RegionStore::GetInstance()->GetRegion(regionNameTarget);
217 
218   G4ProductionCuts* cutsTarget = new G4ProductionCuts ;
219   cutsTarget -> SetProductionCut(fCutTargetGamma,"gamma");
220   cutsTarget -> SetProductionCut(fCutTargetElectron,"e-");
221   cutsTarget -> SetProductionCut(fCutTargetPositron,"e+");
222   cutsTarget -> SetProductionCut(fCutTargetProton,"proton");
223   
224   regionTarget -> SetProductionCuts(cutsTarget);
225     
226 }
227 
228 void STCyclotronPhysicsList::SetCutFoil(G4double cutProton, G4double cutElectron, G4double cutPositron, G4double cutGamma){
229   
230   fCutFoilProton = cutProton*mm;
231   fCutFoilElectron = cutElectron*mm;
232   fCutFoilPositron = cutPositron*mm;
233   fCutFoilGamma = cutGamma*mm;
234 
235   G4RegionStore::GetInstance()->GetRegion("Foil");
236   G4String regionNameFoil = "Foil";
237   G4Region* regionFoil = G4RegionStore::GetInstance()->GetRegion(regionNameFoil);
238   
239   G4ProductionCuts* cutsFoil = new G4ProductionCuts ;
240   cutsFoil -> SetProductionCut(fCutFoilGamma,"gamma");
241   cutsFoil -> SetProductionCut(fCutFoilElectron,"e-");
242   cutsFoil -> SetProductionCut(fCutFoilPositron,"e+");
243   cutsFoil -> SetProductionCut(fCutFoilProton,"proton");
244 
245   regionFoil -> SetProductionCuts(cutsFoil);
246 
247 }
248 
249