ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4AdjointPrimaryGeneratorAction.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4AdjointPrimaryGeneratorAction.hh
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 //
28 // Class Name: G4AdjointPrimaryGeneratorAction
29 // Author: L. Desorgher
30 // Organisation: SpaceIT GmbH
31 // Contract: ESA contract 21435/08/NL/AT
32 // Customer: ESA/ESTEC
34 //
35 // CHANGE HISTORY
36 // --------------
37 // ChangeHistory:
38 // 10-01-2007 creation by L. Desorgher
39 // 1-11-2009 Splitting of G4AdjointPrimaryGeneratorAction in two classes G4AdjointPrimaryGeneratorAction and G4AdjointPrimaryGenerator L.Desorgher
40 //
41 //
42 //-------------------------------------------------------------
43 // Documentation:
44 // This class represents the PrimaryGeneratorAction that is used during the entire adjoint simulation.
45 // It uses the class G4AdjointPrimaryGenerator to generate randomly adjoint primary particles on a user selected
46 // adjoint source (External surface of a volume or Sphere).
47 // The spectrum of the primary adjoint particles is set as 1/E with user defined max and min energy.
48 // 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
49 // particle, n the number of adjoint primary particles of same type that will be generated during the simulation.
50 // Different types of adjoint particles are generated event after event in order
51 // to cover all the type of primaries and secondaries needed for the simulation. For example if reverse e- ionisation, brem, photo electric effect, and
52 // compton are considered both adjoint gamma and adjoint e- will be considered alternatively as adjoint primary.
53 // The user can decide to consider/neglect some type of particle by using the macro
54 // commands /adjoint/ConsiderAsPrimary and /adjoint/NeglectAsPrimary. If an adjoint primary or its secondary has reached the external surface,
55 // 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
56 // and the forward tracking phase starts.
57 //
58 //
59 //
60 #ifndef G4AdjointPrimaryGeneratorAction_h
61 #define G4AdjointPrimaryGeneratorAction_h 1
63 #include "globals.hh"
64 #include"G4ThreeVector.hh"
65 #include <vector>
66 #include <map>
67 #include <iterator>
68 
70 class G4ParticleGun;
71 class G4Event;
74 
76 //
78 {
79  public: //constructor, destructor
80 
83 
84  public: //public methods
85 
87  void SetRndmFlag(const G4String& val) { rndmFlag = val;}
88  void SetEmin(G4double val);
89  void SetEmax(G4double val);
90  void SetEminIon(G4double val);
91  void SetEmaxIon(G4double val);
94  void ConsiderParticleAsPrimary(const G4String& particle_name);
95  void NeglectParticleAsPrimary(const G4String& particle_name);
96  void SetPrimaryIon(G4ParticleDefinition* adjointIon, G4ParticleDefinition* fwdIon);
98  inline size_t GetNbOfAdjointPrimaryTypes(){return ListOfPrimaryAdjParticles.size();}
99  inline std::vector<G4ParticleDefinition*>* GetListOfPrimaryFwdParticles(){
100  return &ListOfPrimaryFwdParticles;}
101  inline const G4String& GetPrimaryIonName(){return ion_name;}
106 
107  private: //private methods
108 
110 
111  private: //attributes
112 
113  G4String rndmFlag; //flag for a rndm impact point
114 
115  //The generator of primary vertex except for weight
117 
118  //Emin and Emax energies of the adjoint source
119  //---------------------------------------------
124 
125  //List of type of primary adjoint and forward particle used in the simulation
126  //---------------------------------------------------------------------------
127  std::vector<G4ParticleDefinition*> ListOfPrimaryFwdParticles;
128  std::vector<G4ParticleDefinition*> ListOfPrimaryAdjParticles;
129  std::map<G4String, G4bool> PrimariesConsideredInAdjointSim; //if true considered if false not considered
130 
131 
133 
135 
136  G4String type_of_adjoint_source; //Spherical ExtSurfaceOfAVolume
142 
143  //For simulation with ions
144  //--------------------------
148  //disable copy constructor and assignement operator
151 };
152 #endif
153 
154