-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathVolumeProcessor.cpp
41 lines (37 loc) · 1.33 KB
/
VolumeProcessor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//==========================================================================
// AIDA Detector description implementation
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
//
//==========================================================================
// Framework includes
#include "DD4hep/Printout.h"
#include "DD4hep/VolumeProcessor.h"
using namespace dd4hep;
/// Default destructor
PlacedVolumeProcessor::~PlacedVolumeProcessor() noexcept(false) {
}
/// Callback to output PlacedVolume information of an entire DetElement
int PlacedVolumeProcessor::process(PlacedVolume pv, int level, bool recursive) {
if ( pv.isValid() ) {
int ret = (*this)(pv, level);
TGeoNode* node = pv.ptr();
if ( recursive ) {
for (Int_t idau = 0, ndau = node->GetNdaughters(); idau < ndau; ++idau) {
PlacedVolume placement(node->GetDaughter(idau));
//if ( placement.data() ) {
ret += process(placement,level+1,recursive);
//}
}
}
return ret;
}
except("PlacedVolume","Cannot process an invalid PlacedVolume element");
return 0;
}