ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4NeutronKiller.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4NeutronKiller.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 //
27 //---------------------------------------------------------------------------
28 //
29 // ClassName: G4NeutronKiller
30 //
31 // Description: The process to kill particles to save CPU
32 //
33 // Author: V.Ivanchenko 26/09/00 for HARP software
34 //
35 //----------------------------------------------------------------------------
36 //
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
39 
40 #include "G4NeutronKiller.hh"
41 
42 #include "G4SystemOfUnits.hh"
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49  : G4VDiscreteProcess(processName, aType)
50 {
51  // set Process Sub Type
53 
54  kinEnergyThreshold = 0.0;
56  pMess = new G4NeutronKillerMessenger(this);
57 }
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60 
62 {
63  delete pMess;
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69 {
70  return (particle.GetParticleName() == "neutron");
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
76 {
77  timeThreshold = val;
78  if(verboseLevel > 0)
79  G4cout << "### G4NeutronKiller: timeLimit(ns) = "
80  << timeThreshold/ns << G4endl;
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
87  kinEnergyThreshold = val;
88  if(verboseLevel > 0)
89  G4cout << "### G4NeutronKiller: Tracking cut E(MeV) = "
91 }
92 
93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94 
96  const G4Track& aTrack,
98 {
99  // condition is set to "Not Forced"
100  *condition = NotForced;
101 
102  return (aTrack.GetGlobalTime() > timeThreshold ||
103  aTrack.GetKineticEnergy() < kinEnergyThreshold) ? 0.0 : DBL_MAX;
104 }
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107 
110 {
111  return DBL_MAX;
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
117  const G4Step&)
118 {
119  pParticleChange->Initialize(aTrack);
121  return pParticleChange;
122 }
123 
124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......