Skip to content
Snippets Groups Projects
Commit 30a6581f authored by adrien-matta's avatar adrien-matta
Browse files

* Fixing Drift Electron amplification process

parent 6acec344
No related branches found
No related tags found
No related merge requests found
...@@ -151,21 +151,20 @@ G4DEAmplification::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep) ...@@ -151,21 +151,20 @@ G4DEAmplification::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
// Create the secondary tracks // Create the secondary tracks
for(G4int i = 0 ; i < number_electron ; i++){ for(G4int i = 0 ; i < number_electron ; i++){
// Electron follow the field direction // Random direction at creation
G4ThreeVector field(0,1,0); G4double cost = 1-2*G4UniformRand();
G4double v_drift = aMaterialPropertiesTable->GetConstProperty("DE_DRIFTSPEED"); G4double theta = acos(cost);
G4double v_long = G4RandGauss::shoot(0,aMaterialPropertiesTable->GetConstProperty("DE_LONGITUDINALSPREAD")/v_drift); G4double phi = twopi*G4UniformRand();
G4double v_trans = G4RandGauss::shoot(0,aMaterialPropertiesTable->GetConstProperty("DE_TRANSVERSALSPREAD")/v_drift); G4ThreeVector p;
cout << v_drift << " " << v_long << " " << v_trans << endl; p.setRThetaPhi(1,theta,phi);
G4ThreeVector v = v_drift*field+v_long*G4ThreeVector(0,0,1)+v_trans*G4ThreeVector(1,0,0);
// Random Position along the step with matching time // Random Position along the step with matching time
G4double rand = G4UniformRand(); G4double rand = G4UniformRand();
G4ThreeVector pos = x0 + rand * aStep.GetDeltaPosition(); G4ThreeVector pos = x0 + rand * aStep.GetDeltaPosition();
G4double time = t0+ rand* aStep.GetDeltaTime(); G4double time = t0+ rand* aStep.GetDeltaTime();
G4DynamicParticle* particle = new G4DynamicParticle(G4DriftElectron::DriftElectron(),v.unit(), electron_mass_c2*v.mag()/c_squared); G4DynamicParticle* particle = new G4DynamicParticle(G4DriftElectron::DriftElectron(),p, pair_energy);
G4Track* aSecondaryTrack = new G4Track(particle,time,pos); G4Track* aSecondaryTrack = new G4Track(particle,time,pos);
aSecondaryTrack->SetTouchableHandle( aSecondaryTrack->SetTouchableHandle(
aStep.GetPreStepPoint()->GetTouchableHandle()); aStep.GetPreStepPoint()->GetTouchableHandle());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment