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 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
HadronicProcessHelper::m_reactionIsPossible
G4bool m_reactionIsPossible(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle, G4ParticleDefinition *target)
Definition: HadronicProcessHelper.cc:271
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
HadronicProcessHelper::HadronicProcessHelper
HadronicProcessHelper(const std::string &fileName)
Definition: HadronicProcessHelper.cc:16
HadronicProcessHelper::ReactionProductList
std::vector< ReactionProduct > ReactionProductList
Definition: HadronicProcessHelper.h:20
HadronicProcessHelper::operator=
HadronicProcessHelper & operator=(const HadronicProcessHelper &)
HadronicProcessHelper::m_reactionProductMass
G4double m_reactionProductMass(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle, G4ParticleDefinition *target)
Definition: HadronicProcessHelper.cc:251
HadronicProcessHelper::m_checkFraction
G4double m_checkFraction
Definition: HadronicProcessHelper.h:75
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
HadronicProcessHelper::m_proton
G4ParticleDefinition * m_proton
Definition: HadronicProcessHelper.h:44
ReactionProduct
std::vector< G4int > ReactionProduct
Definition: G4ProcessHelper.h:16
HadronicProcessHelper::finalState
ReactionProduct finalState(const G4Track &track, G4ParticleDefinition *&target)
Definition: HadronicProcessHelper.h:36
HadronicProcessHelper::m_phaseSpace
G4double m_phaseSpace(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle, G4ParticleDefinition *target)
Definition: HadronicProcessHelper.cc:279
str
#define str(s)
Definition: TestProcessor.cc:52
HadronicProcessHelper::m_n22
G4int m_n22
Definition: HadronicProcessHelper.h:76
HadronicProcessHelper::ReactionMap
std::map< G4int, ReactionProductList > ReactionMap
Definition: HadronicProcessHelper.h:21
HadronicProcessHelper::m_readAndParse
void m_readAndParse(const G4String &str, std::vector< G4String > &tokens, const G4String &delimiters=" ")
Definition: HadronicProcessHelper.cc:287
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HadronicProcessHelper::inclusiveCrossSection
G4double inclusiveCrossSection(const G4DynamicParticle *particle, const G4Element *element)
Definition: HadronicProcessHelper.cc:79
HadronicProcessHelper::m_neutronReactionMap
ReactionMap m_neutronReactionMap
Definition: HadronicProcessHelper.h:70
HadronicProcessHelper
Definition: HadronicProcessHelper.h:16
HadronicProcessHelper::m_protonReactionMap
ReactionMap m_protonReactionMap
Definition: HadronicProcessHelper.h:67
HadronicProcessHelper::ReactionProduct
std::vector< G4int > ReactionProduct
Definition: HadronicProcessHelper.h:19
HadronicProcessHelper::applicabilityTester
G4bool applicabilityTester(const G4ParticleDefinition &particle)
Definition: HadronicProcessHelper.cc:72
HadronicProcessHelper::m_knownParticles
std::map< const G4ParticleDefinition *, G4bool > m_knownParticles
Definition: HadronicProcessHelper.h:64
HadronicProcessHelper::m_n23
G4int m_n23
Definition: HadronicProcessHelper.h:77
HadronicProcessHelper::m_particleTable
G4ParticleTable * m_particleTable
Definition: HadronicProcessHelper.h:72
HadronicProcessHelper::instance
HadronicProcessHelper * instance()
Definition: HadronicProcessHelper.h:29
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
HadronicProcessHelper::m_neutron
G4ParticleDefinition * m_neutron
Definition: HadronicProcessHelper.h:45