#include <G4ProductionCuts.hh>
Public Member Functions | |
G4ProductionCuts () | |
G4ProductionCuts (const G4ProductionCuts &right) | |
G4ProductionCuts & | operator= (const G4ProductionCuts &right) |
virtual | ~G4ProductionCuts () |
G4int | operator== (const G4ProductionCuts &right) const |
G4int | operator!= (const G4ProductionCuts &right) const |
void | SetProductionCut (G4double cut, G4int index=-1) |
void | SetProductionCut (G4double cut, G4ParticleDefinition *ptcl) |
void | SetProductionCut (G4double cut, const G4String &pName) |
G4double | GetProductionCut (G4int index) const |
G4double | GetProductionCut (const G4String &name) const |
void | SetProductionCuts (std::vector< G4double > &) |
const std::vector< G4double > & | GetProductionCuts () const |
G4bool | IsModified () const |
void | PhysicsTableUpdated () |
Static Public Member Functions | |
static G4int | GetIndex (const G4String &name) |
static G4int | GetIndex (const G4ParticleDefinition *ptcl) |
Protected Attributes | |
std::vector< G4double > | fRangeCuts |
G4bool | isModified |
Definition at line 62 of file G4ProductionCuts.hh.
G4ProductionCuts::G4ProductionCuts | ( | ) |
Definition at line 45 of file G4ProductionCuts.cc.
References fRangeCuts, and NumberOfG4CutIndex.
00045 : 00046 isModified(true) 00047 { 00048 for (G4int i=0; i< NumberOfG4CutIndex; i++) { 00049 fRangeCuts.push_back(0.0); 00050 } 00051 }
G4ProductionCuts::G4ProductionCuts | ( | const G4ProductionCuts & | right | ) |
G4ProductionCuts::~G4ProductionCuts | ( | ) | [virtual] |
Definition at line 58 of file G4ProductionCuts.cc.
References fRangeCuts.
00059 { 00060 fRangeCuts.clear(); 00061 }
G4int G4ProductionCuts::GetIndex | ( | const G4ParticleDefinition * | ptcl | ) | [static] |
Definition at line 106 of file G4ProductionCuts.cc.
References G4ParticleDefinition::GetParticleName().
00107 { 00108 if(!ptcl) return -1; 00109 // In the first call, pointers are set 00110 if(gammaDef==0 && ptcl->GetParticleName()=="gamma") { gammaDef = ptcl; } 00111 if(electDef==0 && ptcl->GetParticleName()=="e-") { electDef = ptcl; } 00112 if(positDef==0 && ptcl->GetParticleName()=="e+") { positDef = ptcl; } 00113 if(protonDef==0 && ptcl->GetParticleName()=="proton") { protonDef = ptcl; } 00114 00115 G4int index; 00116 if(ptcl==gammaDef) { index = 0; } 00117 else if(ptcl==electDef) { index = 1; } 00118 else if(ptcl==positDef) { index = 2; } 00119 else if(ptcl==protonDef) { index = 3; } 00120 else { index = -1; } 00121 00122 return index; 00123 }
Definition at line 88 of file G4ProductionCuts.cc.
References G4InuclParticleNames::proton.
Referenced by G4ITStepProcessor::ApplyProductionCut(), G4ProductionCutsTable::ConvertRangeToEnergy(), GetProductionCut(), and SetProductionCut().
00089 { 00090 static G4String gamma("gamma"); 00091 static G4String electron("e-"); 00092 static G4String positron("e+"); 00093 static G4String proton("proton"); 00094 00095 G4int index; 00096 if ( name == gamma ) { index = 0; } 00097 else if ( name == electron ) { index = 1; } 00098 else if ( name == positron ) { index = 2; } 00099 else if ( name == proton ) { index = 3; } 00100 else { index = -1; } 00101 00102 return index; 00103 }
Definition at line 167 of file G4ProductionCuts.hh.
References GetIndex(), and GetProductionCut().
00168 { 00169 return GetProductionCut(GetIndex(name)); 00170 }
Definition at line 157 of file G4ProductionCuts.hh.
References fRangeCuts, and NumberOfG4CutIndex.
Referenced by G4VEnergyLossProcess::AlongStepDoIt(), G4VEnergyLossProcess::AlongStepGetPhysicalInteractionLength(), G4ProductionCutsTable::CheckMaterialCutsCoupleInfo(), G4WentzelVIRelModel::ComputeTruePathLengthLimit(), G4WentzelVIModel::ComputeTruePathLengthLimit(), G4ProductionCutsTable::DumpCouples(), G4RunManagerKernel::DumpRegion(), G4RangeTest::Escape(), G4VUserPhysicsList::GetCutValue(), GetProductionCut(), G4EmModelManager::Initialise(), and G4ProductionCutsTable::StoreMaterialCutsCoupleInfo().
00158 { 00159 G4double cut=-1.0; 00160 if ( (index>=0) && (index<NumberOfG4CutIndex) ) { 00161 cut = fRangeCuts[index]; 00162 } 00163 return cut; 00164 }
const std::vector< G4double > & G4ProductionCuts::GetProductionCuts | ( | ) | const [inline] |
Definition at line 174 of file G4ProductionCuts.hh.
References fRangeCuts.
00175 { 00176 return fRangeCuts; 00177 }
G4bool G4ProductionCuts::IsModified | ( | ) | const [inline] |
Definition at line 180 of file G4ProductionCuts.hh.
References isModified.
Referenced by G4MaterialCutsCouple::IsRecalcNeeded().
00181 { 00182 return isModified; 00183 }
G4int G4ProductionCuts::operator!= | ( | const G4ProductionCuts & | right | ) | const |
G4ProductionCuts & G4ProductionCuts::operator= | ( | const G4ProductionCuts & | right | ) |
Definition at line 63 of file G4ProductionCuts.cc.
References fRangeCuts, isModified, and NumberOfG4CutIndex.
00064 { 00065 if (&right==this) return *this; 00066 00067 for (G4int i=0; i< NumberOfG4CutIndex; i++) { 00068 fRangeCuts[i] = right.fRangeCuts[i]; 00069 } 00070 isModified = right.isModified; 00071 return *this; 00072 }
G4int G4ProductionCuts::operator== | ( | const G4ProductionCuts & | right | ) | const |
void G4ProductionCuts::PhysicsTableUpdated | ( | ) | [inline] |
Definition at line 186 of file G4ProductionCuts.hh.
References isModified.
Referenced by G4MaterialCutsCouple::PhysicsTableUpdated().
00187 { 00188 isModified = false; 00189 }
Definition at line 150 of file G4ProductionCuts.hh.
References GetIndex(), and SetProductionCut().
00151 { 00152 G4int idx = GetIndex(pName); 00153 if(idx>=0) SetProductionCut(cut,idx); 00154 }
void G4ProductionCuts::SetProductionCut | ( | G4double | cut, | |
G4ParticleDefinition * | ptcl | |||
) | [inline] |
Definition at line 142 of file G4ProductionCuts.hh.
References GetIndex(), and SetProductionCut().
00143 { 00144 G4int idx = -1; 00145 if(ptcl) idx = GetIndex(ptcl); 00146 if(idx>=0) SetProductionCut(cut,idx); 00147 }
Definition at line 127 of file G4ProductionCuts.hh.
References fRangeCuts, isModified, and NumberOfG4CutIndex.
Referenced by G4VUserPhysicsList::SetParticleCuts(), and SetProductionCut().
00128 { 00129 if (index<0) { 00130 for(G4int i = 0; i < NumberOfG4CutIndex; i++) { 00131 fRangeCuts[i] = cut; 00132 } 00133 isModified = true; 00134 00135 } else if (index < NumberOfG4CutIndex) { 00136 fRangeCuts[index] = cut; 00137 isModified = true; 00138 } 00139 }
void G4ProductionCuts::SetProductionCuts | ( | std::vector< G4double > & | ) |
Definition at line 126 of file G4ProductionCuts.cc.
References fRangeCuts, G4cerr, G4endl, G4Exception(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProcessTable::GetVerboseLevel(), isModified, JustWarning, and NumberOfG4CutIndex.
00127 { 00128 G4int vSize = cut.size(); 00129 if (vSize != NumberOfG4CutIndex) { 00130 #ifdef G4VERBOSE 00131 if ( G4ProductionCutsTable::GetProductionCutsTable()->GetVerboseLevel()>1) { 00132 G4cerr << "G4ProductionCuts::SetProductionCuts "; 00133 G4cerr << " The size of given cut value vector [=" << vSize << "] " 00134 << " is not consitent with number of CutIndex [=" 00135 << NumberOfG4CutIndex << G4endl; 00136 } 00137 #endif 00138 G4Exception( "G4ProductionCuts::SetProductionCuts ", 00139 "ProcCuts108", 00140 JustWarning, "Given vector size is inconsitent "); 00141 if (NumberOfG4CutIndex<vSize) vSize = NumberOfG4CutIndex; 00142 } 00143 for(G4int i = 0; (i<vSize ); i++) { 00144 fRangeCuts[i] = cut[i]; 00145 } 00146 isModified = true; 00147 }
std::vector<G4double> G4ProductionCuts::fRangeCuts [protected] |
Definition at line 113 of file G4ProductionCuts.hh.
Referenced by G4ProductionCuts(), GetProductionCut(), GetProductionCuts(), operator=(), SetProductionCut(), SetProductionCuts(), and ~G4ProductionCuts().
G4bool G4ProductionCuts::isModified [protected] |
Definition at line 114 of file G4ProductionCuts.hh.
Referenced by IsModified(), operator=(), PhysicsTableUpdated(), SetProductionCut(), and SetProductionCuts().