Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4PolarizedPEEffectModel.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4PolarizedPEEffectModel.cc 96114 2016-03-16 18:51:33Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 //
33 // File name: G4PolarizedPEEffectModel
34 //
35 // Author: Andreas Schaelicke & Karim Laihem
36 //
37 // Creation date: 22.02.2007
38 //
39 // Modifications:
40 //
41 // Class Description:
42 //
43 // Implementation of Photo electric effect
44 // including polarization transfer from circularly polarised gammas
45 
46 // -------------------------------------------------------------------
47 //
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
51 
52 #ifndef NOIONIZATIONAS
53 
55 #include "G4Electron.hh"
56 #include "G4Positron.hh"
57 #include "G4Gamma.hh"
58 #include "Randomize.hh"
59 #include "G4DataVector.hh"
60 #include "G4PhysicsLogVector.hh"
63 #include "G4PolarizationHelper.hh"
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
67 
69  const G4String& nam)
70  : G4PEEffectFluoModel(nam),
71  crossSectionCalculator(nullptr),
72  verboseLevel(0)
73 {
74 }
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
77 
79 {
80  if (crossSectionCalculator) delete crossSectionCalculator;
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
84 
86  const G4DataVector& dv)
87 {
89  if (!crossSectionCalculator)
90  crossSectionCalculator = new G4PolarizedPEEffectCrossSection();
91 }
92 
93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94 
95 void G4PolarizedPEEffectModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
96  const G4MaterialCutsCouple* couple,
97  const G4DynamicParticle* dp,
98  G4double tmin,
99  G4double maxEnergy)
100 {
101  // std::vector<G4DynamicParticle*>* vdp =
102  G4PEEffectFluoModel::SampleSecondaries(vdp,couple, dp, tmin, maxEnergy);
103 
104  if (verboseLevel >= 1) {
105  G4cout << "G4PolarizedPEEffectModel::SampleSecondaries" << G4endl;
106  }
107 
108  if(vdp && vdp->size()>0) {
109  G4double gamEnergy0 = dp->GetKineticEnergy();
110  G4double lepEnergy1 = (*vdp)[0]->GetKineticEnergy();
111  G4double sintheta = dp->GetMomentumDirection().cross((*vdp)[0]->GetMomentumDirection()).mag();
112  if (sintheta>1.) sintheta=1.;
113 
114  G4StokesVector beamPol = dp->GetPolarization();
115  beamPol.SetPhoton();
116  // G4cout<<" beamPol "<<beamPol<<G4endl;
117 
118  // determine interaction plane
119  G4ThreeVector nInteractionFrame =
121  (*vdp)[0]->GetMomentumDirection());
122  // G4cout<<" nInteractionFrame = "<<nInteractionFrame<<G4endl;
123  if (dp->GetMomentumDirection().cross((*vdp)[0]->GetMomentumDirection()).mag()<1.e-10) {
124  // G4cout<<" nInteractionFrame not well defined "<<G4endl;
125  // G4cout<<" choosing random interaction frame "<<G4endl;
126 
128  // G4cout<<"new nInteractionFrame = "<<nInteractionFrame<<G4endl;
129  }
130  /*
131  else {
132  G4ThreeVector mom1=dp->GetMomentumDirection();
133  G4ThreeVector mom2=(*vdp)[0]->GetMomentumDirection();
134  G4cout<<" mom1 = "<<mom1<<G4endl;
135  G4cout<<" mom2 = "<<mom2<<G4endl;
136  G4ThreeVector x=mom1.cross(mom2);
137  G4cout<<" mom1 x mom2 = "<<x<<" "<<x.mag()<<G4endl;
138  G4cout<<" norm = "<<(1./x.mag()*x)<<" "<<G4endl;
139  }
140  */
141 
142  // transform polarization into interaction frame
143  beamPol.InvRotateAz(nInteractionFrame,dp->GetMomentumDirection());
144 
145  // calulcate polarization transfer
146  crossSectionCalculator->SetMaterial(GetCurrentElement()->GetN(), // number of nucleons
147  GetCurrentElement()->GetZ(),
148  GetCurrentElement()->GetfCoulomb());
149  crossSectionCalculator->Initialize(gamEnergy0, lepEnergy1, sintheta,
150  beamPol, G4StokesVector::ZERO);
151 
152  // deterimine final state polarization
153  G4StokesVector lep1Pol = crossSectionCalculator->GetPol2();
154  // G4cout<<" lepPol "<<lep1Pol<<G4endl;
155  lep1Pol.RotateAz(nInteractionFrame,(*vdp)[0]->GetMomentumDirection());
156  (*vdp)[0]->SetPolarization(lep1Pol.p1(),
157  lep1Pol.p2(),
158  lep1Pol.p3());
159 
160  // G4cout<<" lepPol "<<lep1Pol<<G4endl;
161  size_t num = vdp->size();
162  if (num!=1) G4cout<<" WARNING "<<num<<" secondaries in polarized photo electric effect not supported!\n";
163  }
164 }
165 
166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
167 #endif //NOIONIZATIONAS
static G4ThreeVector GetRandomFrame(const G4ThreeVector &)
G4double GetKineticEnergy() const
G4double p2() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
void SetMaterial(G4double A, G4double Z, G4double coul)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4double p3() const
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
static G4ThreeVector GetFrame(const G4ThreeVector &, const G4ThreeVector &)
G4double p1() const
virtual void Initialize(G4double aGammaE, G4double aLept0E, G4double sintheta, const G4StokesVector &beamPol, const G4StokesVector &, G4int flag=0) override
void InvRotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
const G4ThreeVector & GetPolarization() const
void Initialise(const G4ParticleDefinition *pd, const G4DataVector &dv) override
#define G4endl
Definition: G4ios.hh:61
Hep3Vector cross(const Hep3Vector &) const
double G4double
Definition: G4Types.hh:76
static const G4StokesVector ZERO
double mag() const
G4PolarizedPEEffectModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="Polarized-PhotoElectric")
void RotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
const G4Element * GetCurrentElement() const
Definition: G4VEmModel.hh:466
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override