Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -64,7 +64,7 @@ public:
|
||||
//fReadEntry = a_entry;
|
||||
tools_vforit(branch*,m_branches,it) {
|
||||
uint32 n;
|
||||
if(!(*it)->find_entry(a_entry,n)) return false;
|
||||
if(!(*it)->find_entry(m_file,a_entry,n)) return false;
|
||||
nbytes += n;
|
||||
}
|
||||
a_nbytes = nbytes;
|
||||
@@ -81,31 +81,30 @@ public:
|
||||
_dump_branches(a_out,m_branches,a_spaces+a_indent,a_indent);
|
||||
}
|
||||
|
||||
branch* find_branch(const std::string& a_name,
|
||||
bool a_recursive = false) const {
|
||||
branch* find_branch(const std::string& a_name,bool a_recursive = false) const {
|
||||
return _find_branch(m_branches,a_name,a_recursive);
|
||||
}
|
||||
|
||||
std::vector<base_leaf*> find_leaves(){
|
||||
std::vector<base_leaf*> leaves;
|
||||
_find_leaves(m_branches,leaves);
|
||||
return leaves;
|
||||
base_leaf* find_leaf(const std::string& a_name,bool a_recursive = false) const {
|
||||
return _find_leaf(m_branches,a_name,a_recursive);
|
||||
}
|
||||
|
||||
std::vector<branch*> find_branches(){
|
||||
std::vector<branch*> _branches;
|
||||
_find_branches(m_branches,_branches);
|
||||
return _branches;
|
||||
void find_leaves(std::vector<base_leaf*>& a_leaves) const {
|
||||
a_leaves.clear();
|
||||
_find_leaves(m_branches,a_leaves);
|
||||
}
|
||||
|
||||
//branch* find_leaf_branch(base_leaf* a_leaf){
|
||||
// return _find_leaf_branch(m_branches,a_leaf);
|
||||
//}
|
||||
void find_branches(std::vector<branch*>& a_branches) const {
|
||||
a_branches.clear();
|
||||
_find_branches(m_branches,a_branches);
|
||||
}
|
||||
|
||||
branch* find_leaf_branch(const base_leaf& a_leaf) const {return _find_leaf_branch(m_branches,a_leaf);}
|
||||
|
||||
bool show(std::ostream& a_out,uint32 a_entry){
|
||||
a_out << "======> EVENT:" << a_entry << std::endl;
|
||||
tools_vforit(branch*,m_branches,it) {
|
||||
if(!(*it)->show(a_out,a_entry)) return false;
|
||||
if(!(*it)->show(a_out,m_file,a_entry)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -288,9 +287,9 @@ public:
|
||||
// the branches in the upper line of code.
|
||||
//::printf("debug : tree : read leaves : begin\n");
|
||||
{ObjArray<base_leaf> m_leaves(m_fac,true);
|
||||
branch b(m_file,m_fac);
|
||||
branch b(m_out,m_fac);
|
||||
ifac::args args;
|
||||
args[ifac::arg_branch()] = &b;
|
||||
//args[ifac::arg_branch()] = &b;
|
||||
if(!m_leaves.stream(a_buffer,args)) {
|
||||
m_out << "tools::rroot::tree::stream : "
|
||||
<< "can't read leaves."
|
||||
@@ -399,9 +398,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
branch* _find_branch(const std::vector<branch*>& a_bs,
|
||||
const std::string& a_name,
|
||||
bool a_recursive) const {
|
||||
static branch* _find_branch(const std::vector<branch*>& a_bs,const std::string& a_name,bool a_recursive) {
|
||||
tools_vforcit(branch*,a_bs,it) {
|
||||
if(tools::rcmp((*it)->name(),a_name)) return *it;
|
||||
if(a_recursive) {
|
||||
@@ -412,40 +409,41 @@ protected:
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _find_leaves(const std::vector<branch*>& a_bs,
|
||||
std::vector<base_leaf*>& a_leaves){
|
||||
static base_leaf* _find_leaf(const std::vector<branch*>& a_bs,const std::string& a_name,bool a_recursive) {
|
||||
tools_vforcit(branch*,a_bs,it) {
|
||||
{const std::vector<base_leaf*>& lvs = (*it)->leaves();
|
||||
tools_vforcit(base_leaf*,lvs,itl) {
|
||||
a_leaves.push_back(*itl);
|
||||
}}
|
||||
tools_vforcit(base_leaf*,(*it)->leaves(),itl) {
|
||||
if(tools::rcmp((*itl)->name(),a_name)) return *itl;
|
||||
}
|
||||
if(a_recursive) {
|
||||
base_leaf* lf = _find_leaf((*it)->branches(),a_name,a_recursive);
|
||||
if(lf) return lf;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _find_leaves(const std::vector<branch*>& a_bs,std::vector<base_leaf*>& a_leaves) {
|
||||
tools_vforcit(branch*,a_bs,it) {
|
||||
tools_vforcit(base_leaf*,(*it)->leaves(),itl) a_leaves.push_back(*itl);
|
||||
_find_leaves((*it)->branches(),a_leaves);
|
||||
}
|
||||
}
|
||||
|
||||
void _find_branches(const std::vector<branch*>& a_bs,
|
||||
std::vector<branch*>& a_branches){
|
||||
static void _find_branches(const std::vector<branch*>& a_bs,std::vector<branch*>& a_branches){
|
||||
tools_vforcit(branch*,a_bs,it) {
|
||||
a_branches.push_back(*it);
|
||||
_find_branches((*it)->branches(),a_branches);
|
||||
}
|
||||
}
|
||||
|
||||
//branch* _find_leaf_branch(const std::vector<branch*>& a_bs,
|
||||
// base_leaf* a_leaf){
|
||||
// std::vector<branch*>::const_iterator it;
|
||||
// for(it=a_bs.begin();it!=a_bs.end();++it) {
|
||||
// {const std::vector<base_leaf*>& lvs = (*it)->leaves();
|
||||
// std::vector<base_leaf*>::const_iterator itl;
|
||||
// for(itl=lvs.begin();itl!=lvs.end();++itl) {
|
||||
// if(*itl==a_leaf) return *it;
|
||||
// }}
|
||||
// {branch* br = _find_leaf_branch((*it)->branches(),a_leaf);
|
||||
// if(br) return br;}
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
static branch* _find_leaf_branch(const std::vector<branch*>& a_bs,const base_leaf& a_leaf) {
|
||||
tools_vforcit(branch*,a_bs,itb) {
|
||||
tools_vforcit(base_leaf*,(*itb)->leaves(),itl) {if(*itl==&a_leaf) return *itb;}
|
||||
{branch* br = _find_leaf_branch((*itb)->branches(),a_leaf);
|
||||
if(br) return br;}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
protected:
|
||||
ifile& m_file;
|
||||
ifac& m_fac;
|
||||
|
||||
Reference in New Issue
Block a user