ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigDecisionTool
TrigDecisionTool
ClassTraits.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
3
/*
4
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
8
#ifndef TRIGGER_DECISION_TOOL_ClassTraits_H
9
#define TRIGGER_DECISION_TOOL_ClassTraits_H
10
11
namespace
TrigDec
{
12
13
// Here we define the trait classes. The basic problem is
14
// this:
15
//
16
// Some classes are attached to the navigation as basic objects
17
// for example - MuonFeature
18
// Other classes are attached to the navigation as containers of
19
// objects for example - egamma's are attached as egammaContainers
20
// Still other classes are not attached at all, but can be gotten
21
// from the ancestor method in the TDT, such as the L1 items
22
// We need to make this complexity invisible to the user, so they
23
// can just call whatever they want to match to and not worry
24
// about how it interacts with the navigation
25
// We solve this with traits classes (thanks to Scott Snyder for
26
// the suggestion) which tell us whether or not a class is a
27
// container and if it is, allows us to map from the class to
28
// the container class and similarly for ancest style objects
29
30
struct
DirectAttached
{};
// identifies objects as attached directly
31
struct
AncestorAttached
{};
// identifies objects as attached via ancest
32
33
// by default, we assume a class is attached directly
34
template
<
typename
T>
35
struct
ClassTraits
{
36
typedef
T
type
;
37
};
38
39
}
40
41
// now we specialize for the container classes
42
43
// This macro specializes the definition of the
44
// ContainerForClass trait class
45
#define SPECIALIZE_CONTAINER_FOR_CLASS(x,y) \
46
namespace TrigDec { \
47
template<> \
48
struct ClassTraits<x> { \
49
typedef y type; \
50
}; \
51
}
52
53
// This macro does the forward declaration
54
// for objects without a namespace
55
#define DECLARE_ATTACHED_CONTAINER(x,y) \
56
class x; \
57
class y; \
58
SPECIALIZE_CONTAINER_FOR_CLASS(x,y)
59
60
// This macro does the forward declaration
61
// for objects with the same namespace
62
// as the container
63
#define DECLARE_ATTACHED_CONTAINER_NAMESPACE(a,x,y) \
64
namespace a { \
65
class x; \
66
class y; \
67
} \
68
SPECIALIZE_CONTAINER_FOR_CLASS(a::x,a::y)
69
70
// This macro does the forward declaration
71
// for objects with a namespace, but not namespace
72
// on the container
73
#define DECLARE_ATTACHED_CONTAINER_OBJECT_NAMESPACE(a,x,y) \
74
namespace a { \
75
class x; \
76
} \
77
class y; \
78
SPECIALIZE_CONTAINER_FOR_CLASS(a::x,y)
79
80
// This macro does the forward declaration
81
// for objects with a namespace, and containers
82
// that are a typedef
83
#define DECLARE_ATTACHED_CONTAINER_TYPEDEF(a, x, y) \
84
namespace a { \
85
class x; \
86
} \
87
SPECIALZE_CONTAINER_FOR_CLASS(a::x, y)
88
89
DECLARE_ATTACHED_CONTAINER
(
CaloCell
,
CaloCellContainer
)
90
//DECLARE_ATTACHED_CONTAINER(CosmicMuon, CosmicMuonCollection)
91
//DECLARE_ATTACHED_CONTAINER(MdtTrackSegment, MdtTrackSegmentCollection)
92
DECLARE_ATTACHED_CONTAINER
(
TrigInDetTrack
,
TrigInDetTrackCollection
)
93
DECLARE_ATTACHED_CONTAINER
(
TrigVertex
,
TrigVertexCollection
)
94
DECLARE_ATTACHED_CONTAINER
(
CaloCluster
,
CaloClusterContainer
)
95
DECLARE_ATTACHED_CONTAINER
(
CaloShower
,
CaloShowerContainer
)
96
DECLARE_ATTACHED_CONTAINER
(egamma, egammaContainer)
97
DECLARE_ATTACHED_CONTAINER_NAMESPACE
(
Rec
, TrackParticle, TrackParticleContainer)
98
DECLARE_ATTACHED_CONTAINER_NAMESPACE
(
Analysis
, TauDetails, TauDetailsContainer)
99
DECLARE_ATTACHED_CONTAINER_NAMESPACE
(
Analysis
, TauJet, TauJetContainer)
100
DECLARE_ATTACHED_CONTAINER
(
Jet
, JetCollection)
101
DECLARE_ATTACHED_CONTAINER
(
CaloTower
,
CaloTowerContainer
)
102
DECLARE_ATTACHED_CONTAINER
(egDetail, egDetailContainer)
103
DECLARE_ATTACHED_CONTAINER_OBJECT_NAMESPACE
(
Trk
, VxCandidate,
VxContainer
)
104
105
#undef SPECIALIZE_CONTAINER_FOR_CLASS
106
#undef DECLARE_ATTACHED_CONTAINER
107
#undef DECLARE_ATTACHED_CONTAINER_NAMESPACE
108
#undef DECLARE_ATTACHED_CONTAINER_TYPEDEF
109
#undef DECLARE_ATTACHED_CONTAINER_OBJECT_NAMESPACE
110
111
// now we set up the traits for the L1 items
112
113
// this macro setups a template specialization
114
// for the L1 objects
115
/*
116
#define DECLARE_L1_TRIGGER_OBJECT(x) \
117
class x; \
118
namespace TrigDec { \
119
template<> \
120
struct ClassTraits<x> { \
121
typedef AncestorAttached type; \
122
}; \
123
}
124
125
DECLARE_L1_TRIGGER_OBJECT(Muon_ROI)
126
DECLARE_L1_TRIGGER_OBJECT(Jet_ROI)
127
DECLARE_L1_TRIGGER_OBJECT(EmTau_ROI)
128
*/
129
#undef DECLARE_L1_TRIGGER_OBJECT
130
131
#endif
DECLARE_ATTACHED_CONTAINER_OBJECT_NAMESPACE
#define DECLARE_ATTACHED_CONTAINER_OBJECT_NAMESPACE(a, x, y)
Definition
ClassTraits.h:73
DECLARE_ATTACHED_CONTAINER
#define DECLARE_ATTACHED_CONTAINER(x, y)
Definition
ClassTraits.h:55
DECLARE_ATTACHED_CONTAINER_NAMESPACE
#define DECLARE_ATTACHED_CONTAINER_NAMESPACE(a, x, y)
Definition
ClassTraits.h:63
Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloClusterContainer
Storable container for CaloCluster.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloClusterContainer.h:37
CaloCluster
Principal data class for CaloCell clusters.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
CaloShowerContainer
Container class for CaloShower.
Definition
CaloShowerContainer.h:15
CaloShower
Data class for cluster variables associated with a CaloCluster.
Definition
CaloShower.h:12
CaloTowerContainer
Storable container class for CaloTower.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h:77
CaloTower
Data class for calorimeter cell towers.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloTower.h:55
TrigInDetTrackCollection
Definition
TrigInDetTrackCollection.h:13
TrigInDetTrack
represents a LVL2 ID track
Definition
TrigInDetTrack.h:34
TrigVertexCollection
Definition
TrigVertexCollection.h:13
TrigVertex
encapsulates LVL2 vertex parameters (in the global reference frame), covariance matrix,...
Definition
TrigVertex.h:31
VxContainer
Definition
VxContainer.h:28
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition
IConstituent.h:25
Rec
namespace for combined reconstruction tools and interfaces
Definition
FakeTrackBuilder.h:10
TrigDec
Definition
ITrigDecisionCnvTool.h:18
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
TrigDec::AncestorAttached
Definition
ClassTraits.h:31
TrigDec::ClassTraits
Definition
ClassTraits.h:35
TrigDec::ClassTraits::type
T type
Definition
ClassTraits.h:36
TrigDec::DirectAttached
Definition
ClassTraits.h:30
Generated on
for ATLAS Offline Software by
1.17.0