Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
G4RDCrossSectionHandler Class Reference

#include <G4RDCrossSectionHandler.hh>

Inheritance diagram for G4RDCrossSectionHandler:
G4RDVCrossSectionHandler

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.

References G4RDVEMDataSet::AddComponent(), plottest35::bin, G4RDVDataSetAlgorithm::Clone(), G4RDVCrossSectionHandler::CreateInterpolation(), density, G4RDVCrossSectionHandler::FindValue(), G4Material::GetAtomicNumDensityVector(), G4Material::GetElementVector(), G4MaterialCutsCouple::GetMaterial(), G4ProductionCutsTable::GetMaterialCutsCouple(), G4Material::GetNumberOfElements(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), python.hepunit::m, and eplot::material.

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:188
int G4int
Definition: G4Types.hh:78
string material
Definition: eplot.py:19
G4double density
Definition: TRTMaterials.hh:39
virtual G4RDVDataSetAlgorithm * CreateInterpolation()
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:214
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
double G4double
Definition: G4Types.hh:76
virtual void AddComponent(G4RDVEMDataSet *dataSet)=0
const XML_Char const XML_Char * data
const G4Material * GetMaterial() const

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