BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Protected Member Functions | Protected Attributes | Private Attributes
BDSOutputStructures Class Reference

Holder for output information. More...

#include <BDSOutputStructures.hh>

Inheritance diagram for BDSOutputStructures:
Inheritance graph
Collaboration diagram for BDSOutputStructures:
Collaboration graph

Protected Member Functions

 BDSOutputStructures (const BDSGlobalConstants *globals)
 
void InitialiseSamplers ()
 Construct samplers. More...
 
void InitialiseMaterialMap ()
 Construct a map of material pointer to integer ID and name. More...
 
G4int UpdateSamplerStructures ()
 Interface to allow setting up samplers later for dynamic geometry construction a la SixTrack. Not for regular use. More...
 
void PrepareCollimatorInformation ()
 
void InitialiseCollimators ()
 Construct collimtors. More...
 
void ClearStructuresParticleData ()
 Clear the local particle data structure. More...
 
void ClearStructuresHeader ()
 Clear the local header structure. More...
 
void ClearStructuresModel ()
 Clear the local model structure. More...
 
void ClearStructuresBeam ()
 Clear the local beam structure. More...
 
void ClearStructuresOptions ()
 Clear the local options structure. More...
 
void ClearStructuresEventLevel ()
 Clear the local structures in this class in preparation for a new event. More...
 
void ClearStructuresRunLevel ()
 Clear the local structures in this class in preparation for a new run. More...
 
G4int Create1DHistogram (G4String name, G4String title, G4int nbins, G4double xmin, G4double xmax)
 Create histograms for both evtHistos and runHistos. Return index from evtHistos. More...
 
G4int Create1DHistogram (G4String name, G4String title, std::vector< double > &edges)
 Create histograms for both evtHistos and runHistos. Return index from evtHistos. More...
 
G4int Create3DHistogram (G4String name, G4String title, G4int nBinsX, G4double xMin, G4double xMax, G4int nBinsY, G4double yMin, G4double yMax, G4int nBinsZ, G4double zMin, G4double zMax)
 Create histograms for both evtHistos and runHistos. Return index from evtHistos. More...
 
G4int Create4DHistogram (const G4String &name, const G4String &title, const G4String &eScale, const std::vector< double > &eBinsEdges, G4int nBinsX, G4double xMin, G4double xMax, G4int nBinsY, G4double yMin, G4double yMax, G4int nBinsZ, G4double zMin, G4double zMax, G4int nBinsE, G4double eMin, G4double eMax)
 Create histograms for both evtHistos and runHistos. Return index from evtHistos. More...
 

Protected Attributes

BDSOutputROOTParticleDataparticleDataOutput
 Geant4 information / particle tables. More...
 
BDSOutputROOTEventHeaderheaderOutput
 Information about the file. More...
 
BDSOutputROOTEventBeambeamOutput
 Beam output. More...
 
BDSOutputROOTEventOptionsoptionsOutput
 Options output. More...
 
BDSOutputROOTEventModelmodelOutput
 Model output. More...
 
BDSOutputROOTEventSampler< double > * primary
 Primary sampler structure. More...
 
BDSOutputROOTEventSampler< float > * primary
 
BDSOutputROOTEventCoordsprimaryGlobal
 
std::vector< BDSOutputROOTEventSampler< double > * > samplerTrees
 Sampler structures. More...
 
std::vector< BDSOutputROOTEventSampler< float > * > samplerTrees
 
std::vector< std::string > samplerNames
 Sampler names to use. More...
 
std::vector< BDSOutputROOTEventSamplerC * > samplerCTrees
 
std::vector< BDSOutputROOTEventSamplerS * > samplerSTrees
 
std::vector< std::string > samplerCNames
 
std::vector< std::string > samplerSNames
 
std::map< G4int, G4int > samplerIDToIndexPlane
 
std::map< G4int, G4int > samplerIDToIndexCylinder
 
std::map< G4int, G4int > samplerIDToIndexSphere
 
BDSOutputROOTEventRunInforunInfo
 Run information. More...
 
BDSOutputROOTEventHistogramsrunHistos
 Run level histograms. More...
 
BDSOutputROOTEventLosseLoss
 General energy deposition. More...
 
BDSOutputROOTEventLosspFirstHit
 Primary hit point. More...
 
BDSOutputROOTEventLosspLastHit
 Primary loss point. More...
 
BDSOutputROOTEventLosseLossVacuum
 General energy deposition. More...
 
BDSOutputROOTEventLosseLossTunnel
 Tunnel energy deposition. More...
 
BDSOutputROOTEventLossWorldeLossWorld
 World energy deposition. More...
 
BDSOutputROOTEventLossWorldeLossWorldExit
 World exit hits. More...
 
BDSOutputROOTEventLossWorldeLossWorldContents
 Externally supplied world contents hits. More...
 
BDSOutputROOTEventApertureapertureImpacts
 Impacts on the aperture. More...
 
BDSOutputROOTEventTrajectorytraj
 Trajectories. More...
 
BDSOutputROOTEventHistogramsevtHistos
 Event level histograms. More...
 
BDSOutputROOTEventInfoevtInfo
 Event information. More...
 
std::vector< BDSOutputROOTEventCollimator * > collimators
 Collimator output structures. More...
 
std::vector< G4String > collimatorNames
 Names of collimators in output structures. More...
 
G4int nCollimators
 Number of collimators in beam line. More...
 
std::vector< G4int > collimatorIndices
 Indices in beam line that are collimators. More...
 
std::map< G4String, G4int > collimatorIndicesByName
 Indices mapped to their name. More...
 
std::vector< BDSOutputROOTEventCollimatorInfocollimatorInfo
 
std::vector< std::pair< G4double, G4double > > collimatorDifferences
 
std::map< G4Material *, short int > materialToID
 
std::map< short int, G4String > materialIDToNameUnique
 

Private Member Functions

 BDSOutputStructures ()=delete
 Unused default constructors.
 
 BDSOutputStructures (const BDSOutputStructures &)=delete
 Unused default constructors.
 
BDSOutputStructuresoperator= (const BDSOutputStructures &)=delete
 Unused default constructors.
 

Private Attributes

G4bool localSamplersInitialised
 
G4bool localCollimatorsInitialised
 Whether we've setup the member vector of collimators. Similarly to localSamplersInitialised. More...
 

Detailed Description

Holder for output information.

This holds instances of the output classes that can be filled and directly copied to the output file. It also holds and fills the histograms.

Author
S. Boogert, L. Nevay

Definition at line 61 of file BDSOutputStructures.hh.

Constructor & Destructor Documentation

◆ BDSOutputStructures()

BDSOutputStructures::BDSOutputStructures ( const BDSGlobalConstants globals)
explicitprotected

Definition at line 60 of file BDSOutputStructures.cc.

◆ ~BDSOutputStructures()

BDSOutputStructures::~BDSOutputStructures ( )
protectedvirtual

Definition at line 116 of file BDSOutputStructures.cc.

Member Function Documentation

◆ ClearStructuresBeam()

void BDSOutputStructures::ClearStructuresBeam ( )
protected

Clear the local beam structure.

Definition at line 390 of file BDSOutputStructures.cc.

References beamOutput.

Referenced by BDSOutput::FillBeam().

Here is the caller graph for this function:

◆ ClearStructuresEventLevel()

void BDSOutputStructures::ClearStructuresEventLevel ( )
protected

Clear the local structures in this class in preparation for a new event.

Definition at line 400 of file BDSOutputStructures.cc.

References apertureImpacts, collimators, eLoss, eLossTunnel, eLossVacuum, eLossWorld, eLossWorldContents, eLossWorldExit, evtHistos, evtInfo, BDSOutputROOTEventHistograms::Flush(), BDSOutputROOTEventSampler< U >::Flush(), BDSOutputROOTEventTrajectory::Flush(), pFirstHit, pLastHit, primary, samplerTrees, and traj.

Referenced by BDSOutput::FillEvent(), and BDSOutput::FillEventPrimaryOnly().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearStructuresHeader()

void BDSOutputStructures::ClearStructuresHeader ( )
protected

Clear the local header structure.

Definition at line 380 of file BDSOutputStructures.cc.

References headerOutput.

Referenced by BDSOutput::FillHeader().

Here is the caller graph for this function:

◆ ClearStructuresModel()

void BDSOutputStructures::ClearStructuresModel ( )
protected

Clear the local model structure.

Definition at line 385 of file BDSOutputStructures.cc.

References BDSOutputROOTEventModel::Flush(), and modelOutput.

Referenced by BDSOutput::FillModel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearStructuresOptions()

void BDSOutputStructures::ClearStructuresOptions ( )
protected

Clear the local options structure.

Definition at line 395 of file BDSOutputStructures.cc.

References optionsOutput.

Referenced by BDSOutput::FillOptions().

Here is the caller graph for this function:

◆ ClearStructuresParticleData()

void BDSOutputStructures::ClearStructuresParticleData ( )
protected

Clear the local particle data structure.

Definition at line 375 of file BDSOutputStructures.cc.

References BDSOutputROOTParticleData::Flush(), and particleDataOutput.

Here is the call graph for this function:

◆ ClearStructuresRunLevel()

void BDSOutputStructures::ClearStructuresRunLevel ( )
protected

Clear the local structures in this class in preparation for a new run.

Definition at line 426 of file BDSOutputStructures.cc.

References runInfo.

Referenced by BDSOutput::FillRun().

Here is the caller graph for this function:

◆ Create1DHistogram() [1/2]

G4int BDSOutputStructures::Create1DHistogram ( G4String  name,
G4String  title,
G4int  nbins,
G4double  xmin,
G4double  xmax 
)
protected

Create histograms for both evtHistos and runHistos. Return index from evtHistos.

Definition at line 149 of file BDSOutputStructures.cc.

References evtHistos, and runHistos.

Referenced by BDSOutput::CreateHistograms().

Here is the caller graph for this function:

◆ Create1DHistogram() [2/2]

G4int BDSOutputStructures::Create1DHistogram ( G4String  name,
G4String  title,
std::vector< double > &  edges 
)
protected

Create histograms for both evtHistos and runHistos. Return index from evtHistos.

Definition at line 158 of file BDSOutputStructures.cc.

References evtHistos, and runHistos.

◆ Create3DHistogram()

G4int BDSOutputStructures::Create3DHistogram ( G4String  name,
G4String  title,
G4int  nBinsX,
G4double  xMin,
G4double  xMax,
G4int  nBinsY,
G4double  yMin,
G4double  yMax,
G4int  nBinsZ,
G4double  zMin,
G4double  zMax 
)
protected

Create histograms for both evtHistos and runHistos. Return index from evtHistos.

Definition at line 166 of file BDSOutputStructures.cc.

References evtHistos, and runHistos.

Referenced by BDSOutput::CreateHistograms().

Here is the caller graph for this function:

◆ Create4DHistogram()

G4int BDSOutputStructures::Create4DHistogram ( const G4String &  name,
const G4String &  title,
const G4String &  eScale,
const std::vector< double > &  eBinsEdges,
G4int  nBinsX,
G4double  xMin,
G4double  xMax,
G4int  nBinsY,
G4double  yMin,
G4double  yMax,
G4int  nBinsZ,
G4double  zMin,
G4double  zMax,
G4int  nBinsE,
G4double  eMin,
G4double  eMax 
)
protected

Create histograms for both evtHistos and runHistos. Return index from evtHistos.

Definition at line 183 of file BDSOutputStructures.cc.

References evtHistos, and runHistos.

Referenced by BDSOutput::CreateHistograms().

Here is the caller graph for this function:

◆ InitialiseCollimators()

void BDSOutputStructures::InitialiseCollimators ( )
protected

Construct collimtors.

Definition at line 365 of file BDSOutputStructures.cc.

References collimatorIndices, collimators, and localCollimatorsInitialised.

Referenced by BDSOutput::InitialiseGeometryDependent().

Here is the caller graph for this function:

◆ InitialiseMaterialMap()

void BDSOutputStructures::InitialiseMaterialMap ( )
protected

Construct a map of material pointer to integer ID and name.

Definition at line 269 of file BDSOutputStructures.cc.

Referenced by BDSOutput::InitialiseGeometryDependent().

Here is the caller graph for this function:

◆ InitialiseSamplers()

void BDSOutputStructures::InitialiseSamplers ( )
protected

Construct samplers.

Definition at line 206 of file BDSOutputStructures.cc.

References BDSSamplerRegistry::Instance(), localSamplersInitialised, samplerNames, and samplerTrees.

Referenced by BDSOutput::InitialiseGeometryDependent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareCollimatorInformation()

void BDSOutputStructures::PrepareCollimatorInformation ( )
protected

Extract number of collimators and their names from beam line. Two stage initialisation for collimators so histograms can be made dynamically if required or not based on number of collimators.

Definition at line 336 of file BDSOutputStructures.cc.

References BDSBeamline::at(), BDSAcceleratorModel::BeamlineMain(), collimatorDifferences, collimatorIndices, collimatorIndicesByName, collimatorInfo, collimatorNames, BDSBeamline::GetIndicesOfCollimators(), BDSBeamlineElement::GetName(), BDSBeamlineElement::GetPlacementName(), and nCollimators.

Referenced by BDSOutput::InitialiseGeometryDependent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSamplerStructures()

G4int BDSOutputStructures::UpdateSamplerStructures ( )
protected

Interface to allow setting up samplers later for dynamic geometry construction a la SixTrack. Not for regular use.

TBC - does not do cylinder or spheres

Definition at line 315 of file BDSOutputStructures.cc.

References BDSSamplerRegistry::Instance(), samplerNames, and samplerTrees.

Referenced by BDSOutput::UpdateSamplers(), and BDSOutputROOT::UpdateSamplers().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ apertureImpacts

BDSOutputROOTEventAperture* BDSOutputStructures::apertureImpacts
protected

◆ beamOutput

BDSOutputROOTEventBeam* BDSOutputStructures::beamOutput
protected

Beam output.

Definition at line 131 of file BDSOutputStructures.hh.

Referenced by ClearStructuresBeam(), BDSOutput::FillBeam(), and BDSOutputROOT::NewFile().

◆ collimatorDifferences

std::vector<std::pair<G4double, G4double> > BDSOutputStructures::collimatorDifferences
protected

Cache of aperture differences for each collimator info to avoid repeated calculation and to avoid storing unnecessary output in the collimator info.

Definition at line 181 of file BDSOutputStructures.hh.

Referenced by BDSOutput::FillCollimatorHits(), and PrepareCollimatorInformation().

◆ collimatorIndices

std::vector<G4int> BDSOutputStructures::collimatorIndices
protected

◆ collimatorIndicesByName

std::map<G4String, G4int> BDSOutputStructures::collimatorIndicesByName
protected

Indices mapped to their name.

Definition at line 177 of file BDSOutputStructures.hh.

Referenced by BDSOutput::FillModel(), and PrepareCollimatorInformation().

◆ collimatorInfo

std::vector<BDSOutputROOTEventCollimatorInfo> BDSOutputStructures::collimatorInfo
protected

Collimator parameters.

Definition at line 178 of file BDSOutputStructures.hh.

Referenced by BDSOutput::FillCollimatorHits(), BDSOutput::FillModel(), and PrepareCollimatorInformation().

◆ collimatorNames

std::vector<G4String> BDSOutputStructures::collimatorNames
protected

Names of collimators in output structures.

Definition at line 174 of file BDSOutputStructures.hh.

Referenced by BDSOutput::FillModel(), BDSOutputROOT::NewFile(), and PrepareCollimatorInformation().

◆ collimators

std::vector<BDSOutputROOTEventCollimator*> BDSOutputStructures::collimators
protected

Collimator output structures.

Definition at line 173 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillCollimatorHits(), InitialiseCollimators(), and BDSOutputROOT::NewFile().

◆ eLoss

BDSOutputROOTEventLoss* BDSOutputStructures::eLoss
protected

General energy deposition.

Definition at line 159 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().

◆ eLossTunnel

BDSOutputROOTEventLoss* BDSOutputStructures::eLossTunnel
protected

Tunnel energy deposition.

Definition at line 163 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().

◆ eLossVacuum

BDSOutputROOTEventLoss* BDSOutputStructures::eLossVacuum
protected

General energy deposition.

Definition at line 162 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().

◆ eLossWorld

BDSOutputROOTEventLossWorld* BDSOutputStructures::eLossWorld
protected

World energy deposition.

Definition at line 164 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().

◆ eLossWorldContents

BDSOutputROOTEventLossWorld* BDSOutputStructures::eLossWorldContents
protected

Externally supplied world contents hits.

Definition at line 166 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().

◆ eLossWorldExit

BDSOutputROOTEventLossWorld* BDSOutputStructures::eLossWorldExit
protected

World exit hits.

Definition at line 165 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().

◆ evtHistos

BDSOutputROOTEventHistograms* BDSOutputStructures::evtHistos
protected

◆ evtInfo

BDSOutputROOTEventInfo* BDSOutputStructures::evtInfo
protected

◆ headerOutput

BDSOutputROOTEventHeader* BDSOutputStructures::headerOutput
protected

Information about the file.

Definition at line 130 of file BDSOutputStructures.hh.

Referenced by ClearStructuresHeader(), BDSOutput::FillHeader(), and BDSOutputROOT::NewFile().

◆ localCollimatorsInitialised

G4bool BDSOutputStructures::localCollimatorsInitialised
private

Whether we've setup the member vector of collimators. Similarly to localSamplersInitialised.

Definition at line 193 of file BDSOutputStructures.hh.

Referenced by InitialiseCollimators().

◆ localSamplersInitialised

G4bool BDSOutputStructures::localSamplersInitialised
private

Whether we've set up the member vector of samplers. Can only be done once the geometry is constructed so it's done in initialisation. This happens with each new file, but we should only prepare the local samplers once, hence this cache variable.

Definition at line 190 of file BDSOutputStructures.hh.

Referenced by InitialiseSamplers().

◆ materialIDToNameUnique

std::map<short int, G4String> BDSOutputStructures::materialIDToNameUnique
protected

Definition at line 184 of file BDSOutputStructures.hh.

◆ materialToID

std::map<G4Material*, short int> BDSOutputStructures::materialToID
protected

Definition at line 183 of file BDSOutputStructures.hh.

◆ modelOutput

BDSOutputROOTEventModel* BDSOutputStructures::modelOutput
protected

◆ nCollimators

G4int BDSOutputStructures::nCollimators
protected

◆ optionsOutput

BDSOutputROOTEventOptions* BDSOutputStructures::optionsOutput
protected

◆ particleDataOutput

BDSOutputROOTParticleData* BDSOutputStructures::particleDataOutput
protected

Geant4 information / particle tables.

Definition at line 129 of file BDSOutputStructures.hh.

Referenced by ClearStructuresParticleData(), BDSOutput::FillParticleData(), and BDSOutputROOT::NewFile().

◆ pFirstHit

BDSOutputROOTEventLoss* BDSOutputStructures::pFirstHit
protected

Primary hit point.

Definition at line 160 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillPrimaryHit(), and BDSOutputROOT::NewFile().

◆ pLastHit

BDSOutputROOTEventLoss* BDSOutputStructures::pLastHit
protected

Primary loss point.

Definition at line 161 of file BDSOutputStructures.hh.

Referenced by ClearStructuresEventLevel(), BDSOutput::FillPrimaryLoss(), and BDSOutputROOT::NewFile().

◆ primary [1/2]

BDSOutputROOTEventSampler<double>* BDSOutputStructures::primary
protected

◆ primary [2/2]

BDSOutputROOTEventSampler<float>* BDSOutputStructures::primary
protected

Definition at line 139 of file BDSOutputStructures.hh.

◆ primaryGlobal

BDSOutputROOTEventCoords* BDSOutputStructures::primaryGlobal
protected

Definition at line 141 of file BDSOutputStructures.hh.

◆ runHistos

BDSOutputROOTEventHistograms* BDSOutputStructures::runHistos
protected

◆ runInfo

BDSOutputROOTEventRunInfo* BDSOutputStructures::runInfo
protected

Run information.

Definition at line 157 of file BDSOutputStructures.hh.

Referenced by ClearStructuresRunLevel(), BDSOutput::FillRunInfo(), and BDSOutputROOT::NewFile().

◆ samplerCNames

std::vector<std::string> BDSOutputStructures::samplerCNames
protected

Definition at line 151 of file BDSOutputStructures.hh.

◆ samplerCTrees

std::vector<BDSOutputROOTEventSamplerC*> BDSOutputStructures::samplerCTrees
protected

Definition at line 149 of file BDSOutputStructures.hh.

◆ samplerIDToIndexCylinder

std::map<G4int, G4int> BDSOutputStructures::samplerIDToIndexCylinder
protected

Definition at line 154 of file BDSOutputStructures.hh.

◆ samplerIDToIndexPlane

std::map<G4int, G4int> BDSOutputStructures::samplerIDToIndexPlane
protected

Definition at line 153 of file BDSOutputStructures.hh.

◆ samplerIDToIndexSphere

std::map<G4int, G4int> BDSOutputStructures::samplerIDToIndexSphere
protected

Definition at line 155 of file BDSOutputStructures.hh.

◆ samplerNames

std::vector<std::string> BDSOutputStructures::samplerNames
protected

◆ samplerSNames

std::vector<std::string> BDSOutputStructures::samplerSNames
protected

Definition at line 152 of file BDSOutputStructures.hh.

◆ samplerSTrees

std::vector<BDSOutputROOTEventSamplerS*> BDSOutputStructures::samplerSTrees
protected

Definition at line 150 of file BDSOutputStructures.hh.

◆ samplerTrees [1/2]

std::vector<BDSOutputROOTEventSampler<double>*> BDSOutputStructures::samplerTrees
protected

◆ samplerTrees [2/2]

std::vector<BDSOutputROOTEventSampler<float>*> BDSOutputStructures::samplerTrees
protected

Definition at line 146 of file BDSOutputStructures.hh.

◆ traj

BDSOutputROOTEventTrajectory* BDSOutputStructures::traj
protected

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