Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ChannelingMaterialData Class Reference

#include <G4ChannelingMaterialData.hh>

+ Inheritance diagram for G4ChannelingMaterialData:

Public Member Functions

 G4ChannelingMaterialData (const G4String &)
 
virtual ~G4ChannelingMaterialData ()
 
void Print () const
 
void SetFilename (const G4String &)
 
void SetFilenameElement (const G4String &, std::string)
 
G4ChannelingECHARMGetPot ()
 
G4ChannelingECHARMGetEFX ()
 
G4ChannelingECHARMGetEFY ()
 
G4ChannelingECHARMGetNuD ()
 
G4ChannelingECHARMGetElD ()
 
G4ChannelingECHARMGetPotEl (std::string name)
 
G4ChannelingECHARMGetEFXEl (std::string name)
 
G4ChannelingECHARMGetEFYEl (std::string name)
 
G4ChannelingECHARMGetNuDEl (std::string name)
 
G4ChannelingECHARMGetElDEl (std::string name)
 
virtual G4bool IsBent ()
 
virtual G4ThreeVector GetBR (G4ThreeVector &v3)
 
virtual void SetBR (const G4String &)
 
virtual void SetBR (G4double)
 
- Public Member Functions inherited from G4VMaterialExtension
 G4VMaterialExtension (const G4String &name)
 
virtual ~G4VMaterialExtension ()=default
 
const std::size_t & GetHash () const
 
const G4StringGetName () const
 

Protected Attributes

G4PhysicsVectorfVectorR
 
G4bool bIsBent
 
- Protected Attributes inherited from G4VMaterialExtension
const G4StringfName
 
const std::size_t fHash
 

Detailed Description

Definition at line 41 of file G4ChannelingMaterialData.hh.

Constructor & Destructor Documentation

◆ G4ChannelingMaterialData()

G4ChannelingMaterialData::G4ChannelingMaterialData ( const G4String & name)

Definition at line 36 of file G4ChannelingMaterialData.cc.

36 :
38fPotential(0),
39fElectricFieldX(0),
40fElectricFieldY(0),
41fNucleiDensity(0),
42fElectronDensity(0),
43fVectorR(0),
44bIsBent(false){;}
G4VMaterialExtension(const G4String &name)

◆ ~G4ChannelingMaterialData()

G4ChannelingMaterialData::~G4ChannelingMaterialData ( )
virtual

Definition at line 128 of file G4ChannelingMaterialData.cc.

128{;}

Member Function Documentation

◆ GetBR()

virtual G4ThreeVector G4ChannelingMaterialData::GetBR ( G4ThreeVector & v3)
inlinevirtual

Definition at line 85 of file G4ChannelingMaterialData.hh.

85 {
86 return G4ThreeVector(fVectorR->Value(v3.z()),0.,0.);
87 };
CLHEP::Hep3Vector G4ThreeVector
double z() const
G4double Value(const G4double energy, std::size_t &lastidx) const

◆ GetEFX()

G4ChannelingECHARM * G4ChannelingMaterialData::GetEFX ( )
inline

Definition at line 54 of file G4ChannelingMaterialData.hh.

54{return fElectricFieldX;};

◆ GetEFXEl()

G4ChannelingECHARM * G4ChannelingMaterialData::GetEFXEl ( std::string name)
inline

Definition at line 68 of file G4ChannelingMaterialData.hh.

68{return fElectricFieldXElement[name];};
const char * name(G4int ptype)

◆ GetEFY()

G4ChannelingECHARM * G4ChannelingMaterialData::GetEFY ( )
inline

Definition at line 55 of file G4ChannelingMaterialData.hh.

55{return fElectricFieldY;};

◆ GetEFYEl()

G4ChannelingECHARM * G4ChannelingMaterialData::GetEFYEl ( std::string name)
inline

Definition at line 69 of file G4ChannelingMaterialData.hh.

69{return fElectricFieldYElement[name];};

◆ GetElD()

G4ChannelingECHARM * G4ChannelingMaterialData::GetElD ( )
inline

Definition at line 57 of file G4ChannelingMaterialData.hh.

57{return fElectronDensity;};

◆ GetElDEl()

G4ChannelingECHARM * G4ChannelingMaterialData::GetElDEl ( std::string name)
inline

Definition at line 71 of file G4ChannelingMaterialData.hh.

71{return fElectronDensityElement[name];};

◆ GetNuD()

G4ChannelingECHARM * G4ChannelingMaterialData::GetNuD ( )
inline

Definition at line 56 of file G4ChannelingMaterialData.hh.

56{return fNucleiDensity;};

◆ GetNuDEl()

G4ChannelingECHARM * G4ChannelingMaterialData::GetNuDEl ( std::string name)
inline

Definition at line 70 of file G4ChannelingMaterialData.hh.

70{return fNucleiDensityElement[name];};

◆ GetPot()

G4ChannelingECHARM * G4ChannelingMaterialData::GetPot ( )
inline

Definition at line 53 of file G4ChannelingMaterialData.hh.

53{return fPotential;};

◆ GetPotEl()

G4ChannelingECHARM * G4ChannelingMaterialData::GetPotEl ( std::string name)
inline

Definition at line 67 of file G4ChannelingMaterialData.hh.

67{return fPotentialElement[name];};

◆ IsBent()

virtual G4bool G4ChannelingMaterialData::IsBent ( )
inlinevirtual

Definition at line 81 of file G4ChannelingMaterialData.hh.

81 {
82 return bIsBent;
83 };

◆ Print()

void G4ChannelingMaterialData::Print ( ) const
inlinevirtual

Implements G4VMaterialExtension.

Definition at line 48 of file G4ChannelingMaterialData.hh.

48{G4cout << "Channeling Material Data" << G4endl;};
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

◆ SetBR() [1/2]

void G4ChannelingMaterialData::SetBR ( const G4String & filename)
virtual

Definition at line 102 of file G4ChannelingMaterialData.cc.

102 {
103 std::ifstream vFileIn;
104 int points;
105 float maximum;
106 vFileIn.open(filename);
107 vFileIn >> points >> maximum;
108
109 fVectorR = new G4PhysicsLinearVector(0,maximum * CLHEP::millimeter,points);
110 double vTempX;
111 double maximumY = -DBL_MAX;
112 double minimumY = +DBL_MAX;
113 for(G4int i0=0;i0<points; i0++){
114 vFileIn >> vTempX;
115 if(vTempX>maximumY) maximumY = vTempX;
116 if(vTempX<minimumY) minimumY = vTempX;
117 fVectorR->PutValue(i0,vTempX * CLHEP::meter);
118 }
119 G4cout << "G4ChannelingMaterialData::SetBR()" << G4endl;
120 G4cout << "Filename: " << filename << G4endl;
121 G4cout << "Point: " << points << " - Length [mm]: " << maximum << G4endl;
122 G4cout << "Maximum Radius [m]: " << maximumY << " - Minimum Radius [m]: " << minimumY << G4endl;
123 bIsBent = true;
124}
int G4int
Definition G4Types.hh:85
void PutValue(const std::size_t index, const G4double value)
#define DBL_MAX
Definition templates.hh:62

◆ SetBR() [2/2]

void G4ChannelingMaterialData::SetBR ( G4double val)
virtual

Definition at line 93 of file G4ChannelingMaterialData.cc.

93 {
95 fVectorR->PutValue(0,val);
96 fVectorR->PutValue(1,val);
97 bIsBent = true;
98}

◆ SetFilename()

void G4ChannelingMaterialData::SetFilename ( const G4String & fileName)

Definition at line 48 of file G4ChannelingMaterialData.cc.

48 {
49 G4String filePot = fileName + "_pot.txt";
50 G4String fileEFX = fileName + "_efx.txt";
51 G4String fileEFY = fileName + "_efy.txt";
52 G4String fileAtD = fileName + "_atd.txt";
53 G4String fileElD = fileName + "_eld.txt";
54
55 fPotential = new G4ChannelingECHARM(filePot,CLHEP::eV);
56 fElectricFieldX = new G4ChannelingECHARM(fileEFX,CLHEP::eV/CLHEP::m);
57 fElectricFieldY = new G4ChannelingECHARM(fileEFY,CLHEP::eV/CLHEP::m);
58 fNucleiDensity = new G4ChannelingECHARM(fileAtD,1.);
59 fElectronDensity = new G4ChannelingECHARM(fileElD,1.);
60
61 G4cout << filePot << G4endl;
62 G4cout << fileEFX << G4endl;
63 G4cout << fileEFY << G4endl;
64 G4cout << fileAtD << G4endl;
65 G4cout << fileElD << G4endl;
66}

◆ SetFilenameElement()

void G4ChannelingMaterialData::SetFilenameElement ( const G4String & fileName,
std::string elementName )

Definition at line 70 of file G4ChannelingMaterialData.cc.

70 {
71 G4String filePot = fileName + "_pot.txt";
72 G4String fileEFX = fileName + "_efx.txt";
73 G4String fileEFY = fileName + "_efy.txt";
74 G4String fileAtD = fileName + "_atd.txt";
75 G4String fileElD = fileName + "_eld.txt";
76
77 fPotentialElement[elementName] = new G4ChannelingECHARM(filePot,CLHEP::eV);
78 fElectricFieldXElement[elementName] = new G4ChannelingECHARM(fileEFX,CLHEP::eV/CLHEP::m);
79 fElectricFieldYElement[elementName] = new G4ChannelingECHARM(fileEFY,CLHEP::eV/CLHEP::m);
80 fNucleiDensityElement[elementName] = new G4ChannelingECHARM(fileAtD,1.);
81 fElectronDensityElement[elementName] = new G4ChannelingECHARM(fileElD,1.);
82
83 G4cout << filePot << G4endl;
84 G4cout << fileEFX << G4endl;
85 G4cout << fileEFY << G4endl;
86 G4cout << fileAtD << G4endl;
87 G4cout << fileElD << G4endl;
88}

Member Data Documentation

◆ bIsBent

G4bool G4ChannelingMaterialData::bIsBent
protected

Definition at line 93 of file G4ChannelingMaterialData.hh.

Referenced by IsBent(), SetBR(), and SetBR().

◆ fVectorR

G4PhysicsVector* G4ChannelingMaterialData::fVectorR
protected

Definition at line 92 of file G4ChannelingMaterialData.hh.

Referenced by GetBR(), SetBR(), and SetBR().


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