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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 /processes/hadronic/stopping/src/G4MuonMinusAtomicCapture.cc (Version 11.3.0) and /processes/hadronic/stopping/src/G4MuonMinusAtomicCapture.cc (Version 11.2.2)


  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 //                                                 26 //
 27 //--------------------------------------------     27 //---------------------------------------------------------------------
 28 //                                                 28 //
 29 // GEANT4 Class                                    29 // GEANT4 Class 
 30 //                                                 30 //
 31 // GEANT4 Class header file                        31 // GEANT4 Class header file
 32 //                                                 32 //
 33 // File name:     G4MuonMinusAtomicCapture         33 // File name:     G4MuonMinusAtomicCapture
 34 //                                                 34 //
 35 // 20160912 K.L. Genser - New process using G4     35 // 20160912 K.L. Genser - New process using G4MuonicAtom somewhat
 36 //                        based on G4HadronSto     36 //                        based on G4HadronStoppingProcess
 37 //                                                 37 //
 38 // Class Description:                              38 // Class Description: 
 39 //                                                 39 //
 40 // Stopping of mu-                                 40 // Stopping of mu-
 41 //                                                 41 //
 42 // G4VParticleChange will contain gammas from      42 // G4VParticleChange will contain gammas from G4EmCaptureCascade and
 43 // resulting G4MuonicAtom                          43 // resulting G4MuonicAtom
 44 //                                                 44 //
 45 //                                                 45 //
 46 //--------------------------------------------     46 //------------------------------------------------------------------------
 47                                                    47 
 48 #include "G4MuonMinusAtomicCapture.hh"             48 #include "G4MuonMinusAtomicCapture.hh"
 49 #include "G4ParticleDefinition.hh"                 49 #include "G4ParticleDefinition.hh"
 50 #include "G4HadronicProcessType.hh"                50 #include "G4HadronicProcessType.hh"
 51 #include "G4MuonMinusBoundDecay.hh"                51 #include "G4MuonMinusBoundDecay.hh"
 52 #include "G4HadronicInteraction.hh"                52 #include "G4HadronicInteraction.hh"
 53 #include "G4HadProjectile.hh"                      53 #include "G4HadProjectile.hh"
 54 #include "G4HadronicProcessStore.hh"               54 #include "G4HadronicProcessStore.hh"
 55 #include "G4EmCaptureCascade.hh"                   55 #include "G4EmCaptureCascade.hh"
 56 #include "G4MuonMinus.hh"                          56 #include "G4MuonMinus.hh"
 57 #include "G4IonTable.hh"                           57 #include "G4IonTable.hh"
 58 #include "G4RandomDirection.hh"                    58 #include "G4RandomDirection.hh"
 59 #include "G4HadSecondary.hh"                       59 #include "G4HadSecondary.hh"
 60                                                    60 
 61 //....oooOO0OOooo........oooOO0OOooo........oo     61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 62                                                    62 
 63 G4MuonMinusAtomicCapture::G4MuonMinusAtomicCap     63 G4MuonMinusAtomicCapture::G4MuonMinusAtomicCapture(const G4String& name)
 64   : G4VRestProcess(name, fHadronic),               64   : G4VRestProcess(name, fHadronic),
 65     fElementSelector(new G4ElementSelector()),     65     fElementSelector(new G4ElementSelector()),
 66     fEmCascade(new G4EmCaptureCascade()),  //      66     fEmCascade(new G4EmCaptureCascade()),  // Owned by InteractionRegistry
 67     theTotalResult(new G4ParticleChange()),        67     theTotalResult(new G4ParticleChange()),
 68     result(nullptr)                                68     result(nullptr)
 69 {                                                  69 {
 70   SetProcessSubType(fMuAtomicCapture);             70   SetProcessSubType(fMuAtomicCapture);
 71   G4HadronicProcessStore::Instance()->Register     71   G4HadronicProcessStore::Instance()->RegisterExtraProcess(this);
 72 }                                                  72 }
 73                                                    73 
 74 //....oooOO0OOooo........oooOO0OOooo........oo     74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 75                                                    75 
 76 G4MuonMinusAtomicCapture::~G4MuonMinusAtomicCa     76 G4MuonMinusAtomicCapture::~G4MuonMinusAtomicCapture()
 77 {                                                  77 {
 78   G4HadronicProcessStore::Instance()->DeRegist     78   G4HadronicProcessStore::Instance()->DeRegisterExtraProcess(this);
 79   delete theTotalResult;                           79   delete theTotalResult;
 80 }                                                  80 }
 81                                                    81 
 82 //....oooOO0OOooo........oooOO0OOooo........oo     82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 83                                                    83 
 84 G4bool G4MuonMinusAtomicCapture::IsApplicable(     84 G4bool G4MuonMinusAtomicCapture::IsApplicable(const G4ParticleDefinition& p)
 85 {                                                  85 {
 86   return (&p == G4MuonMinus::MuonMinus());         86   return (&p == G4MuonMinus::MuonMinus());
 87 }                                                  87 }
 88 //....oooOO0OOooo........oooOO0OOooo........oo     88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 89                                                    89 
 90 void                                               90 void 
 91 G4MuonMinusAtomicCapture::PreparePhysicsTable(     91 G4MuonMinusAtomicCapture::PreparePhysicsTable(const G4ParticleDefinition& p)
 92 {                                                  92 {
 93   G4HadronicProcessStore::Instance()->Register     93   G4HadronicProcessStore::Instance()->RegisterParticleForExtraProcess(this,&p);
 94 }                                                  94 }
 95                                                    95 
 96 //....oooOO0OOooo........oooOO0OOooo........oo     96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 97                                                    97 
 98 void G4MuonMinusAtomicCapture::BuildPhysicsTab     98 void G4MuonMinusAtomicCapture::BuildPhysicsTable(const G4ParticleDefinition& p) 
 99 {                                                  99 {
100   G4HadronicProcessStore::Instance()->PrintInf    100   G4HadronicProcessStore::Instance()->PrintInfo(&p);
101 }                                                 101 }
102                                                   102 
103 //....oooOO0OOooo........oooOO0OOooo........oo    103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
104                                                   104 
105 G4double G4MuonMinusAtomicCapture::AtRestGetPh    105 G4double G4MuonMinusAtomicCapture::AtRestGetPhysicalInteractionLength(
106                                                   106                                                               const G4Track&, G4ForceCondition* condition)
107 {                                                 107 {
108   *condition = NotForced;                         108   *condition = NotForced;
109   return 0.0;                                     109   return 0.0;
110 }                                                 110 }
111                                                   111 
112 //....oooOO0OOooo........oooOO0OOooo........oo    112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
113                                                   113 
114 G4VParticleChange* G4MuonMinusAtomicCapture::A    114 G4VParticleChange* G4MuonMinusAtomicCapture::AtRestDoIt(const G4Track& track, 
115                                                   115                                                 const G4Step&)
116 {                                                 116 {
117   // if primary is not Alive then do nothing (    117   // if primary is not Alive then do nothing (how?)
118   theTotalResult->Initialize(track);              118   theTotalResult->Initialize(track);
119                                                   119 
120   G4Nucleus* nucleus = &targetNucleus;            120   G4Nucleus* nucleus = &targetNucleus;
121   // the call below actually sets the nucleus     121   // the call below actually sets the nucleus params; 
122   // G4Nucleus targetNucleus; is a member of G    122   // G4Nucleus targetNucleus; is a member of G4HadronicProcess
123   // G4Element* elm =                             123   // G4Element* elm = 
124   fElementSelector->SelectZandA(track, nucleus    124   fElementSelector->SelectZandA(track, nucleus);
125                                                   125 
126   thePro.Initialise(track); // thePro was G4Ha    126   thePro.Initialise(track); // thePro was G4HadProjectile from G4HadronicProcess
127                                                   127 
128   // save track time an dstart capture from ze    128   // save track time an dstart capture from zero time
129   thePro.SetGlobalTime(0.0);                      129   thePro.SetGlobalTime(0.0);
130   G4double time0 = track.GetGlobalTime();         130   G4double time0 = track.GetGlobalTime();
131                                                   131 
132   // Do the electromagnetic cascade in the nuc    132   // Do the electromagnetic cascade in the nuclear field.
133   // EM cascade should keep G4HadFinalState ob    133   // EM cascade should keep G4HadFinalState object,
134   // because it will not be deleted at the end    134   // because it will not be deleted at the end of this method
135   //                                              135   //
136   result = fEmCascade->ApplyYourself(thePro, *    136   result = fEmCascade->ApplyYourself(thePro, *nucleus);
137   G4double ebound = result->GetLocalEnergyDepo    137   G4double ebound = result->GetLocalEnergyDeposit(); // may need to carry this over; review
138   G4double edep = 0.0;                            138   G4double edep = 0.0;
139   G4int nSecondaries = (G4int)result->GetNumbe    139   G4int nSecondaries = (G4int)result->GetNumberOfSecondaries();
140   thePro.SetBoundEnergy(ebound);                  140   thePro.SetBoundEnergy(ebound);
141                                                   141 
142   // creating the muonic atom                     142   // creating the muonic atom
143   ++nSecondaries;                                 143   ++nSecondaries;
144                                                   144 
145   G4IonTable* itp = G4IonTable::GetIonTable();    145   G4IonTable* itp = G4IonTable::GetIonTable();
146   G4ParticleDefinition* muonicAtom = itp->GetM    146   G4ParticleDefinition* muonicAtom = itp->GetMuonicAtom(nucleus->GetZ_asInt(),
147                                                   147                                                         nucleus->GetA_asInt());
148                                                   148 
149   G4DynamicParticle* dp = new G4DynamicParticl    149   G4DynamicParticle* dp = new G4DynamicParticle(muonicAtom,G4RandomDirection(),0.);
150   G4HadSecondary hadSec(dp);                      150   G4HadSecondary hadSec(dp);
151   hadSec.SetTime(time0);                          151   hadSec.SetTime(time0);
152   result->AddSecondary(hadSec);                   152   result->AddSecondary(hadSec);
153                                                   153 
154   // Fill results                                 154   // Fill results
155   //                                              155   //
156   theTotalResult->ProposeTrackStatus(fStopAndK    156   theTotalResult->ProposeTrackStatus(fStopAndKill);
157   theTotalResult->ProposeLocalEnergyDeposit(ed    157   theTotalResult->ProposeLocalEnergyDeposit(edep);  
158   theTotalResult->SetNumberOfSecondaries(nSeco    158   theTotalResult->SetNumberOfSecondaries(nSecondaries);
159   G4double w  = track.GetWeight();                159   G4double w  = track.GetWeight();
160   theTotalResult->ProposeWeight(w);               160   theTotalResult->ProposeWeight(w);
161                                                   161 
162 #ifdef G4VERBOSE                                  162 #ifdef G4VERBOSE
163     if (GetVerboseLevel() > 1) {                  163     if (GetVerboseLevel() > 1) {
164       G4cout << __func__                          164       G4cout << __func__
165              << " nSecondaries "                  165              << " nSecondaries "
166              << nSecondaries                      166              << nSecondaries
167              << G4endl;                           167              << G4endl;
168     }                                             168     }
169 #endif                                            169 #endif
170                                                   170 
171   for(G4int i=0; i<nSecondaries; ++i) {           171   for(G4int i=0; i<nSecondaries; ++i) {
172     G4HadSecondary* sec = result->GetSecondary    172     G4HadSecondary* sec = result->GetSecondary(i);
173                                                   173 
174     // add track global time to the reaction t    174     // add track global time to the reaction time
175     G4double time = sec->GetTime();               175     G4double time = sec->GetTime();
176     if(time < 0.0) { time = 0.0; }                176     if(time < 0.0) { time = 0.0; }
177     time += time0;                                177     time += time0;
178                                                   178 
179 #ifdef G4VERBOSE                                  179 #ifdef G4VERBOSE
180     if (GetVerboseLevel() > 1) {                  180     if (GetVerboseLevel() > 1) {
181       G4cout << __func__                          181       G4cout << __func__
182              << " "                               182              << " "
183              << i                                 183              << i
184              << " Resulting secondary "           184              << " Resulting secondary "
185              << sec->GetParticle()->GetPDGcode    185              << sec->GetParticle()->GetPDGcode()
186              << " "                               186              << " "
187              << sec->GetParticle()->GetDefinit    187              << sec->GetParticle()->GetDefinition()->GetParticleName()
188              << G4endl;                           188              << G4endl;
189     }                                             189     }
190 #endif                                            190 #endif
191                                                   191 
192     // create secondary track                     192     // create secondary track
193     G4Track* t = new G4Track(sec->GetParticle(    193     G4Track* t = new G4Track(sec->GetParticle(),
194            time,                                  194            time, 
195            track.GetPosition());                  195            track.GetPosition());
196     t->SetWeight(w*sec->GetWeight());             196     t->SetWeight(w*sec->GetWeight());
197                                                   197 
198     t->SetTouchableHandle(track.GetTouchableHa    198     t->SetTouchableHandle(track.GetTouchableHandle());
199     theTotalResult->AddSecondary(t);              199     theTotalResult->AddSecondary(t);
200   }                                               200   }
201   result->Clear();                                201   result->Clear();
202                                                   202 
203   // fixme: needs to be done at the MuonicAtom    203   // fixme: needs to be done at the MuonicAtom level
204   // if (epReportLevel != 0) { // G4HadronicPr    204   // if (epReportLevel != 0) { // G4HadronicProcess::
205   //   CheckEnergyMomentumConservation(track,     205   //   CheckEnergyMomentumConservation(track, *nucleus);
206   // }                                            206   // }
207   return theTotalResult;                          207   return theTotalResult;
208 }                                                 208 }
209                                                   209 
210 //....oooOO0OOooo........oooOO0OOooo........oo    210 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
211                                                   211 
212 void G4MuonMinusAtomicCapture::ProcessDescript    212 void G4MuonMinusAtomicCapture::ProcessDescription(std::ostream& outFile) const
213 {                                                 213 {
214   outFile << "Stopping of mu- using default el    214   outFile << "Stopping of mu- using default element selector, EM cascade"
215           << "G4MuonicAtom is created\n";         215           << "G4MuonicAtom is created\n";
216 }                                                 216 }
217                                                   217 
218 //....oooOO0OOooo........oooOO0OOooo........oo    218 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
219                                                   219