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 
15  G4VHadronPhysics("CMSThermalNeutrons"), verbose(ver) {
16 }
17 
19 
21 
22  if(verbose > 0) {
23  G4cout << "### " << GetPhysicsName() << " Construct Processes " << G4endl;
24  }
25  G4Neutron* part = G4Neutron::Neutron();
26  G4HadronicProcess* hpel = FindElasticProcess(part);
27  if(!hpel) {
28  G4cout << "### " << GetPhysicsName()
29  << " WARNING: Fail to add thermal neutron scattering" << G4endl;
30  return;
31  }
32 
33  G4int ni = (hpel->GetHadronicInteractionList()).size();
34  if(ni < 2) {
35  G4cout << "### " << GetPhysicsName()
36  << " WARNING: Fail to add thermal neutron scattering - Nint= "
37  << ni << G4endl;
38  return;
39  }
40  (hpel->GetHadronicInteractionList())[ni-1]->SetMinEnergy(4*CLHEP::eV);
41 
42  hpel->RegisterMe(new G4ParticleHPThermalScattering());
43  hpel->AddDataSet(new G4ParticleHPThermalScatteringData());
44 
45 }
size
Write out results.
virtual void ConstructProcess()
part
Definition: HCALResponse.h:20