ATLAS Offline Software
Loading...
Searching...
No Matches
ClassTraits.h
Go to the documentation of this file.
1// -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2017 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
11namespace 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
93 //DECLARE_ATTACHED_CONTAINER(CosmicMuon, CosmicMuonCollection)
94 //DECLARE_ATTACHED_CONTAINER(MdtTrackSegment, MdtTrackSegmentCollection)
103 DECLARE_ATTACHED_CONTAINER_NAMESPACE(Rec, TrackParticle, TrackParticleContainer)
104 DECLARE_ATTACHED_CONTAINER_NAMESPACE(Analysis, TauDetails, TauDetailsContainer)
112
113#undef SPECIALIZE_CONTAINER_FOR_CLASS
114#undef DECLARE_ATTACHED_CONTAINER
115#undef DECLARE_ATTACHED_CONTAINER_NAMESPACE
116#undef DECLARE_ATTACHED_CONTAINER_TYPEDEF
117#undef DECLARE_ATTACHED_CONTAINER_OBJECT_NAMESPACE
118
119// now we set up the traits for the L1 items
120
121// this macro setups a template specialization
122// for the L1 objects
123 /*
124 #define DECLARE_L1_TRIGGER_OBJECT(x) \
125 class x; \
126 namespace TrigDec { \
127 template<> \
128 struct ClassTraits<x> { \
129 typedef AncestorAttached type; \
130 }; \
131 }
132
133 DECLARE_L1_TRIGGER_OBJECT(Muon_ROI)
134 DECLARE_L1_TRIGGER_OBJECT(Jet_ROI)
135 DECLARE_L1_TRIGGER_OBJECT(EmTau_ROI)
136 */
137#undef DECLARE_L1_TRIGGER_OBJECT
138
139#endif
#define DECLARE_ATTACHED_CONTAINER_OBJECT_NAMESPACE(a, x, y)
Definition ClassTraits.h:73
#define DECLARE_ATTACHED_CONTAINER(x, y)
Definition ClassTraits.h:55
#define DECLARE_ATTACHED_CONTAINER_NAMESPACE(a, x, y)
Definition ClassTraits.h:63
@ TauJet
Container class for CaloCell.
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
Principal data class for CaloCell clusters.
Container class for CaloShower.
Data class for cluster variables associated with a CaloCluster.
Definition CaloShower.h:12
Storable container class for CaloTower.
Data class for calorimeter cell towers.
Container of TrigEFBjet objects to be stored in POOL.
Class representing a b-jet candidate created at EF.
Definition TrigEFBjet.h:38
represents a LVL2 ID track
Container of TrigEFBjet objects to be stored in POOL.
Class representing a b-jet candidate created at L2.
Definition TrigL2Bjet.h:38
encapsulates LVL2 vertex parameters (in the global reference frame), covariance matrix,...
Definition TrigVertex.h:28
Container for detailed egamma information.
Base class for detailed egamma information.
Definition egDetail.h:29
This is a data object, containing a collection of egamma Objects.
elec/gamma data class.
Definition egamma.h:58
The namespace of all packages in PhysicsAnalysis/JetTagging.
Gaudi Tools.
Ensure that the ATLAS eigen extensions are properly loaded.