Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
B4b::RunData Class Reference
basic » B4 » B4b

Run data class. More...

#include <Doxymodules_basic.h>

Inheritance diagram for B4b::RunData:
G4Run

Public Member Functions

 RunData ()=default
 
 ~RunData () override=default
 
void Add (G4int id, G4double de, G4double dl)
 
void FillPerEvent ()
 
void Reset ()
 
G4String GetVolumeName (G4int id) const
 
G4double GetEdep (G4int id) const
 
G4double GetTrackLength (G4int id) const
 

Private Attributes

std::array< G4String, kDimfVolumeNames = { "Absorber", "Gap" }
 
std::array< G4double, kDimfEdep = { 0., 0. }
 
std::array< G4double, kDimfTrackLength = { 0., 0. }
 

Detailed Description

Run data class.

It defines data members to hold the energy deposit and track lengths of charged particles in Absober and Gap layers.

In order to reduce the number of data members a 2-dimensions array is introduced for each quantity:

The data are collected step by step in SteppingAction, and the accumulated values are filled in histograms and a Ntuple event by event in EventAction.

Definition at line 143 of file Doxymodules_basic.h.

Constructor & Destructor Documentation

◆ RunData()

B4b::RunData::RunData ( )
default

◆ ~RunData()

B4b::RunData::~RunData ( )
overridedefault

Member Function Documentation

◆ Add()

void B4b::RunData::Add ( G4int  id,
G4double  de,
G4double  dl 
)
inline

Definition at line 84 of file RunData.hh.

84 {
85 fEdep[id] += de;
86 fTrackLength[id] += dl;
87}
std::array< G4double, kDim > fTrackLength
Definition RunData.hh:79
std::array< G4double, kDim > fEdep
Definition RunData.hh:78

◆ FillPerEvent()

void B4b::RunData::FillPerEvent ( )

Definition at line 41 of file RunData.cc.

42{
43 // get analysis manager
44 auto analysisManager = G4AnalysisManager::Instance();
45
46 // accumulate statistic
47 // in the order of the histograms, ntuple columns declarations
48 G4int counter = 0;
49 for ( auto edep : fEdep ) {
50 analysisManager->FillH1(counter, edep);
51 analysisManager->FillNtupleDColumn(counter++, edep);
52 }
53 for ( auto trackLength : fTrackLength ) {
54 analysisManager->FillH1(counter, trackLength);
55 analysisManager->FillNtupleDColumn(counter++, trackLength);
56 }
57
58 analysisManager->AddNtupleRow();
59}

◆ Reset()

void B4b::RunData::Reset ( )

Definition at line 63 of file RunData.cc.

64{
65 for ( auto& edep : fEdep ) {
66 edep = 0.;
67 }
68 for ( auto& trackLength : fTrackLength ) {
69 trackLength = 0.;
70 }
71}

◆ GetVolumeName()

G4String B4b::RunData::GetVolumeName ( G4int  id) const
inline

Definition at line 89 of file RunData.hh.

89 {
90 return fVolumeNames[id];
91}
std::array< G4String, kDim > fVolumeNames
Definition RunData.hh:77

◆ GetEdep()

G4double B4b::RunData::GetEdep ( G4int  id) const
inline

Definition at line 93 of file RunData.hh.

93 {
94 return fEdep[id];
95}

◆ GetTrackLength()

G4double B4b::RunData::GetTrackLength ( G4int  id) const
inline

Definition at line 97 of file RunData.hh.

97 {
98 return fTrackLength[id];
99}

Member Data Documentation

◆ fVolumeNames

std::array<G4String, kDim> B4b::RunData::fVolumeNames = { "Absorber", "Gap" }
private

Definition at line 77 of file RunData.hh.

77{ "Absorber", "Gap" };

◆ fEdep

std::array<G4double, kDim> B4b::RunData::fEdep = { 0., 0. }
private

Definition at line 78 of file RunData.hh.

78{ 0., 0. };

◆ fTrackLength

std::array<G4double, kDim> B4b::RunData::fTrackLength = { 0., 0. }
private

Definition at line 79 of file RunData.hh.

79{ 0., 0. };

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

Applications | User Support | Publications | Collaboration