Message: CosTheta Distribution Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None CosTheta Distribution 

Forum: Event and Track Management
Date: 01 Apr, 2014
From: A. Hod <A. Hod>

Dear Geant4 Users,

I have encountered the following problem and I am looking forward to your help: I irradiate my detector (PhyBox1) with a beam of electrons. The electron source emits electrons in the +Z direction and interact with the detector. I would like to calculate the angular distribution of the scattered primary electrons. I introduced some modifications in the example TestEm 14 and thus I obtained the projected angular distribution (ThetaX and ThetaY) of the scattered primary electrons at the exit of the detector. But I cannot get the distribution of the cosTheta (not projected angle). I obtained just zeros everywhere and that means there is no scattering!!! I highly welcome your help and thank you very much in advance.

Here is my SteppingAction.cc.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

// Anlgular distribution in the Box3

G4VPhysicalVolume* physVol = theTouchable->GetVolume(); if(strcmp(physVol->GetName(),"PhyBox1")== 0)

{ const G4StepPoint* endPoint = aStep->GetPostStepPoint(); G4String procName = endPoint->GetProcessDefinedStep()->GetProcessName(); G4bool transmit = (endPoint->GetStepStatus() <= fGeomBoundary);

//count processes and keep only Multiple Scattering

  runAction->CountProcesses(procName);

if (procName != "msc" && procName != "stepMax") return;

//////////////// scattered primary particle

G4int id = 1;

  if (aStep->GetTrack()->GetTrackStatus() == fAlive) {
  G4double energy = endPoint->GetKineticEnergy();      
  histoManager->FillHisto(id,energy);

 id = 2;

G4ThreeVector direction = endPoint->GetMomentumDirection();

G4double cosTheta = direction.z();

G4double ux=direction.x();

G4double uy=direction.y();

G4double uz=direction.z();

G4double ThetaX=std::atan(ux/uz); //projected angle at the exit

G4double ThetaY=std::atan(uy/uz); //projected angle at the exit

histoManager->FillHisto(id,cosTheta);

}

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

With kind regards

A.H.

 Add Message Add Message
to: "CosTheta Distribution"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]