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 /*FD */ VS{ "FDHit" }
104#endif
105 };
106 // clang-format on
107
108 // branches that are related to kinematics and general event information
109 static inline const std::vector<std::string> KINEMATICSBRANCHES =
110 {"MCTrack", "MCEventHeader", "TrackRefs"};
111
113};
114
115} // namespace detectors
116
117// some forward declarations
118// forward declares the HitTypes
119namespace trd
120{
121class Hit;
122}
123namespace itsmft
124{
125class Hit;
126}
127namespace tof
128{
129class HitType;
130}
131namespace emcal
132{
133class Hit;
134}
135namespace phos
136{
137class Hit;
138}
139namespace ft0
140{
141class HitType;
142}
143namespace hmpid
144{
145class HitType;
146}
147namespace fdd
148{
149class Hit;
150}
151namespace fv0
152{
153class Hit;
154}
155namespace mch
156{
157class Hit;
158}
159namespace mid
160{
161class Hit;
162}
163namespace zdc
164{
165class Hit;
166}
167namespace tpc
168{
169class HitGroup;
170}
171namespace focal
172{
173class Hit;
174}
175namespace detectors
176{
177
178// mapping the DetID to hit types
179// traits for detectors
180template <int N>
182 using HitType = void;
183};
184
185// specialize for detectors
186template <>
190template <>
194template <>
198template <>
202template <>
206template <>
210template <>
214template <>
218template <>
222template <>
226template <>
230template <>
234template <>
238template <>
242#ifdef ENABLE_UPGRADES
243template <>
244struct DetIDToHitTypes<o2::detectors::DetID::IT3> {
245 using HitType = o2::itsmft::Hit;
246};
247template <>
248struct DetIDToHitTypes<o2::detectors::DetID::TRK> {
249 using HitType = o2::itsmft::Hit;
250};
251template <>
252struct DetIDToHitTypes<o2::detectors::DetID::FT3> {
253 using HitType = o2::itsmft::Hit;
254};
255template <>
256struct DetIDToHitTypes<o2::detectors::DetID::FCT> {
257 using HitType = o2::itsmft::Hit;
258};
259#endif
260
261} // namespace detectors
262
263} // namespace o2
264
265#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:97
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:109
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 ...