Geant4  10.00.p01
G4AdjointPrimaryGenerator.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4AdjointPrimaryGenerator.cc 76257 2013-11-08 11:31:00Z gcosmo $
27 //
29 // Class Name: G4AdjointCrossSurfChecker
30 // Author: L. Desorgher
31 // Organisation: SpaceIT GmbH
32 // Contract: ESA contract 21435/08/NL/AT
33 // Customer: ESA/ESTEC
35 
37 #include "G4PhysicalConstants.hh"
38 #include "G4Event.hh"
40 #include "G4ParticleDefinition.hh"
42 
44 //
46  : radius_spherical_source(0.)
47 {
49  type_of_adjoint_source="Spherical";
51 
56 
58 }
60 //
62 {
64 }
66 //
68 {
69  if (type_of_adjoint_source == "ExternalSurfaceOfAVolume") {
70 
71  //Generate position and direction relative to the external surface of sensitive volume
72  //-------------------------------------------------------------
73 
74  G4double costh_to_normal=1.;
75  G4ThreeVector pos =G4ThreeVector(0.,0.,0.);
76  G4ThreeVector direction = G4ThreeVector(0.,0.,1.);
78  if (costh_to_normal <1.e-4) costh_to_normal =1.e-4;
81  }
82 
85 
88 }
90 //
92 {
93  if (type_of_adjoint_source == "ExternalSurfaceOfAVolume") {
94 
95  //Generate position and direction relative to the external surface of sensitive volume
96  //-------------------------------------------------------------
97 
98  G4double costh_to_normal=1.;
99  G4ThreeVector pos =G4ThreeVector(0.,0.,0.);
100  G4ThreeVector direction = G4ThreeVector(0.,0.,1.);
102  if (costh_to_normal <1.e-4) costh_to_normal =1.e-4;
105  }
106 
109 
112 }
114 //
116 {
117  radius_spherical_source = radius;
118  center_spherical_source = center_pos;
119  type_of_adjoint_source ="Spherical";
127 }
129 //
131 {
133  type_of_adjoint_source ="ExternalSurfaceOfAVolume";
136 }
137 
void SetSphericalAdjointPrimarySource(G4double radius, G4ThreeVector pos)
G4SPSEneDistribution * GetEneDist()
CLHEP::Hep3Vector G4ThreeVector
void GenerateAdjointPrimaryVertex(G4Event *anEvt, G4ParticleDefinition *adj_part, G4double E1, G4double E2)
G4SPSPosDistribution * GetPosDist()
const G4double pi
void SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume(const G4String &volume_name)
G4AdjointPosOnPhysVolGenerator * theG4AdjointPosOnPhysVolGenerator
void SetCentreCoords(G4ThreeVector)
void SetEnergyDisType(G4String)
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
G4SPSAngDistribution * GetAngDist()
void GenerateFwdPrimaryVertex(G4Event *anEvt, G4ParticleDefinition *adj_part, G4double E1, G4double E2)
void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(G4ThreeVector &p, G4ThreeVector &direction)
void DefinePhysicalVolume1(const G4String &aName)
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
static G4AdjointPosOnPhysVolGenerator * GetInstance()
void GeneratePrimaryVertex(G4Event *evt)
double G4double
Definition: G4Types.hh:76
G4SingleParticleSource * theSingleParticleSource
static const G4double pos