CMS 3D CMS Logo

CMSThermalNeutrons.cc
Go to the documentation of this file.
2 
3 #include "G4ParticleDefinition.hh"
4 #include "G4ProcessManager.hh"
5 #include "G4HadronicProcess.hh"
6 
7 #include "G4ParticleHPThermalScattering.hh"
8 #include "G4ParticleHPThermalScatteringData.hh"
9 
10 #include "G4BuilderType.hh"
11 
12 #include "G4SystemOfUnits.hh"
13 
14 CMSThermalNeutrons::CMSThermalNeutrons(G4int ver) : G4VHadronPhysics("CMSThermalNeutrons"), verbose(ver) {}
15 
17 
19  if (verbose > 0) {
20  G4cout << "### " << GetPhysicsName() << " Construct Processes " << G4endl;
21  }
22  G4Neutron* part = G4Neutron::Neutron();
23  G4HadronicProcess* hpel = FindElasticProcess(part);
24  if (!hpel) {
25  G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add thermal neutron scattering" << G4endl;
26  return;
27  }
28 
29  G4int ni = (hpel->GetHadronicInteractionList()).size();
30  if (ni < 1) {
31  G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add thermal neutron scattering - Nint= " << ni << G4endl;
32  return;
33  }
34  (hpel->GetHadronicInteractionList())[ni - 1]->SetMinEnergy(4 * CLHEP::eV);
35 
36  hpel->RegisterMe(new G4ParticleHPThermalScattering());
37  hpel->AddDataSet(new G4ParticleHPThermalScatteringData());
38 }
size
Write out results.
void ConstructProcess() override
part
Definition: HCALResponse.h:20
~CMSThermalNeutrons() override