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

#include <OpNoviceRun.hh>

Inheritance diagram for OpNoviceRun:
G4Run

Public Member Functions

 OpNoviceRun ()=default
 
 ~OpNoviceRun () override=default
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void AddCerenkov (G4double n)
 
void AddScintillation (G4double n)
 
void AddRayleigh (G4double n)
 
void AddAbsorption (G4double n)
 
void AddMie (G4double n)
 
void AddBoundary (G4double n)
 
void Merge (const G4Run *) override
 
void EndOfRun ()
 

Private Attributes

G4ParticleDefinitionfParticle = nullptr
 
G4double fCerenkovCounter = 0.
 
G4double fCerenkov2 = 0.
 
G4double fScintillationCounter = 0.
 
G4double fScintillation2 = 0.
 
G4double fRayleighCounter = 0.
 
G4double fRayleigh2 = 0.
 
G4double fAbsorptionCounter = 0.
 
G4double fAbsorption2 = 0.
 
G4double fMieCounter = 0.
 
G4double fMie2 = 0.
 
G4double fBoundaryCounter = 0.
 
G4double fBoundary2 = 0.
 
G4double fEnergy = -1.
 

Detailed Description

Definition at line 43 of file OpNoviceRun.hh.

Constructor & Destructor Documentation

◆ OpNoviceRun()

OpNoviceRun::OpNoviceRun ( )
default

◆ ~OpNoviceRun()

OpNoviceRun::~OpNoviceRun ( )
overridedefault

Member Function Documentation

◆ SetPrimary()

void OpNoviceRun::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)

Definition at line 41 of file OpNoviceRun.cc.

42{
43 fParticle = particle;
44 fEnergy = energy;
45}
G4double fEnergy
G4ParticleDefinition * fParticle

◆ AddCerenkov()

void OpNoviceRun::AddCerenkov ( G4double  n)
inline

Definition at line 51 of file OpNoviceRun.hh.

52 {
54 fCerenkov2 += n * n;
55 };
G4double fCerenkov2
G4double fCerenkovCounter

◆ AddScintillation()

void OpNoviceRun::AddScintillation ( G4double  n)
inline

Definition at line 56 of file OpNoviceRun.hh.

57 {
59 fScintillation2 += n * n;
60 };
G4double fScintillationCounter
G4double fScintillation2

◆ AddRayleigh()

void OpNoviceRun::AddRayleigh ( G4double  n)
inline

Definition at line 61 of file OpNoviceRun.hh.

62 {
64 fRayleigh2 += n * n;
65 };
G4double fRayleigh2
G4double fRayleighCounter

◆ AddAbsorption()

void OpNoviceRun::AddAbsorption ( G4double  n)
inline

Definition at line 66 of file OpNoviceRun.hh.

67 {
69 fAbsorption2 += n * n;
70 };
G4double fAbsorptionCounter
G4double fAbsorption2

◆ AddMie()

void OpNoviceRun::AddMie ( G4double  n)
inline

Definition at line 71 of file OpNoviceRun.hh.

72 {
73 fMieCounter += n;
74 fMie2 += n * n;
75 };
G4double fMie2
G4double fMieCounter

◆ AddBoundary()

void OpNoviceRun::AddBoundary ( G4double  n)
inline

Definition at line 76 of file OpNoviceRun.hh.

77 {
79 fBoundary2 += n * n;
80 };
G4double fBoundaryCounter
G4double fBoundary2

◆ Merge()

void OpNoviceRun::Merge ( const G4Run run)
override

Definition at line 49 of file OpNoviceRun.cc.

50{
51 const auto localRun = static_cast<const OpNoviceRun*>(run);
52
53 fParticle = localRun->fParticle;
54 fEnergy = localRun->fEnergy;
55
56 fCerenkovCounter += localRun->fCerenkovCounter;
57 fCerenkov2 += localRun->fCerenkov2;
58 fScintillationCounter += localRun->fScintillationCounter;
59 fScintillation2 += localRun->fScintillation2;
60
61 fRayleighCounter += localRun->fRayleighCounter;
62 fRayleigh2 += localRun->fRayleigh2;
63 fAbsorptionCounter += localRun->fAbsorptionCounter;
64 fAbsorption2 += localRun->fAbsorption2;
65 fMieCounter += localRun->fMieCounter;
66 fMie2 += localRun->fMie2;
67 fBoundaryCounter += localRun->fBoundaryCounter;
68 fBoundary2 += localRun->fBoundary2;
69
70 G4Run::Merge(run);
71}

◆ EndOfRun()

void OpNoviceRun::EndOfRun ( )

Definition at line 74 of file OpNoviceRun.cc.

75{
76 if(numberOfEvent == 0)
77 return;
78 auto TotNbofEvents = G4double(numberOfEvent);
79
80 fCerenkovCounter /= TotNbofEvents;
81 fCerenkov2 /= TotNbofEvents;
82 G4double rmsCerenkov = fCerenkov2 - fCerenkovCounter * fCerenkovCounter;
83 if(rmsCerenkov > 0.)
84 rmsCerenkov = std::sqrt(rmsCerenkov);
85 else
86 rmsCerenkov = 0.;
87
88 fScintillationCounter /= TotNbofEvents;
89 fScintillation2 /= TotNbofEvents;
90 G4double rmsScint =
92 if(rmsScint > 0.)
93 rmsScint = std::sqrt(rmsScint);
94 else
95 rmsScint = 0.;
96
97 fRayleighCounter /= TotNbofEvents;
98 fRayleigh2 /= TotNbofEvents;
99 G4double rmsRayleigh = fRayleigh2 - fRayleighCounter * fRayleighCounter;
100 if(rmsRayleigh > 0.)
101 rmsRayleigh = std::sqrt(rmsRayleigh);
102 else
103 rmsRayleigh = 0.;
104
105 fAbsorptionCounter /= TotNbofEvents;
106 fAbsorption2 /= TotNbofEvents;
107 G4double rmsAbsorption =
109 if(rmsAbsorption > 0.)
110 rmsAbsorption = std::sqrt(rmsAbsorption);
111 else
112 rmsAbsorption = 0.;
113
114 fMieCounter /= TotNbofEvents;
115 fMie2 /= TotNbofEvents;
116 G4double rmsMie = fMie2 - fMieCounter * fMieCounter;
117 if(rmsMie > 0.)
118 rmsMie = std::sqrt(rmsMie);
119 else
120 rmsMie = 0.;
121
122 fBoundaryCounter /= TotNbofEvents;
123 fBoundary2 /= TotNbofEvents;
124 G4double rmsBoundary = fBoundary2 - fBoundaryCounter * fBoundaryCounter;
125 if(rmsBoundary > 0.)
126 rmsBoundary = std::sqrt(rmsBoundary);
127 else
128 rmsBoundary = 0.;
129
130 G4int prec = G4cout.precision(3);
131 G4cout << "\n ======================== run summary ======================\n";
132
133 G4cout << "Primary particle was: " << fParticle->GetParticleName()
134 << " with energy " << G4BestUnit(fEnergy, "Energy") << "." << G4endl;
135 G4cout << "Number of events: " << numberOfEvent << G4endl;
136
137 G4cout << "Average number of Cerenkov photons created per event: "
138 << fCerenkovCounter << " +- " << rmsCerenkov << G4endl;
139 G4cout << "Average number of scintillation photons created per event: "
140 << fScintillationCounter << " +- " << rmsScint << G4endl;
141
142 G4cout << "Average number of optical Rayleigh interactions per event: "
143 << fRayleighCounter << " +- " << rmsRayleigh << G4endl;
144 G4cout << "Average number of optical absorption interactions per event: "
145 << fAbsorptionCounter << " +- " << rmsAbsorption << G4endl;
146 G4cout << "Average number of optical Mie interactions per event: "
147 << fMieCounter << " +- " << rmsMie << G4endl;
148 G4cout << "Average number of optical boundary interactions per event: "
149 << fBoundaryCounter << " +- " << rmsBoundary << G4endl;
150
151 G4cout << G4endl;
152 G4cout.precision(prec);
153}

Member Data Documentation

◆ fParticle

G4ParticleDefinition* OpNoviceRun::fParticle = nullptr
private

Definition at line 86 of file OpNoviceRun.hh.

◆ fCerenkovCounter

G4double OpNoviceRun::fCerenkovCounter = 0.
private

Definition at line 88 of file OpNoviceRun.hh.

◆ fCerenkov2

G4double OpNoviceRun::fCerenkov2 = 0.
private

Definition at line 89 of file OpNoviceRun.hh.

◆ fScintillationCounter

G4double OpNoviceRun::fScintillationCounter = 0.
private

Definition at line 90 of file OpNoviceRun.hh.

◆ fScintillation2

G4double OpNoviceRun::fScintillation2 = 0.
private

Definition at line 91 of file OpNoviceRun.hh.

◆ fRayleighCounter

G4double OpNoviceRun::fRayleighCounter = 0.
private

Definition at line 92 of file OpNoviceRun.hh.

◆ fRayleigh2

G4double OpNoviceRun::fRayleigh2 = 0.
private

Definition at line 93 of file OpNoviceRun.hh.

◆ fAbsorptionCounter

G4double OpNoviceRun::fAbsorptionCounter = 0.
private

Definition at line 94 of file OpNoviceRun.hh.

◆ fAbsorption2

G4double OpNoviceRun::fAbsorption2 = 0.
private

Definition at line 95 of file OpNoviceRun.hh.

◆ fMieCounter

G4double OpNoviceRun::fMieCounter = 0.
private

Definition at line 96 of file OpNoviceRun.hh.

◆ fMie2

G4double OpNoviceRun::fMie2 = 0.
private

Definition at line 97 of file OpNoviceRun.hh.

◆ fBoundaryCounter

G4double OpNoviceRun::fBoundaryCounter = 0.
private

Definition at line 98 of file OpNoviceRun.hh.

◆ fBoundary2

G4double OpNoviceRun::fBoundary2 = 0.
private

Definition at line 99 of file OpNoviceRun.hh.

◆ fEnergy

G4double OpNoviceRun::fEnergy = -1.
private

Definition at line 100 of file OpNoviceRun.hh.


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

Applications | User Support | Publications | Collaboration