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 }
HLT_FULL_cff.verboseLevel
verboseLevel
Definition: HLT_FULL_cff.py:8514
CMSSIMPInelasticXS::~CMSSIMPInelasticXS
~CMSSIMPInelasticXS() override
Definition: CMSSIMPInelasticXS.cc:19
CMSSIMPInelasticXS.h
CMSSIMP.h
CMSSIMPInelasticXS::CMSSIMPInelasticXS
CMSSIMPInelasticXS()
Definition: CMSSIMPInelasticXS.cc:13
CMSSIMPInelasticXS::isInitialized
G4bool isInitialized
Definition: CMSSIMPInelasticXS.h:38
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CMSSIMPInelasticXS::IsIsoApplicable
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *) override
Definition: CMSSIMPInelasticXS.cc:23
A
CMSSIMPInelasticXS::GetIsoCrossSection
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat) override
Definition: CMSSIMPInelasticXS.cc:33
CMSSIMPInelasticXS::IsElementApplicable
G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *) override
Definition: CMSSIMPInelasticXS.cc:21
CMSSIMPInelasticXS::BuildPhysicsTable
void BuildPhysicsTable(const G4ParticleDefinition &) override
Definition: CMSSIMPInelasticXS.cc:42
CMSSIMPInelasticXS::nXsection
G4NeutronInelasticXS * nXsection
Definition: CMSSIMPInelasticXS.h:36
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:33
ecalTB2006H4_GenSimDigiReco_cfg.G4cout
G4cout
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:285
CMSSIMPInelasticXS::GetElementCrossSection
G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr) override
Definition: CMSSIMPInelasticXS.cc:27