48 : Emin(0.), Emax(0.), EminIon(0.), EmaxIon(0.), NbOfAdjointPrimaryTypes(0),
49 index_particle(100000), last_generated_part_was_adjoint(false),
50 radius_spherical_source(0.), fwd_ion(0), adj_ion(0),
51 ion_name(
"not_defined")
55 PrimariesConsideredInAdjointSim[
G4String(
"e-")]=
false;
56 PrimariesConsideredInAdjointSim[
G4String(
"gamma")]=
false;
57 PrimariesConsideredInAdjointSim[
G4String(
"proton")]=
false;
58 PrimariesConsideredInAdjointSim[
G4String(
"ion")]=
false;
60 ListOfPrimaryFwdParticles.clear();
61 ListOfPrimaryAdjParticles.clear();
67 delete theAdjointPrimaryGenerator;
73 if ( !last_generated_part_was_adjoint ) {
76 if (index_particle >= ListOfPrimaryAdjParticles.size()) index_particle =0;
83 if (ListOfPrimaryAdjParticles[index_particle]->GetParticleName() ==
"adj_proton") {
87 if (ListOfPrimaryAdjParticles[index_particle]->GetParticleType() ==
"adjoint_nucleus") {
88 G4int A= ListOfPrimaryAdjParticles[index_particle]->GetAtomicMass();
93 ListOfPrimaryAdjParticles[index_particle],
102 G4double m0=ListOfPrimaryAdjParticles[index_particle]->GetPDGMass();
103 G4double ekin=std::sqrt( m0*m0 + pmag*pmag) -m0;
108 G4double adjoint_weight = ComputeEnergyDistWeight(ekin,E1,E2)*adjoint_source_area*
pi;
112 last_generated_part_was_adjoint =
true;
120 aPrimVertex->
SetT0(0.);
122 -
p.x(),-
p.y(),-
p.z());
126 last_generated_part_was_adjoint =
false;
180 radius_spherical_source = radius;
181 center_spherical_source = center_pos;
182 type_of_adjoint_source =
"Spherical";
189 type_of_adjoint_source =
"ExternalSurfaceOfAVolume";
196 if (PrimariesConsideredInAdjointSim.find(particle_name) != PrimariesConsideredInAdjointSim.end()){
197 PrimariesConsideredInAdjointSim[particle_name]=
true;
205 if (PrimariesConsideredInAdjointSim.find(particle_name) != PrimariesConsideredInAdjointSim.end()){
206 PrimariesConsideredInAdjointSim[particle_name]=
false;
215 ListOfPrimaryFwdParticles.clear();
216 ListOfPrimaryAdjParticles.clear();
217 std::map<G4String, G4bool>::iterator iter;
218 for( iter = PrimariesConsideredInAdjointSim.begin(); iter != PrimariesConsideredInAdjointSim.end(); ++iter ) {
221 if ( fwd_particle_name !=
"ion") {
223 ListOfPrimaryFwdParticles.push_back(theParticleTable->
FindParticle(fwd_particle_name));
224 ListOfPrimaryAdjParticles.push_back(theParticleTable->
FindParticle(adj_particle_name));
230 ListOfPrimaryFwdParticles.push_back(fwd_ion);
231 ListOfPrimaryAdjParticles.push_back(adj_ion);
234 ListOfPrimaryFwdParticles.push_back(0);
235 ListOfPrimaryAdjParticles.push_back(0);
247 adj_ion = adjointIon;