#include <G4ImportanceAlgorithm.hh>
Definition at line 41 of file G4ImportanceAlgorithm.hh.
◆ G4ImportanceAlgorithm()
G4ImportanceAlgorithm::G4ImportanceAlgorithm |
( |
| ) |
|
|
default |
◆ ~G4ImportanceAlgorithm()
G4ImportanceAlgorithm::~G4ImportanceAlgorithm |
( |
| ) |
|
|
overridedefault |
◆ Calculate()
Implements G4VImportanceAlgorithm.
Definition at line 50 of file G4ImportanceAlgorithm.cc.
53{
56 if (ipost>0.)
57 {
58 if (!(ipre>0.))
59 {
60 Error("Calculate() - ipre==0.");
61 }
62 G4double ipre_over_ipost = ipre/ipost;
63 if ((ipre_over_ipost<0.25 || ipre_over_ipost> 4) && !fWarned)
64 {
65 std::ostringstream os;
66 os <<
"Calculate() - ipre_over_ipost ! in [0.25, 4]." <<
G4endl
67 << "ipre_over_ipost = " << ipre_over_ipost << ".";
68 Warning(os.str());
69 fWarned = true;
70 if (ipre_over_ipost<=0)
71 {
72 Error("Calculate() - ipre_over_ipost<=0.");
73 }
74 }
75 if (init_w<=0.)
76 {
77 Error("Calculate() - iniitweight<= 0. found!");
78 }
79
80
81
82
84 nw.
fN =
static_cast<G4int>(inv);
85 nw.
fW = init_w * ipre_over_ipost;
86
87
88 if (ipre_over_ipost<1)
89 {
91 {
92
93
95
97 if (r<p)
98 {
100 }
101 }
102 }
103 else if (ipre_over_ipost>1)
104 {
105
107
109 if (r<p)
110 {
111
114 }
115 else
116 {
118 }
119 }
120 }
121 l.unlock();
122
123 return nw;
124}
The documentation for this class was generated from the following files: