Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions source/physics/src/GateBackToBack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,21 @@ void GateBackToBack::GenerateVertex( G4Event* aEvent, G4bool accolinearityFlag)
if (accoValue == 0.0){
accoValue = 0.5*pi / 180;
}

G4double dev = CLHEP::RandGauss::shoot( 0.,accoValue / GateConstants::fwhm_to_sigma );
G4double Phi1 = ( twopi * G4UniformRand() )/2. ;

G4ThreeVector DirectionPhoton( sin( dev ) * cos( Phi1 ),
sin( dev ) * sin( Phi1 ), cos( dev ) );

// Adapt the correction suggested by Toussaint et al. (https://doi.org/10.1088/1361-6560/ad70f1)

// G4double dev = CLHEP::RandGauss::shoot( 0.,accoValue / GateConstants::fwhm_to_sigma );
// G4double Phi1 = ( twopi * G4UniformRand() )/2. ;
//
// G4ThreeVector DirectionPhoton( sin( dev ) * cos( Phi1 ),
// sin( dev ) * sin( Phi1 ), cos( dev ) );

G4double phi = CLHEP::RandGauss::shoot(0., accoValue / GateConstants::fwhm_to_sigma);
G4double psi = CLHEP::RandGauss::shoot(0., accoValue / GateConstants::fwhm_to_sigma);

G4double theta = sqrt(pow(phi, 2.0) + pow(psi, 2.0));

G4ThreeVector DirectionPhoton(sin(theta) * phi / theta, sin(theta) * psi / theta, cos(theta));

// Scale vector to unit length before rotation, re-scale to original length after rotation:
G4double gammaMom_mag = gammaMom.mag();
Expand Down
Loading