Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
WLSRun Class Reference

#include <WLSRun.hh>

Inheritance diagram for WLSRun:
G4Run

Public Member Functions

 WLSRun ()=default
 
 ~WLSRun () override=default
 
void AddTIR (G4int n)
 
void AddExiting (G4int n)
 
void AddEscapedEnd (G4int n)
 
void AddEscapedMid (G4int n)
 
void AddBounce (G4int n)
 
void AddWLSBounce (G4int n)
 
void AddClad1Bounce (G4int n)
 
void AddClad2Bounce (G4int n)
 
void AddReflected (G4int n)
 
void AddEscaped (G4int n)
 
void AddMirror (G4int n)
 
void AddDetectorHits (G4int n)
 
void EndOfRun ()
 
void Merge (const G4Run *) override
 

Private Attributes

G4double fNTIR = 0.
 
G4double fNTIR2 = 0.
 
G4double fNExiting = 0.
 
G4double fNExiting2 = 0.
 
G4double fEscapedEnd = 0.
 
G4double fEscapedEnd2 = 0.
 
G4double fEscapedMid = 0.
 
G4double fEscapedMid2 = 0.
 
G4double fBounce = 0.
 
G4double fBounce2 = 0.
 
G4double fWLSBounce = 0.
 
G4double fWLSBounce2 = 0.
 
G4double fClad1Bounce = 0.
 
G4double fClad1Bounce2 = 0.
 
G4double fClad2Bounce = 0.
 
G4double fClad2Bounce2 = 0.
 
G4double fReflected = 0.
 
G4double fReflected2 = 0.
 
G4double fEscaped = 0.
 
G4double fEscaped2 = 0.
 
G4double fMirror = 0.
 
G4double fMirror2 = 0.
 
G4double fDetectorHits = 0.
 
G4double fDetectorHits2 = 0.
 

Detailed Description

Definition at line 39 of file WLSRun.hh.

Constructor & Destructor Documentation

◆ WLSRun()

WLSRun::WLSRun ( )
default

◆ ~WLSRun()

WLSRun::~WLSRun ( )
overridedefault

Member Function Documentation

◆ AddTIR()

void WLSRun::AddTIR ( G4int  n)
inline

Definition at line 45 of file WLSRun.hh.

46 {
47 G4double nd(n);
48 fNTIR += nd;
49 fNTIR2 += nd * nd;
50 };
G4double fNTIR2
Definition WLSRun.hh:123
G4double fNTIR
Definition WLSRun.hh:122

◆ AddExiting()

void WLSRun::AddExiting ( G4int  n)
inline

Definition at line 51 of file WLSRun.hh.

52 {
53 G4double nd(n);
54 fNExiting += nd;
55 fNExiting2 += nd * nd;
56 };
G4double fNExiting
Definition WLSRun.hh:124
G4double fNExiting2
Definition WLSRun.hh:125

◆ AddEscapedEnd()

void WLSRun::AddEscapedEnd ( G4int  n)
inline

Definition at line 57 of file WLSRun.hh.

58 {
59 G4double nd(n);
60 fEscapedEnd += nd;
61 fEscapedEnd2 += nd * nd;
62 };
G4double fEscapedEnd
Definition WLSRun.hh:126
G4double fEscapedEnd2
Definition WLSRun.hh:127

◆ AddEscapedMid()

void WLSRun::AddEscapedMid ( G4int  n)
inline

Definition at line 63 of file WLSRun.hh.

64 {
65 G4double nd(n);
66 fEscapedMid += nd;
67 fEscapedMid2 += nd * nd;
68 };
G4double fEscapedMid2
Definition WLSRun.hh:129
G4double fEscapedMid
Definition WLSRun.hh:128

◆ AddBounce()

void WLSRun::AddBounce ( G4int  n)
inline

Definition at line 69 of file WLSRun.hh.

70 {
71 G4double nd(n);
72 fBounce += nd;
73 fBounce2 += nd * nd;
74 };
G4double fBounce
Definition WLSRun.hh:130
G4double fBounce2
Definition WLSRun.hh:131

◆ AddWLSBounce()

void WLSRun::AddWLSBounce ( G4int  n)
inline

Definition at line 75 of file WLSRun.hh.

76 {
77 G4double nd(n);
78 fWLSBounce += nd;
79 fWLSBounce2 += nd * nd;
80 };
G4double fWLSBounce
Definition WLSRun.hh:132
G4double fWLSBounce2
Definition WLSRun.hh:133

◆ AddClad1Bounce()

void WLSRun::AddClad1Bounce ( G4int  n)
inline

Definition at line 81 of file WLSRun.hh.

82 {
83 G4double nd(n);
84 fClad1Bounce += nd;
85 fClad1Bounce2 += nd * nd;
86 };
G4double fClad1Bounce
Definition WLSRun.hh:134
G4double fClad1Bounce2
Definition WLSRun.hh:135

◆ AddClad2Bounce()

void WLSRun::AddClad2Bounce ( G4int  n)
inline

Definition at line 87 of file WLSRun.hh.

88 {
89 G4double nd(n);
90 fClad2Bounce += nd;
91 fClad2Bounce2 += nd * nd;
92 };
G4double fClad2Bounce2
Definition WLSRun.hh:137
G4double fClad2Bounce
Definition WLSRun.hh:136

◆ AddReflected()

void WLSRun::AddReflected ( G4int  n)
inline

Definition at line 93 of file WLSRun.hh.

94 {
95 G4double nd(n);
96 fReflected += nd;
97 fReflected2 += nd * nd;
98 };
G4double fReflected
Definition WLSRun.hh:138
G4double fReflected2
Definition WLSRun.hh:139

◆ AddEscaped()

void WLSRun::AddEscaped ( G4int  n)
inline

Definition at line 99 of file WLSRun.hh.

100 {
101 G4double nd(n);
102 fEscaped += nd;
103 fEscaped2 += nd * nd;
104 };
G4double fEscaped2
Definition WLSRun.hh:141
G4double fEscaped
Definition WLSRun.hh:140

◆ AddMirror()

void WLSRun::AddMirror ( G4int  n)
inline

Definition at line 105 of file WLSRun.hh.

106 {
107 G4double nd(n);
108 fMirror += nd;
109 fMirror2 += nd * nd;
110 };
G4double fMirror2
Definition WLSRun.hh:143
G4double fMirror
Definition WLSRun.hh:142

◆ AddDetectorHits()

void WLSRun::AddDetectorHits ( G4int  n)
inline

Definition at line 111 of file WLSRun.hh.

112 {
113 G4double nd(n);
114 fDetectorHits += nd;
115 fDetectorHits2 += nd * nd;
116 };
G4double fDetectorHits2
Definition WLSRun.hh:145
G4double fDetectorHits
Definition WLSRun.hh:144

◆ EndOfRun()

void WLSRun::EndOfRun ( )

Definition at line 70 of file WLSRun.cc.

71{
72 if(numberOfEvent == 0)
73 return;
74 auto TotNbofEvents = G4double(numberOfEvent);
75
76 fNTIR = fNTIR / TotNbofEvents;
77 fNTIR2 = fNTIR2 / TotNbofEvents;
78 G4double rmsTIR = fNTIR2 - fNTIR * fNTIR;
79 if(rmsTIR > 0.)
80 rmsTIR = std::sqrt(rmsTIR);
81 else
82 rmsTIR = 0.;
83
84 fNExiting = fNExiting / TotNbofEvents;
85 fNExiting2 = fNExiting2 / TotNbofEvents;
86 G4double rmsExiting = fNExiting2 - fNExiting * fNExiting;
87 if(rmsExiting > 0.)
88 rmsExiting = std::sqrt(rmsExiting);
89 else
90 rmsExiting = 0.;
91
92 fEscapedEnd = fEscapedEnd / TotNbofEvents;
93 fEscapedEnd2 = fEscapedEnd2 / TotNbofEvents;
94 G4double rmsEscapedEnd = fEscapedEnd2 - fEscapedEnd * fEscapedEnd;
95 if(rmsEscapedEnd > 0.)
96 rmsEscapedEnd = std::sqrt(rmsEscapedEnd);
97 else
98 rmsEscapedEnd = 0.;
99
100 fEscapedMid = fEscapedMid / TotNbofEvents;
101 fEscapedMid2 = fEscapedMid2 / TotNbofEvents;
102 G4double rmsEscapedMid = fEscapedMid2 - fEscapedMid * fEscapedMid;
103 if(rmsEscapedMid > 0.)
104 rmsEscapedMid = std::sqrt(rmsEscapedMid);
105 else
106 rmsEscapedMid = 0.;
107
108 fBounce = fBounce / TotNbofEvents;
109 fBounce2 = fBounce2 / TotNbofEvents;
110 G4double rmsBounce = fBounce2 - fBounce * fBounce;
111 if(rmsBounce > 0.)
112 rmsBounce = std::sqrt(rmsBounce);
113 else
114 rmsBounce = 0.;
115
116 fWLSBounce = fWLSBounce / TotNbofEvents;
117 fWLSBounce2 = fWLSBounce2 / TotNbofEvents;
118 G4double rmsWLSBounce = fWLSBounce2 - fWLSBounce * fWLSBounce;
119 if(rmsWLSBounce > 0.)
120 rmsWLSBounce = std::sqrt(rmsWLSBounce);
121 else
122 rmsWLSBounce = 0.;
123
124 fClad1Bounce = fClad1Bounce / TotNbofEvents;
125 fClad1Bounce2 = fClad1Bounce2 / TotNbofEvents;
126 G4double rmsClad1Bounce = fClad1Bounce2 - fClad1Bounce * fClad1Bounce;
127 if(rmsClad1Bounce > 0.)
128 rmsClad1Bounce = std::sqrt(rmsClad1Bounce);
129 else
130 rmsClad1Bounce = 0.;
131
132 fClad2Bounce = fClad2Bounce / TotNbofEvents;
133 fClad2Bounce2 = fClad2Bounce2 / TotNbofEvents;
134 G4double rmsClad2Bounce = fClad2Bounce2 - fClad2Bounce * fClad2Bounce;
135 if(rmsClad2Bounce > 0.)
136 rmsClad2Bounce = std::sqrt(rmsClad2Bounce);
137 else
138 rmsClad2Bounce = 0.;
139
140 fReflected = fReflected / TotNbofEvents;
141 fReflected2 = fReflected2 / TotNbofEvents;
142 G4double rmsReflected = fReflected2 - fReflected * fReflected;
143 if(rmsReflected > 0.)
144 rmsReflected = std::sqrt(rmsReflected);
145 else
146 rmsReflected = 0.;
147
148 fEscaped = fEscaped / TotNbofEvents;
149 fEscaped2 = fEscaped2 / TotNbofEvents;
150 G4double rmsEscaped = fEscaped2 - fEscaped * fEscaped;
151 if(rmsEscaped > 0.)
152 rmsEscaped = std::sqrt(rmsEscaped);
153 else
154 rmsEscaped = 0.;
155
156 fMirror = fMirror / TotNbofEvents;
157 fMirror2 = fMirror2 / TotNbofEvents;
158 G4double rmsMirror = fMirror2 - fMirror * fMirror;
159 if(rmsMirror > 0.)
160 rmsMirror = std::sqrt(rmsMirror);
161 else
162 rmsMirror = 0.;
163
164 fDetectorHits = fDetectorHits / TotNbofEvents;
165 fDetectorHits2 = fDetectorHits2 / TotNbofEvents;
166 G4double rmsDetectorHits = fDetectorHits2 - fDetectorHits * fDetectorHits;
167 if(rmsDetectorHits > 0.)
168 rmsDetectorHits = std::sqrt(rmsDetectorHits);
169 else
170 rmsDetectorHits = 0.;
171
172 G4int prec = G4cout.precision(3);
173 G4cout << "\n ======================== run summary =====================\n";
174 G4cout << "Average number per event:" << G4endl;
175 G4cout << " TIR: " << fNTIR << " +- " << rmsTIR << G4endl
176 << " Exiting: " << fNExiting << " +- " << rmsExiting << G4endl
177 << " Escaped Mid: " << fEscapedMid << " +- " << rmsEscapedMid
178 << G4endl << " Escaped End: " << fEscapedEnd << " +- "
179 << rmsEscapedEnd << G4endl << " Bounced: " << fBounce << " +- "
180 << rmsBounce << G4endl << " WLS Bounce: " << fWLSBounce << " +- "
181 << rmsWLSBounce << G4endl << " Clad1 Bounce: " << fClad1Bounce
182 << " +- " << rmsClad1Bounce << G4endl
183 << " Clad2 Bounce: " << fClad2Bounce << " +- " << rmsClad2Bounce
184 << G4endl << " Reflected: " << fReflected << " +- " << rmsReflected
185 << G4endl << " Escaped: " << fEscaped << " +- " << rmsEscaped
186 << G4endl << " Mirror: " << fMirror << " +- " << rmsMirror
187 << G4endl << " Detector hit: " << fDetectorHits << " +- "
188 << rmsDetectorHits << G4endl;
189
190 G4cout << G4endl;
191 G4cout.precision(prec);
192}

◆ Merge()

void WLSRun::Merge ( const G4Run run)
override

Definition at line 36 of file WLSRun.cc.

37{
38 const auto localRun = static_cast<const WLSRun*>(run);
39
40 fNTIR += localRun->fNTIR;
41 fNTIR2 += localRun->fNTIR2;
42 fNExiting += localRun->fNExiting;
43 fNExiting2 += localRun->fNExiting2;
44 fEscapedEnd += localRun->fEscapedEnd;
45 fEscapedEnd2 += localRun->fEscapedEnd2;
46 fEscapedMid += localRun->fEscapedMid;
47 fEscapedMid2 += localRun->fEscapedMid2;
48 fBounce += localRun->fBounce;
49 fBounce2 += localRun->fBounce2;
50 fWLSBounce += localRun->fWLSBounce;
51 fWLSBounce2 += localRun->fWLSBounce2;
52 fClad1Bounce += localRun->fClad1Bounce;
53 fClad1Bounce2 += localRun->fClad1Bounce2;
54 fClad2Bounce += localRun->fClad2Bounce;
55 fClad2Bounce2 += localRun->fClad2Bounce2;
56 fReflected += localRun->fReflected;
57 fReflected2 += localRun->fReflected2;
58 fEscaped += localRun->fEscaped;
59 fEscaped2 += localRun->fEscaped2;
60 fMirror += localRun->fMirror;
61 fMirror2 += localRun->fMirror2;
62 fDetectorHits += localRun->fDetectorHits;
63 fDetectorHits2 += localRun->fDetectorHits2;
64
65 G4Run::Merge(run);
66}

Member Data Documentation

◆ fNTIR

G4double WLSRun::fNTIR = 0.
private

Definition at line 122 of file WLSRun.hh.

◆ fNTIR2

G4double WLSRun::fNTIR2 = 0.
private

Definition at line 123 of file WLSRun.hh.

◆ fNExiting

G4double WLSRun::fNExiting = 0.
private

Definition at line 124 of file WLSRun.hh.

◆ fNExiting2

G4double WLSRun::fNExiting2 = 0.
private

Definition at line 125 of file WLSRun.hh.

◆ fEscapedEnd

G4double WLSRun::fEscapedEnd = 0.
private

Definition at line 126 of file WLSRun.hh.

◆ fEscapedEnd2

G4double WLSRun::fEscapedEnd2 = 0.
private

Definition at line 127 of file WLSRun.hh.

◆ fEscapedMid

G4double WLSRun::fEscapedMid = 0.
private

Definition at line 128 of file WLSRun.hh.

◆ fEscapedMid2

G4double WLSRun::fEscapedMid2 = 0.
private

Definition at line 129 of file WLSRun.hh.

◆ fBounce

G4double WLSRun::fBounce = 0.
private

Definition at line 130 of file WLSRun.hh.

◆ fBounce2

G4double WLSRun::fBounce2 = 0.
private

Definition at line 131 of file WLSRun.hh.

◆ fWLSBounce

G4double WLSRun::fWLSBounce = 0.
private

Definition at line 132 of file WLSRun.hh.

◆ fWLSBounce2

G4double WLSRun::fWLSBounce2 = 0.
private

Definition at line 133 of file WLSRun.hh.

◆ fClad1Bounce

G4double WLSRun::fClad1Bounce = 0.
private

Definition at line 134 of file WLSRun.hh.

◆ fClad1Bounce2

G4double WLSRun::fClad1Bounce2 = 0.
private

Definition at line 135 of file WLSRun.hh.

◆ fClad2Bounce

G4double WLSRun::fClad2Bounce = 0.
private

Definition at line 136 of file WLSRun.hh.

◆ fClad2Bounce2

G4double WLSRun::fClad2Bounce2 = 0.
private

Definition at line 137 of file WLSRun.hh.

◆ fReflected

G4double WLSRun::fReflected = 0.
private

Definition at line 138 of file WLSRun.hh.

◆ fReflected2

G4double WLSRun::fReflected2 = 0.
private

Definition at line 139 of file WLSRun.hh.

◆ fEscaped

G4double WLSRun::fEscaped = 0.
private

Definition at line 140 of file WLSRun.hh.

◆ fEscaped2

G4double WLSRun::fEscaped2 = 0.
private

Definition at line 141 of file WLSRun.hh.

◆ fMirror

G4double WLSRun::fMirror = 0.
private

Definition at line 142 of file WLSRun.hh.

◆ fMirror2

G4double WLSRun::fMirror2 = 0.
private

Definition at line 143 of file WLSRun.hh.

◆ fDetectorHits

G4double WLSRun::fDetectorHits = 0.
private

Definition at line 144 of file WLSRun.hh.

◆ fDetectorHits2

G4double WLSRun::fDetectorHits2 = 0.
private

Definition at line 145 of file WLSRun.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration