DD4hep
1.31.0
Detector Description Toolkit for High Energy Physics
Main Page
Related Pages
Modules
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
_
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
u
Enumerator
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
b
d
g
o
p
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
x
Functions
_
c
d
g
h
i
l
m
n
o
p
r
s
u
Variables
Typedefs
_
a
c
d
e
f
g
j
l
o
p
r
s
t
u
v
x
Enumerations
Enumerator
Macros
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
DDCore
src
DetectorProcessor.cpp
Go to the documentation of this file.
1
//==========================================================================
2
// AIDA Detector description implementation
3
//--------------------------------------------------------------------------
4
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5
// All rights reserved.
6
//
7
// For the licensing terms see $DD4hepINSTALL/LICENSE.
8
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9
//
10
// Author : M.Frank
11
//
12
//==========================================================================
13
14
// Framework includes
15
#include <
DD4hep/Printout.h
>
16
#include <
DD4hep/DetectorProcessor.h
>
17
#include <
DD4hep/detail/ContainerHelpers.h
>
18
19
using namespace
dd4hep
;
20
22
DetectorProcessor::~DetectorProcessor
() {
23
}
24
26
int
DetectorProcessor::process
(
DetElement
de,
int
level,
bool
recursive)
const
{
27
if
( de.
isValid
() ) {
28
int
ret = (*this)(de, level);
29
if
( recursive ) {
30
for
(
const
auto
& c : de.children() )
31
ret +=
process
(c.second,level+1,recursive);
32
}
33
return
ret;
34
}
35
except(
"Detector"
,
"Cannot process an invalid detector element"
);
36
return
0;
37
}
38
40
template
<
typename
T>
41
int
DetElementsCollector<T>::operator()
(
DetElement
de,
int
level)
const
{
42
insert_item
(elements, de, level);
43
return
1;
44
}
45
47
namespace
dd4hep
{
48
//template class DetElementsCollector<T>;
49
template
class
DetElementsCollector<std::set<DetElement>
>;
50
template
class
DetElementsCollector<std::list<DetElement>
>;
51
template
class
DetElementsCollector<std::vector<DetElement>
>;
52
53
template
class
DetElementsCollector<std::set<std::pair<DetElement, int>
> >;
54
template
class
DetElementsCollector<std::list<std::pair<DetElement, int>
> >;
55
template
class
DetElementsCollector<std::vector<std::pair<DetElement, int>
> >;
56
}
/* End namespace dd4hep */
57
dd4hep::DetectorProcessor::~DetectorProcessor
virtual ~DetectorProcessor()
Default destructor.
Definition:
DetectorProcessor.cpp:22
DetectorProcessor.h
dd4hep::Handle::isValid
bool isValid() const
Check the validity of the object held by the handle.
Definition:
Handle.h:126
dd4hep::DetElement
Handle class describing a detector element.
Definition:
DetElement.h:187
dd4hep::insert_item
void insert_item(std::vector< T > &c, Q, const T &d)
Definition:
ContainerHelpers.h:37
dd4hep::DetectorProcessor::process
virtual int process(DetElement de, int level, bool recursive) const
Callback to output detector information of an entire DetElement.
Definition:
DetectorProcessor.cpp:26
dd4hep
Namespace for the AIDA detector description toolkit.
Definition:
AlignmentsCalib.h:28
dd4hep::DetElementsCollector
Generic detector element collector of a sub-tree.
Definition:
DetectorProcessor.h:129
dd4hep::DetElementsCollector::operator()
virtual int operator()(DetElement de, int level) const final
Callback to output elements information.
Definition:
DetectorProcessor.cpp:41
ContainerHelpers.h
Printout.h
Generated on Tue Apr 15 2025 16:54:23 for DD4hep by
1.8.18