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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 ]

Diff markup

Differences between /examples/advanced/STCyclotron/src/STCyclotronPhysicsList.cc (Version 11.3.0) and /examples/advanced/STCyclotron/src/STCyclotronPhysicsList.cc (Version 11.1.1)


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