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

#include <G4JAEAPolarizedElasticScatteringModel.hh>

+ Inheritance diagram for G4JAEAPolarizedElasticScatteringModel:

Public Member Functions

 G4JAEAPolarizedElasticScatteringModel ()
 
virtual ~G4JAEAPolarizedElasticScatteringModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
void SetLowEnergyThreshold (G4double val)
 
void SetPolarizationSensitvity (G4bool, G4bool, G4bool)
 
void SetDebugVerbosity (G4int val)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)=0
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double GetPartialCrossSection (const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ComputeCrossSectionPerShell (const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void StartTracking (G4Track *)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
virtual void ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
virtual G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectTargetAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectRandomAtomNumber (const G4Material *)
 
G4int SelectIsotopeNumber (const G4Element *)
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
G4VEmModelGetTripletModel ()
 
void SetTripletModel (G4VEmModel *)
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool LPMFlag () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy) const
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetLPMFlag (G4bool val)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetFluctuationFlag (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
void SetUseBaseMaterials (G4bool val)
 
G4bool UseBaseMaterials () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
const G4ElementGetCurrentElement () const
 
const G4IsotopeGetCurrentIsotope () const
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const G4MaterialpBaseMaterial
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 
G4bool lossFlucFlag
 
G4double inveplus
 
G4double pFactor
 

Detailed Description

Definition at line 48 of file G4JAEAPolarizedElasticScatteringModel.hh.

Constructor & Destructor Documentation

◆ G4JAEAPolarizedElasticScatteringModel()

G4JAEAPolarizedElasticScatteringModel::G4JAEAPolarizedElasticScatteringModel ( )

Definition at line 50 of file G4JAEAPolarizedElasticScatteringModel.cc.

51 :G4VEmModel("G4JAEAPolarizedElasticScatteringModel"),isInitialised(false)
52{
53 fParticleChange = 0;
54 lowEnergyLimit = 100 * keV; //low energy limit for JAEAElasticScattering cross section data
55 fLinearPolarizationSensitvity1=1;
56 fLinearPolarizationSensitvity2=1;
57 fCircularPolarizationSensitvity=1;
58
59 verboseLevel= 0;
60 // Verbosity scale for debugging purposes:
61 // 0 = nothing
62 // 1 = calculation of cross sections, file openings...
63 // 2 = entering in methods
64
65 if(verboseLevel > 0)
66 {
67 G4cout << "G4JAEAPolarizedElasticScatteringModel is constructed " << G4endl;
68 }
69
70}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

◆ ~G4JAEAPolarizedElasticScatteringModel()

G4JAEAPolarizedElasticScatteringModel::~G4JAEAPolarizedElasticScatteringModel ( )
virtual

Definition at line 74 of file G4JAEAPolarizedElasticScatteringModel.cc.

75{
76 if(IsMaster()) {
77 for(G4int i=0; i<=maxZ; ++i) {
78 if(dataCS[i]) {
79 delete dataCS[i];
80 dataCS[i] = nullptr;
81 }
82 if (Polarized_ES_Data[i]){
83 delete Polarized_ES_Data[i];
84 Polarized_ES_Data[i] = nullptr;
85 }
86 }
87 }
88}
int G4int
Definition: G4Types.hh:85
G4bool IsMaster() const
Definition: G4VEmModel.hh:736

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4JAEAPolarizedElasticScatteringModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition ,
G4double  kinEnergy,
G4double  Z,
G4double  A = 0,
G4double  cut = 0,
G4double  emax = DBL_MAX 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 219 of file G4JAEAPolarizedElasticScatteringModel.cc.

224{
225
226
227//Select the energy-grid point closest to the photon energy
228// G4double *whichenergy = lower_bound(ESdata[0],ESdata[0]+300,GammaEnergy);
229// int energyindex = max(0,(int)(whichenergy-ESdata[0]-1));
230
231 if (verboseLevel > 1)
232 {
233 G4cout << "G4JAEAPolarizedElasticScatteringModel::ComputeCrossSectionPerAtom()"
234 << G4endl;
235 }
236
237 if(GammaEnergy < lowEnergyLimit) { return 0.0; }
238
239 G4double xs = 0.0;
240
241 G4int intZ = G4lrint(Z);
242
243 if(intZ < 1 || intZ > maxZ) { return xs; }
244
245 G4LPhysicsFreeVector* pv = dataCS[intZ];
246
247 // if element was not initialised
248 // do initialisation safely for MT mode
249 if(!pv) {
250 InitialiseForElement(0, intZ);
251 pv = dataCS[intZ];
252 if(!pv) { return xs; }
253 }
254
255 G4int n = pv->GetVectorLength() - 1;
256
257 G4double e = GammaEnergy;
258 if(e >= pv->Energy(n)) {
259 xs = (*pv)[n];
260 } else if(e >= pv->Energy(0)) {
261 xs = pv->Value(e);
262 }
263
264 if(verboseLevel > 0)
265 {
266 G4cout << "****** DEBUG: tcs value for Z=" << Z << " at energy (MeV)="
267 << e << G4endl;
268 G4cout << " cs (Geant4 internal unit)=" << xs << G4endl;
269 G4cout << " -> first E*E*cs value in CS data file (iu) =" << (*pv)[0]
270 << G4endl;
271 G4cout << " -> last E*E*cs value in CS data file (iu) =" << (*pv)[n]
272 << G4endl;
273 G4cout << "*********************************************************"
274 << G4endl;
275 }
276
277 return (xs);
278}
double G4double
Definition: G4Types.hh:83
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
G4double Energy(std::size_t index) const
G4double Value(G4double theEnergy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
int G4lrint(double ad)
Definition: templates.hh:134

◆ Initialise()

void G4JAEAPolarizedElasticScatteringModel::Initialise ( const G4ParticleDefinition particle,
const G4DataVector cuts 
)
virtual

Implements G4VEmModel.

Definition at line 92 of file G4JAEAPolarizedElasticScatteringModel.cc.

94{
95 if (verboseLevel > 1)
96 {
97 G4cout << "Calling Initialise() of G4JAEAPolarizedElasticScatteringModel." << G4endl
98 << "Energy range: "
99 << LowEnergyLimit() / eV << " eV - "
100 << HighEnergyLimit() / GeV << " GeV"
101 << G4endl;
102 }
103
104 if(IsMaster()) {
105
106 // Initialise element selector
107 InitialiseElementSelectors(particle, cuts);
108
109 // Access to elements
110 char* path = std::getenv("G4LEDATA");
111 G4ProductionCutsTable* theCoupleTable =
113 G4int numOfCouples = theCoupleTable->GetTableSize();
114
115 for(G4int i=0; i<numOfCouples; ++i)
116 {
117 const G4MaterialCutsCouple* couple =
118 theCoupleTable->GetMaterialCutsCouple(i);
119 const G4Material* material = couple->GetMaterial();
120 const G4ElementVector* theElementVector = material->GetElementVector();
121 G4int nelm = material->GetNumberOfElements();
122
123 for (G4int j=0; j<nelm; ++j)
124 {
125 G4int Z = G4lrint((*theElementVector)[j]->GetZ());
126 if(Z < 1) { Z = 1; }
127 else if(Z > maxZ) { Z = maxZ; }
128 if( (!dataCS[Z]) ) { ReadData(Z, path); }
129 }
130 }
131 }
132
133 if(isInitialised) { return; }
134 fParticleChange = GetParticleChangeForGamma();
135 isInitialised = true;
136
137}
std::vector< G4Element * > G4ElementVector
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:188
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:133
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:652
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:645
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
Definition: G4VEmModel.cc:148

◆ InitialiseForElement()

void G4JAEAPolarizedElasticScatteringModel::InitialiseForElement ( const G4ParticleDefinition ,
G4int  Z 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 597 of file G4JAEAPolarizedElasticScatteringModel.cc.

599{
600 G4AutoLock l(&G4JAEAPolarizedElasticScatteringModelMutex);
601 // G4cout << "G4JAEAPolarizedElasticScatteringModel::InitialiseForElement Z= "
602 // << Z << G4endl;
603 if(!dataCS[Z]) { ReadData(Z); }
604 l.unlock();
605}

Referenced by ComputeCrossSectionPerAtom().

◆ InitialiseLocal()

void G4JAEAPolarizedElasticScatteringModel::InitialiseLocal ( const G4ParticleDefinition ,
G4VEmModel masterModel 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 141 of file G4JAEAPolarizedElasticScatteringModel.cc.

143{
145}
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
Definition: G4VEmModel.hh:842
std::vector< G4EmElementSelector * > * GetElementSelectors()
Definition: G4VEmModel.hh:834

◆ SampleSecondaries()

void G4JAEAPolarizedElasticScatteringModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  ,
const G4MaterialCutsCouple couple,
const G4DynamicParticle aDynamicGamma,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 282 of file G4JAEAPolarizedElasticScatteringModel.cc.

287{
288 if (verboseLevel > 1) {
289
290 G4cout << "Calling SampleSecondaries() of G4JAEAPolarizedElasticScatteringModel."
291 << G4endl;
292 }
293 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
294
295 // absorption of low-energy gamma
296 if (photonEnergy0 <= lowEnergyLimit)
297 {
298 fParticleChange->ProposeTrackStatus(fStopAndKill);
299 fParticleChange->SetProposedKineticEnergy(0.);
300 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0);
301 return ;
302 }
303
304 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition();
305 const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0);
306 G4int Z = G4lrint(elm->GetZ());
307
308
309//Getting the corresponding distrbution
310G4int energyindex=round(100*photonEnergy0)-1;
311//G4cout<<"Rounding Photon Energy for element Z = "<<Z<<G4endl;
312//G4cout<<photonEnergy0<<" "<<" "<<round(1000*photonEnergy0)<<" "<<energyindex<<G4endl;
313 G4double a1=0, a2=0, a3=0,a4=0;
314 for (G4int i=0;i<=180;++i)
315 {
316 a1=Polarized_ES_Data[Z]->at(4*i+300+181*4*(energyindex));
317 a2=Polarized_ES_Data[Z]->at(4*i+1+300+181*4*(energyindex));
318 a3=Polarized_ES_Data[Z]->at(4*i+2+300+181*4*(energyindex));
319 a4=Polarized_ES_Data[Z]->at(4*i+3+300+181*4*(energyindex));
320 distribution[i]=a1*a1+a2*a2+a3*a3+a4*a4;
321 }
322
323 CLHEP::RandGeneral GenThetaDist(distribution,180);
324 //Intial sampling of the scattering angle. To be updated for the circular polarization
325 G4double theta = CLHEP::pi*GenThetaDist.shoot();
326 //G4double theta =45.*CLHEP::pi/180.;
327 //Theta is in degree to call scattering amplitudes
328 G4int theta_in_degree =round(theta*180./CLHEP::pi);
329
330 //theta_in_degree=45;
331
332 G4double am1=0,am2=0,am3=0,am4=0,aparaSquare=0,aperpSquare=0,apara_aper_Asterisk=0,img_apara_aper_Asterisk=0;
333 am1=Polarized_ES_Data[Z]->at(4*theta_in_degree+300+181*4*(energyindex));
334 am2=Polarized_ES_Data[Z]->at(4*theta_in_degree+1+300+181*4*(energyindex));
335 am3=Polarized_ES_Data[Z]->at(4*theta_in_degree+2+300+181*4*(energyindex));
336 am4=Polarized_ES_Data[Z]->at(4*theta_in_degree+3+300+181*4*(energyindex));
337 aparaSquare=am1*am1+am2*am2;
338 aperpSquare=am3*am3+am4*am4;
339 apara_aper_Asterisk=2*a1*a3+2*a2*a4;
340 img_apara_aper_Asterisk=2*a1*a4-2*a2*a3;
341
342 G4ThreeVector Direction_Unpolarized(0.,0.,0.);
343 G4ThreeVector Direction_Linear1(0.,0.,0.);
344 G4ThreeVector Direction_Linear2(0.,0.,0.);
345 G4ThreeVector Direction_Circular(0.,0.,0.);
346 G4ThreeVector Polarization_Unpolarized(0.,0.,0.);
347 G4ThreeVector Polarization_Linear1(0.,0.,0.);
348 G4ThreeVector Polarization_Linear2(0.,0.,0.);
349 G4ThreeVector Polarization_Circular(0.,0.,0.);
350
351
352//Stokes parameters for the incoming and outgoing photon
353G4double Xi1=0, Xi2=0, Xi3=0, Xi1_Prime=0,Xi2_Prime=0,Xi3_Prime=0;
354
355//Getting the Stokes parameters for the incoming photon
356G4ThreeVector gammaPolarization0 = aDynamicGamma->GetPolarization();
357Xi1=gammaPolarization0.x();
358Xi2=gammaPolarization0.y();
359Xi3=gammaPolarization0.z();
360
361//Polarization vector must be unit vector (5% tolerance)
362
363if ((gammaPolarization0.mag())>1.05 || (Xi1*Xi1>1.05) || (Xi2*Xi2>1.05) || (Xi3*Xi3>1.05))
364 {
365 G4Exception("G4JAEAPolarizedElasticScatteringModel::SampleSecondaries()","em1006",
367 "WARNING: G4JAEAPolarizedElasticScatteringModel is only compatible with a unit polarization vector.");
368 return;
369}
370//Unpolarized gamma rays
371if (Xi1==0 && Xi2==0 && Xi3==0)
372{
373 G4double Phi_Unpolarized=0;
374 if (fLinearPolarizationSensitvity1)
375 Phi_Unpolarized=GeneratePolarizedPhi(aparaSquare,aperpSquare,0.);
376 else
377 Phi_Unpolarized=CLHEP::twopi*G4UniformRand();
378 Direction_Unpolarized.setX(sin(theta)*cos(Phi_Unpolarized));
379 Direction_Unpolarized.setY(sin(theta)*sin(Phi_Unpolarized));
380 Direction_Unpolarized.setZ(cos(theta));
381 Direction_Unpolarized.rotateUz(aDynamicGamma->GetMomentumDirection());
382 Xi1_Prime=(aparaSquare-aperpSquare)/(aparaSquare+aperpSquare);
383 Polarization_Unpolarized.setX(Xi1_Prime);
384 Polarization_Unpolarized.setY(0.);
385 Polarization_Unpolarized.setZ(0.);
386 fParticleChange->ProposeMomentumDirection(Direction_Unpolarized);
387 fParticleChange->ProposePolarization(Polarization_Unpolarized);
388 return;
389}
390
391//Linear polarization defined by first Stokes parameter
392G4double InitialAzimuth=aDynamicGamma->GetMomentumDirection().phi();
393if(InitialAzimuth<0) InitialAzimuth=InitialAzimuth+CLHEP::twopi;
394
395G4double Phi_Linear1=0.;
396
397Phi_Linear1 = GeneratePolarizedPhi(aparaSquare+aperpSquare+Xi1*(aparaSquare-aperpSquare),
398 aparaSquare+aperpSquare-Xi1*(aparaSquare-aperpSquare),InitialAzimuth);
399
400Xi1_Prime=((aparaSquare-aperpSquare)+Xi1*(aparaSquare+aperpSquare)*cos(2*Phi_Linear1))/
401 ((aparaSquare+aperpSquare)+Xi1*(aparaSquare-aperpSquare)*cos(2*Phi_Linear1));
402Xi2_Prime=(-Xi1*apara_aper_Asterisk*sin(2*Phi_Linear1))/
403 ((aparaSquare+aperpSquare)+Xi1*(aparaSquare-aperpSquare)*cos(2*Phi_Linear1));
404Xi3_Prime=(-Xi1*img_apara_aper_Asterisk*sin(2*Phi_Linear1))/
405 ((aparaSquare+aperpSquare)+Xi1*(aparaSquare-aperpSquare)*cos(2*Phi_Linear1));
406//Store momentum direction and po;arization
407Direction_Linear1.setX(sin(theta)*cos(Phi_Linear1));
408Direction_Linear1.setY(sin(theta)*sin(Phi_Linear1));
409Direction_Linear1.setZ(cos(theta));
410Polarization_Linear1.setX(Xi1_Prime);
411Polarization_Linear1.setY(Xi2_Prime);
412Polarization_Linear1.setZ(Xi3_Prime);
413
414//Set scattered photon polarization sensitivity
415Xi1_Prime=Xi1_Prime*fLinearPolarizationSensitvity1;
416Xi2_Prime=Xi2_Prime*fLinearPolarizationSensitvity2;
417Xi3_Prime=Xi3_Prime*fCircularPolarizationSensitvity;
418
419G4double dsigmaL1=0.0;
420if(abs(Xi1)>0.0) dsigmaL1=0.25*((aparaSquare+aperpSquare)*(1+Xi1*Xi1_Prime*cos(2*Phi_Linear1))+(aparaSquare-aperpSquare)*(Xi1*cos(2*Phi_Linear1)+Xi1_Prime)
421 -Xi1*Xi2_Prime*apara_aper_Asterisk*sin(2*Phi_Linear1)-Xi1*Xi3_Prime*img_apara_aper_Asterisk*sin(2*Phi_Linear1));
422
423//Linear polarization defined by second Stokes parameter
424//G4double IntialAzimuth=aDynamicGamma->GetMomentumDirection().phi();
425
426G4double Phi_Linear2=0.;
427
428InitialAzimuth=InitialAzimuth-CLHEP::pi/4.;
429if(InitialAzimuth<0) InitialAzimuth=InitialAzimuth+CLHEP::twopi;
430
431Phi_Linear2 = GeneratePolarizedPhi(aparaSquare+aperpSquare+Xi1*(aparaSquare-aperpSquare)
432 ,aparaSquare+aperpSquare-Xi1*(aparaSquare-aperpSquare),InitialAzimuth);
433
434Xi1_Prime=((aparaSquare-aperpSquare)+Xi2*(aparaSquare+aperpSquare)*sin(2*Phi_Linear2))/
435 ((aparaSquare+aperpSquare)+Xi2*(aparaSquare-aperpSquare)*sin(2*Phi_Linear2));
436Xi2_Prime=(Xi2*apara_aper_Asterisk*cos(2*Phi_Linear2))/
437 ((aparaSquare+aperpSquare)+Xi2*(aparaSquare-aperpSquare)*sin(2*Phi_Linear2));
438Xi3_Prime=(Xi2*img_apara_aper_Asterisk*cos(2*Phi_Linear2))/
439 ((aparaSquare+aperpSquare)+Xi2*(aparaSquare-aperpSquare)*sin(2*Phi_Linear2));
440//Store momentum direction and polarization
441Direction_Linear2.setX(sin(theta)*cos(Phi_Linear2));
442Direction_Linear2.setY(sin(theta)*sin(Phi_Linear2));
443Direction_Linear2.setZ(cos(theta));
444Polarization_Linear2.setX(Xi1_Prime);
445Polarization_Linear2.setY(Xi2_Prime);
446Polarization_Linear2.setZ(Xi3_Prime);
447
448//Set scattered photon polarization sensitivity
449Xi1_Prime=Xi1_Prime*fLinearPolarizationSensitvity1;
450Xi2_Prime=Xi2_Prime*fLinearPolarizationSensitvity2;
451Xi3_Prime=Xi3_Prime*fCircularPolarizationSensitvity;
452
453G4double dsigmaL2=0.0;
454if(abs(Xi2)>0.0)
455dsigmaL2=0.25*((aparaSquare+aperpSquare)*(1+Xi2*Xi1_Prime*sin(2*Phi_Linear2))+(aparaSquare-aperpSquare)*(Xi2*sin(2*Phi_Linear2)+Xi1_Prime)
456 +Xi2*Xi2_Prime*apara_aper_Asterisk*cos(2*Phi_Linear2)-Xi2*Xi3_Prime*img_apara_aper_Asterisk*cos(2*Phi_Linear2));
457
458
459//Circular polarization
460G4double Phi_Circular = CLHEP::twopi*G4UniformRand();
461G4double Theta_Circular = 0;
462
463Xi1_Prime=(aparaSquare-aperpSquare)/(aparaSquare+aperpSquare);
464Xi2_Prime=(-Xi3*img_apara_aper_Asterisk)/(aparaSquare+aperpSquare);
465Xi3_Prime=(Xi3*apara_aper_Asterisk)/(aparaSquare+aperpSquare);
466
467Polarization_Circular.setX(Xi1_Prime);
468Polarization_Circular.setY(Xi2_Prime);
469Polarization_Circular.setZ(Xi3_Prime);
470
471//Set scattered photon polarization sensitivity
472Xi1_Prime=Xi1_Prime*fLinearPolarizationSensitvity1;
473Xi2_Prime=Xi2_Prime*fLinearPolarizationSensitvity2;
474Xi3_Prime=Xi3_Prime*fCircularPolarizationSensitvity;
475
476G4double dsigmaC=0.0;
477if(abs(Xi3)>0.0)
478dsigmaC=0.25*(aparaSquare+aperpSquare+Xi1_Prime*(aparaSquare-aperpSquare)-Xi3*Xi2_Prime*img_apara_aper_Asterisk
479 +Xi3*Xi3_Prime*apara_aper_Asterisk);
480
481if (abs(Xi3)==0.0 && abs(Xi1_Prime)==0.0)
482{
483 Direction_Circular.setX(sin(theta)*cos(Phi_Circular));
484 Direction_Circular.setY(sin(theta)*sin(Phi_Circular));
485 Direction_Circular.setZ(cos(theta));
486}
487else
488{
489G4double c1=0, c2=0, c3=0,c4=0;
490 for (G4int i=0;i<=180;++i)
491 {
492 c1=Polarized_ES_Data[Z]->at(4*i+300+181*4*(energyindex));
493 c2=Polarized_ES_Data[Z]->at(4*i+1+300+181*4*(energyindex));
494 c3=Polarized_ES_Data[Z]->at(4*i+2+300+181*4*(energyindex));
495 c4=Polarized_ES_Data[Z]->at(4*i+3+300+181*4*(energyindex));
496 cdistribution[i]=0.25*((c1*c1+c2*c2+c3*c3+c4*c4)+Xi1_Prime*(c1*c1+c2*c2-c3*c3-c4*c4)-Xi3*Xi2_Prime*(2*c1*c4-2*c2*c3)
497 +Xi3*Xi3_Prime*(2*c1*c4-2*c2*c3));
498 }
499CLHEP::RandGeneral GenTheta_Circ_Dist(cdistribution,180);
500Theta_Circular=CLHEP::pi*GenTheta_Circ_Dist.shoot();
501Direction_Circular.setX(sin(Theta_Circular)*cos(Phi_Circular));
502Direction_Circular.setY(sin(Theta_Circular)*sin(Phi_Circular));
503Direction_Circular.setZ(cos(Theta_Circular));
504}
505
506// Sampling scattered photon direction based on asymmetry arising from polarization mixing
507G4double totalSigma= dsigmaL1+dsigmaL2+dsigmaC;
508G4double prob1=dsigmaL1/totalSigma;
509G4double prob2=dsigmaL2/totalSigma;
510G4double probc=1-(prob1+prob2);
511
512//Check the Probability of polarization mixing
513 if (abs(probc - dsigmaC/totalSigma)>=0.0001)
514 {
515 G4Exception("G4JAEAPolarizedElasticScatteringModel::SampleSecondaries()","em1007",
517 "WARNING: Polarization mixing might be incorrect.");
518 }
519
520// Generate outgoing photon direction
521 G4ThreeVector finaldirection(0.0,0.0,0.0);
522 G4ThreeVector outcomingPhotonPolarization(0.0,0.0,0.0);
523
524//Polarization mixing
525G4double polmix=G4UniformRand();
526if (polmix<=prob1)
527{
528 finaldirection.setX(Direction_Linear1.x());
529 finaldirection.setY(Direction_Linear1.y());
530 finaldirection.setZ(Direction_Linear1.z());
531 outcomingPhotonPolarization.setX(Polarization_Linear1.x());
532 outcomingPhotonPolarization.setY(Polarization_Linear1.y());
533 outcomingPhotonPolarization.setZ(Polarization_Linear1.z());
534}
535else if ((polmix>prob1) && (polmix<=prob1+prob2))
536{
537 finaldirection.setX(Direction_Linear2.x());
538 finaldirection.setY(Direction_Linear2.y());
539 finaldirection.setZ(Direction_Linear2.z());
540 outcomingPhotonPolarization.setX(Polarization_Linear2.x());
541 outcomingPhotonPolarization.setY(Polarization_Linear2.y());
542 outcomingPhotonPolarization.setZ(Polarization_Linear2.z());
543}
544else if (polmix>prob1+prob2)
545{
546 finaldirection.setX(Direction_Circular.x());
547 finaldirection.setY(Direction_Circular.y());
548 finaldirection.setZ(Direction_Circular.z());
549 outcomingPhotonPolarization.setX(Polarization_Circular.x());
550 outcomingPhotonPolarization.setY(Polarization_Circular.y());
551 outcomingPhotonPolarization.setZ(Polarization_Circular.z());
552}
553
554 //Sampling the Final State
555 finaldirection.rotateUz(aDynamicGamma->GetMomentumDirection());
556 fParticleChange->ProposeMomentumDirection(finaldirection);
557 fParticleChange->SetProposedKineticEnergy(photonEnergy0);
558 fParticleChange->ProposePolarization(outcomingPhotonPolarization);
559
560}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
@ fStopAndKill
#define G4UniformRand()
Definition: Randomize.hh:52
double z() const
double phi() const
double x() const
double y() const
double mag() const
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4ThreeVector & GetPolarization() const
G4double GetZ() const
Definition: G4Element.hh:130
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposePolarization(const G4ThreeVector &dir)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.hh:570
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)

◆ SetDebugVerbosity()

void G4JAEAPolarizedElasticScatteringModel::SetDebugVerbosity ( G4int  val)
inline

Definition at line 81 of file G4JAEAPolarizedElasticScatteringModel.hh.

81{verboseLevel = val;};

◆ SetLowEnergyThreshold()

void G4JAEAPolarizedElasticScatteringModel::SetLowEnergyThreshold ( G4double  val)
inline

Definition at line 78 of file G4JAEAPolarizedElasticScatteringModel.hh.

78{lowEnergyLimit = val;};

◆ SetPolarizationSensitvity()

void G4JAEAPolarizedElasticScatteringModel::SetPolarizationSensitvity ( G4bool  linear1,
G4bool  linear2,
G4bool  circular 
)
inline

Definition at line 114 of file G4JAEAPolarizedElasticScatteringModel.hh.

115{
116fLinearPolarizationSensitvity1=linear1;
117fLinearPolarizationSensitvity2=linear2;
118fCircularPolarizationSensitvity=circular;
119}

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