Skip to content

Commit a9568c6

Browse files
authored
Merge pull request #762 from mraedler/acollinearity_effect_correction
Correction of the acollinearity sampling following Toussaint et al.
2 parents e99c878 + 7502d71 commit a9568c6

5 files changed

Lines changed: 48 additions & 9 deletions

File tree

source/geometry/include/GateDetectorConstruction.hh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ public:
159159
void SetMaterialIoniPotential(G4String n,G4double v){theListOfIonisationPotential[n]=v;}
160160
G4double GetMaterialIoniPotential(G4String n){ return theListOfIonisationPotential[n];}
161161

162-
162+
void SetMaterialMeanEnergyPerIonPair(G4String n,G4double v){theListOfMeanEnergyPerIonPair[n]=v;}
163+
G4double GetMaterialMeanEnergyPerIonPair(G4String n){ return theListOfMeanEnergyPerIonPair[n];}
163164

164165
private :
165166

@@ -185,6 +186,7 @@ protected :
185186
G4bool moveFlag;
186187

187188
std::map<G4String,G4double> theListOfIonisationPotential;
189+
std::map<G4String,G4double> theListOfMeanEnergyPerIonPair;
188190

189191

190192
private:

source/geometry/include/GateDetectorMessenger.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class GateDetectorMessenger: public G4UImessenger
5858

5959
G4UIcmdWithoutParameter* pListCreatorsCmd;
6060
G4UIcmdWithAString* IoniCmd;
61+
G4UIcmdWithAString* IonPairCmd;
6162

6263
//G4UIcmdWithABool* pEnableAutoUpdateCmd;
6364
//G4UIcmdWithABool* pDisableAutoUpdateCmd;

source/geometry/src/GateDetectorConstruction.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ G4VPhysicalVolume* GateDetectorConstruction::Construct()
153153

154154
const G4MaterialTable * theTable = G4Material::GetMaterialTable();
155155
for(unsigned int i =0;i<(*theTable).size();i++){
156+
// Set the default value
157+
G4double defaultMeanEnergyPerIonPair = 5. * eV;
158+
(*theTable)[i]->GetIonisation()->SetMeanEnergyPerIonPair(defaultMeanEnergyPerIonPair);
159+
160+
// Update, if given
161+
if(theListOfMeanEnergyPerIonPair[(*theTable)[i]->GetName()]){
162+
(*theTable)[i]->GetIonisation()->SetMeanEnergyPerIonPair(theListOfMeanEnergyPerIonPair[(*theTable)[i]->GetName()]);
163+
GateMessage("Physic", 1, " - " << (*theTable)[i]->GetName() << "\t updating the default 'mean energy per ion pair' value of " <<
164+
G4BestUnit(defaultMeanEnergyPerIonPair,"Energy") << "to " <<
165+
G4BestUnit((*theTable)[i]->GetIonisation()->GetMeanEnergyPerIonPair(),"Energy") << Gateendl);
166+
}
167+
else {
168+
GateMessage("Physic", 1, " - " << (*theTable)[i]->GetName() << "\t using the default 'mean energy per ion pair' value of " <<
169+
G4BestUnit((*theTable)[i]->GetIonisation()->GetMeanEnergyPerIonPair(),"Energy") << Gateendl);
170+
}
171+
156172
if(theListOfIonisationPotential[(*theTable)[i]->GetName()]){
157173
(*theTable)[i]->GetIonisation()->SetMeanExcitationEnergy(theListOfIonisationPotential[(*theTable)[i]->GetName()]);
158174
GateMessage("Physic", 1, " - " << (*theTable)[i]->GetName() << "\t defaut value: I = " <<

source/geometry/src/GateDetectorMessenger.cc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,12 @@ GateDetectorMessenger::GateDetectorMessenger(GateDetectorConstruction* GateDet)
171171
IoniCmd = new G4UIcmdWithAString(cmd,this);
172172
IoniCmd->SetGuidance("Set the ionisation potential for a material (two parameters 'material' and 'value and unit')");
173173

174-
175-
174+
cmd = "/gate/geometry/setMeanEnergyPerIonPair";
175+
IonPairCmd = new G4UIcmdWithAString(cmd,this);
176+
IonPairCmd->SetGuidance("Set the mean energy per ion pair. "
177+
"This controls the magnitude of the acollinearity effect for electron-positron annihilation. "
178+
"The default value is 5 eV (see https://www.geant4.org/download/release-notes/notes-v10.7.0.html). "
179+
"(two parameters 'material' and 'value with unit')");
176180

177181
GateDistributionListManager::Init();
178182
}
@@ -245,6 +249,13 @@ void GateDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
245249
GetStringAndValueFromCommand(command, newValue, matName, value);
246250
pDetectorConstruction->SetMaterialIoniPotential(matName,value);
247251
}
252+
else if( command == IonPairCmd )
253+
{
254+
G4String matName;
255+
double value;
256+
GetStringAndValueFromCommand(command, newValue, matName, value);
257+
pDetectorConstruction->SetMaterialMeanEnergyPerIonPair(matName,value);
258+
}
248259
else
249260
G4UImessenger::SetNewValue(command,newValue);
250261

source/physics/src/GateBackToBack.cc

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,21 @@ void GateBackToBack::GenerateVertex( G4Event* aEvent, G4bool accolinearityFlag)
5252
if (accoValue == 0.0){
5353
accoValue = 0.5*pi / 180;
5454
}
55-
56-
G4double dev = CLHEP::RandGauss::shoot( 0.,accoValue / GateConstants::fwhm_to_sigma );
57-
G4double Phi1 = ( twopi * G4UniformRand() )/2. ;
58-
59-
G4ThreeVector DirectionPhoton( sin( dev ) * cos( Phi1 ),
60-
sin( dev ) * sin( Phi1 ), cos( dev ) );
55+
56+
// Adapt the correction suggested by Toussaint et al. (https://doi.org/10.1088/1361-6560/ad70f1)
57+
58+
// G4double dev = CLHEP::RandGauss::shoot( 0.,accoValue / GateConstants::fwhm_to_sigma );
59+
// G4double Phi1 = ( twopi * G4UniformRand() )/2. ;
60+
//
61+
// G4ThreeVector DirectionPhoton( sin( dev ) * cos( Phi1 ),
62+
// sin( dev ) * sin( Phi1 ), cos( dev ) );
63+
64+
G4double phi = CLHEP::RandGauss::shoot(0., accoValue / GateConstants::fwhm_to_sigma);
65+
G4double psi = CLHEP::RandGauss::shoot(0., accoValue / GateConstants::fwhm_to_sigma);
66+
67+
G4double theta = sqrt(pow(phi, 2.0) + pow(psi, 2.0));
68+
69+
G4ThreeVector DirectionPhoton(sin(theta) * phi / theta, sin(theta) * psi / theta, cos(theta));
6170

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

0 commit comments

Comments
 (0)