148 for(CoupleTableIterator CoupleItr=coupleTable.begin();
149 CoupleItr!=coupleTable.end();CoupleItr++)
151 (*CoupleItr)->SetUseFlag(
false);
155 typedef std::vector<G4Region*>::iterator regionIterator;
156 for(regionIterator rItr=fG4RegionStore->begin();
157 rItr!=fG4RegionStore->end();rItr++)
162 if((*rItr)->IsInMassGeometry() || (*rItr)->IsInParallelGeometry())
166 std::vector<G4Material*>::const_iterator mItr =
167 (*rItr)->GetMaterialIterator();
168 size_t nMaterial = (*rItr)->GetNumberOfMaterials();
171 for(
size_t iMate=0;iMate<nMaterial;iMate++){
173 G4bool coupleAlreadyDefined =
false;
175 for(CoupleTableIterator cItr=coupleTable.begin();
176 cItr!=coupleTable.end();cItr++){
177 if( (*cItr)->GetMaterial()==(*mItr) &&
178 (*cItr)->GetProductionCuts()==fProductionCut){
179 coupleAlreadyDefined =
true;
186 if(!coupleAlreadyDefined){
188 coupleTable.push_back(aCouple);
189 aCouple->
SetIndex(coupleTable.size()-1);
193 (*rItr)->RegisterMaterialCouplePair((*mItr),aCouple);
198 std::vector<G4LogicalVolume*>::iterator rootLVItr
199 = (*rItr)->GetRootLogicalVolumeIterator();
200 size_t nRootLV = (*rItr)->GetNumberOfRootVolumes();
201 for(
size_t iLV=0;iLV<nRootLV;iLV++) {
206 ScanAndSetCouple(aLV,aCouple,aR);
222 size_t nCouple = coupleTable.size();
223 size_t nTable = energyCutTable[0]->size();
224 G4bool newCoupleAppears = nCouple>nTable;
225 if(newCoupleAppears) {
226 for(
size_t n=nCouple-nTable;
n>0;
n--) {
228 rangeCutTable[
nn]->push_back(-1.);
229 energyCutTable[
nn]->push_back(-1.);
237 if (verboseLevel>2) {
240 for(CoupleTableIterator cItr=coupleTable.begin();
241 cItr!=coupleTable.end();cItr++){
244 if((*cItr)->IsRecalcNeeded()) {
247 (*(rangeCutTable[ptcl]))[idx] = rCut;
249 if(converters[ptcl]) {
250 (*(energyCutTable[ptcl]))[idx] = converters[ptcl]->
Convert(rCut,aMat);
252 (*(energyCutTable[ptcl]))[idx] = -1.;
258 if (verboseLevel>2) {
260 G4cout <<
"G4ProductionCutsTable::UpdateCoupleTable "
261 <<
" elapsed time for calculation of energy cuts " <<
G4endl;
266 if(newCoupleAppears){
268 G4double* rangeVOld = rangeDoubleVector[ix];
269 G4double* energyVOld = energyDoubleVector[ix];
270 if(rangeVOld)
delete [] rangeVOld;
271 if(energyVOld)
delete [] energyVOld;
272 rangeDoubleVector[ix] =
new G4double[(*(rangeCutTable[ix])).size()];
273 energyDoubleVector[ix] =
new G4double[(*(energyCutTable[ix])).size()];
279 for(
size_t ixx=0;ixx<(*(rangeCutTable[ix])).size();ixx++) {
280 rangeDoubleVector[ix][ixx] = (*(rangeCutTable[ix]))[ixx];
281 energyDoubleVector[ix][ixx] = (*(energyCutTable[ix]))[ixx];
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4double GetProductionCut(G4int index) const
G4GLOB_DLL std::ostream G4cout
virtual G4double Convert(G4double rangeCut, const G4Material *material)
const std::vector< G4double > & GetProductionCuts() const
static G4ParticleTable * GetParticleTable()
void SetUseFlag(G4bool flg=true)
G4int GetVerboseLevel() const
void SetVerboseLevel(G4int value)