ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4PolarizedPEEffectModel.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4PolarizedPEEffectModel.cc
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 //
27 // -------------------------------------------------------------------
28 //
29 // GEANT4 Class file
30 //
31 //
32 // File name: G4PolarizedPEEffectModel
33 //
34 // Author: Andreas Schaelicke & Karim Laihem
35 //
36 // Creation date: 22.02.2007
37 //
38 // Modifications:
39 //
40 // Class Description:
41 //
42 // Implementation of Photo electric effect
43 // including polarization transfer from circularly polarised gammas
44 
45 // -------------------------------------------------------------------
46 //
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50 
51 #ifndef NOIONIZATIONAS
52 
54 #include "G4Electron.hh"
55 #include "G4Positron.hh"
56 #include "G4Gamma.hh"
57 #include "Randomize.hh"
58 #include "G4DataVector.hh"
59 #include "G4PhysicsLogVector.hh"
62 #include "G4PolarizationHelper.hh"
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
66 
68  const G4String& nam)
69  : G4PEEffectFluoModel(nam),
70  crossSectionCalculator(nullptr),
71  verboseLevel(0)
72 {
73 }
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
76 
78 {
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
83 
85  const G4DataVector& dv)
86 {
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93 
94 void G4PolarizedPEEffectModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
95  const G4MaterialCutsCouple* couple,
96  const G4DynamicParticle* dp,
97  G4double tmin,
98  G4double maxEnergy)
99 {
100  // std::vector<G4DynamicParticle*>* vdp =
101  G4PEEffectFluoModel::SampleSecondaries(vdp,couple, dp, tmin, maxEnergy);
102 
103  if (verboseLevel >= 1) {
104  G4cout << "G4PolarizedPEEffectModel::SampleSecondaries" << G4endl;
105  }
106 
107  if(vdp && vdp->size()>0) {
108  G4double gamEnergy0 = dp->GetKineticEnergy();
109  G4double lepEnergy1 = (*vdp)[0]->GetKineticEnergy();
110  G4double sintheta = dp->GetMomentumDirection().cross((*vdp)[0]->GetMomentumDirection()).mag();
111  if (sintheta>1.) sintheta=1.;
112 
113  G4StokesVector beamPol = dp->GetPolarization();
114  beamPol.SetPhoton();
115  // G4cout<<" beamPol "<<beamPol<<G4endl;
116 
117  // determine interaction plane
118  G4ThreeVector nInteractionFrame =
120  (*vdp)[0]->GetMomentumDirection());
121  // G4cout<<" nInteractionFrame = "<<nInteractionFrame<<G4endl;
122  if (dp->GetMomentumDirection().cross((*vdp)[0]->GetMomentumDirection()).mag()<1.e-10) {
123  // G4cout<<" nInteractionFrame not well defined "<<G4endl;
124  // G4cout<<" choosing random interaction frame "<<G4endl;
125 
127  // G4cout<<"new nInteractionFrame = "<<nInteractionFrame<<G4endl;
128  }
129  /*
130  else {
131  G4ThreeVector mom1=dp->GetMomentumDirection();
132  G4ThreeVector mom2=(*vdp)[0]->GetMomentumDirection();
133  G4cout<<" mom1 = "<<mom1<<G4endl;
134  G4cout<<" mom2 = "<<mom2<<G4endl;
135  G4ThreeVector x=mom1.cross(mom2);
136  G4cout<<" mom1 x mom2 = "<<x<<" "<<x.mag()<<G4endl;
137  G4cout<<" norm = "<<(1./x.mag()*x)<<" "<<G4endl;
138  }
139  */
140 
141  // transform polarization into interaction frame
142  beamPol.InvRotateAz(nInteractionFrame,dp->GetMomentumDirection());
143 
144  // calulcate polarization transfer
145  crossSectionCalculator->SetMaterial(GetCurrentElement()->GetN(), // number of nucleons
146  GetCurrentElement()->GetZ(),
147  GetCurrentElement()->GetfCoulomb());
148  crossSectionCalculator->Initialize(gamEnergy0, lepEnergy1, sintheta,
149  beamPol, G4StokesVector::ZERO);
150 
151  // deterimine final state polarization
153  // G4cout<<" lepPol "<<lep1Pol<<G4endl;
154  lep1Pol.RotateAz(nInteractionFrame,(*vdp)[0]->GetMomentumDirection());
155  (*vdp)[0]->SetPolarization(lep1Pol.p1(),
156  lep1Pol.p2(),
157  lep1Pol.p3());
158 
159  // G4cout<<" lepPol "<<lep1Pol<<G4endl;
160  size_t num = vdp->size();
161  if (num!=1) G4cout<<" WARNING "<<num<<" secondaries in polarized photo electric effect not supported!\n";
162  }
163 }
164 
165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
166 #endif //NOIONIZATIONAS