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

#include <G4ChannelingFastSimCrystalData.hh>

+ Inheritance diagram for G4ChannelingFastSimCrystalData:

Public Member Functions

 G4ChannelingFastSimCrystalData ()
 
virtual ~G4ChannelingFastSimCrystalData ()=default
 
void SetMaterialProperties (const G4Material *crystal, const G4String &lattice)
 
G4ThreeVector CoordinatesFromBoxToLattice (const G4ThreeVector &pos0)
 
G4ThreeVector CoordinatesFromLatticeToBox (const G4ThreeVector &pos)
 
G4ThreeVector ChannelChange (G4double &x, G4double &y, G4double &z)
 change the channel if necessary, recalculate x o y
 
G4double AngleXFromBoxToLattice (G4double tx, G4double z)
 
G4double AngleXFromLatticeToBox (G4double tx, G4double z)
 
G4double AngleXShift (G4double z)
 auxialiary function to transform the horizontal angle
 
- Public Member Functions inherited from G4VChannelingFastSimCrystalData
 G4VChannelingFastSimCrystalData ()
 
virtual ~G4VChannelingFastSimCrystalData ()
 
G4double Ex (G4double x, G4double y)
 electric fields produced by crystal lattice
 
G4double Ey (G4double x, G4double y)
 
G4double ElectronDensity (G4double x, G4double y)
 electron density function
 
G4double MinIonizationEnergy (G4double x, G4double y)
 minimum energy of ionization function
 
G4double NuclearDensity (G4double x, G4double y, G4int ielement)
 nuclear density function (normalized to average nuclear density)
 
G4double GetLindhardAngle (G4double etotal, G4double mass)
 Calculate the value of the Lindhard angle (!!! the value for a straight crystal)
 
G4double GetLindhardAngle ()
 Calculate the value of the Lindhard angle (!!! the value for a straight crystal)
 
G4double GetSimulationStep (G4double tx, G4double ty)
 
G4double GetMaxSimulationStep (G4double etotal, G4double mass)
 Calculate maximal simulation step (standard value for channeling particles)
 
G4double GetBeta ()
 get particle velocity/c
 
G4int GetNelements ()
 
G4int GetModel ()
 
G4double GetBendingAngle ()
 
G4double GetMiscutAngle ()
 
G4double GetCurv (G4double z)
 
G4double GetCUx (G4double z)
 get crystalline undulator wave function
 
G4double GetCUtetax (G4double z)
 get crystalline undulator wave 1st derivative function
 
void SetGeometryParameters (const G4LogicalVolume *crystallogic)
 set geometry parameters from current logical volume
 
void SetBendingAngle (G4double tetab, const G4LogicalVolume *crystallogic)
 
void SetMiscutAngle (G4double tetam, const G4LogicalVolume *crystallogic)
 
void SetCrystallineUndulatorParameters (G4double amplitude, G4double period, G4double phase, const G4LogicalVolume *crystallogic)
 
void SetCUParameters (const G4ThreeVector &amplitudePeriodPhase, const G4LogicalVolume *crystallogic)
 
void SetParticleProperties (G4double etotal, G4double mp, G4double charge, G4bool ifhadron)
 
G4double GetCorrectionZ ()
 
G4ThreeVector CoulombAtomicScattering (G4double effectiveStep, G4double step, G4int ielement)
 multiple and single scattering on screened potential
 
G4ThreeVector CoulombElectronScattering (G4double eMinIonization, G4double electronDensity, G4double step)
 multiple and single scattering on electrons
 
G4double IonizationLosses (G4double dz, G4int ielement)
 ionization losses
 
void SetVerbosity (G4int ver)
 

Additional Inherited Members

- Protected Attributes inherited from G4VChannelingFastSimCrystalData
G4ChannelingFastSimInterpolationfElectricFieldX {nullptr}
 classes containing interpolation coefficients
 
G4ChannelingFastSimInterpolationfElectricFieldY {nullptr}
 
G4ChannelingFastSimInterpolationfElectronDensity {nullptr}
 
G4ChannelingFastSimInterpolationfMinIonizationEnergy {nullptr}
 
std::vector< G4ChannelingFastSimInterpolation * > fNucleiDensity
 
G4ThreeVector fHalfDimBoundingBox
 values related to the crystal geometry
 
G4int fBent =0
 
G4double fBendingAngle =0.
 
G4double fBendingR = 0.
 
G4double fBending2R =0.
 
G4double fBendingRsquare =0.
 
G4double fCurv =0.
 
G4double fMiscutAngle = 0.
 
G4double fCosMiscutAngle =1.
 
G4double fSinMiscutAngle =0.
 
G4double fCorrectionZ = 1.
 
G4bool fCU = false
 
G4double fCUAmplitude =0.
 
G4double fCUK =0.
 
G4double fCUPhase =0.
 
G4double fCUAmplitudeK =0.
 
G4double fCUK2 =0.
 
G4int fNelements =1
 values related to the crystal lattice
 
G4int iModel =1
 
G4double fVmax =0
 
G4double fVmax2 =0
 
G4double fVMinCrystal =0
 
G4double fChangeStep =0
 
std::vector< G4doublefI0
 
std::vector< G4doublefRF
 
std::vector< G4doublefTeta10
 angles necessary for multiple and single coulomb scattering
 
std::vector< G4doublefTetamax0
 
std::vector< G4doublefTetamax2
 
std::vector< G4doublefTetamax12
 
std::vector< G4doublefTeta12
 
std::vector< G4doublefK20
 coefficients necessary for multiple and single coulomb scattering
 
std::vector< G4doublefK2
 
std::vector< G4doublefK40
 
G4double fK30 =0
 
G4double fK3 =0
 
std::vector< G4doublefKD
 
std::vector< G4doublefPu11
 coefficients for multiple scattering suppression
 
std::vector< G4doublefPzu11
 
std::vector< G4doublefBB
 
std::vector< G4doublefE1XBbb
 
std::vector< G4doublefBBDEXP
 
G4int fVerbosity = 1
 

Detailed Description

Definition at line 52 of file G4ChannelingFastSimCrystalData.hh.

Constructor & Destructor Documentation

◆ G4ChannelingFastSimCrystalData()

G4ChannelingFastSimCrystalData::G4ChannelingFastSimCrystalData ( )

Definition at line 31 of file G4ChannelingFastSimCrystalData.cc.

32{
33
34}

◆ ~G4ChannelingFastSimCrystalData()

virtual G4ChannelingFastSimCrystalData::~G4ChannelingFastSimCrystalData ( )
virtualdefault

Member Function Documentation

◆ AngleXFromBoxToLattice()

G4double G4ChannelingFastSimCrystalData::AngleXFromBoxToLattice ( G4double tx,
G4double z )
inlinevirtual

calculate the horizontal angle in the co-rotating reference system within a channel (periodic cell) (connected with crystal planes/axes either bent or straight)

Implements G4VChannelingFastSimCrystalData.

Definition at line 80 of file G4ChannelingFastSimCrystalData.hh.

81 {return tx-AngleXShift(z)-GetCUtetax(z);}
G4double AngleXShift(G4double z)
auxialiary function to transform the horizontal angle
G4double GetCUtetax(G4double z)
get crystalline undulator wave 1st derivative function

Referenced by G4ChannelingFastSimModel::DoIt().

◆ AngleXFromLatticeToBox()

G4double G4ChannelingFastSimCrystalData::AngleXFromLatticeToBox ( G4double tx,
G4double z )
inlinevirtual

calculate the horizontal angle in the Box reference system (connected with the bounding box of the volume)

Implements G4VChannelingFastSimCrystalData.

Definition at line 85 of file G4ChannelingFastSimCrystalData.hh.

86 {return tx+AngleXShift(z)+GetCUtetax(z);}

Referenced by G4ChannelingFastSimModel::DoIt().

◆ AngleXShift()

G4double G4ChannelingFastSimCrystalData::AngleXShift ( G4double z)
inlinevirtual

auxialiary function to transform the horizontal angle

Implements G4VChannelingFastSimCrystalData.

Definition at line 89 of file G4ChannelingFastSimCrystalData.hh.

Referenced by AngleXFromBoxToLattice(), and AngleXFromLatticeToBox().

◆ ChannelChange()

G4ThreeVector G4ChannelingFastSimCrystalData::ChannelChange ( G4double & x,
G4double & y,
G4double & z )
virtual

change the channel if necessary, recalculate x o y

Implements G4VChannelingFastSimCrystalData.

Definition at line 379 of file G4ChannelingFastSimCrystalData.cc.

382{
383
384 //test of enter in other channel
385 if (x<0)
386 {
387 fNChannelx-=1;
388 x+=fDx; //enter in other channel
389 //correction of the longitudinal coordinate
390 if (fBent) {fCorrectionZ = fBendingR/(fBendingR-fNChannelx*fDx);}
391 }
392 else if (x>=fDx)
393 {
394 fNChannelx+=1;
395 x-=fDx; //enter in other channel
396 //correction of the longitudinal coordinate
397 if (fBent) {fCorrectionZ = fBendingR/(fBendingR-fNChannelx*fDx);}
398 }
399
400 //test of enter in other channel
401 if (y<0)
402 {
403 fNChannely-=1;
404 y+=fDy; //enter in other channel
405 }
406 else if (y>=fDy)
407 {
408 fNChannely+=1;
409 y-=fDy; //enter in other channel
410 }
411
412 return G4ThreeVector(x,y,z);
413}
CLHEP::Hep3Vector G4ThreeVector

Referenced by G4ChannelingFastSimModel::DoIt().

◆ CoordinatesFromBoxToLattice()

G4ThreeVector G4ChannelingFastSimCrystalData::CoordinatesFromBoxToLattice ( const G4ThreeVector & pos0)
virtual

calculate the coordinates in the co-rotating reference system within a channel (periodic cell) (connected with crystal planes/axes either bent or straight)

Implements G4VChannelingFastSimCrystalData.

Definition at line 296 of file G4ChannelingFastSimCrystalData.cc.

298{
299 G4double x0=pos0.x(),y0=pos0.y(),z0=pos0.z();
301 G4double x,y,z;
302
303 if (fBent)
304 {
305 // for bent crystal
306 G4double rsqrt = std::sqrt(fBendingRsquare -
308 x0*x0 + z0*z0);
309 //transform to co-rotating reference system connected with "central plane/axis"
310 x = fBendingR - rsqrt;
311 y = y0;
312 z = fBendingR*std::asin((z0*fCosMiscutAngle + x0*fSinMiscutAngle)/rsqrt);
313 }
314 else
315 {
316 //for straight crystal
318 y = y0;
320
321 //for crystalline undulator
322 if(fCU){x-=GetCUx(z);}
323 }
324
325 //calculation of coordinates within a channel (periodic cell)
326 fNChannelx=std::floor(x/fDx); //remember the horizontal channel number
327 //to track the particle
328 x-=fNChannelx*fDx;
329 fNChannely=std::floor(y/fDy);//remember the vertical channel number
330 //to track the particle (=0 for planar case)
331 y-=fNChannely*fDy;
332 //correction of the longitudinal coordinate
333 if (fBent) {fCorrectionZ = fBendingR/(fBendingR-fNChannelx*fDx);}
334
335 return G4ThreeVector(x,y,z);
336}
double G4double
Definition G4Types.hh:83
double z() const
double x() const
double y() const
G4ThreeVector fHalfDimBoundingBox
values related to the crystal geometry
G4double GetCUx(G4double z)
get crystalline undulator wave function

Referenced by G4ChannelingFastSimModel::DoIt(), and G4ChannelingFastSimModel::ModelTrigger().

◆ CoordinatesFromLatticeToBox()

G4ThreeVector G4ChannelingFastSimCrystalData::CoordinatesFromLatticeToBox ( const G4ThreeVector & pos)
virtual

calculate the coordinates in the Box reference system (connected with the bounding box of the volume)

Implements G4VChannelingFastSimCrystalData.

Definition at line 340 of file G4ChannelingFastSimCrystalData.cc.

342{
343 G4double x=pos.x(),y=pos.y(),z=pos.z();
344
345 //transform to co-rotating reference system connected with "central plane/axis"
346 x+=fNChannelx*fDx;
347 y+=fNChannely*fDy;
348
349 G4double x0,y0,z0;
350
351 if (fBent)
352 {
353 // for bent crystal
354 G4double rcos = (fBendingR - x)*(1. - std::cos(z/fBendingR));
355 G4double a = x + rcos;
356 G4double b = std::sqrt(x*x + fBending2R*rcos - a*a);
357
358 //transform to Box coordinates
360 y0 = y;
362 }
363 else
364 {
365 //for crystalline undulator
366 if(fCU){x+=GetCUx(z);}
367
368 //for straight crystal
370 y0 = y;
372 }
373
374 return G4ThreeVector(x0,y0,z0-fHalfDimBoundingBox.z());
375}

Referenced by G4ChannelingFastSimModel::DoIt().

◆ SetMaterialProperties()

void G4ChannelingFastSimCrystalData::SetMaterialProperties ( const G4Material * crystal,
const G4String & lattice )
virtual

find and upload crystal lattice input files, calculate all the basic values (to do only once)

Implements G4VChannelingFastSimCrystalData.

Definition at line 38 of file G4ChannelingFastSimCrystalData.cc.

40{
41 G4String filename=crystal->GetName(); //input file
42 filename.erase(0,3);
43
44 if (fVerbosity)
45 {
46 G4cout <<
47 "======================================================================="
48 << G4endl;
49 G4cout <<
50 "====== Crystal lattice data ========"
51 << G4endl;
52 G4cout <<
53 "======================================================================="
54 << G4endl;
55 G4cout << "Crystal material: " << filename << G4endl;
56 }
57
58 //choice between planes (1D model) and axes (2D model)
59 if (lattice.compare(0,1,"(")==0)
60 {
61 iModel=1; //planes
62 filename = filename + "_planes_"; //temporary name
63 if (fVerbosity)
64 G4cout << "Crystal planes: " << lattice << G4endl;
65 }
66 else if (lattice.compare(0,1,"<")==0)
67 {
68 iModel=2; //axes
69 filename = filename + "_axes_"; //temporary name
70 if (fVerbosity)
71 G4cout << "Crystal axes: " << lattice << G4endl;
72 }
73
74 //input file:
75 filename = filename + lattice.substr(1,(lattice.length())-2) + ".dat";
76
78 for(G4int i=0; i<fNelements; i++)
79 {
80 fZ1.push_back(crystal->GetElement(i)->GetZ());
81 fAN.push_back(crystal->GetElement(i)->GetAtomicMassAmu());
82 fI0.push_back(crystal->GetElement(i)->GetIonisation()->GetMeanExcitationEnergy());
83 }
84
85 G4double var;//just variable
86 G4double unitIF;//unit of interpolation function
87
88 std::ifstream vfilein;
89 vfilein.open(filename);
90
91 //read nuclear concentration
92 for(G4int i=0; i<fNelements; i++)
93 {
94 vfilein >> var;
95 fN0.push_back(var/cm3);
96 }
97
98 //read amplitude of thermal oscillations
99 for(G4int i=0; i<fNelements; i++)
100 {
101 vfilein >> var;
102 fU1.push_back(var*cm);
103 }
104
105 if (iModel==1)
106 {
107 // read channel dimensions
108 vfilein >> fDx;
109 fDx*=cm;
110 // read interpolation step size
111 vfilein >> fNpointsx;
112
113 fDy = fDx;
114 fNpointsy = 0;
115 }
116 else if (iModel==2)
117 {
118 // read channel dimensions
119 vfilein >> fDx >> fDy;
120 fDx*=cm;
121 fDy*=cm;
122 // read the number of nodes of interpolation
123 vfilein >> fNpointsx >> fNpointsy;
124 }
125
126 //read the height of the potential well, necessary only for step length calculation
127 vfilein >> fVmax;
128 fVmax*=eV;
129 fVmax2=2.*fVmax;
130
131 //read the on-zero minimal potential inside the crystal,
132 //necessary for angle recalculation for entrance/exit through
133 //the crystal lateral surface
134 vfilein >> fVMinCrystal;
135 fVMinCrystal*=eV;
136
137 // to create the class of interpolation for any function
139 new G4ChannelingFastSimInterpolation(fDx,fDy,fNpointsx,fNpointsy,iModel);
140 if(iModel==2) {fElectricFieldY =
141 new G4ChannelingFastSimInterpolation(fDx,fDy,fNpointsx,fNpointsy,iModel);}
143 new G4ChannelingFastSimInterpolation(fDx,fDy,fNpointsx,fNpointsy,iModel);
145 new G4ChannelingFastSimInterpolation(fDx,fDy,fNpointsx,fNpointsy,iModel);
146
147 // do it for any element of crystal material
148 for(G4int i=0; i<fNelements; i++)
149 {
150 fNucleiDensity.push_back(
151 new G4ChannelingFastSimInterpolation(fDx,fDy,fNpointsx,fNpointsy,iModel));
152 }
153
154 if (iModel==1)
155 {
156 G4double ai, bi, ci, di;
157 for(G4int i=0; i<fNpointsx; i++)
158 {
159 //reading the coefficients of cubic spline
160 vfilein >> ai >> bi >> ci >> di;
161 //setting spline coefficients for electric field
162 unitIF=eV/cm;
163 fElectricFieldX->SetCoefficients1D(ai*unitIF, bi*unitIF,
164 ci*unitIF, di*unitIF, i);
165
166 //reading the coefficients of cubic spline
167 vfilein >> ai >> bi >> ci >> di;
168 //setting spline coefficients for nuclear density (first element)
169 unitIF=1.;
170 fNucleiDensity[0]->SetCoefficients1D(ai*unitIF, bi*unitIF,
171 ci*unitIF, di*unitIF, i);
172
173 //reading the coefficients of cubic spline
174 vfilein >> ai >> bi >> ci >> di;
175 //setting spline coefficients for electron density
176 unitIF=1./cm3;
177 fElectronDensity->SetCoefficients1D(ai*unitIF, bi*unitIF,
178 ci*unitIF, di*unitIF, i);
179
180 //reading the coefficients of cubic spline
181 vfilein >> ai >> bi >> ci >> di;
182 //setting spline coefficients for minimal ionization energy
183 unitIF=eV;
184 fMinIonizationEnergy->SetCoefficients1D(ai*unitIF, bi*unitIF,
185 ci*unitIF, di*unitIF, i);
186
187 for(G4int ii=1; ii<fNelements; ii++)
188 {
189 //reading the coefficients of cubic spline
190 vfilein >> ai >> bi >> ci >> di;
191 //setting spline coefficients for nuclear density (other elements if any)
192 unitIF=1.;
193 fNucleiDensity[ii]->SetCoefficients1D(ai*unitIF, bi*unitIF,
194 ci*unitIF, di*unitIF, i);
195 }
196 }
197 }
198 else if (iModel==2)
199 {
200 G4double ai3D, bi3D, ci3D;
201 for(G4int j=0; j<fNpointsy; j++)
202 {
203 for(G4int i=0; i<fNpointsx+1; i++)
204 {
205 for(G4int k=0; k<2; k++)
206 {
207 //reading the coefficients of cubic spline
208 vfilein >> ai3D >> bi3D >> ci3D;
209 unitIF=eV;
210 //setting spline coefficients for minimal ionization energy
211 fMinIonizationEnergy->SetCoefficients2D(ai3D*unitIF, bi3D*unitIF, ci3D*unitIF,
212 i, j, k);
213
214 //reading the coefficients of cubic spline
215 vfilein >> ai3D >> bi3D >> ci3D;
216 //setting spline coefficients for horizontal electric field
217 unitIF=eV/cm;
218 fElectricFieldX->SetCoefficients2D(ai3D*unitIF, bi3D*unitIF, ci3D*unitIF,
219 i, j, k);
220
221 //reading the coefficients of cubic spline
222 vfilein >> ai3D >> bi3D >> ci3D;
223 //setting spline coefficients for vertical electric field
224 unitIF=eV/cm;
225 fElectricFieldY->SetCoefficients2D(ai3D*unitIF, bi3D*unitIF, ci3D*unitIF,
226 i, j, k);
227
228 //reading the coefficients of cubic spline
229 vfilein >> ai3D >> bi3D >> ci3D;
230 //setting spline coefficients for nuclear density (first element)
231 unitIF=1.;
232 fNucleiDensity[0]->SetCoefficients2D(ai3D*unitIF, bi3D*unitIF, ci3D*unitIF,
233 i, j, k);
234
235 //reading the coefficients of cubic spline
236 vfilein >> ai3D >> bi3D >> ci3D;
237 //setting spline coefficients for electron density
238 unitIF=1./cm3;
239 fElectronDensity->SetCoefficients2D(ai3D*unitIF, bi3D*unitIF, ci3D*unitIF,
240 i, j, k);
241
242 for(G4int ii=1; ii<fNelements; ii++)
243 {
244 //reading the coefficients of cubic spline
245 vfilein >> ai3D >> bi3D >> ci3D;
246 //setting spline coefficients for nuclear density (other elements if any)
247 unitIF=1.;
248 fNucleiDensity[ii]->SetCoefficients2D(ai3D*unitIF, bi3D*unitIF,
249 ci3D*unitIF,
250 i, j, k);
251 }
252
253 }
254 }
255 }
256 }
257
258 vfilein.close();
259
260 //set special values and coefficients
261 G4double alphahbarc2=std::pow(CLHEP::fine_structure_const*CLHEP::hbarc ,2.);
262 fK30=2.*CLHEP::pi*alphahbarc2/CLHEP::electron_mass_c2;
263
264 for(G4int i=0; i<fNelements; i++)
265 {
266 fRF.push_back((std::pow(9*CLHEP::pi*CLHEP::pi/128/fZ1[i],1/3.))
267 *0.5291772109217*angstrom);//Thomas-Fermi screening radius
268
269 fTetamax0.push_back(CLHEP::hbarc/(fR0*std::pow(fAN[i],1./3.)));
270 fTeta10.push_back(CLHEP::hbarc/fRF[i]);
271 fPu11.push_back(std::pow(fU1[i]/CLHEP::hbarc,2.));
272
273 fK20.push_back(alphahbarc2*4*CLHEP::pi*fN0[i]*fZ1[i]*fZ1[i]);
274
275 fK40.push_back(3.76*std::pow(CLHEP::fine_structure_const*fZ1[i],2.));
276
277 fKD.push_back(fK30*fZ1[i]*fN0[i]);
278 }
279
280 fBB.resize(fNelements);
281 fE1XBbb.resize(fNelements);
282 fBBDEXP.resize(fNelements);
283 fPzu11.resize(fNelements);
284 fTeta12.resize(fNelements);
285 fTetamax2.resize(fNelements);
286 fTetamax12.resize(fNelements);
287 fK2.resize(fNelements);
288
289 fChangeStep = CLHEP::pi*std::min(fDx,fDy)/fNsteps;//necessary to define simulation
290 //step = fChannelingStep =
291 // = fChannelingStep0*sqrt(pv)
292}
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void SetCoefficients1D(G4double AI0, G4double BI0, G4double CI0, G4double DI0, G4int i)
Set spline coefficients.
void SetCoefficients2D(G4double AI3D0, G4double BI3D0, G4double CI3D0, G4int i, G4int j, G4int k)
G4double GetAtomicMassAmu() const
Definition G4Element.hh:124
G4double GetZ() const
Definition G4Element.hh:119
G4IonisParamElm * GetIonisation() const
Definition G4Element.hh:171
G4double GetMeanExcitationEnergy() const
const G4Element * GetElement(G4int iel) const
std::size_t GetNumberOfElements() const
const G4String & GetName() const
std::vector< G4double > fK20
coefficients necessary for multiple and single coulomb scattering
std::vector< G4ChannelingFastSimInterpolation * > fNucleiDensity
G4ChannelingFastSimInterpolation * fMinIonizationEnergy
G4ChannelingFastSimInterpolation * fElectricFieldY
G4ChannelingFastSimInterpolation * fElectricFieldX
classes containing interpolation coefficients
G4ChannelingFastSimInterpolation * fElectronDensity
G4int fNelements
values related to the crystal lattice
std::vector< G4double > fTeta10
angles necessary for multiple and single coulomb scattering
std::vector< G4double > fPu11
coefficients for multiple scattering suppression

Referenced by G4ChannelingFastSimModel::Input().


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