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

#include <G4SynchrotronRadiation.hh>

Inheritance diagram for G4SynchrotronRadiation:
G4VDiscreteProcess G4VProcess

Public Member Functions

 G4SynchrotronRadiation (const G4String &pName="SynRad", G4ProcessType type=fElectromagnetic)
 
virtual ~G4SynchrotronRadiation ()
 
virtual G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4VParticleChangePostStepDoIt (const G4Track &track, const G4Step &Step)
 
G4double GetPhotonEnergy (const G4Track &trackData, const G4Step &stepData)
 
G4double GetRandomEnergySR (G4double, G4double)
 
G4double InvSynFracInt (G4double x)
 
G4double Chebyshev (G4double a, G4double b, const G4double c[], G4int n, G4double x)
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void PrintInfoDefinition ()
 
void SetAngularGenerator (G4VEmAngularDistribution *p)
 
- Public Member Functions inherited from G4VDiscreteProcess
 G4VDiscreteProcess (const G4String &, G4ProcessType aType=fNotDefined)
 
 G4VDiscreteProcess (G4VDiscreteProcess &)
 
virtual ~G4VDiscreteProcess ()
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &, const G4Step &)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4int operator== (const G4VProcess &right) const
 
G4int operator!= (const G4VProcess &right) const
 
G4double GetCurrentInteractionLength () const
 
void SetPILfactor (G4double value)
 
G4double GetPILfactor () const
 
G4double AlongStepGPIL (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
 
G4double AtRestGPIL (const G4Track &track, G4ForceCondition *condition)
 
G4double PostStepGPIL (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
 
virtual G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
virtual G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
const G4StringGetPhysicsTableFileName (const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
 
const G4StringGetProcessName () const
 
G4ProcessType GetProcessType () const
 
void SetProcessType (G4ProcessType)
 
G4int GetProcessSubType () const
 
void SetProcessSubType (G4int)
 
virtual void StartTracking (G4Track *)
 
virtual void EndTracking ()
 
virtual void SetProcessManager (const G4ProcessManager *)
 
virtual const G4ProcessManagerGetProcessManager ()
 
virtual void ResetNumberOfInteractionLengthLeft ()
 
G4double GetNumberOfInteractionLengthLeft () const
 
G4double GetTotalNumberOfInteractionLengthTraversed () const
 
G4bool isAtRestDoItIsEnabled () const
 
G4bool isAlongStepDoItIsEnabled () const
 
G4bool isPostStepDoItIsEnabled () const
 
virtual void DumpInfo () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
virtual void SetMasterProcess (G4VProcess *masterP)
 
const G4VProcessGetMasterProcess () const
 
virtual void BuildWorkerPhysicsTable (const G4ParticleDefinition &part)
 
virtual void PrepareWorkerPhysicsTable (const G4ParticleDefinition &)
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager
 
G4VParticleChangepParticleChange
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft
 
G4double currentInteractionLength
 
G4double theInitialNumberOfInteractionLength
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType
 
G4int theProcessSubType
 
G4double thePILfactor
 
G4bool enableAtRestDoIt
 
G4bool enableAlongStepDoIt
 
G4bool enablePostStepDoIt
 
G4int verboseLevel
 

Detailed Description

Definition at line 64 of file G4SynchrotronRadiation.hh.

Constructor & Destructor Documentation

G4SynchrotronRadiation::G4SynchrotronRadiation ( const G4String pName = "SynRad",
G4ProcessType  type = fElectromagnetic 
)

Definition at line 57 of file G4SynchrotronRadiation.cc.

References python.hepunit::c_light, python.hepunit::electron_mass_c2, python.hepunit::eplus, python.hepunit::fine_structure_const, fSynchrotronRadiation, G4TransportationManager::GetPropagatorInField(), G4TransportationManager::GetTransportationManager(), python.hepunit::hbar_Planck, SetAngularGenerator(), G4VProcess::SetProcessSubType(), and G4VProcess::verboseLevel.

58  :G4VDiscreteProcess (processName, type),
59  theGamma (G4Gamma::Gamma() ),
60  theElectron ( G4Electron::Electron() ),
61  thePositron ( G4Positron::Positron() )
62 {
63  G4TransportationManager* transportMgr =
65 
66  fFieldPropagator = transportMgr->GetPropagatorInField();
67 
68  fLambdaConst = std::sqrt(3.0)*electron_mass_c2/
70  fEnergyConst = 1.5*c_light*c_light*eplus*hbar_Planck/electron_mass_c2 ;
71 
73  verboseLevel = 1;
74  FirstTime = true;
75  FirstTime1 = true;
76  genAngle = 0;
78 }
G4int verboseLevel
Definition: G4VProcess.hh:368
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:432
float electron_mass_c2
Definition: hepunit.py:274
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4TransportationManager * GetTransportationManager()
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4Electron * Electron()
Definition: G4Electron.cc:94
G4PropagatorInField * GetPropagatorInField() const
void SetAngularGenerator(G4VEmAngularDistribution *p)
float c_light
Definition: hepunit.py:257
G4SynchrotronRadiation::~G4SynchrotronRadiation ( )
virtual

Definition at line 85 of file G4SynchrotronRadiation.cc.

86 {
87  delete genAngle;
88 }

Member Function Documentation

void G4SynchrotronRadiation::BuildPhysicsTable ( const G4ParticleDefinition part)
virtual

Reimplemented from G4VProcess.

Definition at line 401 of file G4SynchrotronRadiation.cc.

References PrintInfoDefinition(), and G4VProcess::verboseLevel.

402 {
403  if(0 < verboseLevel && &part==theElectron ) PrintInfoDefinition();
404 }
G4int verboseLevel
Definition: G4VProcess.hh:368
G4double G4SynchrotronRadiation::Chebyshev ( G4double  a,
G4double  b,
const G4double  c[],
G4int  n,
G4double  x 
)
inline

Definition at line 117 of file G4SynchrotronRadiation.hh.

References test::b.

Referenced by InvSynFracInt().

119 {
120  G4double y;
121  G4double y2=2.0*(y=(2.0*x-a-b)/(b-a)); // Change of variable.
122  G4double d=0,dd=0;
123  for (G4int j=n-1;j>=1;--j) // Clenshaw's recurrence.
124  { G4double sv=d;
125  d=y2*d-dd+c[j];
126  dd=sv;
127  }
128  return y*d-dd+0.5*c[0];
129 }
int G4int
Definition: G4Types.hh:78
const G4int n
double G4double
Definition: G4Types.hh:76
G4double G4SynchrotronRadiation::GetMeanFreePath ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
)
virtual

Implements G4VDiscreteProcess.

Definition at line 115 of file G4SynchrotronRadiation.cc.

References python.hepunit::c_light, CLHEP::Hep3Vector::cross(), DBL_MAX, G4PropagatorInField::FindAndSetFieldManager(), G4BestUnit, G4cout, G4endl, G4DynamicParticle::GetDefinition(), G4FieldManager::GetDetectorField(), G4Track::GetDynamicParticle(), G4Field::GetFieldValue(), G4Track::GetGlobalTime(), G4DynamicParticle::GetMass(), G4DynamicParticle::GetMomentum(), G4DynamicParticle::GetMomentumDirection(), G4ParticleDefinition::GetPDGCharge(), G4Track::GetPosition(), CLHEP::Hep3Vector::getR(), G4DynamicParticle::GetTotalEnergy(), G4Track::GetVolume(), CLHEP::Hep3Vector::mag(), python.hepunit::MeV, NotForced, python.hepunit::tesla, CLHEP::Hep3Vector::theta(), G4VProcess::verboseLevel, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

118 {
119  // gives the MeanFreePath in GEANT4 internal units
120  G4double MeanFreePath;
121 
122  const G4DynamicParticle* aDynamicParticle = trackData.GetDynamicParticle();
123 
124  *condition = NotForced;
125 
126  G4double gamma = aDynamicParticle->GetTotalEnergy()/
127  aDynamicParticle->GetMass();
128 
129  G4double particleCharge = aDynamicParticle->GetDefinition()->GetPDGCharge();
130 
131  if ( gamma < 1.0e3 || 0.0 == particleCharge) { MeanFreePath = DBL_MAX; }
132  else
133  {
134 
135  G4ThreeVector FieldValue;
136  const G4Field* pField = 0;
137  G4bool fieldExertsForce = false;
138 
139 
140  G4FieldManager* fieldMgr =
141  fFieldPropagator->FindAndSetFieldManager(trackData.GetVolume());
142 
143  if ( fieldMgr != 0 )
144  {
145  // If the field manager has no field, there is no field !
146 
147  fieldExertsForce = ( fieldMgr->GetDetectorField() != 0 );
148  }
149 
150  if ( fieldExertsForce )
151  {
152  pField = fieldMgr->GetDetectorField();
153  G4ThreeVector globPosition = trackData.GetPosition();
154 
155  G4double globPosVec[4], FieldValueVec[6];
156 
157  globPosVec[0] = globPosition.x();
158  globPosVec[1] = globPosition.y();
159  globPosVec[2] = globPosition.z();
160  globPosVec[3] = trackData.GetGlobalTime();
161 
162  pField->GetFieldValue( globPosVec, FieldValueVec );
163 
164  FieldValue = G4ThreeVector( FieldValueVec[0],
165  FieldValueVec[1],
166  FieldValueVec[2] );
167 
168  G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
169  G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum);
170  G4double perpB = unitMcrossB.mag();
171 
172  if( perpB > 0.0 ) MeanFreePath = fLambdaConst/perpB;
173  else MeanFreePath = DBL_MAX;
174 
175  if(verboseLevel > 0 && FirstTime)
176  {
177  G4cout << "G4SynchrotronRadiation::GetMeanFreePath :" << '\n'
178  << " MeanFreePath = " << G4BestUnit(MeanFreePath, "Length")
179  << G4endl;
180  if(verboseLevel > 1)
181  {
182  G4ThreeVector pvec = aDynamicParticle->GetMomentum();
183  G4double Btot = FieldValue.getR();
184  G4double ptot = pvec.getR();
185  G4double rho = ptot / (MeV * c_light * Btot );
186  // full bending radius
187  G4double Theta=unitMomentum.theta(FieldValue);
188  // angle between particle and field
189  G4cout << " B = " << Btot/tesla << " Tesla"
190  << " perpB = " << perpB/tesla << " Tesla"
191  << " Theta = " << Theta << " std::sin(Theta)="
192  << std::sin(Theta) << '\n'
193  << " ptot = " << G4BestUnit(ptot,"Energy")
194  << " rho = " << G4BestUnit(rho,"Length")
195  << G4endl;
196  }
197  FirstTime=false;
198  }
199  }
200  else MeanFreePath = DBL_MAX;
201 
202  }
203 
204  return MeanFreePath;
205 }
G4double condition(const G4ErrorSymMatrix &m)
double getR() const
G4int verboseLevel
Definition: G4VProcess.hh:368
CLHEP::Hep3Vector G4ThreeVector
G4double GetTotalEnergy() const
virtual void GetFieldValue(const double Point[4], double *fieldArr) const =0
double x() const
G4ParticleDefinition * GetDefinition() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
double z() const
G4GLOB_DLL std::ostream G4cout
G4double GetMass() const
bool G4bool
Definition: G4Types.hh:79
const G4ThreeVector & GetMomentumDirection() const
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
double theta() const
double y() const
#define G4endl
Definition: G4ios.hh:61
Hep3Vector cross(const Hep3Vector &) const
double G4double
Definition: G4Types.hh:76
const G4Field * GetDetectorField() const
G4double GetPDGCharge() const
double mag() const
#define DBL_MAX
Definition: templates.hh:83
float c_light
Definition: hepunit.py:257
G4ThreeVector GetMomentum() const
G4double G4SynchrotronRadiation::GetPhotonEnergy ( const G4Track trackData,
const G4Step stepData 
)
G4double G4SynchrotronRadiation::GetRandomEnergySR ( G4double  gamma,
G4double  perpB 
)

Definition at line 373 of file G4SynchrotronRadiation.cc.

References G4BestUnit, G4cout, G4endl, G4UniformRand, InvSynFracInt(), and G4VProcess::verboseLevel.

Referenced by PostStepDoIt().

374 {
375 
376  G4double Ecr=fEnergyConst*gamma*gamma*perpB;
377 
378  // static G4ThreadLocal G4bool FirstTime=true;
379  if(verboseLevel > 0 && FirstTime1)
380  { G4double Emean=8./(15.*std::sqrt(3.))*Ecr; // mean photon energy
381  G4double E_rms=std::sqrt(211./675.)*Ecr; // rms of photon energy distribution
382  G4int prec = G4cout.precision();
383  G4cout << "G4SynchrotronRadiation::GetRandomEnergySR :" << '\n'
384  << std::setprecision(4)
385  << " Ecr = " << G4BestUnit(Ecr,"Energy") << '\n'
386  << " Emean = " << G4BestUnit(Emean,"Energy") << '\n'
387  << " E_rms = " << G4BestUnit(E_rms,"Energy") << G4endl;
388  FirstTime1=false;
389  G4cout.precision(prec);
390  }
391 
392  G4double energySR=Ecr*InvSynFracInt(G4UniformRand());
393  return energySR;
394 }
G4int verboseLevel
Definition: G4VProcess.hh:368
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4double InvSynFracInt(G4double x)
double G4double
Definition: G4Types.hh:76
G4double G4SynchrotronRadiation::InvSynFracInt ( G4double  x)

Definition at line 313 of file G4SynchrotronRadiation.cc.

References Chebyshev(), and G4Log().

Referenced by GetRandomEnergySR().

315 {
316  // from 0 to 0.7
317  static const G4double aa1=0 ,aa2=0.7;
318  static const G4int ncheb1=27;
319  static const G4double cheb1[] =
320  { 1.22371665676046468821,0.108956475422163837267,0.0383328524358594396134,0.00759138369340257753721,
321  0.00205712048644963340914,0.000497810783280019308661,0.000130743691810302187818,0.0000338168760220395409734,
322  8.97049680900520817728e-6,2.38685472794452241466e-6,6.41923109149104165049e-7,1.73549898982749277843e-7,
323  4.72145949240790029153e-8,1.29039866111999149636e-8,3.5422080787089834182e-9,9.7594757336403784905e-10,
324  2.6979510184976065731e-10,7.480422622550977077e-11,2.079598176402699913e-11,5.79533622220841193e-12,
325  1.61856011449276096e-12,4.529450993473807e-13,1.2698603951096606e-13,3.566117394511206e-14,1.00301587494091e-14,
326  2.82515346447219e-15,7.9680747949792e-16};
327  // from 0.7 to 0.9132260271183847
328  static const G4double aa3=0.9132260271183847;
329  static const G4int ncheb2=27;
330  static const G4double cheb2[] =
331  { 1.1139496701107756,0.3523967429328067,0.0713849171926623,0.01475818043595387,0.003381255637322462,
332  0.0008228057599452224,0.00020785506681254216,0.00005390169253706556,0.000014250571923902464,3.823880733161044e-6,
333  1.0381966089136036e-6,2.8457557457837253e-7,7.86223332179956e-8,2.1866609342508474e-8,6.116186259857143e-9,
334  1.7191233618437565e-9,4.852755117740807e-10,1.3749966961763457e-10,3.908961987062447e-11,1.1146253766895824e-11,
335  3.1868887323415814e-12,9.134319791300977e-13,2.6211077371181566e-13,7.588643377757906e-14,2.1528376972619e-14,
336  6.030906040404772e-15,1.9549163926819867e-15};
337  // Chebyshev with exp/log scale
338  // a = -Log[1 - SynFracInt[1]]; b = -Log[1 - SynFracInt[7]];
339  static const G4double aa4=2.4444485538746025480,aa5=9.3830728608909477079;
340  static const G4int ncheb3=28;
341  static const G4double cheb3[] =
342  { 1.2292683840435586977,0.160353449247864455879,-0.0353559911947559448721,0.00776901561223573936985,
343  -0.00165886451971685133259,0.000335719118906954279467,-0.0000617184951079161143187,9.23534039743246708256e-6,
344  -6.06747198795168022842e-7,-3.07934045961999778094e-7,1.98818772614682367781e-7,-8.13909971567720135413e-8,
345  2.84298174969641838618e-8,-9.12829766621316063548e-9,2.77713868004820551077e-9,-8.13032767247834023165e-10,
346  2.31128525568385247392e-10,-6.41796873254200220876e-11,1.74815310473323361543e-11,-4.68653536933392363045e-12,
347  1.24016595805520752748e-12,-3.24839432979935522159e-13,8.44601465226513952994e-14,-2.18647276044246803998e-14,
348  5.65407548745690689978e-15,-1.46553625917463067508e-15,3.82059606377570462276e-16,-1.00457896653436912508e-16};
349  static const G4double aa6=33.122936966163038145;
350  static const G4int ncheb4=27;
351  static const G4double cheb4[] =
352  {1.69342658227676741765,0.0742766400841232319225,-0.019337880608635717358,0.00516065527473364110491,
353  -0.00139342012990307729473,0.000378549864052022522193,-0.000103167085583785340215,0.0000281543441271412178337,
354  -7.68409742018258198651e-6,2.09543221890204537392e-6,-5.70493140367526282946e-7,1.54961164548564906446e-7,
355  -4.19665599629607704794e-8,1.13239680054166507038e-8,-3.04223563379021441863e-9,8.13073745977562957997e-10,
356  -2.15969415476814981374e-10,5.69472105972525594811e-11,-1.48844799572430829499e-11,3.84901514438304484973e-12,
357  -9.82222575944247161834e-13,2.46468329208292208183e-13,-6.04953826265982691612e-14,1.44055805710671611984e-14,
358  -3.28200813577388740722e-15,6.96566359173765367675e-16,-1.294122794852896275e-16};
359 
360  if(x<aa2) return x*x*x*Chebyshev(aa1,aa2,cheb1,ncheb1,x);
361  else if(x<aa3) return Chebyshev(aa2,aa3,cheb2,ncheb2,x);
362  else if(x<1-0.0000841363)
363  { G4double y=-G4Log(1-x);
364  return y*Chebyshev(aa4,aa5,cheb3,ncheb3,y);
365  }
366  else
367  { G4double y=-G4Log(1-x);
368  return y*Chebyshev(aa5,aa6,cheb4,ncheb4,y);
369  }
370 }
G4double Chebyshev(G4double a, G4double b, const G4double c[], G4int n, G4double x)
int G4int
Definition: G4Types.hh:78
G4double G4Log(G4double x)
Definition: G4Log.hh:227
double G4double
Definition: G4Types.hh:76
G4bool G4SynchrotronRadiation::IsApplicable ( const G4ParticleDefinition particle)
virtual

Reimplemented from G4VProcess.

Definition at line 103 of file G4SynchrotronRadiation.cc.

104 {
105  return ( ( &particle == theElectron ) || ( &particle == thePositron ));
106 }
G4VParticleChange * G4SynchrotronRadiation::PostStepDoIt ( const G4Track track,
const G4Step Step 
)
virtual

Reimplemented from G4VDiscreteProcess.

Definition at line 212 of file G4SynchrotronRadiation.cc.

References G4ParticleChange::AddSecondary(), G4VProcess::aParticleChange, CLHEP::Hep3Vector::cross(), G4PropagatorInField::FindAndSetFieldManager(), G4DynamicParticle::GetDefinition(), G4FieldManager::GetDetectorField(), G4Track::GetDynamicParticle(), G4Field::GetFieldValue(), G4Track::GetGlobalTime(), G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetMass(), G4DynamicParticle::GetMomentumDirection(), G4ParticleDefinition::GetPDGCharge(), G4Track::GetPosition(), GetRandomEnergySR(), G4DynamicParticle::GetTotalEnergy(), G4Track::GetVolume(), G4ParticleChange::Initialize(), CLHEP::Hep3Vector::mag(), G4VDiscreteProcess::PostStepDoIt(), G4ParticleChange::ProposeEnergy(), G4VEmAngularDistribution::SampleDirection(), G4VParticleChange::SetNumberOfSecondaries(), G4DynamicParticle::SetPolarization(), CLHEP::Hep3Vector::unit(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

215 {
216  aParticleChange.Initialize(trackData);
217 
218  const G4DynamicParticle* aDynamicParticle = trackData.GetDynamicParticle();
219 
220  G4double gamma = aDynamicParticle->GetTotalEnergy()/
221  (aDynamicParticle->GetMass() );
222 
223  G4double particleCharge = aDynamicParticle->GetDefinition()->GetPDGCharge();
224  if(gamma <= 1.0e3 || 0.0 == particleCharge)
225  {
226  return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
227  }
228 
229  G4ThreeVector FieldValue;
230  const G4Field* pField = 0;
231 
232  G4bool fieldExertsForce = false;
233  G4FieldManager* fieldMgr =
234  fFieldPropagator->FindAndSetFieldManager(trackData.GetVolume());
235 
236  if ( fieldMgr != 0 )
237  {
238  // If the field manager has no field, there is no field !
239  fieldExertsForce = ( fieldMgr->GetDetectorField() != 0 );
240  }
241 
242  if ( fieldExertsForce )
243  {
244  pField = fieldMgr->GetDetectorField();
245  G4ThreeVector globPosition = trackData.GetPosition();
246  G4double globPosVec[4], FieldValueVec[6];
247  globPosVec[0] = globPosition.x();
248  globPosVec[1] = globPosition.y();
249  globPosVec[2] = globPosition.z();
250  globPosVec[3] = trackData.GetGlobalTime();
251 
252  pField->GetFieldValue( globPosVec, FieldValueVec );
253  FieldValue = G4ThreeVector( FieldValueVec[0],
254  FieldValueVec[1],
255  FieldValueVec[2] );
256 
257  G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
258  G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum);
259  G4double perpB = unitMcrossB.mag();
260  if(perpB > 0.0)
261  {
262  // M-C of synchrotron photon energy
263 
264  G4double energyOfSR = GetRandomEnergySR(gamma,perpB);
265 
266  // check against insufficient energy
267 
268  if( energyOfSR <= 0.0 )
269  {
270  return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
271  }
272  G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
273  G4ThreeVector gammaDirection =
274  genAngle->SampleDirection(aDynamicParticle,
275  energyOfSR, 1, 0);
276 
277  G4ThreeVector gammaPolarization = FieldValue.cross(gammaDirection);
278  gammaPolarization = gammaPolarization.unit();
279 
280  // create G4DynamicParticle object for the SR photon
281 
282  G4DynamicParticle* aGamma= new G4DynamicParticle ( theGamma,
283  gammaDirection,
284  energyOfSR );
285  aGamma->SetPolarization( gammaPolarization.x(),
286  gammaPolarization.y(),
287  gammaPolarization.z() );
288 
291 
292  // Update the incident particle
293 
294  G4double newKinEnergy = kineticEnergy - energyOfSR;
295 
296  if (newKinEnergy > 0.)
297  {
298  aParticleChange.ProposeEnergy( newKinEnergy );
299  }
300  else
301  {
303  }
304  }
305  }
306  return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
307 }
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
G4double GetTotalEnergy() const
virtual void GetFieldValue(const double Point[4], double *fieldArr) const =0
double x() const
G4ParticleDefinition * GetDefinition() const
G4double GetRandomEnergySR(G4double, G4double)
double z() const
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4double GetMass() const
bool G4bool
Definition: G4Types.hh:79
const G4ThreeVector & GetMomentumDirection() const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
virtual void Initialize(const G4Track &)
void SetNumberOfSecondaries(G4int totSecondaries)
Hep3Vector unit() const
double y() const
void ProposeEnergy(G4double finalEnergy)
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
void AddSecondary(G4Track *aSecondary)
Hep3Vector cross(const Hep3Vector &) const
double G4double
Definition: G4Types.hh:76
const G4Field * GetDetectorField() const
G4double GetPDGCharge() const
double mag() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void G4SynchrotronRadiation::PrintInfoDefinition ( )
virtual

Definition at line 410 of file G4SynchrotronRadiation.cc.

References G4cout, G4endl, and G4VProcess::GetProcessName().

Referenced by BuildPhysicsTable().

412 {
413  G4String comments ="Incoherent Synchrotron Radiation\n";
414  G4cout << G4endl << GetProcessName() << ": " << comments
415  << " good description for long magnets at all energies"
416  << G4endl;
417 }
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
void G4SynchrotronRadiation::SetAngularGenerator ( G4VEmAngularDistribution p)

Definition at line 94 of file G4SynchrotronRadiation.cc.

Referenced by G4SynchrotronRadiation().

95 {
96  if(p != genAngle) {
97  delete genAngle;
98  genAngle = p;
99  }
100 }
const char * p
Definition: xmltok.h:285

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