Geant4-11
Public Types | Public Member Functions | Private Attributes
G4LatticeLogical Class Reference

#include <G4LatticeLogical.hh>

Public Types

enum  { MAXRES =322 }
 

Public Member Functions

void Dump (std::ostream &os) const
 
void Dump_NMap (std::ostream &os, G4int pol, const G4String &name) const
 
void DumpMap (std::ostream &os, G4int pol, const G4String &name) const
 
 G4LatticeLogical ()
 
G4double GetAnhDecConstant () const
 
G4double GetBeta () const
 
G4double GetFTDOS () const
 
G4double GetGamma () const
 
G4double GetLambda () const
 
G4double GetLDOS () const
 
G4double GetMu () const
 
G4double GetScatteringConstant () const
 
G4double GetSTDOS () const
 
G4bool Load_NMap (G4int, G4int, G4int, G4String)
 
G4bool LoadMap (G4int, G4int, G4int, G4String)
 
virtual G4double MapKtoV (G4int, const G4ThreeVector &) const
 
virtual G4ThreeVector MapKtoVDir (G4int, const G4ThreeVector &) const
 
void SetAnhDecConstant (G4double a)
 
void SetDynamicalConstants (G4double Beta, G4double Gamma, G4double Lambda, G4double Mu)
 
void SetFTDOS (G4double FTDOS)
 
void SetLDOS (G4double LDOS)
 
void SetScatteringConstant (G4double b)
 
void SetSTDOS (G4double STDOS)
 
void SetVerboseLevel (G4int vb)
 
virtual ~G4LatticeLogical ()
 

Private Attributes

G4double fA
 
G4double fB
 
G4double fBeta
 
G4int fDresPhi
 
G4int fDresTheta
 
G4double fFTDOS
 
G4double fGamma
 
G4double fLambda
 
G4double fLDOS
 
G4double fMap [3][MAXRES][MAXRES]
 
G4double fMu
 
G4ThreeVector fN_map [3][MAXRES][MAXRES]
 
G4double fSTDOS
 
G4int fVresPhi
 
G4int fVresTheta
 
G4int verboseLevel
 

Detailed Description

Definition at line 41 of file G4LatticeLogical.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAXRES 

Definition at line 85 of file G4LatticeLogical.hh.

85{ MAXRES=322 }; // Maximum map resolution (bins)

Constructor & Destructor Documentation

◆ G4LatticeLogical()

G4LatticeLogical::G4LatticeLogical ( )

Definition at line 39 of file G4LatticeLogical.cc.

41 fA(0), fB(0), fLDOS(0), fSTDOS(0), fFTDOS(0),
42 fBeta(0), fGamma(0), fLambda(0), fMu(0) {
43 for (G4int i=0; i<3; i++) {
44 for (G4int j=0; j<MAXRES; j++) {
45 for (G4int k=0; k<MAXRES; k++) {
46 fMap[i][j][k] = 0.;
47 fN_map[i][j][k].set(0.,0.,0.);
48 }
49 }
50 }
51}
int G4int
Definition: G4Types.hh:85
void set(double x, double y, double z)
G4ThreeVector fN_map[3][MAXRES][MAXRES]
G4double fMap[3][MAXRES][MAXRES]

References fMap, fN_map, MAXRES, and CLHEP::Hep3Vector::set().

◆ ~G4LatticeLogical()

G4LatticeLogical::~G4LatticeLogical ( )
virtual

Definition at line 53 of file G4LatticeLogical.cc.

53{;}

Member Function Documentation

◆ Dump()

void G4LatticeLogical::Dump ( std::ostream &  os) const

Definition at line 201 of file G4LatticeLogical.cc.

201 {
202 os << "dyn " << fBeta << " " << fGamma << " " << fLambda << " " << fMu
203 << "\nscat " << fB << " decay " << fA
204 << "\nLDOS " << fLDOS << " STDOS " << fSTDOS << " FTDOS " << fFTDOS
205 << std::endl;
206
207 Dump_NMap(os, 0, "LVec.ssv");
208 Dump_NMap(os, 1, "FTVec.ssv");
209 Dump_NMap(os, 2, "STVec.ssv");
210
211 DumpMap(os, 0, "L.ssv");
212 DumpMap(os, 1, "FT.ssv");
213 DumpMap(os, 2, "ST.ssv");
214}
void DumpMap(std::ostream &os, G4int pol, const G4String &name) const
void Dump_NMap(std::ostream &os, G4int pol, const G4String &name) const

References Dump_NMap(), DumpMap(), fA, fB, fBeta, fFTDOS, fGamma, fLambda, fLDOS, fMu, and fSTDOS.

Referenced by operator<<().

◆ Dump_NMap()

void G4LatticeLogical::Dump_NMap ( std::ostream &  os,
G4int  pol,
const G4String name 
) const

Definition at line 228 of file G4LatticeLogical.cc.

229 {
230 os << "VDir " << name << " " << (pol==0?"L":pol==1?"FT":pol==2?"ST":"??")
231 << " " << fDresTheta << " " << fDresPhi << std::endl;
232
233 for (G4int iTheta=0; iTheta<fDresTheta; iTheta++) {
234 for (G4int iPhi=0; iPhi<fDresPhi; iPhi++) {
235 os << fN_map[pol][iTheta][iPhi].x()
236 << " " << fN_map[pol][iTheta][iPhi].y()
237 << " " << fN_map[pol][iTheta][iPhi].z()
238 << std::endl;
239 }
240 }
241}
double z() const
double x() const
double y() const
const char * name(G4int ptype)

References fDresPhi, fDresTheta, fN_map, G4InuclParticleNames::name(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by Dump().

◆ DumpMap()

void G4LatticeLogical::DumpMap ( std::ostream &  os,
G4int  pol,
const G4String name 
) const

Definition at line 216 of file G4LatticeLogical.cc.

217 {
218 os << "VG " << name << " " << (pol==0?"L":pol==1?"FT":pol==2?"ST":"??")
219 << " " << fVresTheta << " " << fVresPhi << std::endl;
220
221 for (G4int iTheta=0; iTheta<fVresTheta; iTheta++) {
222 for (G4int iPhi=0; iPhi<fVresPhi; iPhi++) {
223 os << fMap[pol][iTheta][iPhi] << std::endl;
224 }
225 }
226}

References fMap, fVresPhi, fVresTheta, and G4InuclParticleNames::name().

Referenced by Dump().

◆ GetAnhDecConstant()

G4double G4LatticeLogical::GetAnhDecConstant ( ) const
inline

Definition at line 79 of file G4LatticeLogical.hh.

79{ return fA; }

References fA.

Referenced by G4LatticePhysical::GetAnhDecConstant().

◆ GetBeta()

G4double G4LatticeLogical::GetBeta ( ) const
inline

Definition at line 74 of file G4LatticeLogical.hh.

74{ return fBeta; }

References fBeta.

Referenced by G4LatticePhysical::GetBeta().

◆ GetFTDOS()

G4double G4LatticeLogical::GetFTDOS ( ) const
inline

Definition at line 82 of file G4LatticeLogical.hh.

82{ return fFTDOS; }

References fFTDOS.

Referenced by G4LatticePhysical::GetFTDOS().

◆ GetGamma()

G4double G4LatticeLogical::GetGamma ( ) const
inline

Definition at line 75 of file G4LatticeLogical.hh.

75{ return fGamma; }

References fGamma.

Referenced by G4LatticePhysical::GetGamma().

◆ GetLambda()

G4double G4LatticeLogical::GetLambda ( ) const
inline

Definition at line 76 of file G4LatticeLogical.hh.

76{ return fLambda; }

References fLambda.

Referenced by G4LatticePhysical::GetLambda().

◆ GetLDOS()

G4double G4LatticeLogical::GetLDOS ( ) const
inline

Definition at line 80 of file G4LatticeLogical.hh.

80{ return fLDOS; }

References fLDOS.

Referenced by G4LatticePhysical::GetLDOS().

◆ GetMu()

G4double G4LatticeLogical::GetMu ( ) const
inline

Definition at line 77 of file G4LatticeLogical.hh.

77{ return fMu; }

References fMu.

Referenced by G4LatticePhysical::GetMu().

◆ GetScatteringConstant()

G4double G4LatticeLogical::GetScatteringConstant ( ) const
inline

Definition at line 78 of file G4LatticeLogical.hh.

78{ return fB; }

References fB.

Referenced by G4LatticePhysical::GetScatteringConstant().

◆ GetSTDOS()

G4double G4LatticeLogical::GetSTDOS ( ) const
inline

Definition at line 81 of file G4LatticeLogical.hh.

81{ return fSTDOS; }

References fSTDOS.

Referenced by G4LatticePhysical::GetSTDOS().

◆ Load_NMap()

G4bool G4LatticeLogical::Load_NMap ( G4int  tRes,
G4int  pRes,
G4int  polarizationState,
G4String  map 
)

Definition at line 97 of file G4LatticeLogical.cc.

98 {
99 if (tRes>MAXRES || pRes>MAXRES) {
100 G4cerr << "G4LatticeLogical::LoadMap exceeds maximum resolution of "
101 << MAXRES << " by " << MAXRES << ". terminating." << G4endl;
102 return false; //terminate if resolution out of bounds.
103 }
104
105 std::ifstream fMapFile(map.data());
106 if(!fMapFile.is_open()) return false;
107
108 G4double x,y,z; // Buffers to read coordinates from file
109 G4ThreeVector dir;
110 for (G4int theta = 0; theta<tRes; theta++) {
111 for (G4int phi = 0; phi<pRes; phi++) {
112 fMapFile >> x >> y >> z;
113 dir.set(x,y,z);
114 fN_map[polarizationState][theta][phi] = dir.unit(); // Enforce unity
115 }
116 }
117
118 if (verboseLevel) {
119 G4cout << "\nG4LatticeLogical::Load_NMap(" << map << ") successful"
120 << " (Vdir " << tRes << " x " << pRes << " for polarization "
121 << polarizationState << ")." << G4endl;
122 }
123
124 fDresTheta=tRes; //store map dimensions
125 fDresPhi=pRes;
126 return true;
127}
double G4double
Definition: G4Types.hh:83
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
Hep3Vector unit() const

References fDresPhi, fDresTheta, fN_map, G4cerr, G4cout, G4endl, anonymous_namespace{G4QuasiElRatios.cc}::map, MAXRES, CLHEP::Hep3Vector::set(), CLHEP::Hep3Vector::unit(), and verboseLevel.

Referenced by G4LatticeReader::ProcessNMap().

◆ LoadMap()

G4bool G4LatticeLogical::LoadMap ( G4int  tRes,
G4int  pRes,
G4int  polarizationState,
G4String  map 
)

Definition at line 61 of file G4LatticeLogical.cc.

62 {
63 if (tRes>MAXRES || pRes>MAXRES) {
64 G4cerr << "G4LatticeLogical::LoadMap exceeds maximum resolution of "
65 << MAXRES << " by " << MAXRES << ". terminating." << G4endl;
66 return false; //terminate if resolution out of bounds.
67 }
68
69 std::ifstream fMapFile(map.data());
70 if (!fMapFile.is_open()) return false;
71
72 G4double vgrp = 0.;
73 for (G4int theta = 0; theta<tRes; theta++) {
74 for (G4int phi = 0; phi<pRes; phi++) {
75 fMapFile >> vgrp;
76 fMap[polarizationState][theta][phi] = vgrp * (m/s);
77 }
78 }
79
80 if (verboseLevel) {
81 G4cout << "\nG4LatticeLogical::LoadMap(" << map << ") successful"
82 << " (Vg scalars " << tRes << " x " << pRes << " for polarization "
83 << polarizationState << ")." << G4endl;
84 }
85
86 fVresTheta=tRes; //store map dimensions
87 fVresPhi=pRes;
88 return true;
89}
static constexpr double m
Definition: G4SIunits.hh:109
static constexpr double s
Definition: G4SIunits.hh:154

References fMap, fVresPhi, fVresTheta, G4cerr, G4cout, G4endl, m, anonymous_namespace{G4QuasiElRatios.cc}::map, MAXRES, s, and verboseLevel.

Referenced by G4LatticeReader::ProcessMap().

◆ MapKtoV()

G4double G4LatticeLogical::MapKtoV ( G4int  polarizationState,
const G4ThreeVector k 
) const
virtual

Definition at line 135 of file G4LatticeLogical.cc.

136 {
137 G4double theta, phi, tRes, pRes;
138
139 tRes=pi/fVresTheta;
140 pRes=twopi/fVresPhi;
141
142 theta=k.getTheta();
143 phi=k.getPhi();
144
145 if(phi<0) phi = phi + twopi;
146 if(theta>pi) theta=theta-pi;
147
148 G4double Vg = fMap[polarizationState][int(theta/tRes)][int(phi/pRes)];
149
150 if(Vg == 0){
151 G4cout<<"\nFound v=0 for polarization "<<polarizationState
152 <<" theta "<<theta<<" phi "<<phi<< " translating to map coords "
153 <<"theta "<< int(theta/tRes) << " phi " << int(phi/pRes)<<G4endl;
154 }
155
156 if (verboseLevel>1) {
157 G4cout << "G4LatticeLogical::MapKtoV theta,phi=" << theta << " " << phi
158 << " : ith,iph " << int(theta/tRes) << " " << int(phi/pRes)
159 << " : V " << Vg << G4endl;
160 }
161
162 return Vg;
163}
static constexpr double twopi
Definition: G4SIunits.hh:56
static constexpr double pi
Definition: G4SIunits.hh:55
double getTheta() const
double getPhi() const

References fMap, fVresPhi, fVresTheta, G4cout, G4endl, CLHEP::Hep3Vector::getPhi(), CLHEP::Hep3Vector::getTheta(), pi, twopi, and verboseLevel.

Referenced by G4LatticePhysical::MapKtoV().

◆ MapKtoVDir()

G4ThreeVector G4LatticeLogical::MapKtoVDir ( G4int  polarizationState,
const G4ThreeVector k 
) const
virtual

Definition at line 171 of file G4LatticeLogical.cc.

172 {
173 G4double theta, phi, tRes, pRes;
174
175 tRes=pi/(fDresTheta-1);//The summant "-1" is required:index=[0:array length-1]
176 pRes=2*pi/(fDresPhi-1);
177
178 theta=k.getTheta();
179 phi=k.getPhi();
180
181 if(theta>pi) theta=theta-pi;
182 //phi=[0 to 2 pi] in accordance with DMC //if(phi>pi/2) phi=phi-pi/2;
183 if(phi<0) phi = phi + 2*pi;
184
185 G4int iTheta = int(theta/tRes+0.5);
186 G4int iPhi = int(phi/pRes+0.5);
187
188 if (verboseLevel>1) {
189 G4cout << "G4LatticeLogical::MapKtoVDir theta,phi=" << theta << " " << phi
190 << " : ith,iph " << iTheta << " " << iPhi
191 << " : dir " << fN_map[polarizationState][iTheta][iPhi] << G4endl;
192 }
193
194 return fN_map[polarizationState][iTheta][iPhi];
195}

References fDresPhi, fDresTheta, fN_map, G4cout, G4endl, CLHEP::Hep3Vector::getPhi(), CLHEP::Hep3Vector::getTheta(), pi, and verboseLevel.

Referenced by G4LatticePhysical::MapKtoVDir().

◆ SetAnhDecConstant()

void G4LatticeLogical::SetAnhDecConstant ( G4double  a)
inline

Definition at line 69 of file G4LatticeLogical.hh.

69{ fA=a; }

References fA.

Referenced by G4LatticeReader::ProcessValue().

◆ SetDynamicalConstants()

void G4LatticeLogical::SetDynamicalConstants ( G4double  Beta,
G4double  Gamma,
G4double  Lambda,
G4double  Mu 
)
inline

Definition at line 63 of file G4LatticeLogical.hh.

64 {
65 fBeta=Beta; fGamma=Gamma; fLambda=Lambda; fMu=Mu;
66 }

References fBeta, fGamma, fLambda, fMu, and G4INCL::Lambda.

Referenced by G4LatticeReader::ProcessConstants().

◆ SetFTDOS()

void G4LatticeLogical::SetFTDOS ( G4double  FTDOS)
inline

Definition at line 72 of file G4LatticeLogical.hh.

72{ fFTDOS=FTDOS; }

References fFTDOS.

Referenced by G4LatticeReader::ProcessValue().

◆ SetLDOS()

void G4LatticeLogical::SetLDOS ( G4double  LDOS)
inline

Definition at line 70 of file G4LatticeLogical.hh.

70{ fLDOS=LDOS; }

References fLDOS.

Referenced by G4LatticeReader::ProcessValue().

◆ SetScatteringConstant()

void G4LatticeLogical::SetScatteringConstant ( G4double  b)
inline

Definition at line 68 of file G4LatticeLogical.hh.

68{ fB=b; }

References fB.

Referenced by G4LatticeReader::ProcessValue().

◆ SetSTDOS()

void G4LatticeLogical::SetSTDOS ( G4double  STDOS)
inline

Definition at line 71 of file G4LatticeLogical.hh.

71{ fSTDOS=STDOS; }

References fSTDOS.

Referenced by G4LatticeReader::ProcessValue().

◆ SetVerboseLevel()

void G4LatticeLogical::SetVerboseLevel ( G4int  vb)
inline

Definition at line 46 of file G4LatticeLogical.hh.

46{ verboseLevel = vb; }

References verboseLevel.

Field Documentation

◆ fA

G4double G4LatticeLogical::fA
private

Definition at line 98 of file G4LatticeLogical.hh.

Referenced by Dump(), GetAnhDecConstant(), and SetAnhDecConstant().

◆ fB

G4double G4LatticeLogical::fB
private

Definition at line 99 of file G4LatticeLogical.hh.

Referenced by Dump(), GetScatteringConstant(), and SetScatteringConstant().

◆ fBeta

G4double G4LatticeLogical::fBeta
private

Definition at line 103 of file G4LatticeLogical.hh.

Referenced by Dump(), GetBeta(), and SetDynamicalConstants().

◆ fDresPhi

G4int G4LatticeLogical::fDresPhi
private

Definition at line 96 of file G4LatticeLogical.hh.

Referenced by Dump_NMap(), Load_NMap(), and MapKtoVDir().

◆ fDresTheta

G4int G4LatticeLogical::fDresTheta
private

Definition at line 95 of file G4LatticeLogical.hh.

Referenced by Dump_NMap(), Load_NMap(), and MapKtoVDir().

◆ fFTDOS

G4double G4LatticeLogical::fFTDOS
private

Definition at line 102 of file G4LatticeLogical.hh.

Referenced by Dump(), GetFTDOS(), and SetFTDOS().

◆ fGamma

G4double G4LatticeLogical::fGamma
private

Definition at line 103 of file G4LatticeLogical.hh.

Referenced by Dump(), GetGamma(), and SetDynamicalConstants().

◆ fLambda

G4double G4LatticeLogical::fLambda
private

Definition at line 103 of file G4LatticeLogical.hh.

Referenced by Dump(), GetLambda(), and SetDynamicalConstants().

◆ fLDOS

G4double G4LatticeLogical::fLDOS
private

Definition at line 100 of file G4LatticeLogical.hh.

Referenced by Dump(), GetLDOS(), and SetLDOS().

◆ fMap

G4double G4LatticeLogical::fMap[3][MAXRES][MAXRES]
private

Definition at line 90 of file G4LatticeLogical.hh.

Referenced by DumpMap(), G4LatticeLogical(), LoadMap(), and MapKtoV().

◆ fMu

G4double G4LatticeLogical::fMu
private

Definition at line 103 of file G4LatticeLogical.hh.

Referenced by Dump(), GetMu(), and SetDynamicalConstants().

◆ fN_map

G4ThreeVector G4LatticeLogical::fN_map[3][MAXRES][MAXRES]
private

Definition at line 91 of file G4LatticeLogical.hh.

Referenced by Dump_NMap(), G4LatticeLogical(), Load_NMap(), and MapKtoVDir().

◆ fSTDOS

G4double G4LatticeLogical::fSTDOS
private

Definition at line 101 of file G4LatticeLogical.hh.

Referenced by Dump(), GetSTDOS(), and SetSTDOS().

◆ fVresPhi

G4int G4LatticeLogical::fVresPhi
private

Definition at line 94 of file G4LatticeLogical.hh.

Referenced by DumpMap(), LoadMap(), and MapKtoV().

◆ fVresTheta

G4int G4LatticeLogical::fVresTheta
private

Definition at line 93 of file G4LatticeLogical.hh.

Referenced by DumpMap(), LoadMap(), and MapKtoV().

◆ verboseLevel

G4int G4LatticeLogical::verboseLevel
private

Definition at line 88 of file G4LatticeLogical.hh.

Referenced by Load_NMap(), LoadMap(), MapKtoV(), MapKtoVDir(), and SetVerboseLevel().


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