BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Holder for output information. More...
#include <BDSOutputStructures.hh>
Protected Member Functions | |
BDSOutputStructures (const BDSGlobalConstants *globals) | |
void | InitialiseSamplers () |
Construct samplers. | |
void | InitialiseMaterialMap () |
Construct a map of material pointer to integer ID and name. | |
G4int | UpdateSamplerStructures () |
Interface to allow setting up samplers later for dynamic geometry construction a la SixTrack. Not for regular use. | |
void | PrepareCollimatorInformation () |
void | PrepareCavityInformation () |
Extract number of collimators and their names from beam line. | |
void | InitialiseCollimators () |
Construct collimators. | |
void | ClearStructuresParticleData () |
Clear the local particle data structure. | |
void | ClearStructuresHeader () |
Clear the local header structure. | |
void | ClearStructuresModel () |
Clear the local model structure. | |
void | ClearStructuresBeam () |
Clear the local beam structure. | |
void | ClearStructuresOptions () |
Clear the local options structure. | |
void | ClearStructuresEventLevel () |
Clear the local structures in this class in preparation for a new event. | |
void | ClearStructuresRunLevel () |
Clear the local structures in this class in preparation for a new run. | |
G4int | Create1DHistogram (G4String name, G4String title, G4int nbins, G4double xmin, G4double xmax) |
Create histograms for both evtHistos and runHistos. Return index from evtHistos. | |
G4int | Create1DHistogram (G4String name, G4String title, std::vector< double > &edges) |
Create histograms for both evtHistos and runHistos. Return index from evtHistos. | |
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. | |
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. | |
Protected Attributes | |
BDSOutputROOTParticleData * | particleDataOutput |
Geant4 information / particle tables. | |
BDSOutputROOTEventHeader * | headerOutput |
Information about the file. | |
BDSOutputROOTEventBeam * | beamOutput |
Beam output. | |
BDSOutputROOTEventOptions * | optionsOutput |
Options output. | |
BDSOutputROOTEventModel * | modelOutput |
Model output. | |
BDSOutputROOTEventSampler< double > * | primary |
Primary sampler structure. | |
BDSOutputROOTEventSampler< float > * | primary |
BDSOutputROOTEventCoords * | primaryGlobal |
std::vector< BDSOutputROOTEventSampler< double > * > | samplerTrees |
Sampler structures. | |
std::vector< BDSOutputROOTEventSampler< float > * > | samplerTrees |
std::vector< std::string > | samplerNames |
Sampler names to use. | |
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 |
BDSOutputROOTEventRunInfo * | runInfo |
Run information. | |
BDSOutputROOTEventHistograms * | runHistos |
Run level histograms. | |
BDSOutputROOTEventLoss * | eLoss |
General energy deposition. | |
BDSOutputROOTEventLoss * | pFirstHit |
Primary hit point. | |
BDSOutputROOTEventLoss * | pLastHit |
Primary loss point. | |
BDSOutputROOTEventLoss * | eLossVacuum |
General energy deposition. | |
BDSOutputROOTEventLoss * | eLossTunnel |
Tunnel energy deposition. | |
BDSOutputROOTEventLossWorld * | eLossWorld |
World energy deposition. | |
BDSOutputROOTEventLossWorld * | eLossWorldExit |
World exit hits. | |
BDSOutputROOTEventLossWorld * | eLossWorldContents |
Externally supplied world contents hits. | |
BDSOutputROOTEventAperture * | apertureImpacts |
Impacts on the aperture. | |
BDSOutputROOTEventTrajectory * | traj |
Trajectories. | |
BDSOutputROOTEventHistograms * | evtHistos |
Event level histograms. | |
BDSOutputROOTEventInfo * | evtInfo |
Event information. | |
std::vector< BDSOutputROOTEventCollimator * > | collimators |
Collimator output structures. | |
std::vector< G4String > | collimatorNames |
Names of collimators in output structures. | |
G4int | nCollimators |
Number of collimators in beam line. | |
std::vector< G4int > | collimatorIndices |
Indices in beam line that are collimators. | |
std::map< G4String, G4int > | collimatorIndicesByName |
Indices mapped to their name. | |
std::vector< BDSOutputROOTEventCollimatorInfo > | collimatorInfo |
std::vector< std::pair< G4double, G4double > > | collimatorDifferences |
std::vector< G4String > | cavityNames |
Names of cavities in output structures. | |
G4int | nCavities |
Number of cavities in beam line. | |
std::vector< G4int > | cavityIndices |
Indices in beam line that are cavities. | |
std::map< G4String, G4int > | cavityIndicesByName |
Indices mapped to their name. | |
std::vector< BDSOutputROOTEventCavityInfo > | cavityInfo |
Cavity parameters. | |
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. | |
BDSOutputStructures & | operator= (const BDSOutputStructures &)=delete |
Unused default constructors. | |
Private Attributes | |
G4bool | localSamplersInitialised |
G4bool | localCollimatorsInitialised |
Whether we've setup the member vector of collimators. Similarly to localSamplersInitialised. | |
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.
Definition at line 62 of file BDSOutputStructures.hh.
|
explicitprotected |
Definition at line 60 of file BDSOutputStructures.cc.
|
protectedvirtual |
Definition at line 118 of file BDSOutputStructures.cc.
|
protected |
Clear the local beam structure.
Definition at line 432 of file BDSOutputStructures.cc.
References beamOutput.
Referenced by BDSOutput::FillBeam().
|
protected |
Clear the local structures in this class in preparation for a new event.
Definition at line 442 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().
|
protected |
Clear the local header structure.
Definition at line 422 of file BDSOutputStructures.cc.
References headerOutput.
Referenced by BDSOutput::CloseAndOpenNewFile().
|
protected |
Clear the local model structure.
Definition at line 427 of file BDSOutputStructures.cc.
References BDSOutputROOTEventModel::Flush(), and modelOutput.
Referenced by BDSOutput::FillModel().
|
protected |
Clear the local options structure.
Definition at line 437 of file BDSOutputStructures.cc.
References optionsOutput.
Referenced by BDSOutput::FillOptions().
|
protected |
Clear the local particle data structure.
Definition at line 417 of file BDSOutputStructures.cc.
References BDSOutputROOTParticleData::Flush(), and particleDataOutput.
|
protected |
Clear the local structures in this class in preparation for a new run.
Definition at line 468 of file BDSOutputStructures.cc.
References runInfo.
Referenced by BDSOutput::FillRun().
|
protected |
Create histograms for both evtHistos and runHistos. Return index from evtHistos.
Definition at line 151 of file BDSOutputStructures.cc.
References evtHistos, and runHistos.
Referenced by BDSOutput::CreateHistograms().
|
protected |
Create histograms for both evtHistos and runHistos. Return index from evtHistos.
Definition at line 160 of file BDSOutputStructures.cc.
|
protected |
Create histograms for both evtHistos and runHistos. Return index from evtHistos.
Definition at line 168 of file BDSOutputStructures.cc.
References evtHistos, and runHistos.
Referenced by BDSOutput::CreateHistograms().
|
protected |
Create histograms for both evtHistos and runHistos. Return index from evtHistos.
Definition at line 185 of file BDSOutputStructures.cc.
References evtHistos, and runHistos.
Referenced by BDSOutput::CreateHistograms().
|
protected |
Construct collimators.
Definition at line 407 of file BDSOutputStructures.cc.
References collimatorIndices, collimators, and localCollimatorsInitialised.
Referenced by BDSOutput::InitialiseGeometryDependent().
|
protected |
Construct a map of material pointer to integer ID and name.
Definition at line 271 of file BDSOutputStructures.cc.
Referenced by BDSOutput::InitialiseGeometryDependent().
|
protected |
Construct samplers.
Definition at line 208 of file BDSOutputStructures.cc.
References BDSSamplerRegistry::Instance(), localSamplersInitialised, samplerNames, and samplerTrees.
Referenced by BDSOutput::InitialiseGeometryDependent().
|
protected |
Extract number of collimators and their names from beam line.
Definition at line 377 of file BDSOutputStructures.cc.
References BDSBeamline::at(), BDSAcceleratorModel::BeamlineMain(), cavityIndices, cavityIndicesByName, cavityInfo, cavityNames, BDSBeamline::GetIndicesOfElementsOfType(), BDSBeamlineElement::GetName(), BDSBeamlineElement::GetPlacementName(), and nCavities.
Referenced by BDSOutput::InitialiseGeometryDependent().
|
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 347 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().
|
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 326 of file BDSOutputStructures.cc.
References BDSSamplerRegistry::Instance(), samplerNames, and samplerTrees.
Referenced by BDSOutput::UpdateSamplers(), and BDSOutputROOT::UpdateSamplers().
|
protected |
Impacts on the aperture.
Definition at line 171 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillApertureImpacts(), BDSOutput::FillEvent(), and BDSOutputROOT::NewFile().
|
protected |
Beam output.
Definition at line 135 of file BDSOutputStructures.hh.
Referenced by ClearStructuresBeam(), BDSOutput::FillBeam(), and BDSOutputROOT::NewFile().
|
protected |
Indices in beam line that are cavities.
Definition at line 190 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillModel(), and PrepareCavityInformation().
|
protected |
Indices mapped to their name.
Definition at line 191 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillModel(), and PrepareCavityInformation().
|
protected |
Cavity parameters.
Definition at line 192 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillModel(), and PrepareCavityInformation().
|
protected |
Names of cavities in output structures.
Definition at line 188 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillModel(), and PrepareCavityInformation().
|
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 185 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillCollimatorHits(), and PrepareCollimatorInformation().
|
protected |
Indices in beam line that are collimators.
Definition at line 180 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillCollimatorHits(), BDSOutput::FillEnergyLoss(), BDSOutput::FillModel(), BDSOutput::FillPrimaryHit(), BDSOutput::FillPrimaryLoss(), InitialiseCollimators(), and PrepareCollimatorInformation().
|
protected |
Indices mapped to their name.
Definition at line 181 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillModel(), and PrepareCollimatorInformation().
|
protected |
Collimator parameters.
Definition at line 182 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillCollimatorHits(), BDSOutput::FillModel(), and PrepareCollimatorInformation().
|
protected |
Names of collimators in output structures.
Definition at line 178 of file BDSOutputStructures.hh.
Referenced by BDSOutput::FillModel(), BDSOutputROOT::NewFile(), and PrepareCollimatorInformation().
|
protected |
Collimator output structures.
Definition at line 177 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillCollimatorHits(), InitialiseCollimators(), and BDSOutputROOT::NewFile().
|
protected |
General energy deposition.
Definition at line 163 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().
|
protected |
Tunnel energy deposition.
Definition at line 167 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().
|
protected |
General energy deposition.
Definition at line 166 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().
|
protected |
World energy deposition.
Definition at line 168 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().
|
protected |
Externally supplied world contents hits.
Definition at line 170 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().
|
protected |
World exit hits.
Definition at line 169 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillEnergyLoss(), and BDSOutputROOT::NewFile().
|
protected |
Event level histograms.
Definition at line 173 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::CopyFromHistToHist1D(), Create1DHistogram(), Create3DHistogram(), Create4DHistogram(), BDSOutput::FillApertureImpacts(), BDSOutput::FillCollimatorHits(), BDSOutput::FillEnergyLoss(), BDSOutput::FillPrimaryHit(), BDSOutput::FillPrimaryLoss(), BDSOutput::FillScorerHitsIndividual(), and BDSOutputROOT::NewFile().
|
protected |
Event information.
Definition at line 174 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillEventInfo(), and BDSOutputROOT::NewFile().
|
protected |
Information about the file.
Definition at line 134 of file BDSOutputStructures.hh.
Referenced by ClearStructuresHeader(), BDSOutput::FillHeader(), BDSOutput::FillRunInfoAndUpdateHeader(), and BDSOutputROOT::NewFile().
|
private |
Whether we've setup the member vector of collimators. Similarly to localSamplersInitialised.
Definition at line 204 of file BDSOutputStructures.hh.
Referenced by InitialiseCollimators().
|
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 201 of file BDSOutputStructures.hh.
Referenced by InitialiseSamplers().
|
protected |
Definition at line 195 of file BDSOutputStructures.hh.
|
protected |
Definition at line 194 of file BDSOutputStructures.hh.
|
protected |
Model output.
Definition at line 137 of file BDSOutputStructures.hh.
Referenced by ClearStructuresModel(), BDSOutput::FillModel(), and BDSOutputROOT::NewFile().
|
protected |
Number of cavities in beam line.
Definition at line 189 of file BDSOutputStructures.hh.
Referenced by PrepareCavityInformation().
|
protected |
Number of collimators in beam line.
Definition at line 179 of file BDSOutputStructures.hh.
Referenced by BDSOutput::CreateHistograms(), BDSOutput::FillCollimatorHits(), BDSOutput::FillEnergyLoss(), BDSOutput::FillPrimaryHit(), BDSOutput::FillPrimaryLoss(), and PrepareCollimatorInformation().
|
protected |
Options output.
Definition at line 136 of file BDSOutputStructures.hh.
Referenced by ClearStructuresOptions(), BDSOutput::FillOptions(), and BDSOutputROOT::NewFile().
|
protected |
Geant4 information / particle tables.
Definition at line 133 of file BDSOutputStructures.hh.
Referenced by ClearStructuresParticleData(), BDSOutput::FillParticleData(), and BDSOutputROOT::NewFile().
|
protected |
Primary hit point.
Definition at line 164 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillPrimaryHit(), and BDSOutputROOT::NewFile().
|
protected |
Primary loss point.
Definition at line 165 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillPrimaryLoss(), and BDSOutputROOT::NewFile().
|
protected |
Primary sampler structure.
Definition at line 141 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillEventPrimaryOnly(), BDSOutput::FillPrimary(), and BDSOutputROOT::NewFile().
|
protected |
Definition at line 143 of file BDSOutputStructures.hh.
|
protected |
Definition at line 145 of file BDSOutputStructures.hh.
|
protected |
Run level histograms.
Definition at line 162 of file BDSOutputStructures.hh.
Referenced by BDSOutput::CopyFromHistToHist1D(), Create1DHistogram(), Create3DHistogram(), Create4DHistogram(), BDSOutput::FillEnergyLoss(), BDSOutput::FillPrimaryHit(), BDSOutput::FillPrimaryLoss(), BDSOutput::FillScorerHitsIndividual(), and BDSOutputROOT::NewFile().
|
protected |
Run information.
Definition at line 161 of file BDSOutputStructures.hh.
Referenced by ClearStructuresRunLevel(), BDSOutput::FillRunInfoAndUpdateHeader(), and BDSOutputROOT::NewFile().
|
protected |
Definition at line 155 of file BDSOutputStructures.hh.
|
protected |
Definition at line 153 of file BDSOutputStructures.hh.
|
protected |
Definition at line 158 of file BDSOutputStructures.hh.
|
protected |
Definition at line 157 of file BDSOutputStructures.hh.
|
protected |
Definition at line 159 of file BDSOutputStructures.hh.
|
protected |
Sampler names to use.
Definition at line 152 of file BDSOutputStructures.hh.
Referenced by InitialiseSamplers(), BDSOutputROOT::NewFile(), BDSOutputROOT::UpdateSamplers(), and UpdateSamplerStructures().
|
protected |
Definition at line 156 of file BDSOutputStructures.hh.
|
protected |
Definition at line 154 of file BDSOutputStructures.hh.
|
protected |
Sampler structures.
Global coordinates of primary particle.
Definition at line 148 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillSamplerHits(), BDSOutput::FillSamplerHitsLink(), BDSOutput::FillSamplerHitsVector(), InitialiseSamplers(), BDSOutputROOT::NewFile(), BDSOutputROOT::UpdateSamplers(), and UpdateSamplerStructures().
|
protected |
Definition at line 150 of file BDSOutputStructures.hh.
|
protected |
Trajectories.
Definition at line 172 of file BDSOutputStructures.hh.
Referenced by ClearStructuresEventLevel(), BDSOutput::FillTrajectories(), and BDSOutputROOT::NewFile().