CMS 3D CMS Logo

CMSSIMPInelasticXS.cc
Go to the documentation of this file.
1 
4 #include "G4DynamicParticle.hh"
5 #include "G4Element.hh"
6 #include "G4ElementTable.hh"
7 #include "G4PhysicsLogVector.hh"
8 #include "G4PhysicsVector.hh"
9 #include "G4NeutronInelasticXS.hh"
10 #include "G4Proton.hh"
11 #include "G4Neutron.hh"
12 
13 CMSSIMPInelasticXS::CMSSIMPInelasticXS() : G4VCrossSectionDataSet("CMSSIMPInelasticXS"), neutron(G4Neutron::Neutron()) {
14  verboseLevel = 1;
15  nXsection = new G4NeutronInelasticXS();
16  isInitialized = false;
17 }
18 
20 
21 G4bool CMSSIMPInelasticXS::IsElementApplicable(const G4DynamicParticle*, G4int, const G4Material*) { return true; }
22 
23 G4bool CMSSIMPInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int, const G4Element*, const G4Material*) {
24  return true;
25 }
26 
27 G4double CMSSIMPInelasticXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
28  G4int Z,
29  const G4Material* mat) {
30  return nXsection->GetElementCrossSection(aParticle, Z, mat);
31 }
32 
33 G4double CMSSIMPInelasticXS::GetIsoCrossSection(const G4DynamicParticle* aParticle,
34  G4int Z,
35  G4int A,
36  const G4Isotope* iso,
37  const G4Element* elm,
38  const G4Material* mat) {
39  return nXsection->GetIsoCrossSection(aParticle, Z, A, iso, elm, mat);
40 }
41 
42 void CMSSIMPInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p) {
43  if (isInitialized) {
44  return;
45  }
46  nXsection->BuildPhysicsTable(p);
47  if (verboseLevel > 0) {
48  G4cout << "CMSSIMPInelasticXS::BuildPhysicsTable for " << p.GetParticleName() << G4endl;
49  }
50  if (p.GetParticleName() != "chi" && p.GetParticleName() != "anti_chi" && p.GetParticleName() != "chibar") {
51  G4ExceptionDescription ed;
52  ed << p.GetParticleName() << " is a wrong particle type -"
53  << " only simp is allowed";
54  G4Exception("CMSSIMPInelasticXS::BuildPhysicsTable(..)", "had012", FatalException, ed, "");
55  return;
56  }
57  isInitialized = true;
58 }
void BuildPhysicsTable(const G4ParticleDefinition &) override
~CMSSIMPInelasticXS() override
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *) override
G4NeutronInelasticXS * nXsection
G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr) override
G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *) override
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat) override
Definition: APVGainStruct.h:7