ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExUCNExtraPhysics.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ExUCNExtraPhysics.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
29 //
30 //
31 #include "G4ParticleDefinition.hh"
32 #include "G4ProcessManager.hh"
33 
34 #include "G4Transportation.hh"
35 
36 #include "G4Decay.hh"
37 #include "G4DecayTable.hh"
39 
40 #include "G4UserSpecialCuts.hh"
41 #include "G4StepLimiter.hh"
42 #include "G4SystemOfUnits.hh"
43 
44 #include "G4UCNLoss.hh"
45 #include "G4UCNAbsorption.hh"
46 #include "G4UCNMultiScattering.hh"
47 #include "G4UCNBoundaryProcess.hh"
48 
49 #include "ExUCNExtraPhysics.hh"
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52 
54  : G4VPhysicsConstructor("Extra") {;}
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
67 {
69  particleIterator->reset();
70 
71  while ((*particleIterator)()) {
73  G4ProcessManager* pmanager = particle->GetProcessManager();
74  G4String particleName = particle->GetParticleName();
75 
76  if (!pmanager) {
77  std::ostringstream o;
78  o << "Particle " << particleName << "without a Process Manager";
79  G4Exception("ExUCNExtraPhysics::ConstructProcess()","",
80  FatalException,o.str().c_str());
81  }
82 
83  pmanager->AddDiscreteProcess(new G4StepLimiter());
84  pmanager->AddDiscreteProcess(new G4UserSpecialCuts());
85  }
86 
87  ConstructUCN();
88 
89  // G4Transportation::EnableMagneticMoment();
91 }
92 
93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94 
96 {
98  particleIterator->reset();
99  G4ProcessManager* pmanager = NULL;
100 
101  while ((*particleIterator)()) {
103  pmanager = particle->GetProcessManager();
104  G4String particleName = particle->GetParticleName();
105 
106  if (!pmanager) {
107  std::ostringstream o;
108  o << "Particle " << particleName << "without a Process Manager";
109  G4Exception("ExUCNExtraPhysics::ConstructProcess()","",
110  FatalException,o.str().c_str());
111  }
112 
113  if (particleName == "neutron") {
114  pmanager->AddDiscreteProcess(new G4UCNLoss());
115  pmanager->AddDiscreteProcess(new G4UCNAbsorption());
116  pmanager->AddDiscreteProcess(new G4UCNMultiScattering());
117 
118  G4UCNBoundaryProcess* ucnBoundaryProcess =
119  new G4UCNBoundaryProcess();
120  ucnBoundaryProcess->SetMicroRoughness(true);
121  ucnBoundaryProcess->SetVerboseLevel(0);
122 
123  pmanager->AddDiscreteProcess(ucnBoundaryProcess);
124  }
125  }
126 }
127 
128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......