Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RDCrossSectionHandler Class Reference

#include <G4RDCrossSectionHandler.hh>

Inheritance diagram for G4RDCrossSectionHandler:
Collaboration diagram for G4RDCrossSectionHandler:

Public Member Functions

 G4RDCrossSectionHandler ()
 
 ~G4RDCrossSectionHandler ()
 
- Public Member Functions inherited from G4RDVCrossSectionHandler
 G4RDVCrossSectionHandler ()
 
 G4RDVCrossSectionHandler (G4RDVDataSetAlgorithm *interpolation, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int nBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99)
 
virtual ~G4RDVCrossSectionHandler ()
 
void Initialise (G4RDVDataSetAlgorithm *interpolation=0, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int numberOfBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99)
 
G4int SelectRandomAtom (const G4MaterialCutsCouple *couple, G4double e) const
 
const G4ElementSelectRandomElement (const G4MaterialCutsCouple *material, G4double e) const
 
G4int SelectRandomShell (G4int Z, G4double e) const
 
G4RDVEMDataSetBuildMeanFreePathForMaterials (const G4DataVector *energyCuts=0)
 
G4double FindValue (G4int Z, G4double e) const
 
G4double FindValue (G4int Z, G4double e, G4int shellIndex) const
 
G4double ValueForMaterial (const G4Material *material, G4double e) const
 
void LoadData (const G4String &dataFile)
 
void LoadShellData (const G4String &dataFile)
 
void PrintData () const
 
void Clear ()
 

Protected Member Functions

virtual std::vector
< G4RDVEMDataSet * > * 
BuildCrossSectionsForMaterials (const G4DataVector &energyVector, const G4DataVector *energyCuts=0)
 
- Protected Member Functions inherited from G4RDVCrossSectionHandler
G4int NumberOfComponents (G4int Z) const
 
void ActiveElements ()
 
virtual G4RDVDataSetAlgorithmCreateInterpolation ()
 
const G4RDVDataSetAlgorithmGetInterpolation () const
 

Detailed Description

Definition at line 59 of file G4RDCrossSectionHandler.hh.

Constructor & Destructor Documentation

G4RDCrossSectionHandler::G4RDCrossSectionHandler ( )

Definition at line 55 of file G4RDCrossSectionHandler.cc.

56 { }
G4RDCrossSectionHandler::~G4RDCrossSectionHandler ( )

Definition at line 58 of file G4RDCrossSectionHandler.cc.

59 { }

Member Function Documentation

std::vector< G4RDVEMDataSet * > * G4RDCrossSectionHandler::BuildCrossSectionsForMaterials ( const G4DataVector energyVector,
const G4DataVector energyCuts = 0 
)
protectedvirtual

Implements G4RDVCrossSectionHandler.

Definition at line 62 of file G4RDCrossSectionHandler.cc.

64 {
65  G4DataVector* energies;
67 
68  std::vector<G4RDVEMDataSet*>* matCrossSections = new std::vector<G4RDVEMDataSet*>;
69 
70  const G4ProductionCutsTable* theCoupleTable=
72  size_t numOfCouples = theCoupleTable->GetTableSize();
73 
74  size_t nOfBins = energyVector.size();
75  const G4RDVDataSetAlgorithm* interpolationAlgo = CreateInterpolation();
76 
77  for (size_t m=0; m<numOfCouples; m++)
78  {
79  const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(m);
80  const G4Material* material= couple->GetMaterial();
81  G4int nElements = material->GetNumberOfElements();
82  const G4ElementVector* elementVector = material->GetElementVector();
83  const G4double* nAtomsPerVolume = material->GetAtomicNumDensityVector();
84 
85  G4RDVDataSetAlgorithm* algo = interpolationAlgo->Clone();
86 
87  G4RDVEMDataSet* setForMat = new G4RDCompositeEMDataSet(algo,1.,1.);
88 
89  for (G4int i=0; i<nElements; i++) {
90 
91  G4int Z = (G4int) (*elementVector)[i]->GetZ();
92  G4double density = nAtomsPerVolume[i];
93 
94  energies = new G4DataVector;
95  data = new G4DataVector;
96 
97 
98  for (size_t bin=0; bin<nOfBins; bin++)
99  {
100  G4double e = energyVector[bin];
101  energies->push_back(e);
102  G4double cross = density*FindValue(Z,e);
103  data->push_back(cross);
104  }
105 
106  G4RDVDataSetAlgorithm* algo1 = interpolationAlgo->Clone();
107  G4RDVEMDataSet* elSet = new G4RDEMDataSet(i,energies,data,algo1,1.,1.);
108  setForMat->AddComponent(elSet);
109  }
110 
111  matCrossSections->push_back(setForMat);
112  }
113  return matCrossSections;
114 }
virtual G4RDVDataSetAlgorithm * Clone() const =0
std::vector< G4Element * > G4ElementVector
tuple bin
Definition: plottest35.py:22
G4double FindValue(G4int Z, G4double e) const
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
int G4int
Definition: G4Types.hh:78
const XML_Char const XML_Char * data
Definition: expat.h:268
string material
Definition: eplot.py:19
static constexpr double m
Definition: G4SIunits.hh:129
virtual G4RDVDataSetAlgorithm * CreateInterpolation()
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:216
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
double G4double
Definition: G4Types.hh:76
virtual void AddComponent(G4RDVEMDataSet *dataSet)=0
const G4Material * GetMaterial() const

Here is the call graph for this function:


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