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[ 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/decay/src/G4UnknownDecay.cc (Version 11.3.0) and /processes/decay/src/G4UnknownDecay.cc (Version 5.2)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 //                                                
 28 //                                                
 29 // -------------------------------------------    
 30 //      GEANT 4 class implementation file         
 31 //                                                
 32 // -------------------------------------------    
 33 //                                                
 34                                                   
 35 #include "G4UnknownDecay.hh"                      
 36                                                   
 37 #include "G4PhysicalConstants.hh"                 
 38 #include "G4SystemOfUnits.hh"                     
 39 #include "G4DynamicParticle.hh"                   
 40 #include "G4DecayProducts.hh"                     
 41 #include "G4PhysicsLogVector.hh"                  
 42 #include "G4ParticleChangeForDecay.hh"            
 43 #include "G4DecayProcessType.hh"                  
 44                                                   
 45 // constructor                                    
 46 G4UnknownDecay::G4UnknownDecay(const G4String&    
 47                                :G4VDiscretePro    
 48         verboseLevel(1),                          
 49                                 HighestValue(2    
 50 {                                                 
 51   // set Process Sub Type                         
 52   SetProcessSubType(static_cast<int>(DECAY_Unk    
 53                                                   
 54 #ifdef G4VERBOSE                                  
 55   if (GetVerboseLevel()>1) {                      
 56     G4cout << "G4UnknownDecay  constructor " <    
 57   }                                               
 58 #endif                                            
 59   pParticleChange = &fParticleChangeForDecay;     
 60 }                                                 
 61                                                   
 62 G4UnknownDecay::~G4UnknownDecay()                 
 63 {                                                 
 64 }                                                 
 65                                                   
 66 G4bool G4UnknownDecay::IsApplicable(const G4Pa    
 67 {                                                 
 68   if(aParticleType.GetParticleName()=="unknown    
 69   return false;                                   
 70 }                                                 
 71                                                   
 72 G4double G4UnknownDecay::GetMeanFreePath(const    
 73 {                                                 
 74    return 0.0;                                    
 75 }                                                 
 76                                                   
 77 void G4UnknownDecay::BuildPhysicsTable(const G    
 78 {                                                 
 79   return;                                         
 80 }                                                 
 81                                                   
 82 G4VParticleChange* G4UnknownDecay::DecayIt(con    
 83 {                                                 
 84   // The DecayIt() method returns by pointer a    
 85   // Units are expressed in GEANT4 internal un    
 86                                                   
 87   //   Initialize ParticleChange                  
 88   //     all members of G4VParticleChange are     
 89   //     corresponding member in G4Track          
 90   fParticleChangeForDecay.Initialize(aTrack);     
 91                                                   
 92   // get particle                                 
 93   const G4DynamicParticle* aParticle = aTrack.    
 94                                                   
 95   //check if thePreAssignedDecayProducts exist    
 96   const G4DecayProducts* o_products = (aPartic    
 97   G4bool isPreAssigned = (o_products != nullpt    
 98   G4DecayProducts* products = nullptr;            
 99                                                   
100   if (!isPreAssigned ){                           
101     fParticleChangeForDecay.SetNumberOfSeconda    
102     // Kill the parent particle                   
103     fParticleChangeForDecay.ProposeTrackStatus    
104     fParticleChangeForDecay.ProposeLocalEnergy    
105                                                   
106     ClearNumberOfInteractionLengthLeft();         
107     return &fParticleChangeForDecay ;             
108   }                                               
109                                                   
110   // copy decay products                          
111   products = new G4DecayProducts(*o_products);    
112                                                   
113   // get parent particle information .........    
114   G4double   ParentEnergy  = aParticle->GetTot    
115   G4double   ParentMass    = aParticle->GetMas    
116   if (ParentEnergy < ParentMass) {                
117     ParentEnergy = ParentMass;                    
118 #ifdef G4VERBOSE                                  
119     if (GetVerboseLevel()>1) {                    
120       G4cout << "G4UnknownDecay::DoIt  : Total    
121       G4cout << " Particle: " << aParticle->Ge    
122       G4cout << " Energy:"    << ParentEnergy/    
123       G4cout << " Mass:"    << ParentMass/MeV     
124       G4cout << G4endl;                           
125     }                                             
126 #endif                                            
127   }                                               
128   G4ThreeVector ParentDirection(aParticle->Get    
129                                                   
130   G4double energyDeposit = 0.0;                   
131   G4double finalGlobalTime = aTrack.GetGlobalT    
132   //boost all decay products to laboratory fra    
133   //if the particle has traveled                  
134   if(aParticle->GetPreAssignedDecayProperTime(    
135     products->Boost( ParentEnergy, ParentDirec    
136   }                                               
137                                                   
138   //add products in fParticleChangeForDecay       
139   G4int numberOfSecondaries = products->entrie    
140   fParticleChangeForDecay.SetNumberOfSecondari    
141 #ifdef G4VERBOSE                                  
142   if (GetVerboseLevel()>1) {                      
143     G4cout << "G4UnknownDecay::DoIt  : Decay v    
144     G4cout << " Time: " << finalGlobalTime/ns     
145     G4cout << " X:" << (aTrack.GetPosition()).    
146     G4cout << " Y:" << (aTrack.GetPosition()).    
147     G4cout << " Z:" << (aTrack.GetPosition()).    
148     G4cout << G4endl;                             
149     G4cout << "G4UnknownDecay::DoIt  : decay p    
150     products->DumpInfo();                         
151   }                                               
152 #endif                                            
153   G4int index;                                    
154   G4ThreeVector currentPosition;                  
155   const G4TouchableHandle thand = aTrack.GetTo    
156   for (index=0; index < numberOfSecondaries; i    
157     // get current position of the track          
158     currentPosition = aTrack.GetPosition();       
159     // create a new track object                  
160     G4Track* secondary = new G4Track( products    
161               finalGlobalTime ,                   
162               currentPosition );                  
163     // switch on good for tracking flag           
164     secondary->SetGoodForTrackingFlag();          
165     secondary->SetTouchableHandle(thand);         
166     // add the secondary track in the List        
167     fParticleChangeForDecay.AddSecondary(secon    
168   }                                               
169   delete products;                                
170                                                   
171   // Kill the parent particle                     
172   fParticleChangeForDecay.ProposeTrackStatus(     
173   fParticleChangeForDecay.ProposeLocalEnergyDe    
174   fParticleChangeForDecay.ProposeGlobalTime( f    
175   // reset NumberOfInteractionLengthLeft          
176   ClearNumberOfInteractionLengthLeft();           
177                                                   
178   return &fParticleChangeForDecay ;               
179 }                                                 
180                                                   
181 void G4UnknownDecay::ProcessDescription(std::o    
182 {                                                 
183   outFile << GetProcessName()                     
184     << ": Decay of 'unknown' particles. \n"       
185     << "kinematics of daughters are dertermine    
186     << "by PreAssignedDecayProducts. \n";         
187 }                                                 
188                                                   
189                                                   
190                                                   
191                                                   
192                                                   
193