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

#include <Doxymodules_optical.h>

Inheritance diagram for WLSEventAction:
G4UserEventAction

Public Member Functions

 WLSEventAction ()
 
 ~WLSEventAction () override
 
void BeginOfEventAction (const G4Event *) override
 
void EndOfEventAction (const G4Event *) override
 
G4int GetEventNo ()
 
void SetEventVerbose (G4int)
 
void AddTIR ()
 
void AddExiting ()
 
void AddEscapedEnd ()
 
void AddEscapedMid ()
 
void AddBounce ()
 
void AddWLSBounce ()
 
void AddClad1Bounce ()
 
void AddClad2Bounce ()
 
void AddReflected ()
 
void AddEscaped ()
 
void AddMirror ()
 

Private Attributes

WLSEventActionMessengerfEventMessenger = nullptr
 
G4int fVerboseLevel = 0
 
G4int fMPPCCollID = 0
 
G4int fNTIR = 0
 
G4int fNExiting = 0
 
G4int fEscapedEnd = 0
 
G4int fEscapedMid = 0
 
G4int fBounce = 0
 
G4int fWLSBounce = 0
 
G4int fClad1Bounce = 0
 
G4int fClad2Bounce = 0
 
G4int fReflected = 0
 
G4int fEscaped = 0
 
G4int fMirror = 0
 

Detailed Description

Definition at line 87 of file Doxymodules_optical.h.

Constructor & Destructor Documentation

◆ WLSEventAction()

WLSEventAction::WLSEventAction ( )

Definition at line 53 of file WLSEventAction.cc.

54{
56}
WLSEventActionMessenger * fEventMessenger

◆ ~WLSEventAction()

WLSEventAction::~WLSEventAction ( )
override

Definition at line 60 of file WLSEventAction.cc.

60{ delete fEventMessenger; }

Member Function Documentation

◆ BeginOfEventAction()

void WLSEventAction::BeginOfEventAction ( const G4Event )
override

Definition at line 64 of file WLSEventAction.cc.

65{
66 fNTIR = 0;
67 fNExiting = 0;
68 fEscapedEnd = 0;
69 fEscapedMid = 0;
70 fBounce = 0;
71 fWLSBounce = 0;
72 fClad1Bounce = 0;
73 fClad2Bounce = 0;
74 fReflected = 0;
75 fEscaped = 0;
76 fMirror = 0;
77}

◆ EndOfEventAction()

void WLSEventAction::EndOfEventAction ( const G4Event evt)
override

Definition at line 81 of file WLSEventAction.cc.

82{
83 // Get Hits from the detector if any
84 G4SDManager* SDman = G4SDManager::GetSDMpointer();
85 G4String colName = "PhotonDetHitCollection";
86 fMPPCCollID = SDman->GetCollectionID(colName);
87
88 G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
89 WLSPhotonDetHitsCollection* mppcHC = nullptr;
90
91 // Get the hit collections
92 if(HCE)
93 {
94 if(fMPPCCollID >= 0)
95 {
96 mppcHC = (WLSPhotonDetHitsCollection*) (HCE->GetHC(fMPPCCollID));
97 }
98 }
99
100 // Get hit information about photons that reached the detector in this event
101 G4int n_hit = 0;
102 if(mppcHC)
103 {
104 n_hit = mppcHC->entries();
105 }
106
107 auto analysisManager = G4AnalysisManager::Instance();
108 analysisManager->FillH1(2, mppcHC->entries());
109 for (size_t i = 0; i < mppcHC->entries(); ++i) {
110 auto pdHit = (*mppcHC)[i];
111 analysisManager->FillH1(0, pdHit->GetEnergy());
112 analysisManager->FillH1(1, pdHit->GetArrivalTime());
113 }
114
115 if(fVerboseLevel > 1)
116 {
117 G4cout << "-------------------------------------" << G4endl
118 << " In this event, number of:" << G4endl
119 << " TIR: " << fNTIR << G4endl
120 << " Exiting: " << fNExiting << G4endl
121 << " Escaped Mid: " << fEscapedMid << G4endl
122 << " Escaped End: " << fEscapedEnd << G4endl
123 << " Bounced: " << fBounce << G4endl
124 << " WLS Bounce: " << fWLSBounce << G4endl
125 << " Clad1 Bounce: " << fClad1Bounce << G4endl
126 << " Clad2 Bounce: " << fClad2Bounce << G4endl
127 << " Reflected: " << fReflected << G4endl
128 << " Escaped: " << fEscaped << G4endl
129 << " Mirror: " << fMirror << G4endl
130 << " Detector hit: " << n_hit << G4endl;
131 }
132
133 auto run = static_cast<WLSRun*>(
134 G4RunManager::GetRunManager()->GetNonConstCurrentRun());
135
136 run->AddTIR(fNTIR);
137 run->AddExiting(fNExiting);
138 run->AddEscapedEnd(fEscapedEnd);
139 run->AddEscapedMid(fEscapedMid);
140 run->AddBounce(fBounce);
141 run->AddClad1Bounce(fClad1Bounce);
142 run->AddClad2Bounce(fClad2Bounce);
143 run->AddReflected(fReflected);
144 run->AddEscaped(fEscaped);
145 run->AddMirror(fMirror);
146 run->AddDetectorHits(n_hit);
147}
G4THitsCollection< WLSPhotonDetHit > WLSPhotonDetHitsCollection
void AddTIR(G4int n)
Definition WLSRun.hh:45

◆ GetEventNo()

G4int WLSEventAction::GetEventNo ( )

Definition at line 151 of file WLSEventAction.cc.

152{
153 return fpEventManager->GetConstCurrentEvent()->GetEventID();
154}

◆ SetEventVerbose()

void WLSEventAction::SetEventVerbose ( G4int  level)

Definition at line 158 of file WLSEventAction.cc.

158{ fVerboseLevel = level; }

◆ AddTIR()

void WLSEventAction::AddTIR ( )
inline

Definition at line 54 of file WLSEventAction.hh.

54{ fNTIR += 1; };

◆ AddExiting()

void WLSEventAction::AddExiting ( )
inline

Definition at line 55 of file WLSEventAction.hh.

55{ fNExiting += 1; };

◆ AddEscapedEnd()

void WLSEventAction::AddEscapedEnd ( )
inline

Definition at line 56 of file WLSEventAction.hh.

56{ fEscapedEnd += 1; };

◆ AddEscapedMid()

void WLSEventAction::AddEscapedMid ( )
inline

Definition at line 57 of file WLSEventAction.hh.

57{ fEscapedMid += 1; };

◆ AddBounce()

void WLSEventAction::AddBounce ( )
inline

Definition at line 58 of file WLSEventAction.hh.

58{ fBounce += 1; };

◆ AddWLSBounce()

void WLSEventAction::AddWLSBounce ( )
inline

Definition at line 59 of file WLSEventAction.hh.

59{ fWLSBounce += 1; };

◆ AddClad1Bounce()

void WLSEventAction::AddClad1Bounce ( )
inline

Definition at line 60 of file WLSEventAction.hh.

60{ fClad1Bounce += 1; };

◆ AddClad2Bounce()

void WLSEventAction::AddClad2Bounce ( )
inline

Definition at line 61 of file WLSEventAction.hh.

61{ fClad2Bounce += 1; };

◆ AddReflected()

void WLSEventAction::AddReflected ( )
inline

Definition at line 62 of file WLSEventAction.hh.

62{ fReflected += 1; };

◆ AddEscaped()

void WLSEventAction::AddEscaped ( )
inline

Definition at line 63 of file WLSEventAction.hh.

63{ fEscaped += 1; };

◆ AddMirror()

void WLSEventAction::AddMirror ( )
inline

Definition at line 64 of file WLSEventAction.hh.

64{ fMirror += 1; };

Member Data Documentation

◆ fEventMessenger

WLSEventActionMessenger* WLSEventAction::fEventMessenger = nullptr
private

Definition at line 67 of file WLSEventAction.hh.

◆ fVerboseLevel

G4int WLSEventAction::fVerboseLevel = 0
private

Definition at line 69 of file WLSEventAction.hh.

◆ fMPPCCollID

G4int WLSEventAction::fMPPCCollID = 0
private

Definition at line 71 of file WLSEventAction.hh.

◆ fNTIR

G4int WLSEventAction::fNTIR = 0
private

Definition at line 73 of file WLSEventAction.hh.

◆ fNExiting

G4int WLSEventAction::fNExiting = 0
private

Definition at line 74 of file WLSEventAction.hh.

◆ fEscapedEnd

G4int WLSEventAction::fEscapedEnd = 0
private

Definition at line 75 of file WLSEventAction.hh.

◆ fEscapedMid

G4int WLSEventAction::fEscapedMid = 0
private

Definition at line 76 of file WLSEventAction.hh.

◆ fBounce

G4int WLSEventAction::fBounce = 0
private

Definition at line 77 of file WLSEventAction.hh.

◆ fWLSBounce

G4int WLSEventAction::fWLSBounce = 0
private

Definition at line 78 of file WLSEventAction.hh.

◆ fClad1Bounce

G4int WLSEventAction::fClad1Bounce = 0
private

Definition at line 79 of file WLSEventAction.hh.

◆ fClad2Bounce

G4int WLSEventAction::fClad2Bounce = 0
private

Definition at line 80 of file WLSEventAction.hh.

◆ fReflected

G4int WLSEventAction::fReflected = 0
private

Definition at line 81 of file WLSEventAction.hh.

◆ fEscaped

G4int WLSEventAction::fEscaped = 0
private

Definition at line 82 of file WLSEventAction.hh.

◆ fMirror

G4int WLSEventAction::fMirror = 0
private

Definition at line 83 of file WLSEventAction.hh.


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

Applications | User Support | Publications | Collaboration