Belle II Software development
|
Production notes for RootParameterTracker: More...
#include <RootParameterTracker.h>
Public Member Functions | |
RootParameterTracker () | |
constructor setting standard values | |
void | initialize (std::string fileName, std::string fileTreatment) |
creates rootFile, first parameter is fileName, second one specifies how the file shall be treated. | |
void | addParameters4DoubleAlgorithms (std::string tcTypeName, std::string algorithmName) |
relevant for all algorithms storing one double per TC: | |
void | addParameters4IntAlgorithms (std::string tcTypeName, std::string algorithmName) |
relevant for all algorithms storing one int per TC: | |
void | addParameters4VecDoubleAlgorithms (std::string tcTypeName, std::string algorithmName) |
relevant for all algorithms storing one vector of double per TC: | |
void | collectData (const std::vector< AnalizerTCInfo > &tcVector) |
take vector and fill for each tcType stored in rootParameterTracker | |
void | fillRoot () |
fills tree/branches with their stuff, clear intermediate results afterwards | |
void | terminate () |
final cleanup and closing rootFile | |
Protected Types | |
template<class ValueType > | |
using | StringKeyBox = KeyValBox< std::string, ValueType > |
short-cut since strings are always used as keys here: | |
template<class DataType > | |
using | AnalyzingAlgorithm = AnalyzingAlgorithmBase< DataType, AnalizerTCInfo, ROOT::Math::XYZVector > |
short-cut for typical algorithm-types used | |
template<class DataType > | |
using | AlgoDataBox = StringKeyBox< StringKeyBox< std::pair< AnalyzingAlgorithm< DataType > *, std::vector< DataType > * > > > |
contains algorithms and its raw data to be streamed into ttrees. | |
Protected Member Functions | |
TTree * | prepareTTree (std::string tcTypeName) |
checks if ttree for given tcTypeName exists and creates it if not. | |
void | collectData4DoubleAlgorithms (std::string tcTypeName, const AnalizerTCInfo &aTC) |
takes aTC with tcTypeName and applies the algorithms for it | |
void | collectData4IntAlgorithms (std::string tcTypeName, const AnalizerTCInfo &aTC) |
takes aTC with tcTypeName and applies the algorithms for it | |
void | collectData4VecDoubleAlgorithms (std::string tcTypeName, const AnalizerTCInfo &aTC) |
takes aTC with tcTypeName and applies the algorithms for it | |
Protected Attributes | |
StringKeyBox< TTree * > | m_treeBox |
contains all the trees for rootFile-filling later-on. | |
AlgoDataBox< double > | m_algoDataDouble |
contains all algorithms and its data storing one double per TC | |
AlgoDataBox< int > | m_algoDataInt |
contains all algorithms and its data storing one int per TC | |
AlgoDataBox< std::vector< double > > | m_algoDataVecDouble |
contains all algorithms and its data storing one vector of double per TC | |
TFile * | m_file |
stores pointer to file | |
Production notes for RootParameterTracker:
internalTreeContainer, internalAlgorithmContainer, internalLinkContainer are all a vector< pair < key, value> >. .find returns a link to the entry (.second only) searched for and takes a key and compares only with the key (like a map) .push_back simply push_back a pair .clearAll() for each entry.second .clear();
shall be a simple class just containing this vector and a find function doing what one wants to do
reread pseudo code down below to be sure that the container does what it shall do. takes care of collecting data of track candidates and storing it to root branches.
Definition at line 49 of file RootParameterTracker.h.
|
protected |
contains algorithms and its raw data to be streamed into ttrees.
key of AlgoDataBox is tcType, val is another box with: key is algorithmType val is pair: .first is the algorithm to be applied onto the AnalizerTCInfo-instances. .second is the data collected for .first to be streamed into ttrees.
Definition at line 68 of file RootParameterTracker.h.
|
protected |
short-cut for typical algorithm-types used
Definition at line 57 of file RootParameterTracker.h.
|
protected |
short-cut since strings are always used as keys here:
Definition at line 53 of file RootParameterTracker.h.
|
inline |
constructor setting standard values
Definition at line 140 of file RootParameterTracker.h.
void addParameters4DoubleAlgorithms | ( | std::string | tcTypeName, |
std::string | algorithmName | ||
) |
relevant for all algorithms storing one double per TC:
for given tcTypename <-> algorithmName-combination, this tracker will be prepared for tracking them in a root-file.
for given tcTypename <-> algorithmName-combination, this tracker will be prepared for tracking them in a root-file.
Production notes - pseudo code:
want to have one ttree for each tcType.
if TCType.convertToString (tcTypeName) not in internalTreeContainer: internalTreeContainer.push_back(tcTypeName, new TTree(tcTypeName, ("collects data collected to tcType" + tcTypeName).c_str());
if TCType.convertToString (tcTypeName) not in internalAlgorithmContainer: internalAlgorithmContainer.push_back(tcTypeName, {} ); // .second contains all the algorithms in the end
if algorithmName already in internalAlgorithmContainer: B2WARNING return;
internalAlgorithmContainer.find(tcTypeName).push_back(newAlgorithm); internalLinkContainer.find(tcTypeName).push_back( { algorithmName, {} ); // .second (empty curly braces) contains the collected data in the end
auto linkToData = internalLinkContainer.find(tcTypeName).find(algorithmName);
internalTreeContainer.find(tcTypeName)->Branch("algorithmName", &linkToData);
make sure that container for algorithms of given tcType exists:
make sure that algorithm and its dataStuff exists:
make sure that there is a branch linked to the raw data stored for this tcType <-> algorithm combination:
Definition at line 155 of file RootParameterTracker.cc.
void addParameters4IntAlgorithms | ( | std::string | tcTypeName, |
std::string | algorithmName | ||
) |
relevant for all algorithms storing one int per TC:
for given tcTypename <-> algorithmName-combination, this tracker will be prepared for tracking them in a root-file.
for given tcTypename <-> algorithmName-combination, this tracker will be prepared for tracking them in a root-file.
make sure that container for algorithms of given tcType exists:
make sure that algorithm and its dataStuff exists:
make sure that there is a branch linked to the raw data stored for this tcType <-> algorithm combination:
Definition at line 234 of file RootParameterTracker.cc.
void addParameters4VecDoubleAlgorithms | ( | std::string | tcTypeName, |
std::string | algorithmName | ||
) |
relevant for all algorithms storing one vector of double per TC:
for given tcTypename <-> algorithmName-combination, this tracker will be prepared for tracking them in a root-file.
for given tcTypename <-> algorithmName-combination, this tracker will be prepared for tracking them in a root-file.
make sure that container for algorithms of given tcType exists:
make sure that algorithm and its dataStuff exists:
make sure that there is a branch linked to the raw data stored for this tcType <-> algorithm combination:
Definition at line 292 of file RootParameterTracker.cc.
|
inline |
take vector and fill for each tcType stored in rootParameterTracker
Production notes: take internal container where all the requested parameters are tracked: for currenttcType in internalAlgorithmContainer: for tc in tcVector if tc.tctype == currenttcType fill internalLinkContainer with result of applied algorithm
Definition at line 183 of file RootParameterTracker.h.
|
protected |
takes aTC with tcTypeName and applies the algorithms for it
Definition at line 14 of file RootParameterTracker.cc.
|
protected |
takes aTC with tcTypeName and applies the algorithms for it
Definition at line 57 of file RootParameterTracker.cc.
|
protected |
takes aTC with tcTypeName and applies the algorithms for it
Definition at line 100 of file RootParameterTracker.cc.
|
inline |
fills tree/branches with their stuff, clear intermediate results afterwards
Definition at line 206 of file RootParameterTracker.h.
|
inline |
creates rootFile, first parameter is fileName, second one specifies how the file shall be treated.
Valid values for fileTreatment: 'RECREATE' or 'UPDATE'.
calling it more than once will result in a B2FATAL-message.
Definition at line 147 of file RootParameterTracker.h.
|
inlineprotected |
checks if ttree for given tcTypeName exists and creates it if not.
returns ttree for given tcType
make sure that tree exists:
Definition at line 97 of file RootParameterTracker.h.
|
inline |
final cleanup and closing rootFile
Definition at line 240 of file RootParameterTracker.h.
|
protected |
contains all algorithms and its data storing one double per TC
Definition at line 81 of file RootParameterTracker.h.
|
protected |
contains all algorithms and its data storing one int per TC
Definition at line 85 of file RootParameterTracker.h.
|
protected |
contains all algorithms and its data storing one vector of double per TC
Definition at line 89 of file RootParameterTracker.h.
|
protected |
stores pointer to file
Definition at line 93 of file RootParameterTracker.h.
|
protected |
contains all the trees for rootFile-filling later-on.
Key is tcTypeName as a string Value are TTrees, one tree for each tcType
Definition at line 77 of file RootParameterTracker.h.