File indexing completed on 2025-01-18 09:14:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/VolumeProcessor.h>
0017
0018 using namespace dd4hep;
0019
0020
0021 PlacedVolumeProcessor::~PlacedVolumeProcessor() noexcept(false) {
0022 }
0023
0024
0025 int PlacedVolumeProcessor::process(PlacedVolume pv, int level, bool recursive) {
0026 if ( pv.isValid() ) {
0027 int ret = (*this)(pv, level);
0028 TGeoNode* node = pv.ptr();
0029 if ( recursive ) {
0030 for (Int_t idau = 0, ndau = node->GetNdaughters(); idau < ndau; ++idau) {
0031 PlacedVolume placement(node->GetDaughter(idau));
0032
0033 ret += process(placement,level+1,recursive);
0034
0035 }
0036 }
0037 return ret;
0038 }
0039 except("PlacedVolume","Cannot process an invalid PlacedVolume element");
0040 return 0;
0041 }