CMS 3D CMS Logo

HadronicProcessHelper.h
Go to the documentation of this file.
1 #ifndef SimG4Core_CustomPhysics_HadronicProcessHelper_H
2 #define SimG4Core_CustomPhysics_HadronicProcessHelper_H
3 
4 #include"globals.hh"
5 #include"G4ParticleDefinition.hh"
6 #include"G4DynamicParticle.hh"
7 #include"G4Element.hh"
8 #include"G4Track.hh"
9 
10 #include<vector>
11 #include<map>
12 #include <string>
13 
14 class G4ParticleTable;
15 
17 
18 public:
19 
20 //Typedefs just made to make life easier :-)
21  typedef std::vector<G4int> ReactionProduct;
22  typedef std::vector<ReactionProduct > ReactionProductList;
23  typedef std::map<G4int , ReactionProductList> ReactionMap;
24 
26 
28 
30 
31  HadronicProcessHelper* instance() {return this;};
32 
33  G4bool applicabilityTester(const G4ParticleDefinition& particle);
34 
35  G4double inclusiveCrossSection(const G4DynamicParticle *particle,
36  const G4Element *element);
37 
38  //Make sure the element is known (for n/p-decision)
39  ReactionProduct finalState(const G4Track& track,G4ParticleDefinition*& target)
40  {
41  return finalState(track.GetDynamicParticle(),track.GetMaterial(), target);
42  }
43  ReactionProduct finalState(const G4DynamicParticle * particle, const G4Material* material, G4ParticleDefinition*& target);
44 
45 
46 private:
47 
48  G4ParticleDefinition* m_proton;
49  G4ParticleDefinition* m_neutron;
50 
51 // ReactionMap* m_reactionMap;
52 
53  G4double m_phaseSpace(const ReactionProduct& aReaction,const G4DynamicParticle* aDynamicParticle,
54  G4ParticleDefinition* target);
55 
56  G4double m_reactionProductMass(const ReactionProduct& aReaction,const G4DynamicParticle* aDynamicParticle,
57  G4ParticleDefinition* target);
58 
59  G4bool m_reactionIsPossible(const ReactionProduct& aReaction,const G4DynamicParticle* aDynamicParticle,
60  G4ParticleDefinition* target);
61 
62  void m_readAndParse(const G4String& str,
63  std::vector<G4String>& tokens,
64  const G4String& delimiters = " ");
65 
66  //Map of applicable particles
67  std::map<const G4ParticleDefinition*,G4bool> m_knownParticles;
68 
69  //Proton-scattering processes
70  ReactionMap m_protonReactionMap;
71 
72  //Neutron-scattering processes
73  ReactionMap m_neutronReactionMap;
74 
75  G4ParticleTable* m_particleTable;
76 
78  G4double m_checkFraction;
79  G4int m_n22;
80  G4int m_n23;
81 
82 };
83 
84 #endif
ReactionProduct finalState(const G4Track &track, G4ParticleDefinition *&target)
void m_readAndParse(const G4String &str, std::vector< G4String > &tokens, const G4String &delimiters=" ")
HadronicProcessHelper(const std::string &fileName)
G4bool m_reactionIsPossible(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle, G4ParticleDefinition *target)
G4double m_phaseSpace(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle, G4ParticleDefinition *target)
G4double m_reactionProductMass(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle, G4ParticleDefinition *target)
G4double inclusiveCrossSection(const G4DynamicParticle *particle, const G4Element *element)
HadronicProcessHelper * instance()
HadronicProcessHelper & operator=(const HadronicProcessHelper &)
std::map< G4int, ReactionProductList > ReactionMap
G4ParticleDefinition * m_neutron
G4ParticleTable * m_particleTable
G4ParticleDefinition * m_proton
G4bool applicabilityTester(const G4ParticleDefinition &particle)
std::map< const G4ParticleDefinition *, G4bool > m_knownParticles
std::vector< ReactionProduct > ReactionProductList
std::vector< G4int > ReactionProduct