CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CMSNeutronXS.cc
Go to the documentation of this file.
2 
3 #include "G4NeutronInelasticXS.hh"
4 #include "G4NeutronCaptureXS.hh"
5 
6 #include "G4ParticleDefinition.hh"
7 #include "G4HadronicProcess.hh"
8 #include "G4ProcessManager.hh"
9 #include "G4ProcessVector.hh"
10 #include "G4HadronicProcessType.hh"
11 
12 #include "G4Neutron.hh"
13 
14 CMSNeutronXS::CMSNeutronXS(const G4String&, G4int ver) :
15  G4VPhysicsConstructor("Neutron XS"), verbose(ver) {}
16 
18 
20 
22 
23  G4NeutronInelasticXS* xinel = new G4NeutronInelasticXS();
24  G4NeutronCaptureXS* xcap = new G4NeutronCaptureXS();
25 
26  const G4ParticleDefinition* neutron = G4Neutron::Neutron();
27  if(verbose > 1) {
28  G4cout << "### CMSNeutronXS: use alternative neutron X-sections"
29  << G4endl;
30  }
31 
32  G4ProcessVector* pv = neutron->GetProcessManager()->GetProcessList();
33  G4int n = pv->size();
34  G4HadronicProcess* had = 0;
35  for(G4int i=0; i<n; i++) {
36  if(fHadronInelastic == ((*pv)[i])->GetProcessSubType()) {
37  had = static_cast<G4HadronicProcess*>((*pv)[i]);
38  had->AddDataSet(xinel);
39  } else if(fCapture == ((*pv)[i])->GetProcessSubType()) {
40  had = static_cast<G4HadronicProcess*>((*pv)[i]);
41  had->AddDataSet(xcap);
42  }
43  }
44 }
int i
Definition: DBlmapReader.cc:9
CMSNeutronXS(const G4String &nam, G4int ver)
Definition: CMSNeutronXS.cc:14
virtual void ConstructProcess()
Definition: CMSNeutronXS.cc:21
virtual void ConstructParticle()
Definition: CMSNeutronXS.cc:19
virtual ~CMSNeutronXS()
Definition: CMSNeutronXS.cc:17