File indexing completed on 2025-01-30 09:16:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/DetectorProcessor.h>
0017 #include <DD4hep/detail/ContainerHelpers.h>
0018
0019 using namespace dd4hep;
0020
0021
0022 DetectorProcessor::~DetectorProcessor() {
0023 }
0024
0025
0026 int DetectorProcessor::process(DetElement de, int level, bool recursive) const {
0027 if ( de.isValid() ) {
0028 int ret = (*this)(de, level);
0029 if ( recursive ) {
0030 for (const auto& c : de.children() )
0031 ret += process(c.second,level+1,recursive);
0032 }
0033 return ret;
0034 }
0035 except("Detector","Cannot process an invalid detector element");
0036 return 0;
0037 }
0038
0039
0040 template <typename T>
0041 int DetElementsCollector<T>::operator()(DetElement de, int level) const {
0042 insert_item(elements, de, level);
0043 return 1;
0044 }
0045
0046
0047 namespace dd4hep {
0048
0049 template class DetElementsCollector<std::set<DetElement> >;
0050 template class DetElementsCollector<std::list<DetElement> >;
0051 template class DetElementsCollector<std::vector<DetElement> >;
0052
0053 template class DetElementsCollector<std::set<std::pair<DetElement, int> > >;
0054 template class DetElementsCollector<std::list<std::pair<DetElement, int> > >;
0055 template class DetElementsCollector<std::vector<std::pair<DetElement, int> > >;
0056 }
0057