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

#include <Doxymodules_optical.h>

Inheritance diagram for WLSRunAction:
G4UserRunAction

Public Member Functions

 WLSRunAction ()
 
 ~WLSRunAction () override=default
 
void BeginOfRunAction (const G4Run *) override
 
void EndOfRunAction (const G4Run *) override
 
G4RunGenerateRun () override
 

Private Attributes

WLSRunfRun = nullptr
 

Detailed Description

Definition at line 98 of file Doxymodules_optical.h.

Constructor & Destructor Documentation

◆ WLSRunAction()

WLSRunAction::WLSRunAction ( )

Definition at line 45 of file WLSRunAction.cc.

46{
47 auto analysisManager = G4AnalysisManager::Instance();
48
49 analysisManager->SetDefaultFileType("root");
50 analysisManager->SetVerboseLevel(1);
51 G4cout << "Using " << analysisManager->GetType() << G4endl;
52
53 analysisManager->CreateH1("Energy", "Energy of optical photon", 100,
54 2.*CLHEP::eV, 3.2*CLHEP::eV);
55 analysisManager->CreateH1("Time", "Arrival time", 100, 0., 100.*CLHEP::ns);
56 analysisManager->CreateH1("Number of photons", "Number of photons", 100, 0., 100.);
57}

◆ ~WLSRunAction()

WLSRunAction::~WLSRunAction ( )
overridedefault

Member Function Documentation

◆ BeginOfRunAction()

void WLSRunAction::BeginOfRunAction ( const G4Run )
override

Definition at line 69 of file WLSRunAction.cc.

70{
71 G4AnalysisManager::Instance()->OpenFile("wls");
72}

◆ EndOfRunAction()

void WLSRunAction::EndOfRunAction ( const G4Run )
override

Definition at line 76 of file WLSRunAction.cc.

77{
78 auto analysisManager = G4AnalysisManager::Instance();
79 if (analysisManager->GetH1(0)) {
80 G4cout << G4endl << " ----> print histograms statistics ";
81 if(isMaster)
82 {
83 G4cout << "for the entire run " << G4endl << G4endl;
84 }
85 else {
86 G4cout << "for the local thread " << G4endl << G4endl;
87 }
88
89 G4cout << " Mean number of photons detected/event: "
90 << analysisManager->GetH1(2)->mean()
91 << " rms = "
92 << analysisManager->GetH1(2)->rms() << G4endl;
93 }
94
95 analysisManager->Write();
96 analysisManager->CloseFile();
97
98 if(isMaster)
99 fRun->EndOfRun();
100}
WLSRun * fRun
void EndOfRun()
Definition WLSRun.cc:70

◆ GenerateRun()

G4Run * WLSRunAction::GenerateRun ( )
override

Definition at line 61 of file WLSRunAction.cc.

62{
63 fRun = new WLSRun();
64 return fRun;
65}

Member Data Documentation

◆ fRun

WLSRun* WLSRunAction::fRun = nullptr
private

Definition at line 53 of file WLSRunAction.hh.


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

Applications | User Support | Publications | Collaboration