Geant4-11
G4IonTable.cc
Go to the documentation of this file.
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// G4IonTable class implementation
27//
28// Author: H.Kurashige, 27 June 1998
29// --------------------------------------------------------------------
30
31#include <iostream>
32#include <iomanip>
33#include <sstream>
34#include <algorithm>
35#include <vector>
36
37#include "G4ios.hh"
38#include "G4Threading.hh"
39#include "G4AutoDelete.hh"
40
41#include "G4IonTable.hh"
43#include "G4SystemOfUnits.hh"
44#include "G4ParticleTable.hh"
45#include "G4StateManager.hh"
46#include "G4Ions.hh"
47#include "G4UImanager.hh"
48#include "G4NucleiProperties.hh"
50
51#include "G4IsotopeProperty.hh"
52#include "G4VIsotopeTable.hh"
53#include "G4NuclideTable.hh"
54
55#include "G4MuonicAtom.hh"
56#include "G4MuonicAtomHelper.hh"
57
58// It is very important for multithreaded Geant4 to keep only one copy of the
59// particle table pointer and the ion table pointer. However, we try to let
60// each worker thread hold its own copy of the particle dictionary and the
61// ion list. This implementation is equivalent to make the ion table thread
62// private. The two shadow ponters are used by each worker thread to copy the
63// content from the master thread.
64//
66G4ThreadLocal std::vector<G4VIsotopeTable*> *G4IonTable::fIsotopeTableList = nullptr;
68std::vector<G4VIsotopeTable*> *G4IonTable::fIsotopeTableListShadow = nullptr;
69
70namespace lightions
71{
72 static const G4ParticleDefinition* p_proton = nullptr;
73 static const G4ParticleDefinition* p_deuteron = nullptr;
74 static const G4ParticleDefinition* p_triton = nullptr;
75 static const G4ParticleDefinition* p_alpha = nullptr;
76 static const G4ParticleDefinition* p_He3 = nullptr;
77 void Init()
78 {
79 if ( p_proton != nullptr ) return;
85 }
86}
87
89{
90 static const G4ParticleDefinition* p_proton = nullptr;
91 static const G4ParticleDefinition* p_deuteron = nullptr;
92 static const G4ParticleDefinition* p_triton = nullptr;
93 static const G4ParticleDefinition* p_alpha = nullptr;
94 static const G4ParticleDefinition* p_He3 = nullptr;
95 void Init()
96 {
97 if ( p_proton != nullptr ) return;
103 }
104}
105
106#ifdef G4MULTITHREADED
107G4Mutex G4IonTable::ionTableMutex = G4MUTEX_INITIALIZER;
108#endif
109
110// --------------------------------------------------------------------
111// Constructor
112//
114{
115 fIonList = new G4IonList();
116
117 // Set up the shadow pointer used by worker threads.
118 //
119 if (fIonListShadow == nullptr)
120 {
122 }
123
124 fIsotopeTableList = new std::vector<G4VIsotopeTable*>;
125
126 // Set up the shadow pointer used by worker threads.
127 //
128 if (fIsotopeTableListShadow == nullptr)
129 {
131 }
132
135}
136
137// --------------------------------------------------------------------
138// Destructor
139//
141{
142 // delete IsotopeTable if existing
143 if (fIsotopeTableList != nullptr )
144 {
145 for (std::size_t i=0; i<fIsotopeTableList->size(); ++i)
146 {
147 G4VIsotopeTable* fIsotopeTable= (*fIsotopeTableList)[i];
148 if( fIsotopeTable != G4NuclideTable::GetNuclideTable() )
149 {
150 delete fIsotopeTable;
151 }
152 }
153 fIsotopeTableList->clear();
154 delete fIsotopeTableList;
155 }
156 fIsotopeTableList = nullptr;
157
158 if (fIonList == nullptr) return;
159
160 // remove all contents in the Ion List
161 // No need to delete here because all particles are dynamic objects
162 fIonList->clear();
163 delete fIonList;
164 fIonList = nullptr;
165}
166
167// --------------------------------------------------------------------
168// GetIonTable
169//
171{
173}
174
175// --------------------------------------------------------------------
176// WorkerG4IonTable
177//
178// Used by each worker thread to copy the content from the master thread
179//
181{
182 if( fIonList == nullptr ) { fIonList = new G4IonList(); }
183 else { fIonList->clear(); }
184
185 for (auto it = fIonListShadow->cbegin(); it != fIonListShadow->cend(); ++it )
186 {
187 fIonList->insert(*it);
188 }
189
190 // Do not copy Isotope Table to Worker thread
191 //
192 if( fIsotopeTableList == nullptr )
193 {
194 fIsotopeTableList = new std::vector<G4VIsotopeTable*>;
195 for (std::size_t i = 0; i < fIsotopeTableListShadow->size(); ++i)
196 {
198 }
199 }
200}
201
202// --------------------------------------------------------------------
203// InitializeLightIons
204//
206{
209}
210
211// --------------------------------------------------------------------
212// DestroyWorkerG4IonTable
213//
215{
216 // delete IsotopeTable if existing
217 if (fIsotopeTableList != nullptr )
218 {
219 for (std::size_t i=0; i<fIsotopeTableList->size(); ++i)
220 {
221 G4VIsotopeTable* fIsotopeTable= (*fIsotopeTableList)[i];
222 if( fIsotopeTable != G4NuclideTable::GetNuclideTable() )
223 {
224 delete fIsotopeTable;
225 }
226 }
227 fIsotopeTableList->clear();
228 delete fIsotopeTableList;
229 }
230 fIsotopeTableList = nullptr;
231
232
233 if (fIonList == nullptr) return;
234
235 // remove all contents in the Ion List
236 // No need to delete here because all particles are dynamic objects
237 fIonList->clear();
238 delete fIonList;
239 fIonList = nullptr;
240}
241
242// --------------------------------------------------------------------
243// CreateIon
244//
247{
248 G4ParticleDefinition* ion = nullptr;
249
250 // check whether GenericIon has processes
251 G4ParticleDefinition* genericIon =
253 G4ProcessManager* pman = nullptr;
254 if (genericIon!= nullptr) { pman = genericIon->GetProcessManager(); }
255 if ((genericIon == nullptr) || (genericIon->GetParticleDefinitionID() < 0)
256 || (pman==nullptr))
257 {
258#ifdef G4VERBOSE
259 if (GetVerboseLevel()>1)
260 {
261 G4cout << "G4IonTable::CreateIon() : can not create ion of "
262 << " Z =" << Z << " A = " << A
263 << " because GenericIon is not ready !!" << G4endl;
264 }
265#endif
266 G4Exception( "G4IonTable::CreateIon()", "PART105", JustWarning,
267 "Can not create ions because GenericIon is not ready");
268 return nullptr;
269 }
270
271 G4double life = 0.0;
272 G4DecayTable* decayTable = nullptr;
273 G4bool stable = true;
274 G4double mu = 0.0;
275 G4double Eex = 0.0;
276 G4int lvl = 0;
277 G4int J = 0;
278
279 const G4IsotopeProperty* fProperty = FindIsotope(Z, A, E, flb);
280 if (fProperty != nullptr )
281 {
282 Eex = fProperty->GetEnergy();
283 lvl = fProperty->GetIsomerLevel();
284 J = fProperty->GetiSpin();
285 life = fProperty->GetLifeTime();
286 mu = fProperty->GetMagneticMoment();
287 decayTable = fProperty->GetDecayTable();
288 stable = (life <= 0.) || (decayTable == nullptr);
289 lvl = fProperty->GetIsomerLevel();
290 if (lvl <0) lvl=9;
291 }
292 else
293 {
294#ifdef G4VERBOSE
295 if (GetVerboseLevel()>1)
296 {
298 ed << "G4IonTable::CreateIon(): G4IsotopeProperty object is not found for"
299 << " Z = " << Z << " A = " << A << " E = " << E/keV << " (keV)";
301 {
302 ed << " FloatingLevel +" << G4Ions::FloatLevelBaseChar(flb);
303 }
304 ed << ".\n"
305 << " Physics quantities such as life are not set for this ion.";
306 G4Exception( "G4IonTable::CreateIon()","PART70105", JustWarning, ed);
307 }
308#endif
309 // excitation energy
310 Eex = E;
311 // lvl is assigned to 9 temporarily
312 if (Eex>0.0) lvl=9;
313 }
314
315 // Eex = G4NuclideTable::Round(Eex);
316 if (Eex==0.0) lvl=0;
317 // ion name
318 G4String name ="";
320 if (lvl==0 && flb==G4Ions::G4FloatLevelBase::no_Float)
321 name = GetIonName(Z, A, lvl);
322 else
323 name = GetIonName(Z, A, Eex, flb);
324
325 // PDG encoding
327
328 // PDG mass
329 G4double mass = GetNucleusMass(Z, A)+ Eex;
330
331 // PDG charge is set to one of nucleus
332 G4double charge = G4double(Z)*eplus;
333
334 // create an ion
335 // spin, parity, isospin values are fixed
336
337 // Request lock for particle table accesses. Some changes are inside
338 // this critical region.
339 //
340 ion = new G4Ions( name, mass, 0.0*MeV, charge,
341 J, +1, 0,
342 0, 0, 0,
343 "nucleus", 0, A, encoding,
344 stable, life, decayTable, false,
345 "generic", 0,
346 Eex, lvl );
347
348 // Release lock for particle table accesses.
349 //
350 ion->SetPDGMagneticMoment(mu);
351 static_cast<G4Ions*>(ion)->SetFloatLevelBase(flb);
352
353 // No Anti particle registered
354 ion->SetAntiPDGEncoding(0);
355
356#ifdef G4VERBOSE
357 if (GetVerboseLevel()>1)
358 {
359 G4cout << "G4IonTable::CreateIon() : create ion of " << name
360 << " " << Z << ", " << A
361 << " encoding=" << encoding;
362 if (E>0.0)
363 {
364 G4cout << " IsomerLVL=" << lvl
365 << " excited energy=" << Eex/keV << "[keV]";
366 }
367 G4cout << G4endl;
368 }
369#endif
370
371 // Add process manager to the ion
373
374#ifdef G4MULTITHREADED
375 // Fill decay channels if this method is invoked from worker
377 {
378 if(!stable && decayTable)
379 {
380 G4int nCh = decayTable->entries();
381 for(G4int iCh=0; iCh<nCh; ++iCh)
382 {
383 decayTable->GetDecayChannel(iCh)->GetDaughter(0);
384 }
385 }
386 }
387#endif
388
389 return ion;
390}
391
392// --------------------------------------------------------------------
393// CreateIon
394//
398{
399 if (LL==0) return CreateIon(Z,A,E,flb);
400
401 // create hyper nucleus
402 G4ParticleDefinition* ion = nullptr;
403
404 // check whether GenericIon has processes
405 G4ParticleDefinition* genericIon =
407 G4ProcessManager* pman = nullptr;
408 if (genericIon != nullptr) pman = genericIon->GetProcessManager();
409 if ((genericIon == nullptr) || (genericIon->GetParticleDefinitionID() < 0)
410 || (pman==nullptr))
411 {
412#ifdef G4VERBOSE
413 if (GetVerboseLevel()>1)
414 {
415 G4cout << "G4IonTable::CreateIon() : can not create ion of "
416 << " Z =" << Z << " A = " << A
417 << " because GenericIon is not ready !!" << G4endl;
418 }
419#endif
420 G4Exception( "G4IonTable::CreateIon()","PART105", JustWarning,
421 "Can not create ions because GenericIon is not ready");
422 return nullptr;
423 }
424
425 G4int J = 0;
426 G4double life = 0.0;
427 G4DecayTable* decayTable = nullptr;
428 G4bool stable = true;
429
430 // excitation energy
431 // G4double Eex = G4NuclideTable::Round(E);
432 G4double Eex = E;
433 G4double mass = GetNucleusMass(Z, A, LL)+ Eex;
434 G4int lvl = 0;
435 // lvl is assigned to 9 temporarily
436 if (Eex>0.0) lvl=9;
437
438 // PDG encoding
440
441 // PDG charge is set to one of nucleus
442 G4double charge = G4double(Z)*eplus;
443
444 // create an ion
445 // spin, parity, isospin values are fixed
446 //
447 // get ion name
448 G4String name = GetIonName(Z, A, LL, Eex, flb);
449
450 ion = new G4Ions( name, mass, 0.0*MeV, charge,
451 J, +1, 0,
452 0, 0, 0,
453 "nucleus", 0, A, encoding,
454 stable, life, decayTable, false,
455 "generic", 0,
456 Eex, lvl );
457
458 // Release lock for particle table accesses
459
460 G4double mu = 0.0; // magnetic moment
461 ion->SetPDGMagneticMoment(mu);
462 static_cast<G4Ions*>(ion)->SetFloatLevelBase(flb);
463
464 // No Anti particle registered
465 ion->SetAntiPDGEncoding(0);
466
467#ifdef G4VERBOSE
468 if (GetVerboseLevel()>1)
469 {
470 G4cout << "G4IonTable::CreateIon() : create hyper ion of " << name
471 << " " << Z << ", " << A << ", " << LL
472 << " encoding=" << encoding;
473 if (E>0.0)
474 {
475 G4cout << " IsomerLVL=" << lvl
476 << " excited energy=" << Eex/keV << "[keV]";
477 }
478 G4cout << G4endl;
479 }
480#endif
481
482 // Add process manager to the ion
484
485 return ion;
486}
487
488// --------------------------------------------------------------------
489// CreateIon
490//
492{
493 if(lvl == 0) return CreateIon(Z,A,0.0,G4Ions::G4FloatLevelBase::no_Float);
494 G4Exception( "G4IonTable::CreateIon()","PART105", JustWarning,
495 "Ion cannot be created by an isomer level. Use excitation energy.");
496 return nullptr;
497}
498
499// --------------------------------------------------------------------
500// CreateIon
501//
504{
505 if (LL==0) return CreateIon(Z,A,lvl);
506 if(lvl == 0) return CreateIon(Z,A,0.0,G4Ions::G4FloatLevelBase::no_Float);
507
508 if (lvl>0)
509 {
511 ed << "Isomer level " << lvl << " is unknown for the isotope (Z="
512 << Z << ", A=" << A << ", L=" << LL << "). Null pointer is returned.";
513 G4Exception( "G4IonTable::GetIon()","PART106", JustWarning, ed);
514 return nullptr;
515 }
516 return nullptr;
517}
518
519// --------------------------------------------------------------------
520// -- GetIon methods ------
521//
523{
524 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) )
525 {
526#ifdef G4VERBOSE
527 if (GetVerboseLevel()>0)
528 {
529 G4cout << "G4IonTable::GetIon() : illegal atomic number/mass"
530 << " Z =" << Z << " A = " << A << " Lvl = " << lvl << G4endl;
531 }
532#endif
533 return nullptr;
534 }
535 if ( lvl == 0 ) return GetIon(Z,A,0.0);
536
537 // Search ions with A, Z, lvl
538 G4ParticleDefinition* ion = FindIon(Z,A,lvl);
539
540 // create ion
541#ifdef G4MULTITHREADED
542 if (ion == nullptr )
543 {
545 {
546 G4MUTEXLOCK(&G4IonTable::ionTableMutex);
547 ion = FindIonInMaster(Z,A,lvl);
548 if(ion != nullptr ) InsertWorker(ion);
549 G4MUTEXUNLOCK(&G4IonTable::ionTableMutex);
550 }
551 }
552#endif
553 if (ion == nullptr )
554 {
555 G4Exception( "G4IonTable::GetIon()","PART105", JustWarning,
556 "Ion cannot be created by an isomer level. Use excitation energy.");
557 }
558 return ion;
559}
560
561// --------------------------------------------------------------------
562//
564{
565 if (LL==0) return GetIon(Z,A,lvl);
566
567 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 )
568 {
569#ifdef G4VERBOSE
570 if (GetVerboseLevel()>0)
571 {
572 G4cout << "G4IonTable::GetIon() : illegal atomic number/mass"
573 << " Z =" << Z << " A = " << A << " L = " << LL
574 <<" IsomerLvl = " << lvl << G4endl;
575 }
576#endif
577 return nullptr;
578 }
579 else if( A==2 )
580 {
581#ifdef G4VERBOSE
582 if (GetVerboseLevel()>0)
583 {
584 G4cout << "G4IonTable::GetIon() : No boud state for "
585 << " Z =" << Z << " A = " << A << " L = " << LL
586 <<" IsomerLvl = " << lvl << G4endl;
587 }
588#endif
589 return nullptr;
590 }
591
592 // Search ions with A, Z
593 G4ParticleDefinition* ion = FindIon(Z,A,LL,lvl);
594
595 // create ion
596 if (ion == nullptr)
597 {
598 if (lvl==0)
599 {
600#ifdef G4MULTITHREADED
602 {
603 G4MUTEXLOCK(&G4IonTable::ionTableMutex);
604 ion = FindIonInMaster(Z,A,LL,lvl);
605 if(ion == nullptr) ion = CreateIon(Z, A, LL, lvl);
606 InsertWorker(ion);
607 G4MUTEXUNLOCK(&G4IonTable::ionTableMutex);
608 }
609 else
610 {
611 ion = CreateIon(Z, A, LL, lvl);
612 }
613#else
614 ion = CreateIon(Z, A, LL, lvl);
615#endif
616 }
617 }
618
619 return ion;
620}
621
622// --------------------------------------------------------------------
623//
625{
627}
628
629// --------------------------------------------------------------------
630//
633{
634 return GetIon(Z,A,E,G4Ions::FloatLevelBase(flbChar),J);
635}
636
637// --------------------------------------------------------------------
638//
641{
642 if ( (A<1) || (Z<=0) || (E<0.0) || (A>999) || (J<0) )
643 {
644#ifdef G4VERBOSE
645 if (GetVerboseLevel()>0)
646 {
647 G4cout << "G4IonTable::GetIon() : illegal atomic number/mass"
648 << " Z =" << Z << " A = " << A << " E = " << E/keV << G4endl;
649 }
650#endif
651 return nullptr;
652 }
653
654 // Search ions with A, Z
655 G4ParticleDefinition* ion = FindIon(Z,A,E,flb,J);
656
657 // create ion
658#ifdef G4MULTITHREADED
659 if(ion == nullptr )
660 {
662 {
663 G4MUTEXLOCK(&G4IonTable::ionTableMutex);
664 ion = FindIonInMaster(Z,A,E,flb,J);
665 if(ion == nullptr) ion = CreateIon(Z,A,E,flb);
666 InsertWorker(ion);
667 G4MUTEXUNLOCK(&G4IonTable::ionTableMutex);
668 }
669 else
670 {
671 ion = CreateIon(Z,A,E,flb);
672 }
673 }
674#else
675 if (ion == nullptr) ion = CreateIon(Z,A,E,flb);
676#endif
677
678 return ion;
679}
680
681// --------------------------------------------------------------------
682//
685{
687}
688
689// --------------------------------------------------------------------
690//
693 char flbChar, G4int J)
694{
695 return GetIon(Z,A,LL,E,G4Ions::FloatLevelBase(flbChar),J);
696}
697
698// --------------------------------------------------------------------
699//
703{
704 if (LL==0) return GetIon(Z,A,E,flb,J);
705
706 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 )
707 {
708#ifdef G4VERBOSE
709 if (GetVerboseLevel()>0)
710 {
711 G4cout << "G4IonTable::GetIon() : illegal atomic number/mass"
712 << " Z =" << Z << " A = " << A << " L = " << LL
713 <<" E = " << E/keV << G4endl;
714 }
715#endif
716 return nullptr;
717 }
718 else if( A==2 )
719 {
720#ifdef G4VERBOSE
721 if (GetVerboseLevel()>0)
722 {
723 G4cout << "G4IonTable::GetIon() : No boud state for "
724 << " Z =" << Z << " A = " << A << " L = " << LL
725 << " E = " << E/keV << G4endl;
726 }
727#endif
728 return nullptr;
729 }
730
731 // Search ions with A, Z
732 G4ParticleDefinition* ion = FindIon(Z,A,LL,E,flb,J);
733
734 // create ion
735#ifdef G4MULTITHREADED
736 if(ion == nullptr ){
738 {
739 G4MUTEXLOCK(&G4IonTable::ionTableMutex);
740 ion = FindIonInMaster(Z,A,LL,E,flb,J);
741 if(ion == nullptr) ion = CreateIon(Z,A,LL,E,flb);
742 InsertWorker(ion);
743 G4MUTEXUNLOCK(&G4IonTable::ionTableMutex);
744 }
745 else
746 {
747 ion = CreateIon(Z,A,LL,E,flb);
748 }
749 }
750#else
751 if(ion == nullptr) ion = CreateIon(Z,A,LL,E,flb);
752#endif
753
754 return ion;
755}
756
757// --------------------------------------------------------------------
758//
760{
761 G4int Z, A, LL, IsoLvl;
762 G4double E;
763 if (!GetNucleusByEncoding(encoding,Z,A,LL,E,IsoLvl))
764 {
765#ifdef G4VERBOSE
766 if (GetVerboseLevel()>0)
767 {
768 G4cout << "G4IonTable::GetIon() : illegal encoding"
769 << " CODE:" << encoding << G4endl;
770 }
771#endif
772 G4Exception( "G4IonTable::GetIon()","PART106",
773 JustWarning, "illegal encoding for an ion");
774 return nullptr;
775 }
776 return GetIon( Z, A, LL, IsoLvl);
777}
778
779// --------------------------------------------------------------------
780// -- FindIon methods ------
781//
784{
786}
787
788// --------------------------------------------------------------------
789//
792{
793 return FindIon(Z,A,E,G4Ions::FloatLevelBase(flbChar),J);
794}
795
796// --------------------------------------------------------------------
797//
801{
802 if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) )
803 {
804#ifdef G4VERBOSE
805 if (GetVerboseLevel()>0)
806 {
807 G4cout << "G4IonTable::FindIon(): illegal atomic number/mass"
808 << " or excitation level:" << G4endl
809 << " Z =" << Z << " A = " << A << " E = " << E/keV << G4endl;
810 }
811#endif
812 G4Exception("G4IonTable::FindIon()","PART107",
813 JustWarning, "illegal atomic number/mass");
814 return nullptr;
815 }
816 // Search ions with A, Z ,E
817 // !! J is omitted now !!
818 const G4ParticleDefinition* ion = nullptr;
819 G4bool isFound = false;
820
821 // check if light ion
822 ion = GetLightIon(Z,A);
823 if (ion!= nullptr && E == 0.0)
824 {
825 // light ion
826 isFound = true;
827 }
828 else
829 {
830 // -- loop over all particles in Ion table
832 for(auto i = fIonList->find(encoding); i != fIonList->cend(); ++i)
833 {
834 ion = i->second;
835 if ( (ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
836 // excitation level
837 G4double anExcitaionEnergy= ((const G4Ions*)(ion))->GetExcitationEnergy();
838 if (std::fabs(E - anExcitaionEnergy) < pNuclideTable->GetLevelTolerance())
839 {
840 if(((const G4Ions*)(ion))->GetFloatLevelBase()==flb)
841 {
842 isFound = true;
843 break;
844 }
845 }
846 }
847 }
848
849 if ( isFound )
850 {
851 return const_cast<G4ParticleDefinition*>(ion);
852 }
853 else
854 {
855 return nullptr;
856 }
857}
858
859// --------------------------------------------------------------------
860//
863{
865}
866
867// --------------------------------------------------------------------
868//
871 char flbChar, G4int J)
872{
873 return FindIon(Z,A,LL,E,G4Ions::FloatLevelBase(flbChar),J);
874}
875
876// --------------------------------------------------------------------
877//
881{
882 if (LL==0) return FindIon(Z,A,E,flb,J);
883
884 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 )
885 {
886#ifdef G4VERBOSE
887 if (GetVerboseLevel()>0)
888 {
889 G4cout << "G4IonTable::FindIon(): illegal atomic number/mass"
890 << " or excitation level:" << G4endl
891 << " Z =" << Z << " A = " << A << " L = " << LL
892 <<" E = " << E/keV << G4endl;
893 }
894#endif
895 G4Exception("G4IonTable::FindIon()", "PART107",
896 JustWarning, "illegal atomic number/mass");
897 return nullptr;
898 }
899 // Search ions with A, Z ,E
900 // !! J is omitted now !!
901 const G4ParticleDefinition* ion = nullptr;
902 G4bool isFound = false;
903
904 // -- loop over all particles in Ion table
906 for(auto i = fIonList->find(encoding); i != fIonList->cend() ; ++i)
907 {
908 ion = i->second;
909 if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
910 if( ion->GetQuarkContent(3) != LL ) break;
911 // excitation level
912 G4double anExcitaionEnergy = ((const G4Ions*)(ion))->GetExcitationEnergy();
913 if (std::fabs(E - anExcitaionEnergy) < pNuclideTable->GetLevelTolerance())
914 {
915 if(((const G4Ions*)(ion))->GetFloatLevelBase()==flb)
916 {
917 isFound = true;
918 break;
919 }
920 }
921 }
922
923 if ( isFound )
924 {
925 return const_cast<G4ParticleDefinition*>(ion);
926 }
927 else
928 {
929 return nullptr;
930 }
931}
932
933// --------------------------------------------------------------------
934//
936{
937 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) )
938 {
939#ifdef G4VERBOSE
940 if (GetVerboseLevel()>0)
941 {
942 G4cout << "G4IonTable::FindIon(): illegal atomic number/mass"
943 << " or excitation level:" << G4endl
944 << " Z =" << Z << " A = " << A << " IsoLvl = " << lvl << G4endl;
945 }
946#endif
947 G4Exception("G4IonTable::FindIon()", "PART107",
948 JustWarning, "illegal atomic number/mass");
949 return nullptr;
950 }
951 // Search ions with A, Z ,E
952 // !! J is omitted now !!
953 const G4ParticleDefinition* ion = nullptr;
954 G4bool isFound = false;
955
956 // check if light ion
957 ion = GetLightIon(Z,A);
958 if (ion != nullptr && lvl==0)
959 {
960 // light ion
961 isFound = true;
962 }
963 else
964 {
965 // -- loop over all particles in Ion table
967 for(auto i = fIonList->find(encoding); i != fIonList->cend(); ++i)
968 {
969 ion = i->second;
970 if ( (ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
971 // excitation level
972 if ( ((const G4Ions*)(ion))->GetIsomerLevel() == lvl)
973 {
974 isFound = true;
975 break;
976 }
977 }
978 }
979
980 if ( isFound )
981 {
982 if(lvl==9)
983 {
984 G4Exception("G4IonTable::FindIon()","PART5107", JustWarning,
985 "Isomer level 9 may be ambiguous.");
986 }
987 return const_cast<G4ParticleDefinition*>(ion);
988 }
989 else
990 {
991 return nullptr;
992 }
993}
994
995// --------------------------------------------------------------------
996//
999{
1000 if (LL==0) return FindIon(Z,A,lvl);
1001
1002 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 )
1003 {
1004#ifdef G4VERBOSE
1005 if (GetVerboseLevel()>0)
1006 {
1007 G4cout << "G4IonTable::FindIon(): illegal atomic number/mass"
1008 << " or excitation level:" << G4endl
1009 << " Z =" << Z << " A = " << A << " L = " << LL
1010 <<" IsomerLvl = " << lvl << G4endl;
1011 }
1012#endif
1013 G4Exception( "G4IonTable::FindIon()", "PART107",
1014 JustWarning, "illegal atomic number/mass");
1015 return nullptr;
1016 }
1017
1018 // Search ions with A, Z ,E, lvl
1019 const G4ParticleDefinition* ion = nullptr;
1020 G4bool isFound = false;
1021
1022 // -- loop over all particles in Ion table
1024 for(auto i = fIonList->find(encoding); i != fIonList->cend() ; ++i)
1025 {
1026 ion = i->second;
1027 if ( (ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
1028 if ( ion->GetQuarkContent(3) != LL) break;
1029 // excitation level
1030 if ( ((const G4Ions*)(ion))->GetIsomerLevel() == lvl)
1031 {
1032 isFound = true;
1033 break;
1034 }
1035 }
1036
1037 if ( isFound )
1038 {
1039 if(lvl==9)
1040 {
1041 G4Exception("G4IonTable::FindIon()", "PART5107", JustWarning,
1042 "Isomer level 9 may be ambiguous.");
1043 }
1044 return const_cast<G4ParticleDefinition*>(ion);
1045 }
1046 else
1047 {
1048 return nullptr;
1049 }
1050}
1051
1052// --------------------------------------------------------------------
1053// GetNucleusEncoding
1054//
1056{
1057 // PDG code for Ions
1058 // Nuclear codes are given as 10-digit numbers +-100ZZZAAAI.
1059 // For a nucleus consisting of np protons and nn neutrons
1060 // A = np + nn and Z = np.
1061 // I gives the isomer level, with I = 0 corresponding
1062 // to the ground state and I >0 to excitations
1063
1064 if ( Z==1 && A==1 && E==0.0 ) return 2212; // proton
1065
1066 G4int encoding = 1000000000;
1067 encoding += Z * 10000;
1068 encoding += A *10;
1069 if (lvl>0&&lvl<10) encoding +=lvl; //isomer level
1070 else if (E>0.0) encoding += 9; //isomer level
1071
1072 return encoding;
1073}
1074
1075// --------------------------------------------------------------------
1076// GetNucleusEncoding
1077//
1079 G4double E, G4int lvl)
1080{
1081 // Get PDG code for Hyper-Nucleus Ions
1082 // Nuclear codes are given as 10-digit numbers +-10LZZZAAAI.
1083 // For a nucleus consisting of np protons and nn neutrons
1084 // A = np + nn +nlambda and Z = np.
1085 // LL = nlambda
1086 // I gives the isomer level, with I = 0 corresponding
1087 // to the ground state and I >0 to excitations
1088
1089 G4int encoding = GetNucleusEncoding(Z, A, E, lvl);
1090 if (LL==0) return encoding;
1091 encoding += LL* 10000000;
1092 if ( Z==1 && A==1 && E==0.0 ) encoding = 3122; // Lambda
1093
1094 return encoding;
1095}
1096
1097// --------------------------------------------------------------------
1098// GetNucleusByEncoding
1099//
1101 G4int& Z, G4int& A,
1102 G4double& E, G4int& lvl)
1103{
1104 if (encoding <= 0) return false; // anti particle
1105
1106 if (encoding == 2212) // proton
1107 {
1108 Z = 1; A = 1;
1109 E = 0.0; lvl =0;
1110 return true;
1111 }
1112
1113 encoding -= 1000000000;
1114 Z = encoding/10000;
1115 encoding -= 10000*Z;
1116 A = encoding/10;
1117 lvl = encoding % 10;
1118 return true;
1119}
1120
1121// --------------------------------------------------------------------
1122// GetNucleusByEncoding
1123//
1125 G4int& Z, G4int& A,
1126 G4int& LL,
1127 G4double& E, G4int& lvl)
1128{
1129 if (encoding <= 0) return false; // anti particle
1130
1131 if (encoding == 3122) // Lambda
1132 {
1133 Z = 1; A = 1; LL = 1;
1134 E = 0.0; lvl =0;
1135 return true;
1136 }
1137
1138 if (encoding % 10 != 0)
1139 {
1140 // !!!not supported for excitation states !!!
1141 return false;
1142 }
1143 if (encoding < 1000000000)
1144 {
1145 // anti particle
1146 return false;
1147 }
1148
1149 encoding -= 1000000000;
1150 LL = encoding/10000000;
1151 encoding -= 10000000*LL;
1152 Z = encoding/10000;
1153 encoding -= 10000*Z;
1154 A = encoding/10;
1155 lvl = encoding % 10;
1156 return true;
1157}
1158
1159// --------------------------------------------------------------------
1160// GetIonName
1161//
1163 G4Ions::G4FloatLevelBase flb) const
1164{
1165 static G4ThreadLocal G4String* pname = nullptr;
1166 if ( pname == nullptr )
1167 {
1168 pname = new G4String("");
1170 }
1171 G4String& name = *pname;
1172
1173 static G4ThreadLocal std::ostringstream* os = nullptr;
1174 if ( os == nullptr )
1175 {
1176 os = new std::ostringstream();
1178 os->setf(std::ios::fixed);
1179 os->precision(3);
1180 }
1181
1182 name = GetIonName(Z, A);
1183
1184 // Excited energy
1185 if ( E>0 || flb!=G4Ions::G4FloatLevelBase::no_Float)
1186 {
1187 os->str("");
1188 std::ostringstream& oo = *os;
1189
1190 // Excited nucleus
1191 oo<<'['<<E/keV;
1193 {
1195 }
1196 oo<< ']';
1197 name += os->str();
1198 }
1199
1200 return name;
1201}
1202
1203// --------------------------------------------------------------------
1204// GetIonName
1205//
1207 G4Ions::G4FloatLevelBase flb) const
1208{
1209 if (LL==0) return GetIonName(Z, A, E, flb);
1210 static G4ThreadLocal G4String* pname = nullptr;
1211 if (pname == nullptr)
1212 {
1213 pname = new G4String("");
1215 }
1216 G4String& name = *pname;
1217 name = "";
1218 for (G4int i=0; i<LL; ++i)
1219 {
1220 name +="L";
1221 }
1222 name += GetIonName(Z, A, E, flb);
1223 return name;
1224}
1225
1226// --------------------------------------------------------------------
1227// GetIonName
1228//
1230{
1231 static G4ThreadLocal G4String* pname = nullptr;
1232 if ( pname == nullptr )
1233 {
1234 pname = new G4String("");
1236 }
1237 G4String& name = *pname;
1238
1239 static G4ThreadLocal std::ostringstream* os = nullptr;
1240 if ( os == nullptr )
1241 {
1242 os = new std::ostringstream();
1244 os->setf(std::ios::fixed);
1245 }
1246
1247 if ( (0< Z) && (Z <=numberOfElements) )
1248 {
1249 name = elementName[Z-1];
1250 }
1251 else if (Z > numberOfElements)
1252 {
1253 os->str("");
1254 os->operator<<(Z);
1255 name = "E" + os->str() + "-";
1256 }
1257 else
1258 {
1259 name = "?";
1260 return name;
1261 }
1262 // Atomic Mass
1263 os->str("");
1264 os->operator<<(A);
1265
1266 if ( lvl>0 )
1267 {
1268 std::ostringstream& oo = *os;
1269 // Isomer level for Excited nucelus
1270 oo<<'['<<lvl << ']';
1271 }
1272 name += os->str();
1273
1274 return name;
1275}
1276
1277// --------------------------------------------------------------------
1278// GetIonName
1279//
1280const G4String&
1282{
1283 if (LL==0) return GetIonName(Z, A, lvl);
1284 static G4ThreadLocal G4String* pname = nullptr;
1285 if ( pname == nullptr )
1286 {
1287 pname = new G4String("");
1289 }
1290 G4String &name = *pname;
1291 for (G4int i=0; i<LL; ++i)
1292 {
1293 name +="L";
1294 }
1295 name += GetIonName(Z, A, lvl);
1296 return name;
1297}
1298
1299// --------------------------------------------------------------------
1300// IsIon
1301//
1303{
1304 // Return true if the particle is ion
1305 static const G4String nucleus("nucleus");
1306 static const G4String proton("proton");
1307
1308 // Neutron is not ion
1309 if ( (particle->GetAtomicMass()>0)
1310 && (particle->GetAtomicNumber()>0) )
1311 {
1312 if (particle->GetBaryonNumber()>0) return true;
1313 else return false;
1314 }
1315
1316 // Particles derived from G4Ions
1317 if (particle->GetParticleType() == nucleus) return true;
1318
1319 // Proton (Hydrogen nucleus)
1320 if (particle->GetParticleName() == proton) return true;
1321
1322 return false;
1323}
1324
1325// --------------------------------------------------------------------
1326// IsAntiIon
1327//
1329{
1330 // Return true if the particle is ion
1331 static const G4String anti_nucleus("anti_nucleus");
1332 static const G4String anti_proton("anti_proton");
1333
1334 // Anti_neutron is not ion
1335 if ( (particle->GetAtomicMass()>0)
1336 && (particle->GetAtomicNumber()>0) )
1337 {
1338 if (particle->GetBaryonNumber()<0) return true;
1339 else return false;
1340 }
1341
1342 // Particles derived from G4Ions
1343 if (particle->GetParticleType() == anti_nucleus) return true;
1344
1345 // Anti_proton (Anti_Hydrogen nucleus)
1346 if (particle->GetParticleName() == anti_proton) return true;
1347
1348 return false;
1349}
1350
1351// --------------------------------------------------------------------
1352// IsLightIon
1353//
1355{
1356 static const std::string names[]
1357 = { "proton", "alpha", "deuteron", "triton", "He3"};
1358
1359 // Return true if the particle is pre-defined ion
1360 return std::find(names, names+5, (particle->GetParticleName()).c_str())!=names+5;
1361}
1362
1363// --------------------------------------------------------------------
1364// IsLightAntiIon
1365//
1367{
1368 static const std::string names[]
1369 = { "anti_proton", "anti_alpha", "anti_deuteron", "anti_triton", "anti_He3"};
1370
1371 // Return true if the particle is pre-defined ion
1372 return std::find(names, names+5, (particle->GetParticleName()).c_str())!=names+5;
1373}
1374
1375// --------------------------------------------------------------------
1376// GetLightIon
1377//
1379{
1380 // Returns pointer to pre-defined ions
1381 const G4ParticleDefinition* ion = nullptr;
1382 if ( (Z<=2) )
1383 {
1384#ifndef G4MULTITHREADED
1385 // In sequential use lazy-initialization
1387#endif
1388 if ( (Z==1)&&(A==1) ) {
1389 ion = lightions::p_proton;
1390 } else if ( (Z==1)&&(A==2) ) {
1392 } else if ( (Z==1)&&(A==3) ) {
1393 ion = lightions::p_triton;
1394 } else if ( (Z==2)&&(A==4) ) {
1395 ion = lightions::p_alpha;
1396 } else if ( (Z==2)&&(A==3) ) {
1397 ion = lightions::p_He3;
1398 }
1399 }
1400 return const_cast<G4ParticleDefinition*>(ion);
1401}
1402
1403// --------------------------------------------------------------------
1404// GetLightAntiIon
1405//
1407{
1408 // Returns pointer to pre-defined ions
1409 const G4ParticleDefinition* ion = nullptr;
1410 if ( (Z<=2) )
1411 {
1412#ifndef G4MULTITHREADED
1413 // In sequential use lazy-initialization
1415#endif
1416 if ( (Z==1)&&(A==1) ) {
1418 } else if ( (Z==1)&&(A==2) ) {
1420 } else if ( (Z==1)&&(A==3) ) {
1422 } else if ( (Z==2)&&(A==4) ) {
1424 } else if ( (Z==2)&&(A==3) ) {
1426 }
1427 }
1428 return const_cast<G4ParticleDefinition*>(ion);
1429}
1430
1431// --------------------------------------------------------------------
1432// GetNucleusMass
1433//
1436{
1437 if ( (A<1) || (Z<0) || (LL<0) || (lvl<0) || (lvl>9) )
1438 {
1439#ifdef G4VERBOSE
1440 if (GetVerboseLevel()>0)
1441 {
1442 G4cout << "G4IonTable::GetNucleusMass() : illegal atomic number/mass:"
1443 << G4endl
1444 << " Z =" << Z << " A = " << A
1445 << " L = " << LL << " lvl = " << lvl << G4endl;
1446 }
1447#endif
1448 G4Exception("G4IonTable::GetNucleusMass()","PART107",
1449 EventMustBeAborted, "illegal atomic number/mass");
1450 return -1.0;
1451 }
1452
1453 G4double mass;
1454 if (LL == 0)
1455 {
1456 // calculate nucleus mass
1457 const G4ParticleDefinition* ion=GetLightIon(Z, A);
1458
1459 if (ion != nullptr)
1460 {
1461 mass = ion->GetPDGMass();
1462 }
1463 else
1464 {
1465 // Use G4NucleiProperties::GetNuclearMass
1467 }
1468
1469 // Isomer
1470 if ( lvl>0 )
1471 {
1472 // -- loop over all particles in Ion table
1474 G4bool isFound = false;
1475 for(auto i = fIonList->find(encoding);i != fIonList->cend() ; ++i)
1476 {
1477 ion = i->second;
1478 if ( ( ion->GetAtomicNumber()!=Z) || (ion->GetAtomicMass()!=A) ) break;
1479 // Excitation level
1480 if ( ((const G4Ions*)(ion))->GetIsomerLevel() == lvl)
1481 {
1482 isFound = true;
1483 break;
1484 }
1485 }
1486 if (isFound)
1487 {
1488 // Return existing isomer mass
1489 mass = ion->GetPDGMass();
1490 }
1491 else
1492 {
1493 // Find isomer from IsotopeTable
1494 const G4IsotopeProperty* fProperty = FindIsotope(Z, A, lvl);
1495 if (fProperty != nullptr ) mass += fProperty->GetEnergy();
1496 }
1497 }
1498 }
1499 else
1500 {
1502 }
1503 return mass;
1504}
1505
1506// --------------------------------------------------------------------
1507// GetIsomerMass
1508//
1510{
1511 return GetNucleusMass(Z,A,0,lvl);
1512}
1513
1514// --------------------------------------------------------------------
1515// GetIonMass
1516//
1518{
1519 return GetNucleusMass(Z,A,LL,lvl);
1520}
1521
1522// --------------------------------------------------------------------
1523// -- Methods for handling container ---
1524// --------------------------------------------------------------------
1525//
1527{
1528 if (G4ParticleTable::GetParticleTable()->GetReadiness())
1529 {
1530 G4Exception("G4IonTable::clear()",
1531 "PART116", JustWarning,
1532 "No effects because readyToUse is true.");
1533 return;
1534 }
1535
1536#ifdef G4VERBOSE
1537 if (GetVerboseLevel()>2)
1538 {
1539 G4cout << "G4IonTable::Clear() : number of Ion registered = ";
1540 G4cout << fIonList->size() << G4endl;
1541 }
1542#endif
1543 fIonList->clear();
1544}
1545
1546// --------------------------------------------------------------------
1547//
1549{
1550 if (!IsIon(particle)) return;
1551 if (Contains(particle)) return;
1552
1553 G4int Z = particle->GetAtomicNumber();
1554 G4int A = particle->GetAtomicMass();
1555 G4int LL = particle->GetQuarkContent(3); //strangeness
1556 G4int encoding=GetNucleusEncoding(Z, A, LL); // encoding of the groud state
1557
1558 // Register the ion with its encoding of the ground state
1559 fIonListShadow->insert( std::pair<const G4int,
1560 const G4ParticleDefinition*>(encoding, particle) );
1561}
1562
1563// --------------------------------------------------------------------
1564//
1566{
1567 if(!particle) return;
1568
1569 G4int Z = particle->GetAtomicNumber();
1570 G4int A = particle->GetAtomicMass();
1571 G4int LL = particle->GetQuarkContent(3); //strangeness
1573 G4bool found = false;
1574 if (encoding !=0 )
1575 {
1576 for(auto i = fIonList->find(encoding); i != fIonList->cend(); ++i)
1577 {
1578 if (particle == i->second)
1579 {
1580 found = true;
1581 break;
1582 }
1583 }
1584 }
1585 if(found) return;
1586
1587 // Register the ion with its encoding of the gronud state
1588 fIonList->insert( std::pair<const G4int,
1589 const G4ParticleDefinition*>(encoding, particle) );
1590}
1591
1592// --------------------------------------------------------------------
1593//
1595{
1596 if(particle == nullptr) return;
1597#ifdef G4MULTITHREADED
1599 {
1601 ed << "Request of removing " << particle->GetParticleName()
1602 << " is ignored as it is invoked from a worker thread.";
1603 G4Exception("G4IonTable::Remove()", "PART10117", JustWarning, ed);
1604 return;
1605 }
1606#endif
1607 if (G4ParticleTable::GetParticleTable()->GetReadiness())
1608 {
1610 G4ApplicationState currentState = pStateManager->GetCurrentState();
1611 if (currentState != G4State_PreInit)
1612 {
1613 G4String msg = "Request of removing ";
1614 msg += particle->GetParticleName();
1615 msg += " has No effects other than Pre_Init";
1616 G4Exception("G4IonTable::Remove()",
1617 "PART117", JustWarning, msg);
1618 return;
1619 }
1620 else
1621 {
1622#ifdef G4VERBOSE
1623 if (GetVerboseLevel()>0)
1624 {
1625 G4cout << particle->GetParticleName()
1626 << " will be removed from the IonTable " << G4endl;
1627 }
1628#endif
1629 }
1630 }
1631
1632 if (IsIon(particle))
1633 {
1634 G4int Z = particle->GetAtomicNumber();
1635 G4int A = particle->GetAtomicMass();
1636 G4int LL = particle->GetQuarkContent(3); // strangeness
1638 if (encoding !=0 )
1639 {
1640 for(auto i = fIonListShadow->find(encoding);
1641 i != fIonListShadow->cend() ; ++i)
1642 {
1643 if (particle == i->second)
1644 {
1645 fIonListShadow->erase(i);
1646 break;
1647 }
1648 }
1649 }
1650 }
1651 else
1652 {
1653#ifdef G4VERBOSE
1654 if (GetVerboseLevel()>1)
1655 {
1656 G4cout << "G4IonTable::Remove :" << particle->GetParticleName()
1657 << " is not ions" << G4endl;
1658 }
1659#endif
1660 }
1661}
1662
1663// --------------------------------------------------------------------
1664// -- Dump Information
1665//
1666void G4IonTable::DumpTable(const G4String& particle_name) const
1667{
1668 const G4ParticleDefinition* ion;
1669 for (auto idx = fIonList->cbegin(); idx!= fIonList->cend(); ++idx)
1670 {
1671 ion = idx->second;
1672 if (( particle_name == "ALL" ) || (particle_name == "all"))
1673 {
1674 ion->DumpTable();
1675 }
1676 else if ( particle_name == ion->GetParticleName() )
1677 {
1678 ion->DumpTable();
1679 }
1680 }
1681}
1682
1683// --------------------------------------------------------------------
1684//
1686{
1687 "H", "He",
1688 "Li", "Be", "B", "C", "N", "O", "F", "Ne",
1689 "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar",
1690 "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr",
1691 "Rb", "Sr", "Y", "Zr", "Nb", "Mo","Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe",
1692 "Cs", "Ba",
1693 "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu",
1694 "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn",
1695 "Fr", "Ra",
1696 "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr",
1697 "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg", "Cn", "Nh", "Fl", "Mc", "Lv", "Ts", "Og"
1698};
1699
1700// --------------------------------------------------------------------
1701// GetVerboseLevel
1702//
1704{
1706}
1707
1708// --------------------------------------------------------------------
1709// AddProcessManager
1710//
1712{
1713 if(ion->IsGeneralIon())
1714 {
1715 // Check whether GenericIon has processes
1716 G4ParticleDefinition* genericIon =
1718
1719 G4ProcessManager* pman = nullptr;
1720 if (genericIon != nullptr) pman = genericIon->GetProcessManager();
1721 if ((genericIon == nullptr) || (genericIon->GetParticleDefinitionID() < 0)
1722 || (pman==nullptr))
1723 {
1724 G4String msg = "G4IonTable::AddProcessManager(): cannot create ion of ";
1725 msg += ion->GetParticleName();
1726 msg += "\n because GenericIon is not available!!";
1727 G4Exception("G4IonTable::AddProcessManager()", "PART105",
1728 FatalException, msg);
1729 return;
1730 }
1731
1733 }
1734 else
1735 {
1736 // Is this a MuonicAtom ?
1737 G4MuonicAtom* muatom = dynamic_cast<G4MuonicAtom*> (ion);
1738
1739 if ( muatom != nullptr )
1740 {
1741#ifdef G4VERBOSE
1742 if (GetVerboseLevel()>1)
1743 {
1744 G4cout << "G4IonTable::AddProcessManager(): "
1745 << "MuonicAtom dynamic_cast succeeded for "
1746 << ion->GetParticleName() << G4endl;
1747 }
1748#endif
1749 // Check whether GenericMuonicAtom has processes
1750 G4ParticleDefinition* genericMA =
1752
1753 G4ProcessManager* pman = nullptr;
1754 if (genericMA != nullptr) pman = genericMA->GetProcessManager();
1755 if ((genericMA == nullptr) || (genericMA->GetParticleDefinitionID() < 0)
1756 || (pman==nullptr))
1757 {
1758 G4String msg =
1759 "G4IonTable::AddProcessManager(): cannot create MuonicAtom ";
1760 msg += ion->GetParticleName();
1761 msg += "\n because GenericMuonicAtom is not available!!";
1762 G4Exception("G4IonTable::AddProcessManager()",
1763 "PART106", FatalException, msg);
1764 return;
1765 }
1766
1768 }
1769 else
1770 {
1771 G4String msg =
1772 "G4IonTable::AddProcessManager(): cannot create ";
1773 msg += ion->GetParticleName();
1774 msg += "\n because of unsupported particle type !!";
1775 G4Exception("G4IonTable::AddProcessManager()", "PART107",
1776 FatalException, msg);
1777 return;
1778 }
1779 }
1780 return;
1781}
1782
1783// --------------------------------------------------------------------
1784// RegisterIsotopeTable
1785//
1787{
1788 //check duplication
1789 G4String name = table->GetName();
1790 for (std::size_t i=0; i<fIsotopeTableList->size(); ++i)
1791 {
1792 G4VIsotopeTable* fIsotopeTable= (*fIsotopeTableList)[i];
1793 if (name == fIsotopeTable->GetName()) return;
1794 }
1795 // register
1796 fIsotopeTableList->push_back(table);
1797}
1798
1799// --------------------------------------------------------------------
1800// GetIsotopeTable
1801//
1803{
1804 G4VIsotopeTable* fIsotopeTable = nullptr;
1805 if ( index < fIsotopeTableList->size() )
1806 {
1807 fIsotopeTable = (*fIsotopeTableList)[index];
1808 }
1809 return fIsotopeTable;
1810}
1811
1812// --------------------------------------------------------------------
1813// FindIsotope
1814//
1816 G4Ions::G4FloatLevelBase flb) const
1817{
1818 if (fIsotopeTableList == nullptr) return nullptr;
1819 if (fIsotopeTableList->size() == 0) return nullptr;
1820
1821 G4IsotopeProperty* property = nullptr;
1822
1823 for (std::size_t i=0; i<fIsotopeTableList->size(); ++i)
1824 {
1825 G4VIsotopeTable* fIsotopeTable
1826 = (*fIsotopeTableList)[fIsotopeTableList->size()-i-1];
1827 property = fIsotopeTable->GetIsotope(Z,A,E,flb);
1828 if(property) break;
1829 }
1830
1831 return property;
1832}
1833
1834// --------------------------------------------------------------------
1835// FindIsotope
1836//
1838{
1839 if (fIsotopeTableList == nullptr) return nullptr;
1840 if (fIsotopeTableList->size()==0) return nullptr;
1841
1842 G4IsotopeProperty* property = nullptr;
1843
1844 // iterate
1845 for (std::size_t i=0; i<fIsotopeTableList->size(); ++i)
1846 {
1847 G4VIsotopeTable* fIsotopeTable
1848 = (*fIsotopeTableList)[fIsotopeTableList->size()-i-1];
1849 property = fIsotopeTable->GetIsotope(Z,A,lvl);
1850 if(property) break;
1851 }
1852
1853 return property;
1854}
1855
1856// --------------------------------------------------------------------
1857// CreateAllIon
1858//
1860{
1862}
1863
1864// --------------------------------------------------------------------
1865// CreateAllIsomer
1866//
1868{
1870}
1871
1872// --------------------------------------------------------------------
1873// PrepareNuclideTable
1874//
1876{
1877 if (pNuclideTable == nullptr)
1879}
1880
1881// --------------------------------------------------------------------
1882// PreloadNuclide
1883//
1885{
1887
1889
1890 for ( std::size_t i=0 ; i!=pNuclideTable->entries(); ++i )
1891 {
1892 const G4IsotopeProperty* fProperty = pNuclideTable->GetIsotopeByIndex( i );
1893 G4int Z = fProperty->GetAtomicNumber();
1894 G4int A = fProperty->GetAtomicMass();
1895 G4double Eex = fProperty->GetEnergy();
1896 GetIon(Z,A,Eex);
1897 }
1898
1899 isIsomerCreated = true;
1900}
1901
1902// --------------------------------------------------------------------
1903// GetParticle
1904//
1906{
1907 if ( (index >=0) && (index < Entries()) )
1908 {
1909 auto idx = fIonList->cbegin();
1910 G4int counter = 0;
1911 while( idx != fIonList->cend() ) // Loop checking, 09.08.2015, K.Kurashige
1912 {
1913 if ( counter == index )
1914 {
1915 return const_cast<G4ParticleDefinition*>(idx->second);
1916 }
1917 ++counter;
1918 ++idx;
1919 }
1920 }
1921#ifdef G4VERBOSE
1922 if (GetVerboseLevel()>1)
1923 {
1924 G4cout << " G4IonTable::GetParticle"
1925 << " invalid index (=" << index << ")"
1926 << " entries = " << Entries() << G4endl;
1927 }
1928#endif
1929 return nullptr;
1930}
1931
1932// --------------------------------------------------------------------
1933// Contains
1934//
1936{
1937 if (!IsIon(particle)) return false;
1938
1939 G4int Z = particle->GetAtomicNumber();
1940 G4int A = particle->GetAtomicMass();
1941 G4int LL = particle->GetQuarkContent(3); //strangeness
1943 G4bool found = false;
1944 if (encoding != 0 )
1945 {
1946 for(auto i = fIonListShadow->find(encoding);
1947 i != fIonListShadow->cend(); ++i)
1948 {
1949 if (particle == i->second )
1950 {
1951 found = true;
1952 break;
1953 }
1954 }
1955 }
1956 return found;
1957}
1958
1959// --------------------------------------------------------------------
1960// Entries
1961//
1963{
1964 return fIonList->size();
1965}
1966
1967// --------------------------------------------------------------------
1968// size
1969//
1971{
1972 return fIonList->size();
1973}
1974
1975// --------------------------------------------------------------------
1976// FindIonInMaster
1977//
1981{
1982 // Search ions with A, Z ,E
1983 // !! J is omitted now !!
1984 const G4ParticleDefinition* ion = nullptr;
1985 G4bool isFound = false;
1986
1987 // -- loop over all particles in Ion table
1989 for(auto i = fIonListShadow->find(encoding); i != fIonListShadow->cend(); ++i)
1990 {
1991 ion = i->second;
1992 if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
1993 // excitation level
1994 G4double anExcitaionEnergy = ((const G4Ions*)(ion))->GetExcitationEnergy();
1995 if (std::fabs(E - anExcitaionEnergy) < pNuclideTable->GetLevelTolerance() )
1996 {
1997 if(((const G4Ions*)(ion))->GetFloatLevelBase()==flb)
1998 {
1999 isFound = true;
2000 break;
2001 }
2002 }
2003 }
2004
2005 if ( isFound )
2006 {
2007 return const_cast<G4ParticleDefinition*>(ion);
2008 }
2009 else
2010 {
2011 return nullptr;
2012 }
2013}
2014
2015// --------------------------------------------------------------------
2016// FindIonInMaster
2017//
2021{
2022 if (LL==0) return FindIon(Z,A,E,flb,J);
2023
2024 // Search ions with A, Z ,E
2025 // !! J is omitted now !!
2026 const G4ParticleDefinition* ion = nullptr;
2027 G4bool isFound = false;
2028
2029 // -- loop over all particles in Ion table
2030 G4int encoding = GetNucleusEncoding(Z, A, LL, 0.0, 0);
2031 for(auto i = fIonListShadow->find(encoding); i != fIonListShadow->cend(); ++i)
2032 {
2033 ion = i->second;
2034 if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
2035 if( ion->GetQuarkContent(3) != LL) break;
2036 // Excitation level
2037 G4double anExcitaionEnergy = ((const G4Ions*)(ion))->GetExcitationEnergy();
2038 if (std::fabs(E - anExcitaionEnergy) < pNuclideTable->GetLevelTolerance() )
2039 {
2040 if(((const G4Ions*)(ion))->GetFloatLevelBase()==flb)
2041 {
2042 isFound = true;
2043 break;
2044 }
2045 }
2046 }
2047
2048 if ( isFound )
2049 {
2050 return const_cast<G4ParticleDefinition*>(ion);
2051 }
2052 else
2053 {
2054 return nullptr;
2055 }
2056}
2057
2058// --------------------------------------------------------------------
2059// FindIonInMaster
2060//
2062{
2063 // Search ions with A, Z ,E
2064 // !! J is omitted now !!
2065 const G4ParticleDefinition* ion = nullptr;
2066 G4bool isFound = false;
2067
2068 // -- loop over all particles in Ion table
2070 for(auto i = fIonListShadow->find(encoding); i != fIonListShadow->cend(); ++i)
2071 {
2072 ion = i->second;
2073 if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
2074 // Excitation level
2075 if ( ((const G4Ions*)(ion))->GetIsomerLevel() == lvl)
2076 {
2077 isFound = true;
2078 break;
2079 }
2080 }
2081
2082 if ( isFound )
2083 {
2084 return const_cast<G4ParticleDefinition*>(ion);
2085 }
2086 else
2087 {
2088 return nullptr;
2089 }
2090}
2091
2092// --------------------------------------------------------------------
2093// FindIonInMaster
2094//
2097{
2098 if (LL==0) return FindIon(Z,A,lvl);
2099
2100 // Search ions with A, Z ,E, lvl
2101 const G4ParticleDefinition* ion = nullptr;
2102 G4bool isFound = false;
2103
2104 // -- loop over all particles in Ion table
2106 for(auto i = fIonListShadow->find(encoding); i != fIonListShadow->cend(); ++i)
2107 {
2108 ion = i->second;
2109 if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
2110 if ( ion->GetQuarkContent(3) != LL) break;
2111 // excitation level
2112 if ( ((const G4Ions*)(ion))->GetIsomerLevel() == lvl)
2113 {
2114 isFound = true;
2115 break;
2116 }
2117 }
2118
2119 if ( isFound )
2120 {
2121 return const_cast<G4ParticleDefinition*>(ion);
2122 }
2123 else
2124 {
2125 return nullptr;
2126 }
2127}
2128
2129// --------------------------------------------------------------------
2130// GetLifeTime
2131//
2133{
2134 if((particle->IsGeneralIon()) && (pNuclideTable == nullptr))
2135 {
2136 G4Exception("G4IonTable::GetLifeTime()", "ParticleIon1001", FatalException,
2137 "Method is invoked before G4IonTable is initialized.");
2138 return 0.;
2139 }
2140 return particle->GetPDGLifeTime();
2141}
2142
2143// --------------------------------------------------------------------
2144// GetLifeTime
2145//
2148{
2149 return GetLifeTime(Z,A,E,G4Ions::FloatLevelBase(flbChar));
2150}
2151
2152// --------------------------------------------------------------------
2153// GetLifeTime
2154//
2156 G4Ions::G4FloatLevelBase flb) const
2157{
2158 G4double life = -1001.0;
2159 const G4IsotopeProperty* fProperty = FindIsotope(Z, A, E, flb);
2160 if( fProperty != nullptr ) life = fProperty->GetLifeTime();
2161 return life;
2162}
2163
2164// --------------------------------------------------------------------
2165// GetMuonicAtom
2166//
2168{
2169 if (base==nullptr || !IsIon(base))
2170 {
2171 G4Exception("G4IonTable::GetMuonicAtom()", "PART987654321",
2172 FatalException, "Constructor argument is not a G4Ions");
2173 return nullptr;
2174 }
2175
2176 // We're assuming here that we get a base that is actually
2177 // constructed and unexcited ... strip excitations, Lambdas, and
2178 // isomers from the encoding
2179
2180 auto const Z = base->GetAtomicNumber();
2181 auto const A = base->GetAtomicMass();
2182 auto const baseenc = GetNucleusEncoding(Z,A);
2183 auto const encoding = baseenc+1000000000;
2184
2185 // We have to do all the MT manipulations manually, because the
2186 // convenience functions assume a G4Ions with canonical PDG codes;
2187 // they recalculate the encoding from particle properties rather
2188 // than using the carried member function values. Thus, they will
2189 // do operations on the base ion, rather than the passed in
2190 // G4MuonicAtom
2191
2192 auto i = fIonList->find(encoding);
2193 if(i!=fIonList->cend())
2194 {
2195 return const_cast<G4ParticleDefinition*>(i->second);
2196 }
2197 // not in threadlocal list; check global list ...
2198#ifdef G4MULTITHREADED
2200 {
2201 G4MUTEXLOCK(&G4IonTable::ionTableMutex);
2202 i = fIonListShadow->find(encoding);
2203 auto end = fIonListShadow->cend();
2204 G4MUTEXUNLOCK(&G4IonTable::ionTableMutex);
2205 if(i!=end)
2206 {
2207 // we found it, stuff it into the threadlocal list
2208 fIonList->insert(*i);
2209 // and then return it ...
2210 return const_cast<G4ParticleDefinition*>(i->second);
2211 }
2212 }
2213#endif
2214
2215 // not found in either list; create and potentially insert
2216 auto const name = "Mu"+GetIonName(Z,A);
2217
2218 G4MuonicAtom* muatom =
2220
2221 // Not sure this is doing the right thing...
2222 AddProcessManager(muatom);
2223
2224 // Now, we have to push the muatom into the appropriate IonTables
2225 // first, recheck global list, in case another thread came along
2226 // before us and created this same muatom
2227
2228#ifdef G4MULTITHREADED
2230 {
2231 G4MUTEXLOCK(&G4IonTable::ionTableMutex);
2232 // first, we need to make sure it hasn't been inserted by some
2233 // other thread
2234 auto j = fIonListShadow->find(encoding);
2235 if( j!= fIonListShadow->cend() )
2236 {
2237 // oops ... someone else built a copy when we weren't looking;
2238 // cleanup our instantiation, and take a handle to the one in
2239 // the global list
2240 delete muatom;
2241 muatom = const_cast<G4MuonicAtom*>
2242 (static_cast<G4MuonicAtom const*>(j->second));
2243 }
2244 else
2245 {
2246 // otherwise, push onto the global list first
2247 fIonListShadow->insert(std::make_pair(encoding, muatom));
2248 }
2249 G4MUTEXUNLOCK(&G4IonTable::ionTableMutex);
2250 }
2251#endif
2252 // in either case, push onto the the threadlocal list
2253 fIonList->insert(std::make_pair(encoding,muatom));
2254
2255 return muatom;
2256}
2257
2258// --------------------------------------------------------------------
2259// GetMuonicAtom
2260//
2262{
2263 // Need the cast because we need a G4Ions* to pass into the
2264 // function, but GetIon returns a G4ParticleDefinition*
2265 auto base = static_cast<G4Ions const*>(GetIon(Z,A, 0.0));
2266 return GetMuonicAtom(base);
2267}
G4ApplicationState
@ G4State_PreInit
static const G4int LL[nN]
@ JustWarning
@ FatalException
@ EventMustBeAborted
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
static constexpr double eplus
Definition: G4SIunits.hh:184
static constexpr double keV
Definition: G4SIunits.hh:202
static constexpr double MeV
Definition: G4SIunits.hh:200
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:85
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254
std::mutex G4Mutex
Definition: G4Threading.hh:81
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4VDecayChannel * GetDecayChannel(G4int index) const
G4int entries() const
static G4double GetNuclearMass(G4int A, G4int Z, G4int L)
void PreloadNuclide()
Definition: G4IonTable.cc:1884
G4bool Contains(const G4ParticleDefinition *particle) const
Definition: G4IonTable.cc:1935
const G4String & GetIonName(G4int Z, G4int A, G4int lvl=0) const
Definition: G4IonTable.cc:1229
void Remove(const G4ParticleDefinition *particle)
Definition: G4IonTable.cc:1594
G4bool isIsomerCreated
Definition: G4IonTable.hh:312
static G4ThreadLocal std::vector< G4VIsotopeTable * > * fIsotopeTableList
Definition: G4IonTable.hh:253
void PrepareNuclideTable()
Definition: G4IonTable.cc:1875
static G4IonList * fIonListShadow
Definition: G4IonTable.hh:254
G4bool IsLightAntiIon(const G4ParticleDefinition *) const
Definition: G4IonTable.cc:1366
void CreateAllIsomer()
Definition: G4IonTable.cc:1867
G4double GetNucleusMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
Definition: G4IonTable.cc:1435
void clear()
Definition: G4IonTable.cc:1526
static G4bool GetNucleusByEncoding(G4int encoding, G4int &Z, G4int &A, G4double &E, G4int &lvl)
Definition: G4IonTable.cc:1100
G4ParticleDefinition * GetMuonicAtom(G4Ions const *)
Definition: G4IonTable.cc:2167
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522
G4ParticleDefinition * GetParticle(G4int index) const
Definition: G4IonTable.cc:1905
G4bool IsLightIon(const G4ParticleDefinition *) const
Definition: G4IonTable.cc:1354
std::multimap< G4int, const G4ParticleDefinition * > G4IonList
Definition: G4IonTable.hh:57
void DestroyWorkerG4IonTable()
Definition: G4IonTable.cc:214
static std::vector< G4VIsotopeTable * > * fIsotopeTableListShadow
Definition: G4IonTable.hh:255
void DumpTable(const G4String &particle_name="ALL") const
Definition: G4IonTable.cc:1666
@ numberOfElements
Definition: G4IonTable.hh:263
void WorkerG4IonTable()
Definition: G4IonTable.cc:180
static G4ThreadLocal G4IonList * fIonList
Definition: G4IonTable.hh:252
G4ParticleDefinition * GetLightIon(G4int Z, G4int A) const
Definition: G4IonTable.cc:1378
static G4IonTable * GetIonTable()
Definition: G4IonTable.cc:170
G4NuclideTable * pNuclideTable
Definition: G4IonTable.hh:310
G4double GetLifeTime(const G4ParticleDefinition *) const
Definition: G4IonTable.cc:2132
void RegisterIsotopeTable(G4VIsotopeTable *table)
Definition: G4IonTable.cc:1786
static G4bool IsIon(const G4ParticleDefinition *)
Definition: G4IonTable.cc:1302
G4ParticleDefinition * FindIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:935
static G4int GetNucleusEncoding(G4int Z, G4int A, G4double E=0.0, G4int lvl=0)
Definition: G4IonTable.cc:1055
G4int Entries() const
Definition: G4IonTable.cc:1962
void InsertWorker(const G4ParticleDefinition *particle)
Definition: G4IonTable.cc:1565
void AddProcessManager(G4ParticleDefinition *)
Definition: G4IonTable.cc:1711
void Insert(const G4ParticleDefinition *particle)
Definition: G4IonTable.cc:1548
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
Definition: G4IonTable.cc:1517
G4int GetVerboseLevel() const
Definition: G4IonTable.cc:1703
static const G4String elementName[numberOfElements]
Definition: G4IonTable.hh:264
G4double GetIsomerMass(G4int Z, G4int A, G4int lvl=0) const
Definition: G4IonTable.cc:1509
static G4bool IsAntiIon(const G4ParticleDefinition *)
Definition: G4IonTable.cc:1328
G4IsotopeProperty * FindIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb) const
Definition: G4IonTable.cc:1815
G4VIsotopeTable * GetIsotopeTable(std::size_t idx=0) const
Definition: G4IonTable.cc:1802
void CreateAllIon()
Definition: G4IonTable.cc:1859
void InitializeLightIons()
Definition: G4IonTable.cc:205
G4int size() const
Definition: G4IonTable.cc:1970
G4ParticleDefinition * GetLightAntiIon(G4int Z, G4int A) const
Definition: G4IonTable.cc:1406
G4ParticleDefinition * FindIonInMaster(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:2061
G4ParticleDefinition * CreateIon(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb)
Definition: G4IonTable.cc:245
Definition: G4Ions.hh:52
static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb)
Definition: G4Ions.cc:165
static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar)
Definition: G4Ions.cc:103
G4FloatLevelBase
Definition: G4Ions.hh:83
G4int GetiSpin() const
G4DecayTable * GetDecayTable() const
G4double GetEnergy() const
G4int GetAtomicMass() const
G4int GetAtomicNumber() const
G4int GetIsomerLevel() const
G4double GetLifeTime() const
G4double GetMagneticMoment() const
static G4MuonicAtom * ConstructMuonicAtom(const G4String &name, G4int encoding, G4Ions const *baseion)
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4IsotopeProperty * GetIsotopeByIndex(std::size_t idx) const
static G4NuclideTable * GetNuclideTable()
G4double GetLevelTolerance()
std::size_t entries() const
G4ProcessManager * GetProcessManager() const
G4int GetAtomicNumber() const
G4bool IsGeneralIon() const
const G4String & GetParticleType() const
void SetPDGMagneticMoment(G4double mageticMoment)
void SetParticleDefinitionID(G4int id=-1)
G4int GetAtomicMass() const
G4int GetQuarkContent(G4int flavor) const
void SetAntiPDGEncoding(G4int aEncoding)
G4double GetPDGLifeTime() const
G4int GetParticleDefinitionID() const
const G4String & GetParticleName() const
G4IonTable * GetIonTable() const
G4int GetVerboseLevel() const
G4ParticleDefinition * GetGenericMuonicAtom() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * GetGenericIon() const
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
G4ParticleDefinition * GetDaughter(G4int anIndex)
const G4String & GetName() const
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)=0
void Register(T *inst)
Definition: G4AutoDelete.hh:65
const char * name(G4int ptype)
G4bool IsWorkerThread()
Definition: G4Threading.cc:123
G4bool IsMultithreadedApplication()
Definition: G4Threading.cc:130
static const G4ParticleDefinition * p_alpha
Definition: G4IonTable.cc:93
static const G4ParticleDefinition * p_deuteron
Definition: G4IonTable.cc:91
static const G4ParticleDefinition * p_proton
Definition: G4IonTable.cc:90
static const G4ParticleDefinition * p_triton
Definition: G4IonTable.cc:92
static const G4ParticleDefinition * p_He3
Definition: G4IonTable.cc:94
string pname
Definition: eplot.py:33
static const G4ParticleDefinition * p_alpha
Definition: G4IonTable.cc:75
static const G4ParticleDefinition * p_triton
Definition: G4IonTable.cc:74
void Init()
Definition: G4IonTable.cc:77
static const G4ParticleDefinition * p_proton
Definition: G4IonTable.cc:72
static const G4ParticleDefinition * p_deuteron
Definition: G4IonTable.cc:73
static const G4ParticleDefinition * p_He3
Definition: G4IonTable.cc:76
#define G4ThreadLocal
Definition: tls.hh:77
#define encoding
Definition: xmlparse.cc:605