Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:10:22

0001 
0002 #define TOOLS_WROOT_MT_NTUPLE_SET_MAX(a__type) \
0003      {leaf_ref<a__type>* _mleaf_ = _mleaf?id_cast<base_leaf, leaf_ref<a__type> >(*_mleaf):0;\
0004       leaf_ref<a__type>* _pleaf_ = _pleaf?id_cast<base_leaf, leaf_ref<a__type> >(*_pleaf):0;\
0005       if(_mleaf_&&!_pleaf_) {\
0006         m_out << "tools::wroot::mt_ntuple::end_leaves : merge leaves problem (1)." << std::endl;\
0007         if(_mleaf) m_out << "main leaf name " << _mleaf->name() << ", cid " << _mleaf->id_cls() << std::endl;\
0008         return false;\
0009       }\
0010       if(!_mleaf_&&_pleaf_) {\
0011         m_out << "tools::wroot::mt_ntuple::end_leaves : merge leaves problem (2)." << std::endl;\
0012         if(_pleaf) m_out << "to compare with parallel leaf name " << _pleaf->name() << ", cid " << _pleaf->id_cls() << std::endl;\
0013         return false;\
0014       }\
0015       if(_mleaf_ && _pleaf_) {\
0016         a__type _mx = _pleaf_->get_max();\
0017         a_mutex.lock(); /*do it here (and not outside loop) because of upper m_out.*/\
0018         _mleaf_->set_max(max_of<a__type>(_mx,_mleaf_->get_max()));\
0019         a_mutex.unlock();\
0020       }}
0021 
0022 #define TOOLS_WROOT_MT_NTUPLE_STRING_SET_MAX \
0023      {leaf_string_ref* _mleaf_ = _mleaf?id_cast<base_leaf,leaf_string_ref>(*_mleaf):0;\
0024       leaf_string_ref* _pleaf_ = _pleaf?id_cast<base_leaf,leaf_string_ref>(*_pleaf):0;\
0025       if(_mleaf_&&!_pleaf_) {\
0026         m_out << "tools::wroot::mt_ntuple::end_leaves : merge string leaves problem (1)." << std::endl;\
0027         if(_mleaf) m_out << "main leaf name " << _mleaf->name() << ", cid " << _mleaf->id_cls() << std::endl;\
0028         return false;\
0029       }\
0030       if(!_mleaf_&&_pleaf_) {\
0031         m_out << "tools::wroot::mt_ntuple::end_leaves : merge string leaves problem (2)." << std::endl;\
0032         if(_pleaf) m_out << "to compare with parallel leaf name " << _pleaf->name() << ", cid " << _pleaf->id_cls() << std::endl;\
0033         return false;\
0034       }\
0035       if(_mleaf_ && _pleaf_) {\
0036         uint32 _length = _pleaf_->length();\
0037         int _mx = _pleaf_->get_max();\
0038         a_mutex.lock(); /*do it here (and not outside loop) because of upper m_out.*/\
0039         _mleaf_->set_length(max_of(_length,_mleaf_->length()));\
0040         _mleaf_->set_max(max_of(_mx,_mleaf_->get_max()));\
0041         a_mutex.unlock();\
0042       }}
0043