CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 public:
18  //Typedefs just made to make life easier :-)
19  typedef std::vector<G4int> ReactionProduct;
20  typedef std::vector<ReactionProduct> ReactionProductList;
21  typedef std::map<G4int, ReactionProductList> ReactionMap;
22 
24 
26 
28 
29  HadronicProcessHelper* instance() { return this; };
30 
31  G4bool applicabilityTester(const G4ParticleDefinition& particle);
32 
33  G4double inclusiveCrossSection(const G4DynamicParticle* particle, const G4Element* element);
34 
35  //Make sure the element is known (for n/p-decision)
36  ReactionProduct finalState(const G4Track& track, G4ParticleDefinition*& target) {
37  return finalState(track.GetDynamicParticle(), track.GetMaterial(), target);
38  }
39  ReactionProduct finalState(const G4DynamicParticle* particle,
40  const G4Material* material,
41  G4ParticleDefinition*& target);
42 
43 private:
44  G4ParticleDefinition* m_proton;
45  G4ParticleDefinition* m_neutron;
46 
47  // ReactionMap* m_reactionMap;
48 
49  G4double m_phaseSpace(const ReactionProduct& aReaction,
50  const G4DynamicParticle* aDynamicParticle,
51  G4ParticleDefinition* target);
52 
53  G4double m_reactionProductMass(const ReactionProduct& aReaction,
54  const G4DynamicParticle* aDynamicParticle,
55  G4ParticleDefinition* target);
56 
57  G4bool m_reactionIsPossible(const ReactionProduct& aReaction,
58  const G4DynamicParticle* aDynamicParticle,
59  G4ParticleDefinition* target);
60 
61  void m_readAndParse(const G4String& str, std::vector<G4String>& tokens, const G4String& delimiters = " ");
62 
63  //Map of applicable particles
64  std::map<const G4ParticleDefinition*, G4bool> m_knownParticles;
65 
66  //Proton-scattering processes
68 
69  //Neutron-scattering processes
71 
72  G4ParticleTable* m_particleTable;
73 
75  G4double m_checkFraction;
76  G4int m_n22;
77  G4int m_n23;
78 };
79 
80 #endif
ReactionProduct finalState(const G4Track &track, G4ParticleDefinition *&target)
void m_readAndParse(const G4String &str, std::vector< G4String > &tokens, const G4String &delimiters=" ")
std::vector< ReactionProduct > ReactionProductList
std::map< G4int, ReactionProductList > ReactionMap
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)
std::vector< G4int > ReactionProduct
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 &)
G4ParticleDefinition * m_neutron
G4ParticleTable * m_particleTable
G4ParticleDefinition * m_proton
std::map< const G4ParticleDefinition *, G4bool > m_knownParticles
G4bool applicabilityTester(const G4ParticleDefinition &particle)
#define str(s)
std::vector< G4int > ReactionProduct