Little helper functor class to create or reset branches in a tree.
More...
|
| BranchCreator (TTree *tree) |
|
|
void | operator() (std::string name, void *address, std::string leaflist) |
| Create a branch if it does not exist, and set its address. More...
|
|
void | operator() (std::string name, void *address, const std::stringstream &leaflist) |
|
template<typename T > |
void | operator() (std::string name, std::vector< T > &data, std::string leaflist) |
|
template<typename T > |
void | operator() (std::string name, std::vector< T > &data) |
|
Little helper functor class to create or reset branches in a tree.
Definition at line 584 of file icaruscode/icaruscode/Analysis/AnalysisTree_module.cc.
icarus::AnalysisTreeDataStruct::BranchCreator::BranchCreator |
( |
TTree * |
tree | ) |
|
|
inline |
void icarus::AnalysisTreeDataStruct::BranchCreator::operator() |
( |
std::string |
name, |
|
|
void * |
address, |
|
|
std::string |
leaflist |
|
) |
| |
|
inline |
Create a branch if it does not exist, and set its address.
Definition at line 592 of file icaruscode/icaruscode/Analysis/AnalysisTree_module.cc.
595 TBranch* pBranch =
pTree->GetBranch(
name.c_str());
597 pTree->Branch(
name.c_str(), address, leaflist.c_str() );
598 MF_LOG_DEBUG(
"AnalysisTreeStructure")
599 <<
"Creating branch '" <<
name <<
" with leaf '" << leaflist <<
"'";
601 else if (pBranch->GetAddress() != address) {
602 pBranch->SetAddress(address);
603 MF_LOG_DEBUG(
"AnalysisTreeStructure")
604 <<
"Reassigning address to branch '" <<
name <<
"'";
607 MF_LOG_DEBUG(
"AnalysisTreeStructure")
608 <<
"Branch '" <<
name <<
"' is fine";
TTree * pTree
the tree to be worked on
void icarus::AnalysisTreeDataStruct::BranchCreator::operator() |
( |
std::string |
name, |
|
|
void * |
address, |
|
|
const std::stringstream & |
leaflist |
|
) |
| |
|
inline |
template<typename T >
void icarus::AnalysisTreeDataStruct::BranchCreator::operator() |
( |
std::string |
name, |
|
|
std::vector< T > & |
data, |
|
|
std::string |
leaflist |
|
) |
| |
|
inline |
template<typename T >
void icarus::AnalysisTreeDataStruct::BranchCreator::operator() |
( |
std::string |
name, |
|
|
std::vector< T > & |
data |
|
) |
| |
|
inline |
Definition at line 620 of file icaruscode/icaruscode/Analysis/AnalysisTree_module.cc.
628 TBranch* pBranch =
pTree->GetBranch(
name.c_str());
633 MF_LOG_DEBUG(
"AnalysisTreeStructure")
634 <<
"Creating object branch '" <<
name
635 <<
" with " << TClass::GetClass(
typeid(T))->ClassName();
638 (*(
reinterpret_cast<std::vector<T>**
>(pBranch->GetAddress())) != &data)
645 pBranch->SetObject(&data);
646 MF_LOG_DEBUG(
"AnalysisTreeStructure")
647 <<
"Reassigning object to branch '" <<
name <<
"'";
650 MF_LOG_DEBUG(
"AnalysisTreeStructure")
651 <<
"Branch '" <<
name <<
"' is fine";
TTree * pTree
the tree to be worked on
TTree* icarus::AnalysisTreeDataStruct::BranchCreator::pTree |
The documentation for this class was generated from the following file: