Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ProductionCuts Class Reference

#include <G4ProductionCuts.hh>

Public Member Functions

 G4ProductionCuts ()
 
 G4ProductionCuts (const G4ProductionCuts &right)
 
G4ProductionCutsoperator= (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< G4doublefRangeCuts
 
G4bool isModified
 

Detailed Description

Definition at line 62 of file G4ProductionCuts.hh.

Constructor & Destructor Documentation

G4ProductionCuts::G4ProductionCuts ( )

Definition at line 45 of file G4ProductionCuts.cc.

45  :
46  isModified(true)
47 {
48  for (G4int i=0; i< NumberOfG4CutIndex; i++) {
49  fRangeCuts.push_back(0.0);
50  }
51 }
std::vector< G4double > fRangeCuts
int G4int
Definition: G4Types.hh:78
G4ProductionCuts::G4ProductionCuts ( const G4ProductionCuts right)

Definition at line 53 of file G4ProductionCuts.cc.

54  : isModified(true)
55 {
56  for (G4int i=0; i< NumberOfG4CutIndex; i++) {
57  fRangeCuts.push_back(0.0);
58  }
59  *this = right;
60 }
std::vector< G4double > fRangeCuts
int G4int
Definition: G4Types.hh:78
G4ProductionCuts::~G4ProductionCuts ( )
virtual

Definition at line 62 of file G4ProductionCuts.cc.

63 {
64  fRangeCuts.clear();
65 }
std::vector< G4double > fRangeCuts

Member Function Documentation

G4int G4ProductionCuts::GetIndex ( const G4String name)
static

Definition at line 92 of file G4ProductionCuts.cc.

93 {
94  static const G4String gamma ("gamma");
95  static const G4String electron("e-");
96  static const G4String positron("e+");
97  static const G4String proton("proton");
98 
99  G4int index;
100  if ( name == gamma ) { index = 0; }
101  else if ( name == electron ) { index = 1; }
102  else if ( name == positron ) { index = 2; }
103  else if ( name == proton ) { index = 3; }
104  else { index = -1; }
105 
106  return index;
107 }
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

G4int G4ProductionCuts::GetIndex ( const G4ParticleDefinition ptcl)
static

Definition at line 110 of file G4ProductionCuts.cc.

111 {
112  if(!ptcl) return -1;
113  // In the first call, pointers are set
114  if(gammaDef==0 && ptcl->GetParticleName()=="gamma") { gammaDef = (G4ParticleDefinition*) ptcl; }
115  if(electDef==0 && ptcl->GetParticleName()=="e-") { electDef = (G4ParticleDefinition*) ptcl; }
116  if(positDef==0 && ptcl->GetParticleName()=="e+") { positDef = (G4ParticleDefinition*) ptcl; }
117  if(protonDef==0 && ptcl->GetParticleName()=="proton") { protonDef = (G4ParticleDefinition*) ptcl; }
118 
119  G4int index;
120  if(ptcl==(const G4ParticleDefinition*) gammaDef) { index = 0; }
121  else if(ptcl==(const G4ParticleDefinition*) electDef) { index = 1; }
122  else if(ptcl==(const G4ParticleDefinition*) positDef) { index = 2; }
123  else if(ptcl==(const G4ParticleDefinition*) protonDef) { index = 3; }
124  else { index = -1; }
125 
126  return index;
127 }
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const

Here is the call graph for this function:

G4double G4ProductionCuts::GetProductionCut ( G4int  index) const
inline

Definition at line 157 of file G4ProductionCuts.hh.

158 {
159  G4double cut=-1.0;
160  if ( (index>=0) && (index<NumberOfG4CutIndex) ) {
161  cut = fRangeCuts[index];
162  }
163  return cut;
164 }
std::vector< G4double > fRangeCuts
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4ProductionCuts::GetProductionCut ( const G4String name) const
inline

Definition at line 167 of file G4ProductionCuts.hh.

168 {
169  return GetProductionCut(GetIndex(name));
170 }
static G4int GetIndex(const G4String &name)
G4double GetProductionCut(G4int index) const

Here is the call graph for this function:

const std::vector< G4double > & G4ProductionCuts::GetProductionCuts ( ) const
inline

Definition at line 174 of file G4ProductionCuts.hh.

175 {
176  return fRangeCuts;
177 }
std::vector< G4double > fRangeCuts

Here is the caller graph for this function:

G4bool G4ProductionCuts::IsModified ( ) const
inline

Definition at line 180 of file G4ProductionCuts.hh.

181 {
182  return isModified;
183 }

Here is the caller graph for this function:

G4int G4ProductionCuts::operator!= ( const G4ProductionCuts right) const

Definition at line 86 of file G4ProductionCuts.cc.

87 {
88  return (this != &right);
89 }
G4ProductionCuts & G4ProductionCuts::operator= ( const G4ProductionCuts right)

Definition at line 67 of file G4ProductionCuts.cc.

68 {
69  if (&right==this) return *this;
70 
71  for (G4int i=0; i< NumberOfG4CutIndex; i++) {
72  fRangeCuts[i] = right.fRangeCuts[i];
73  }
74  isModified = right.isModified;
75  return *this;
76 }
std::vector< G4double > fRangeCuts
int G4int
Definition: G4Types.hh:78
G4int G4ProductionCuts::operator== ( const G4ProductionCuts right) const

Definition at line 80 of file G4ProductionCuts.cc.

81 {
82  return (this == &right);
83 }
void G4ProductionCuts::PhysicsTableUpdated ( )
inline

Definition at line 186 of file G4ProductionCuts.hh.

187 {
188  isModified = false;
189 }

Here is the caller graph for this function:

void G4ProductionCuts::SetProductionCut ( G4double  cut,
G4int  index = -1 
)
inline

Definition at line 127 of file G4ProductionCuts.hh.

128 {
129  if (index<0) {
130  for(G4int i = 0; i < NumberOfG4CutIndex; i++) {
131  fRangeCuts[i] = cut;
132  }
133  isModified = true;
134 
135  } else if (index < NumberOfG4CutIndex) {
136  fRangeCuts[index] = cut;
137  isModified = true;
138  }
139 }
std::vector< G4double > fRangeCuts
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

void G4ProductionCuts::SetProductionCut ( G4double  cut,
G4ParticleDefinition ptcl 
)
inline

Definition at line 142 of file G4ProductionCuts.hh.

143 {
144  G4int idx = -1;
145  if(ptcl) idx = GetIndex(ptcl);
146  if(idx>=0) SetProductionCut(cut,idx);
147 }
static G4int GetIndex(const G4String &name)
void SetProductionCut(G4double cut, G4int index=-1)
int G4int
Definition: G4Types.hh:78

Here is the call graph for this function:

void G4ProductionCuts::SetProductionCut ( G4double  cut,
const G4String pName 
)
inline

Definition at line 150 of file G4ProductionCuts.hh.

151 {
152  G4int idx = GetIndex(pName);
153  if(idx>=0) SetProductionCut(cut,idx);
154 }
static G4int GetIndex(const G4String &name)
void SetProductionCut(G4double cut, G4int index=-1)
int G4int
Definition: G4Types.hh:78

Here is the call graph for this function:

void G4ProductionCuts::SetProductionCuts ( std::vector< G4double > &  cut)

Definition at line 130 of file G4ProductionCuts.cc.

131 {
132  G4int vSize = cut.size();
133  if (vSize != NumberOfG4CutIndex) {
134 #ifdef G4VERBOSE
135  if ( G4ProductionCutsTable::GetProductionCutsTable()->GetVerboseLevel()>1) {
136  G4cerr << "G4ProductionCuts::SetProductionCuts ";
137  G4cerr << " The size of given cut value vector [=" << vSize << "] "
138  << " is not consitent with number of CutIndex [="
140  }
141 #endif
142  G4Exception( "G4ProductionCuts::SetProductionCuts ",
143  "ProcCuts108",
144  JustWarning, "Given vector size is inconsitent ");
145  if (NumberOfG4CutIndex<vSize) vSize = NumberOfG4CutIndex;
146  }
147  for(G4int i = 0; (i<vSize ); i++) {
148  fRangeCuts[i] = cut[i];
149  }
150  isModified = true;
151 }
std::vector< G4double > fRangeCuts
int G4int
Definition: G4Types.hh:78
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4ProductionCutsTable * GetProductionCutsTable()
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

Member Data Documentation

std::vector<G4double> G4ProductionCuts::fRangeCuts
protected

Definition at line 113 of file G4ProductionCuts.hh.

G4bool G4ProductionCuts::isModified
protected

Definition at line 114 of file G4ProductionCuts.hh.


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