BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes
DataLoader Class Reference

Loader for a ROOT file using classes used to generate the file. More...

#include <DataLoader.hh>

Collaboration diagram for DataLoader:
Collaboration graph

Public Member Functions

 DataLoader (const std::string &fileName, bool debugIn=false, bool processSamplersIn=true, bool allBranchesOn=true, const RBDS::BranchMap *branchesToTurnOn=nullptr, bool backwardsCompatibleIn=true)
 
void CommonCtor (const std::string &fileName)
 
void BuildInputFileList (std::string inputPath)
 Build up the input file list.
 
void BuildTreeNameList ()
 Open the first file in the file list and map the trees in it.
 
void BuildEventBranchNameList ()
 
void ChainTrees ()
 Create a tree for each sampler and add all the files to it.
 
void SetBranchAddress (bool allOn=true, const RBDS::BranchMap *bToTurnOn=nullptr)
 Map each chain to the member instance of each storage class in this class.
 
int DataVersion () const
 
std::vector< std::string > GetFileNames ()
 Accessor.
 
std::vector< std::string > GetTreeNames ()
 Accessor.
 
std::vector< std::string > GetBranchNames ()
 Accessor.
 
std::vector< std::string > GetSamplerNames ()
 Accessor.
 
std::vector< std::string > GetCollimatorNames ()
 Accessor.
 
HeaderGetHeader ()
 Accessor.
 
ParticleDataGetParticleData ()
 Accessor.
 
BeamGetBeam ()
 Accessor.
 
OptionsGetOptions ()
 Accessor.
 
ModelGetModel ()
 Accessor.
 
EventGetEvent ()
 Accessor.
 
RunGetRun ()
 Accessor.
 
TChain * GetHeaderTree ()
 Accessor.
 
TChain * GetParticleDataTree ()
 Accessor.
 
TChain * GetBeamTree ()
 Accessor.
 
TChain * GetOptionsTree ()
 Accessor.
 
TChain * GetModelTree ()
 Accessor.
 
TChain * GetEventTree ()
 Accessor.
 
TChain * GetRunTree ()
 Accessor.
 

Private Member Functions

 ClassDef (DataLoader, 2)
 

Private Attributes

bool debug
 
bool processSamplers
 
bool allBranchesOn
 
const RBDS::BranchMap * branchesToTurnOn
 
bool backwardsCompatible
 
Headerhea
 
ParticleDatapar
 
Beambea
 
Optionsopt
 
Modelmod
 
Eventevt
 
Runrun
 
std::vector< std::string > fileNames
 
std::vector< std::string > treeNames
 
std::vector< std::string > branchNames
 
std::vector< std::string > samplerNames
 
std::vector< std::string > samplerCNames
 
std::vector< std::string > samplerSNames
 
std::vector< std::string > allSamplerNames
 
std::vector< std::string > allCSamplerNames
 
std::vector< std::string > allSSamplerNames
 
std::vector< std::string > collimatorNames
 
TChain * heaChain
 
TChain * parChain
 
TChain * beaChain
 
TChain * optChain
 
TChain * modChain
 
TChain * evtChain
 
TChain * runChain
 
int dataVersion
 Integer version of data loaded.
 

Detailed Description

Loader for a ROOT file using classes used to generate the file.

Author
Stewart Boogert

Definition at line 45 of file DataLoader.hh.

Constructor & Destructor Documentation

◆ ~DataLoader()

DataLoader::~DataLoader ( )
virtual

Definition at line 64 of file DataLoader.cc.

Member Function Documentation

◆ BuildEventBranchNameList()

void DataLoader::BuildEventBranchNameList ( )

Inspect the first file (leaving it open...) and build a list of samplers by checking whether they have 'Sampler' in the name.

Definition at line 200 of file DataLoader.cc.

References Model::CollimatorNames(), dataVersion, Model::SamplerNames(), and Model::SetBranchAddress().

Referenced by CommonCtor().

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

◆ BuildInputFileList()

void DataLoader::BuildInputFileList ( std::string  inputPath)

Build up the input file list.

Definition at line 121 of file DataLoader.cc.

References dataVersion, and RBDS::IsBDSIMOutputFile().

Referenced by CommonCtor().

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

◆ BuildTreeNameList()

void DataLoader::BuildTreeNameList ( )

Open the first file in the file list and map the trees in it.

Definition at line 179 of file DataLoader.cc.

Referenced by CommonCtor().

Here is the caller graph for this function:

◆ ChainTrees()

void DataLoader::ChainTrees ( )

Create a tree for each sampler and add all the files to it.

Definition at line 256 of file DataLoader.cc.

References dataVersion.

Referenced by CommonCtor().

Here is the caller graph for this function:

◆ CommonCtor()

void DataLoader::CommonCtor ( const std::string &  fileName)

Create an instance of each class in the file to be overlaid by loading the ROOT file.

Definition at line 82 of file DataLoader.cc.

References BuildEventBranchNameList(), BuildInputFileList(), BuildTreeNameList(), ChainTrees(), dataVersion, ParticleData::particleData, and SetBranchAddress().

Here is the call graph for this function:

◆ DataVersion()

int DataLoader::DataVersion ( ) const
inline

Definition at line 78 of file DataLoader.hh.

◆ GetBeam()

Beam * DataLoader::GetBeam ( )
inline

Accessor.

Definition at line 88 of file DataLoader.hh.

◆ GetBeamTree()

TChain * DataLoader::GetBeamTree ( )
inline

Accessor.

Definition at line 95 of file DataLoader.hh.

◆ GetBranchNames()

std::vector< std::string > DataLoader::GetBranchNames ( )
inline

Accessor.

Definition at line 83 of file DataLoader.hh.

◆ GetCollimatorNames()

std::vector< std::string > DataLoader::GetCollimatorNames ( )
inline

Accessor.

Definition at line 85 of file DataLoader.hh.

◆ GetEvent()

Event * DataLoader::GetEvent ( )
inline

Accessor.

Definition at line 91 of file DataLoader.hh.

Referenced by EventDisplay::EventDisplay().

Here is the caller graph for this function:

◆ GetEventTree()

TChain * DataLoader::GetEventTree ( )
inline

Accessor.

Definition at line 98 of file DataLoader.hh.

Referenced by EventDisplay::EventDisplay().

Here is the caller graph for this function:

◆ GetFileNames()

std::vector< std::string > DataLoader::GetFileNames ( )
inline

Accessor.

Definition at line 81 of file DataLoader.hh.

◆ GetHeader()

Header * DataLoader::GetHeader ( )
inline

Accessor.

Definition at line 86 of file DataLoader.hh.

◆ GetHeaderTree()

TChain * DataLoader::GetHeaderTree ( )
inline

Accessor.

Definition at line 93 of file DataLoader.hh.

◆ GetModel()

Model * DataLoader::GetModel ( )
inline

Accessor.

Definition at line 90 of file DataLoader.hh.

Referenced by EventDisplay::EventDisplay().

Here is the caller graph for this function:

◆ GetModelTree()

TChain * DataLoader::GetModelTree ( )
inline

Accessor.

Definition at line 97 of file DataLoader.hh.

Referenced by EventDisplay::EventDisplay().

Here is the caller graph for this function:

◆ GetOptions()

Options * DataLoader::GetOptions ( )
inline

Accessor.

Definition at line 89 of file DataLoader.hh.

Referenced by EventDisplay::EventDisplay().

Here is the caller graph for this function:

◆ GetOptionsTree()

TChain * DataLoader::GetOptionsTree ( )
inline

Accessor.

Definition at line 96 of file DataLoader.hh.

Referenced by EventDisplay::EventDisplay().

Here is the caller graph for this function:

◆ GetParticleData()

ParticleData * DataLoader::GetParticleData ( )
inline

Accessor.

Definition at line 87 of file DataLoader.hh.

◆ GetParticleDataTree()

TChain * DataLoader::GetParticleDataTree ( )
inline

Accessor.

Definition at line 94 of file DataLoader.hh.

◆ GetRun()

Run * DataLoader::GetRun ( )
inline

Accessor.

Definition at line 92 of file DataLoader.hh.

◆ GetRunTree()

TChain * DataLoader::GetRunTree ( )
inline

Accessor.

Definition at line 99 of file DataLoader.hh.

◆ GetSamplerNames()

std::vector< std::string > DataLoader::GetSamplerNames ( )
inline

Accessor.

Definition at line 84 of file DataLoader.hh.

◆ GetTreeNames()

std::vector< std::string > DataLoader::GetTreeNames ( )
inline

Accessor.

Definition at line 82 of file DataLoader.hh.

◆ SetBranchAddress()

void DataLoader::SetBranchAddress ( bool  allOn = true,
const RBDS::BranchMap *  bToTurnOn = nullptr 
)

Map each chain to the member instance of each storage class in this class.

Definition at line 272 of file DataLoader.cc.

References dataVersion, Header::SetBranchAddress(), ParticleData::SetBranchAddress(), Beam::SetBranchAddress(), Model::SetBranchAddress(), Options::SetBranchAddress(), Run::SetBranchAddress(), and Event::SetBranchAddress().

Referenced by CommonCtor().

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

Field Documentation

◆ allBranchesOn

bool DataLoader::allBranchesOn
private

Definition at line 105 of file DataLoader.hh.

◆ allCSamplerNames

std::vector<std::string> DataLoader::allCSamplerNames
private

Definition at line 124 of file DataLoader.hh.

◆ allSamplerNames

std::vector<std::string> DataLoader::allSamplerNames
private

Definition at line 123 of file DataLoader.hh.

◆ allSSamplerNames

std::vector<std::string> DataLoader::allSSamplerNames
private

Definition at line 125 of file DataLoader.hh.

◆ backwardsCompatible

bool DataLoader::backwardsCompatible
private

Definition at line 107 of file DataLoader.hh.

◆ bea

Beam* DataLoader::bea
private

Definition at line 111 of file DataLoader.hh.

◆ beaChain

TChain* DataLoader::beaChain
private

Definition at line 130 of file DataLoader.hh.

◆ branchesToTurnOn

const RBDS::BranchMap* DataLoader::branchesToTurnOn
private

Definition at line 106 of file DataLoader.hh.

◆ branchNames

std::vector<std::string> DataLoader::branchNames
private

Definition at line 119 of file DataLoader.hh.

◆ collimatorNames

std::vector<std::string> DataLoader::collimatorNames
private

Definition at line 126 of file DataLoader.hh.

◆ dataVersion

int DataLoader::dataVersion
private

Integer version of data loaded.

Definition at line 136 of file DataLoader.hh.

Referenced by BuildEventBranchNameList(), BuildInputFileList(), ChainTrees(), CommonCtor(), and SetBranchAddress().

◆ debug

bool DataLoader::debug
private

Definition at line 103 of file DataLoader.hh.

◆ evt

Event* DataLoader::evt
private

Definition at line 114 of file DataLoader.hh.

◆ evtChain

TChain* DataLoader::evtChain
private

Definition at line 133 of file DataLoader.hh.

◆ fileNames

std::vector<std::string> DataLoader::fileNames
private

Definition at line 117 of file DataLoader.hh.

◆ hea

Header* DataLoader::hea
private

Definition at line 109 of file DataLoader.hh.

◆ heaChain

TChain* DataLoader::heaChain
private

Definition at line 128 of file DataLoader.hh.

◆ mod

Model* DataLoader::mod
private

Definition at line 113 of file DataLoader.hh.

◆ modChain

TChain* DataLoader::modChain
private

Definition at line 132 of file DataLoader.hh.

◆ opt

Options* DataLoader::opt
private

Definition at line 112 of file DataLoader.hh.

◆ optChain

TChain* DataLoader::optChain
private

Definition at line 131 of file DataLoader.hh.

◆ par

ParticleData* DataLoader::par
private

Definition at line 110 of file DataLoader.hh.

◆ parChain

TChain* DataLoader::parChain
private

Definition at line 129 of file DataLoader.hh.

◆ processSamplers

bool DataLoader::processSamplers
private

Definition at line 104 of file DataLoader.hh.

◆ run

Run* DataLoader::run
private

Definition at line 115 of file DataLoader.hh.

◆ runChain

TChain* DataLoader::runChain
private

Definition at line 134 of file DataLoader.hh.

◆ samplerCNames

std::vector<std::string> DataLoader::samplerCNames
private

Definition at line 121 of file DataLoader.hh.

◆ samplerNames

std::vector<std::string> DataLoader::samplerNames
private

Definition at line 120 of file DataLoader.hh.

◆ samplerSNames

std::vector<std::string> DataLoader::samplerSNames
private

Definition at line 122 of file DataLoader.hh.

◆ treeNames

std::vector<std::string> DataLoader::treeNames
private

Definition at line 118 of file DataLoader.hh.


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