Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LENDManager Class Reference

#include <G4LENDManager.hh>

Public Member Functions

G4GIDI_targetGetLENDTarget (G4ParticleDefinition *, G4String, G4int iZ, G4int iA, G4int iM=0)
 
std::vector< G4StringIsLENDTargetAvailable (G4ParticleDefinition *, G4int iZ, G4int iA, G4int iM=0)
 
G4int GetNucleusEncoding (G4int iZ, G4int iA)
 
G4NistElementBuilderGetNistElementBuilder ()
 
G4int GetVerboseLevel ()
 
G4bool RequestChangeOfVerboseLevel (G4int)
 

Static Public Member Functions

static G4LENDManagerGetInstance ()
 

Protected Member Functions

 G4LENDManager ()
 
 G4LENDManager (const G4LENDManager &)
 
 ~G4LENDManager ()
 

Detailed Description

Definition at line 63 of file G4LENDManager.hh.

Constructor & Destructor Documentation

◆ G4LENDManager() [1/2]

G4LENDManager::G4LENDManager ( )
protected

Definition at line 47 of file G4LENDManager.cc.

48:verboseLevel( 0 )
49{
50
51 printBanner();
52
53 if(!getenv("G4LENDDATA"))
54 throw G4HadronicException(__FILE__, __LINE__, " Please setenv G4LENDDATA to point to the LEND files." );
55
56 G4String xmcf = getenv("G4LENDDATA");
57 xmcf = xmcf+"/xmcf.n_1.map";
58
59// for neutron
60
61 G4GIDI* axLEND = new G4GIDI( 1 , xmcf );
62
63 if ( proj_lend_map.find ( G4Neutron::Neutron() ) == proj_lend_map.end() )
64 {
65 proj_lend_map.insert ( std::pair < G4ParticleDefinition* , G4GIDI* > ( G4Neutron::Neutron() , axLEND ) );
66 }
67
68 v_lend_target.clear();
69
70 ionTable = new G4IonTable();
71 nistElementBuilder = new G4NistElementBuilder( 0 );
72
73}
Definition: G4GIDI.hh:73
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

Referenced by GetInstance().

◆ G4LENDManager() [2/2]

G4LENDManager::G4LENDManager ( const G4LENDManager )
inlineprotected

Definition at line 70 of file G4LENDManager.hh.

70{;};

◆ ~G4LENDManager()

G4LENDManager::~G4LENDManager ( )
protected

Definition at line 77 of file G4LENDManager.cc.

78{
79
80// deleting target
81 for ( std::vector < lend_target >::iterator
82 it = v_lend_target.begin() ; it != v_lend_target.end() ; it++ )
83 {
84 (*it).lend->freeTarget( it->target );
85 }
86
87// deleting lend
88 for ( std::map < G4ParticleDefinition* , G4GIDI* >::iterator
89 it = proj_lend_map.begin() ; it != proj_lend_map.end() ; it++ )
90 {
91 delete it->second;
92 }
93
94 delete ionTable;
95 delete nistElementBuilder;
96
97}

Member Function Documentation

◆ GetInstance()

static G4LENDManager * G4LENDManager::GetInstance ( )
inlinestatic

Definition at line 75 of file G4LENDManager.hh.

76 {
77 if ( lend_manager == NULL) lend_manager = new G4LENDManager();
78 return lend_manager;
79 };

Referenced by G4LENDCrossSection::G4LENDCrossSection(), and G4LENDModel::G4LENDModel().

◆ GetLENDTarget()

G4GIDI_target * G4LENDManager::GetLENDTarget ( G4ParticleDefinition proj,
G4String  evaluation,
G4int  iZ,
G4int  iA,
G4int  iM = 0 
)

Definition at line 101 of file G4LENDManager.cc.

102{
103
104 G4GIDI_target* anLENDTarget = NULL;
105
106 G4int iTarg = ionTable->GetNucleusEncoding( iZ , iA );
107 // G4double E=0.0, G4int J=0);
108
109 for ( std::vector < lend_target >::iterator
110 it = v_lend_target.begin() ; it != v_lend_target.end() ; it++ )
111 {
112// find the target
113 if ( it->proj == proj && it->target_code == iTarg && it->evaluation == evaluation )
114 {
115 return it->target;
116 }
117 }
118
119 if ( proj_lend_map.find ( proj ) == proj_lend_map.end() )
120 {
121 G4cout << proj->GetParticleName() << " is not supported by this LEND." << G4endl;
122 return anLENDTarget; // return NULL
123 }
124
125 G4GIDI* xlend = proj_lend_map.find ( proj ) -> second;
126
127 if ( xlend->isThisDataAvailable( evaluation, iZ, iA , iM ) )
128 {
129
130 if ( verboseLevel > 1 )
131 G4cout << evaluation << " for " << ionTable->GetIonName( iZ , iA , 0 ) << " is exist in this LEND." << G4endl;
132
133 anLENDTarget = xlend->readTarget( evaluation , iZ , iA , iM );
134
135 lend_target new_target;
136 new_target.lend = xlend;
137 new_target.target = anLENDTarget;
138 new_target.proj = proj;
139 new_target.evaluation = evaluation;
140 new_target.target_code = iTarg;
141
142 v_lend_target.push_back( new_target );
143
144// found EXACT
145 return anLENDTarget;
146
147 }
148 else
149 {
150// NO EXACT DATA (Evaluatino & Z,A,M)
151 // This is for ground state
152 if ( verboseLevel > 1 )
153 G4cout << evaluation << " for " << ionTable->GetIonName( iZ , iA , 0 ) << " is not exist in this LEND." << G4endl;
154
155 std::vector< std::string >* available = xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
156 if ( available->size() > 0 )
157 {
158// EXACT Z,A,M but Evaluation is different
159 if ( verboseLevel > 1 )
160 {
161 G4cout << " However you can use following evaluation(s) for the target. " << G4endl;
162
163 std::vector< std::string >::iterator its;
164 for ( its = available->begin() ; its != available->end() ; its++ )
165 G4cout << *its << G4endl;
166
167 G4cout << G4endl;
168 }
169 }
170//
171// checking natural abundance data for Z
172//
173 else if ( xlend->isThisDataAvailable( evaluation, iZ, 0 , iM ) )
174 {
175// EXACT natural abundance data for the evaluation
176 if ( verboseLevel > 1 )
177 G4cout << " However you can use natural abundance data for the target. " << G4endl;
178 }
179 else
180 {
181 std::vector< std::string >* available_nat = xlend->getNamesOfAvailableLibraries( iZ, 0 , iM );
182//
183 if ( available_nat->size() > 0 )
184 {
185// EXACT natural abundance data for Z but differnet evaluation
186 if ( verboseLevel > 1 )
187 {
188 G4cout << " However you can use following evaluation(s) for natural abundace of the target. " << G4endl;
189
190 std::vector< std::string >::iterator its;
191 for ( its = available_nat->begin() ; its != available_nat->end() ; its++ )
192 G4cout << *its << G4endl;
193 G4cout << G4endl;
194 }
195 }
196 }
197
198// return NULL if exact data is not available
199 return anLENDTarget; // return NULL
200 }
201
202 return anLENDTarget;
203}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
bool isThisDataAvailable(std::string &lib_name, int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:184
G4GIDI_target * readTarget(std::string &lib_name, int iZ, int iA, int iM=0, bool bind=true)
Definition: G4GIDI.cc:293
std::vector< std::string > * getNamesOfAvailableLibraries(int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:240
static G4int GetNucleusEncoding(G4int Z, G4int A, G4double E=0.0, G4int J=0)
Definition: G4IonTable.cc:446
const G4String & GetIonName(G4int Z, G4int A, G4double E) const
Definition: G4IonTable.cc:558
const G4String & GetParticleName() const
G4int target_code
G4ParticleDefinition * proj
G4GIDI_target * target
G4GIDI * lend
G4String evaluation

◆ GetNistElementBuilder()

G4NistElementBuilder * G4LENDManager::GetNistElementBuilder ( )
inline

Definition at line 86 of file G4LENDManager.hh.

86{ return nistElementBuilder; };

Referenced by G4LENDCrossSection::create_used_target_map(), and G4LENDModel::create_used_target_map().

◆ GetNucleusEncoding()

◆ GetVerboseLevel()

G4int G4LENDManager::GetVerboseLevel ( )
inline

Definition at line 88 of file G4LENDManager.hh.

88{ return verboseLevel; };

◆ IsLENDTargetAvailable()

std::vector< G4String > G4LENDManager::IsLENDTargetAvailable ( G4ParticleDefinition proj,
G4int  iZ,
G4int  iA,
G4int  iM = 0 
)

Definition at line 207 of file G4LENDManager.cc.

208{
209
210 std::vector< G4String > answer;
211 if ( proj_lend_map.find ( proj ) == proj_lend_map.end() )
212 {
213 G4cout << proj->GetParticleName() << " is not supported by this LEND." << G4endl;
214 return answer; // return NULL
215 }
216
217 G4GIDI* xlend = proj_lend_map.find ( proj ) -> second;
218 std::vector< std::string >* available = xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
219
220 if ( available->size() > 0 )
221 {
222 std::vector< std::string >::iterator its;
223 for ( its = available->begin() ; its != available->end() ; its++ )
224 answer.push_back ( *its );
225 }
226
227 return answer;
228}

◆ RequestChangeOfVerboseLevel()

G4bool G4LENDManager::RequestChangeOfVerboseLevel ( G4int  newValue)

Definition at line 270 of file G4LENDManager.cc.

271{
272 G4bool result=false;
273 if ( newValue >= verboseLevel)
274 {
275 verboseLevel = newValue;
276 result=true;
277 }
278 else
279 {
280 G4cout << "Since other LEND model or cross section have set the higher verbose level (" << verboseLevel << ") in LENDManager, you cannot change the value now." << G4endl;
281 }
282
283 return result;
284}
bool G4bool
Definition: G4Types.hh:67

Referenced by G4LENDCrossSection::create_used_target_map(), and G4LENDModel::create_used_target_map().


The documentation for this class was generated from the following files: