Geant4  v4-10.4-release
이 파일의 문서화 페이지로 가기
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 *
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 *
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: G4AdjointPrimaryGeneratorAction.hh 98735 2016-08-09 10:54:06Z gcosmo$
27 //
30 // Author: L. Desorgher
31 // Organisation: SpaceIT GmbH
32 // Contract: ESA contract 21435/08/NL/AT
33 // Customer: ESA/ESTEC
35 //
36 // CHANGE HISTORY
37 // --------------
38 // ChangeHistory:
39 // 10-01-2007 creation by L. Desorgher
41 //
42 //
43 //-------------------------------------------------------------
44 // Documentation:
45 // This class represents the PrimaryGeneratorAction that is used during the entire adjoint simulation.
46 // It uses the class G4AdjointPrimaryGenerator to generate randomly adjoint primary particles on a user selected
47 // adjoint source (External surface of a volume or Sphere).
48 // The spectrum of the primary adjoint particles is set as 1/E with user defined max and min energy.
49 // The weight of the primary is set according to ReverseMC theory as w=log(Emax/Emin)*E*adjoint_source_area*pi/n, with E the energy of the
50 // particle, n the number of adjoint primary particles of same type that will be generated during the simulation.
51 // Different types of adjoint particles are generated event after event in order
52 // to cover all the type of primaries and secondaries needed for the simulation. For example if reverse e- ionisation, brem, photo electric effect, and
53 // compton are considered both adjoint gamma and adjoint e- will be considered alternatively as adjoint primary.
54 // The user can decide to consider/neglect some type of particle by using the macro
55 // commands /adjoint/ConsiderAsPrimary and /adjoint/NeglectAsPrimary. If an adjoint primary or its secondary has reached the external surface,
56 // in the next event a fwd primary particle equivalent to the last generated adjoint primary is generated with the same position, energy but opposite direction
57 // and the forward tracking phase starts.
58 //
59 //
60 //
64 #include "globals.hh"
65 #include"G4ThreeVector.hh"
66 #include <vector>
67 #include <map>
68 #include <iterator>
69
71 class G4ParticleGun;
72 class G4Event;
75
77 //
79 {
80  public: //constructor, destructor
81
84
85  public: //public methods
86
88  void SetRndmFlag(const G4String& val) { rndmFlag = val;}
89  void SetEmin(G4double val);
90  void SetEmax(G4double val);
91  void SetEminIon(G4double val);
92  void SetEmaxIon(G4double val);
95  void ConsiderParticleAsPrimary(const G4String& particle_name);
96  void NeglectParticleAsPrimary(const G4String& particle_name);
97  void SetPrimaryIon(G4ParticleDefinition* adjointIon, G4ParticleDefinition* fwdIon);
100  inline std::vector<G4ParticleDefinition*>* GetListOfPrimaryFwdParticles(){
101  return &ListOfPrimaryFwdParticles;}
102  inline const G4String& GetPrimaryIonName(){return ion_name;}
107
108  private: //private methods
109
111
112  private: //attributes
113
114  G4String rndmFlag; //flag for a rndm impact point
115
116  //The generator of primary vertex except for weight
118
119  //Emin and Emax energies of the adjoint source
120  //---------------------------------------------
125
126  //List of type of primary adjoint and forward particle used in the simulation
127  //---------------------------------------------------------------------------
128  std::vector<G4ParticleDefinition*> ListOfPrimaryFwdParticles;
130  std::map<G4String, G4bool> PrimariesConsideredInAdjointSim; //if true considered if false not considered
131
132
134
136
143
144  //For simulation with ions
145  //--------------------------
149  //disable copy constructor and assignement operator
152 };
153 #endif
154
155
std::vector< G4ParticleDefinition * > ListOfPrimaryFwdParticles
G4ParticleDefinition * GetLastGeneratedFwdPrimaryParticle()
double G4double
Definition: G4Types.hh:76
G4double ComputeEnergyDistWeight(G4double energy, G4double E1, G4double E2)
double energy
Definition: plottest35.C:25
std::vector< G4ParticleDefinition * > * GetListOfPrimaryFwdParticles()
int G4int
Definition: G4Types.hh:78