Project
Loading...
Searching...
No Matches
SimTraits.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
19
20#ifndef O2_BASE_SIMTRAITS_
21#define O2_BASE_SIMTRAITS_
22
24
25namespace o2
26{
27namespace detectors
28{
29
32{
33 using VS = std::vector<std::string>;
34
35 public:
36 // initialization fragile since depends on correct order. Can we do better?
37
38 // clang-format off
39 static inline const std::array<std::vector<std::string>, DetID::nDetectors> DETECTORBRANCHNAMES =
40 { /*ITS*/ VS{ "ITSHit" },
41 /*TPC*/ VS{ "TPCHitsShiftedSector0",
42 "TPCHitsShiftedSector1",
43 "TPCHitsShiftedSector2",
44 "TPCHitsShiftedSector3",
45 "TPCHitsShiftedSector4",
46 "TPCHitsShiftedSector5",
47 "TPCHitsShiftedSector6",
48 "TPCHitsShiftedSector7",
49 "TPCHitsShiftedSector8",
50 "TPCHitsShiftedSector9",
51 "TPCHitsShiftedSector10",
52 "TPCHitsShiftedSector11",
53 "TPCHitsShiftedSector12",
54 "TPCHitsShiftedSector13",
55 "TPCHitsShiftedSector14",
56 "TPCHitsShiftedSector15",
57 "TPCHitsShiftedSector16",
58 "TPCHitsShiftedSector17",
59 "TPCHitsShiftedSector18",
60 "TPCHitsShiftedSector19",
61 "TPCHitsShiftedSector20",
62 "TPCHitsShiftedSector21",
63 "TPCHitsShiftedSector22",
64 "TPCHitsShiftedSector23",
65 "TPCHitsShiftedSector24",
66 "TPCHitsShiftedSector25",
67 "TPCHitsShiftedSector26",
68 "TPCHitsShiftedSector27",
69 "TPCHitsShiftedSector28",
70 "TPCHitsShiftedSector29",
71 "TPCHitsShiftedSector30",
72 "TPCHitsShiftedSector31",
73 "TPCHitsShiftedSector32",
74 "TPCHitsShiftedSector33",
75 "TPCHitsShiftedSector34",
76 "TPCHitsShiftedSector35"},
77 /*TRD*/ VS{ "TRDHit" },
78 /*TOF*/ VS{ "TOFHit" },
79 /*PHS*/ VS{ "PHSHit" },
80 /*CPV*/ VS{ "CPVHit" },
81 /*EMC*/ VS{ "EMCHit" },
82 /*HMP*/ VS{ "HMPHit" },
83 /*MFT*/ VS{ "MFTHit" },
84 /*MCH*/ VS{ "MCHHit" },
85 /*MID*/ VS{ "MIDHit" },
86 /*ZDC*/ VS{ "ZDCHit" },
87 /*FT0*/ VS{ "FT0Hit" },
88 /*FV0*/ VS{ "FV0Hit" },
89 /*FDD*/ VS{ "FDDHit" },
90 /*TST*/ VS{ "TSTHit" }, // former ACO
91 /*CTP*/ VS{ "CTPHit" },
92 /*FOC*/ VS{ "FOCHit" }
93#ifdef ENABLE_UPGRADES
94 ,
95 /*IT3*/ VS{ "IT3Hit" },
96 /*TRK*/ VS{ "TRKHit" },
97 /*FT3*/ VS{ "FT3Hit" },
98 /*FCT*/ VS{ "FCTHit" },
99 /*TF3*/ VS{ "TF3Hit" },
100 /*RCH*/ VS{ "RCHHit" },
101 /*MI3*/ VS{ "MI3Hit" },
102 /*ECL*/ VS{ "ECLHit" }
103#endif
104 };
105 // clang-format on
106
107 // branches that are related to kinematics and general event information
108 static inline const std::vector<std::string> KINEMATICSBRANCHES =
109 {"MCTrack", "MCEventHeader", "TrackRefs"};
110
112};
113
114} // namespace detectors
115
116// some forward declarations
117// forward declares the HitTypes
118namespace trd
119{
120class Hit;
121}
122namespace itsmft
123{
124class Hit;
125}
126namespace tof
127{
128class HitType;
129}
130namespace emcal
131{
132class Hit;
133}
134namespace phos
135{
136class Hit;
137}
138namespace ft0
139{
140class HitType;
141}
142namespace hmpid
143{
144class HitType;
145}
146namespace fdd
147{
148class Hit;
149}
150namespace fv0
151{
152class Hit;
153}
154namespace mch
155{
156class Hit;
157}
158namespace mid
159{
160class Hit;
161}
162namespace zdc
163{
164class Hit;
165}
166namespace tpc
167{
168class HitGroup;
169}
170namespace focal
171{
172class Hit;
173}
174namespace detectors
175{
176
177// mapping the DetID to hit types
178// traits for detectors
179template <int N>
181 using HitType = void;
182};
183
184// specialize for detectors
185template <>
189template <>
193template <>
197template <>
201template <>
205template <>
209template <>
213template <>
217template <>
221template <>
225template <>
229template <>
233template <>
237template <>
241#ifdef ENABLE_UPGRADES
242template <>
243struct DetIDToHitTypes<o2::detectors::DetID::IT3> {
244 using HitType = o2::itsmft::Hit;
245};
246template <>
247struct DetIDToHitTypes<o2::detectors::DetID::TRK> {
248 using HitType = o2::itsmft::Hit;
249};
250template <>
251struct DetIDToHitTypes<o2::detectors::DetID::FT3> {
252 using HitType = o2::itsmft::Hit;
253};
254template <>
255struct DetIDToHitTypes<o2::detectors::DetID::FCT> {
256 using HitType = o2::itsmft::Hit;
257};
258#endif
259
260} // namespace detectors
261
262} // namespace o2
263
264#endif
static constexpr ID FV0
Definition DetID.h:76
static constexpr ID PHS
Definition DetID.h:67
static constexpr ID MID
Definition DetID.h:73
static constexpr ID ITS
Definition DetID.h:63
static constexpr ID MFT
Definition DetID.h:71
static constexpr int nDetectors
number of defined detectors
Definition DetID.h:96
static constexpr ID ZDC
Definition DetID.h:74
static constexpr ID FT0
Definition DetID.h:75
static constexpr ID TRD
Definition DetID.h:65
static constexpr ID FOC
Definition DetID.h:80
static constexpr ID TPC
Definition DetID.h:64
static constexpr ID EMC
Definition DetID.h:69
static constexpr ID MCH
Definition DetID.h:72
static constexpr ID HMP
Definition DetID.h:70
static constexpr ID TOF
Definition DetID.h:66
Static class standardizing names / branches / other properties for simulation properties.
Definition SimTraits.h:32
static const std::vector< std::string > KINEMATICSBRANCHES
Definition SimTraits.h:108
ClassDefNV(SimTraits, 1)
static const std::array< std::vector< std::string >, DetID::nDetectors > DETECTORBRANCHNAMES
Definition SimTraits.h:39
EMCAL simulation hit information.
Definition Hit.h:28
Common FOCAL hit class for the detector simulation.
Definition Hit.h:28
PHOS simulation hit information.
Definition Hit.h:25
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
std::string detectors(const std::vector< std::string > &det, unsigned mask)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...