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 733 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.
sbnd::AnalysisTreeDataStruct::BranchCreator::BranchCreator |
( |
TTree * |
tree | ) |
|
|
inline |
void sbnd::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 741 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.
744 TBranch* pBranch =
pTree->GetBranch(
name.c_str());
746 pTree->Branch(
name.c_str(), address, leaflist.c_str() );
747 MF_LOG_DEBUG(
"AnalysisTreeStructure")
748 <<
"Creating branch '" <<
name <<
" with leaf '" << leaflist <<
"'";
750 else if (pBranch->GetAddress() != address) {
751 pBranch->SetAddress(address);
752 MF_LOG_DEBUG(
"AnalysisTreeStructure")
753 <<
"Reassigning address to branch '" <<
name <<
"'";
756 MF_LOG_DEBUG(
"AnalysisTreeStructure")
757 <<
"Branch '" <<
name <<
"' is fine";
TTree * pTree
the tree to be worked on
void sbnd::AnalysisTreeDataStruct::BranchCreator::operator() |
( |
std::string |
name, |
|
|
void * |
address, |
|
|
const std::stringstream & |
leaflist |
|
) |
| |
|
inline |
template<typename T >
void sbnd::AnalysisTreeDataStruct::BranchCreator::operator() |
( |
std::string |
name, |
|
|
std::vector< T > & |
data, |
|
|
std::string |
leaflist |
|
) |
| |
|
inline |
template<typename T >
void sbnd::AnalysisTreeDataStruct::BranchCreator::operator() |
( |
std::string |
name, |
|
|
std::vector< T > & |
data |
|
) |
| |
|
inline |
Definition at line 769 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.
777 TBranch* pBranch =
pTree->GetBranch(
name.c_str());
782 MF_LOG_DEBUG(
"AnalysisTreeStructure")
783 <<
"Creating object branch '" <<
name
784 <<
" with " << TClass::GetClass(
typeid(T))->ClassName();
787 (*(
reinterpret_cast<std::vector<T>**
>(pBranch->GetAddress())) != &data)
794 pBranch->SetObject(&data);
795 MF_LOG_DEBUG(
"AnalysisTreeStructure")
796 <<
"Reassigning object to branch '" <<
name <<
"'";
799 MF_LOG_DEBUG(
"AnalysisTreeStructure")
800 <<
"Branch '" <<
name <<
"' is fine";
TTree * pTree
the tree to be worked on
TTree* sbnd::AnalysisTreeDataStruct::BranchCreator::pTree |
The documentation for this class was generated from the following file: