Geant4  10.02.p03
G4ComponentSAIDTotalXS Class Reference

#include <G4ComponentSAIDTotalXS.hh>

Inheritance diagram for G4ComponentSAIDTotalXS:
Collaboration diagram for G4ComponentSAIDTotalXS:

Public Member Functions

 G4ComponentSAIDTotalXS ()
 
virtual ~G4ComponentSAIDTotalXS ()
 
virtual G4double GetTotalElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, G4int, G4double)
 
virtual G4double GetTotalIsotopeCrossSection (const G4ParticleDefinition *, G4double kinEnergy, G4int, G4int)
 
virtual G4double GetInelasticElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, G4int, G4double)
 
virtual G4double GetInelasticIsotopeCrossSection (const G4ParticleDefinition *, G4double kinEnergy, G4int, G4int)
 
virtual G4double GetElasticElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, G4int, G4double)
 
virtual G4double GetElasticIsotopeCrossSection (const G4ParticleDefinition *, G4double kinEnergy, G4int, G4int)
 
G4double GetChargeExchangeCrossSection (const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4double kinEnergy, G4int, G4int)
 
virtual void Description () const
 
- Public Member Functions inherited from G4VComponentCrossSection
 G4VComponentCrossSection (const G4String &nam="")
 
virtual ~G4VComponentCrossSection ()
 
G4double GetTotalElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)
 
G4double GetInelasticElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)
 
G4double GetElasticElementCrossSection (const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)
 
virtual G4double ComputeQuasiElasticRatio (const G4ParticleDefinition *, G4double kinEnergy, G4int, G4int)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Private Member Functions

G4SAIDCrossSectionType GetType (const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4int Z, G4int N)
 
void Initialise (G4SAIDCrossSectionType tp)
 
void ReadData (G4int index, G4PhysicsVector *, const G4String &, const G4String &)
 
void PrintWarning (const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4int, G4int, const G4String &, const G4String &)
 
G4ComponentSAIDTotalXSoperator= (const G4ComponentSAIDTotalXS &right)
 
 G4ComponentSAIDTotalXS (const G4ComponentSAIDTotalXS &)
 

Private Attributes

G4PhysicsVectorelastdata [numberOfSaidXS]
 
G4PhysicsVectorinelastdata [numberOfSaidXS]
 

Static Private Attributes

static const G4String fnames [numberOfSaidXS]
 

Detailed Description

Definition at line 74 of file G4ComponentSAIDTotalXS.hh.

Constructor & Destructor Documentation

◆ G4ComponentSAIDTotalXS() [1/2]

G4ComponentSAIDTotalXS::G4ComponentSAIDTotalXS ( )

Definition at line 50 of file G4ComponentSAIDTotalXS.cc.

51  : G4VComponentCrossSection("xsSAID")
52 {
53  for(G4int i=0; i<numberOfSaidXS; ++i) {
54  elastdata[i] = 0;
55  inelastdata[i] = 0;
56  }
57 }
int G4int
Definition: G4Types.hh:78
G4PhysicsVector * inelastdata[numberOfSaidXS]
G4PhysicsVector * elastdata[numberOfSaidXS]
G4VComponentCrossSection(const G4String &nam="")

◆ ~G4ComponentSAIDTotalXS()

G4ComponentSAIDTotalXS::~G4ComponentSAIDTotalXS ( )
virtual

Definition at line 59 of file G4ComponentSAIDTotalXS.cc.

60 {
61  for(G4int i=0; i<numberOfSaidXS; ++i) {
62  if(elastdata[i]) {
63  delete elastdata[i];
64  elastdata[i] = 0;
65  }
66  if(inelastdata[i]) {
67  delete inelastdata[i];
68  inelastdata[i] = 0;
69  }
70  }
71 }
int G4int
Definition: G4Types.hh:78
G4PhysicsVector * inelastdata[numberOfSaidXS]
G4PhysicsVector * elastdata[numberOfSaidXS]

◆ G4ComponentSAIDTotalXS() [2/2]

G4ComponentSAIDTotalXS::G4ComponentSAIDTotalXS ( const G4ComponentSAIDTotalXS )
private

Member Function Documentation

◆ Description()

void G4ComponentSAIDTotalXS::Description ( ) const
virtual

Reimplemented from G4VComponentCrossSection.

Definition at line 168 of file G4ComponentSAIDTotalXS.cc.

169 {
170 }

◆ GetChargeExchangeCrossSection()

G4double G4ComponentSAIDTotalXS::GetChargeExchangeCrossSection ( const G4ParticleDefinition prim,
const G4ParticleDefinition sec,
G4double  kinEnergy,
G4int  Z,
G4int  N 
)

Definition at line 150 of file G4ComponentSAIDTotalXS.cc.

154 {
155  G4double cross = 0.0;
156  G4SAIDCrossSectionType tp = GetType(prim,sec,Z,N);
157  if(saidUnknown != tp) {
158  G4int idx = G4int(tp);
159  if(!inelastdata[idx]) { Initialise(tp); }
160  if(inelastdata[idx]) {
161  cross = (inelastdata[idx])->Value(kinEnergy);
162  }
163  }
164  return cross;
165 }
G4SAIDCrossSectionType
int G4int
Definition: G4Types.hh:78
G4PhysicsVector * inelastdata[numberOfSaidXS]
Float_t Z
void Initialise(G4SAIDCrossSectionType tp)
**D E S C R I P T I O N
G4SAIDCrossSectionType GetType(const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4int Z, G4int N)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ GetElasticElementCrossSection()

G4double G4ComponentSAIDTotalXS::GetElasticElementCrossSection ( const G4ParticleDefinition part,
G4double  kinEnergy,
G4int  Z,
G4double  N 
)
virtual

Implements G4VComponentCrossSection.

Definition at line 122 of file G4ComponentSAIDTotalXS.cc.

125 {
126  PrintWarning(part,0,Z,G4lrint(N),
127  "G4ComponentSAIDTotalXS::GetTotalElementCrossSection",
128  "Method is not implemented");
129  return 0.0;
130 }
void PrintWarning(const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4int, G4int, const G4String &, const G4String &)
Float_t Z
int G4lrint(double ad)
Definition: templates.hh:163
**D E S C R I P T I O N
Here is the call graph for this function:

◆ GetElasticIsotopeCrossSection()

G4double G4ComponentSAIDTotalXS::GetElasticIsotopeCrossSection ( const G4ParticleDefinition part,
G4double  kinEnergy,
G4int  Z,
G4int  N 
)
virtual

Implements G4VComponentCrossSection.

Definition at line 133 of file G4ComponentSAIDTotalXS.cc.

136 {
137  G4double cross = 0.0;
138  G4SAIDCrossSectionType tp = GetType(part,0,Z,N);
139  if(saidUnknown != tp) {
140  G4int idx = G4int(tp);
141  if(!elastdata[idx]) { Initialise(tp); }
142  if(elastdata[idx]) {
143  cross = (elastdata[idx])->Value(kinEnergy);
144  }
145  }
146  return cross;
147 }
G4SAIDCrossSectionType
int G4int
Definition: G4Types.hh:78
G4PhysicsVector * elastdata[numberOfSaidXS]
Float_t Z
void Initialise(G4SAIDCrossSectionType tp)
**D E S C R I P T I O N
G4SAIDCrossSectionType GetType(const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4int Z, G4int N)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInelasticElementCrossSection()

G4double G4ComponentSAIDTotalXS::GetInelasticElementCrossSection ( const G4ParticleDefinition part,
G4double  kinEnergy,
G4int  Z,
G4double  N 
)
virtual

Implements G4VComponentCrossSection.

Definition at line 94 of file G4ComponentSAIDTotalXS.cc.

97 {
98  PrintWarning(part,0,Z,G4lrint(N),
99  "G4ComponentSAIDTotalXS::GetTotalElementCrossSection",
100  "Method is not implemented");
101  return 0.0;
102 }
void PrintWarning(const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4int, G4int, const G4String &, const G4String &)
Float_t Z
int G4lrint(double ad)
Definition: templates.hh:163
**D E S C R I P T I O N
Here is the call graph for this function:

◆ GetInelasticIsotopeCrossSection()

G4double G4ComponentSAIDTotalXS::GetInelasticIsotopeCrossSection ( const G4ParticleDefinition part,
G4double  kinEnergy,
G4int  Z,
G4int  N 
)
virtual

Implements G4VComponentCrossSection.

Definition at line 105 of file G4ComponentSAIDTotalXS.cc.

108 {
109  G4double cross = 0.0;
110  G4SAIDCrossSectionType tp = GetType(part,0,Z,N);
111  if(saidUnknown != tp) {
112  G4int idx = G4int(tp);
113  if(!inelastdata[idx]) { Initialise(tp); }
114  if(inelastdata[idx]) {
115  cross = (inelastdata[idx])->Value(kinEnergy);
116  }
117  }
118  return cross;
119 }
G4SAIDCrossSectionType
int G4int
Definition: G4Types.hh:78
G4PhysicsVector * inelastdata[numberOfSaidXS]
Float_t Z
void Initialise(G4SAIDCrossSectionType tp)
**D E S C R I P T I O N
G4SAIDCrossSectionType GetType(const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4int Z, G4int N)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTotalElementCrossSection()

G4double G4ComponentSAIDTotalXS::GetTotalElementCrossSection ( const G4ParticleDefinition part,
G4double  kinEnergy,
G4int  Z,
G4double  N 
)
virtual

Implements G4VComponentCrossSection.

Definition at line 74 of file G4ComponentSAIDTotalXS.cc.

77 {
78  PrintWarning(part,0,Z,G4lrint(N),
79  "G4ComponentSAIDTotalXS::GetTotalElementCrossSection",
80  "Method is not implemented");
81  return 0.0;
82 }
void PrintWarning(const G4ParticleDefinition *prim, const G4ParticleDefinition *sec, G4int, G4int, const G4String &, const G4String &)
Float_t Z
int G4lrint(double ad)
Definition: templates.hh:163
**D E S C R I P T I O N
Here is the call graph for this function:

◆ GetTotalIsotopeCrossSection()

G4double G4ComponentSAIDTotalXS::GetTotalIsotopeCrossSection ( const G4ParticleDefinition part,
G4double  kinEnergy,
G4int  Z,
G4int  N 
)
virtual

Implements G4VComponentCrossSection.

Definition at line 85 of file G4ComponentSAIDTotalXS.cc.

88 {
89  return GetInelasticIsotopeCrossSection(part,kinEnergy,Z,N)
90  + GetElasticIsotopeCrossSection(part,kinEnergy,Z,N);
91 }
virtual G4double GetInelasticIsotopeCrossSection(const G4ParticleDefinition *, G4double kinEnergy, G4int, G4int)
virtual G4double GetElasticIsotopeCrossSection(const G4ParticleDefinition *, G4double kinEnergy, G4int, G4int)
Float_t Z
**D E S C R I P T I O N
Here is the call graph for this function:

◆ GetType()

G4SAIDCrossSectionType G4ComponentSAIDTotalXS::GetType ( const G4ParticleDefinition prim,
const G4ParticleDefinition sec,
G4int  Z,
G4int  N 
)
private

Definition at line 173 of file G4ComponentSAIDTotalXS.cc.

176 {
178  if(1 == N && prim) {
179  G4int code = prim->GetPDGEncoding();
180 
181  // only gamma + N x-sections available
182  if(0 == Z && sec && 22 == code) {
183  G4int code1 = sec->GetPDGEncoding();
184  if(-211 == code1) { type = saidGN_PINP; }
185  else if(111 == code1) { type = saidGN_PI0N; }
186 
187  // x-sections off proton
188  } else if(1 == Z) {
189  if(sec) {
190  G4int code1 = sec->GetPDGEncoding();
191  if(-211 == code) {
192  if(111 == code1) { type = saidPINP_PI0N; }
193  else if(221 == code1) { type = saidPINP_ETAN; }
194 
195  } else if(22 == code) {
196  if(111 == code1) { type = saidGP_PI0P; }
197  else if(211 == code1) { type = saidGP_PIPN; }
198  else if(221 == code1) { type = saidGP_ETAP; }
199  else if(331 == code1) { type = saidGP_ETAPP; }
200  }
201  } else {
202  if(2212 == code) { type = saidPP; }
203  else if(2112 == code) { type = saidNP; }
204  else if(211 == code) { type = saidPIPP; }
205  else if(-211 == code) { type = saidPINP; }
206  }
207  }
208  }
209  //G4cout << "G4ComponentSAIDTotalXS::Type= " << type << G4endl;
210  return type;
211 }
G4SAIDCrossSectionType
int G4int
Definition: G4Types.hh:78
Float_t Z
Definition: inftrees.h:24
**D E S C R I P T I O N
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialise()

void G4ComponentSAIDTotalXS::Initialise ( G4SAIDCrossSectionType  tp)
private

Definition at line 213 of file G4ComponentSAIDTotalXS.cc.

214 {
215  G4int idx = G4int(tp);
216  // check environment variable
217  // Build the complete string identifying the file with the data set
218  char* path = getenv("G4SAIDXSDATA");
219  if (!path){
220  G4Exception("G4ComponentSAIDTotalXS::Initialise(..)","had013",
222  "Environment variable G4SAIDXSDATA is not defined");
223  return;
224  }
225  if(idx <= 4) {
226  elastdata[idx] = new G4LPhysicsFreeVector();
227  inelastdata[idx] = new G4LPhysicsFreeVector();
228  ReadData(idx,elastdata[idx],path,"_el.dat");
229  ReadData(idx,inelastdata[idx],path,"_in.dat");
230  } else {
231  inelastdata[idx] = new G4LPhysicsFreeVector();
232  ReadData(idx,inelastdata[idx],path,".dat");
233  }
234 }
int G4int
Definition: G4Types.hh:78
G4PhysicsVector * inelastdata[numberOfSaidXS]
G4PhysicsVector * elastdata[numberOfSaidXS]
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void ReadData(G4int index, G4PhysicsVector *, const G4String &, const G4String &)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

G4ComponentSAIDTotalXS& G4ComponentSAIDTotalXS::operator= ( const G4ComponentSAIDTotalXS right)
private

◆ PrintWarning()

void G4ComponentSAIDTotalXS::PrintWarning ( const G4ParticleDefinition prim,
const G4ParticleDefinition sec,
G4int  Z,
G4int  N,
const G4String ss1,
const G4String ss2 
)
private

Definition at line 263 of file G4ComponentSAIDTotalXS.cc.

268 {
269  G4cout << ss1 << ": " << ss2 << G4endl;
270  G4cout << "For Z= " << Z << " N= " << N << " of ";
271  if(prim) { G4cout << prim->GetParticleName() << " "; }
272  if(sec) { G4cout << " x-section to " << sec->GetParticleName(); }
273  G4cout << G4endl;
274 }
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
Float_t Z
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadData()

void G4ComponentSAIDTotalXS::ReadData ( G4int  index,
G4PhysicsVector v,
const G4String ss1,
const G4String ss2 
)
private

Definition at line 236 of file G4ComponentSAIDTotalXS.cc.

240 {
241  std::ostringstream ost;
242  ost << ss1 << "/" << fnames[index] << ss2;
243  std::ifstream filein(ost.str().c_str());
244  if (!(filein)) {
246  ed << "Data file <" << ost.str().c_str()
247  << "> is not opened!";
248  G4Exception("G4ComponentSAIDTotalXS::ReadData(..)","had014",
249  FatalException, ed, "Check G4SAIDXSDATA");
250  } else {
251  if(GetVerboseLevel() > 1) {
252  G4cout << "File " << ost.str()
253  << " is opened by G4ComponentSAIDTotalXS" << G4endl;
254  }
255  // retrieve data from DB
256  v->Retrieve(filein, true);
258  v->SetSpline(true);
259  }
260 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
Int_t index
static const double millibarn
Definition: SystemOfUnits.h:85
static const G4String fnames[numberOfSaidXS]
void SetSpline(G4bool)
G4GLOB_DLL std::ostream G4cout
virtual void ScaleVector(G4double factorE, G4double factorV)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
#define G4endl
Definition: G4ios.hh:61
static const double MeV
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ elastdata

G4PhysicsVector* G4ComponentSAIDTotalXS::elastdata[numberOfSaidXS]
private

Definition at line 140 of file G4ComponentSAIDTotalXS.hh.

◆ fnames

const G4String G4ComponentSAIDTotalXS::fnames
staticprivate
Initial value:
= {
"","pp","np","pip","pim",
"pin","pie",
"gp_pi0p","gp_pi+n","gn_pi-p","gn_pi0n","gp_etap","gp_etapp"
}

Definition at line 139 of file G4ComponentSAIDTotalXS.hh.

◆ inelastdata

G4PhysicsVector* G4ComponentSAIDTotalXS::inelastdata[numberOfSaidXS]
private

Definition at line 141 of file G4ComponentSAIDTotalXS.hh.


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