Geant4  10.02.p03
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
 

Private Member Functions

 G4RDCrossSectionHandler (const G4RDCrossSectionHandler &)
 
G4RDCrossSectionHandleroperator= (const G4RDCrossSectionHandler &right)
 

Detailed Description

Definition at line 59 of file G4RDCrossSectionHandler.hh.

Constructor & Destructor Documentation

◆ G4RDCrossSectionHandler() [1/2]

G4RDCrossSectionHandler::G4RDCrossSectionHandler ( )

Definition at line 55 of file G4RDCrossSectionHandler.cc.

56 { }

◆ ~G4RDCrossSectionHandler()

G4RDCrossSectionHandler::~G4RDCrossSectionHandler ( )

Definition at line 58 of file G4RDCrossSectionHandler.cc.

59 { }

◆ G4RDCrossSectionHandler() [2/2]

G4RDCrossSectionHandler::G4RDCrossSectionHandler ( const G4RDCrossSectionHandler )
private

Member Function Documentation

◆ BuildCrossSectionsForMaterials()

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;
66  G4DataVector* data;
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
const G4Material * GetMaterial() const
float bin[41]
Definition: plottest35.C:14
int G4int
Definition: G4Types.hh:78
string material
Definition: eplot.py:19
G4double density
Definition: TRTMaterials.hh:39
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:216
Float_t Z
virtual G4RDVDataSetAlgorithm * CreateInterpolation()
G4double FindValue(G4int Z, G4double e) const
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
static const double m
Definition: G4SIunits.hh:128
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
double G4double
Definition: G4Types.hh:76
virtual void AddComponent(G4RDVEMDataSet *dataSet)=0
Here is the call graph for this function:

◆ operator=()

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

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