Skip to content

Commit 09e1dd4

Browse files
authored
ALICE3toAO2D macro for tests (#5344)
1 parent ffc8b77 commit 09e1dd4

File tree

7 files changed

+1043
-2
lines changed

7 files changed

+1043
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
2+
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
3+
# verbatim in the file "COPYING".
4+
#
5+
# See http://alice-o2.web.cern.ch/license for full licensing information.
6+
#
7+
# In applying this license CERN does not waive the privileges and immunities
8+
# granted to it by virtue of its status as an Intergovernmental Organization or
9+
# submit itself to any jurisdiction.
10+
11+
o2_add_library(UpgradesAODUtils
12+
SOURCES src/Run2LikeAO2D.cxx
13+
PUBLIC_LINK_LIBRARIES ROOT::Core)
14+
15+
o2_target_root_dictionary(UpgradesAODUtils
16+
HEADERS include/UpgradesAODUtils/Run2LikeAO2D.h)
Lines changed: 312 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,312 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
/// \file Run2LikeAO2D.h
12+
13+
//******************************************************************
14+
// AO2D helper information
15+
//
16+
// This header contains basic info needed to mimick a Run 2-like
17+
// converted AO2D file. Its current use case is the ALICE 3
18+
// G3/G4 simulation to AO2D conversion.
19+
//
20+
//******************************************************************
21+
#ifndef RUN2LIKE_AOD_H
22+
#define RUN2LIKE_AOD_H
23+
#include <TString.h>
24+
25+
namespace o2
26+
{
27+
namespace upgrades_utils
28+
{
29+
30+
enum TreeIndex { // Index of the output trees
31+
kEvents = 0, //ok
32+
kEventsExtra, //ok
33+
kTracks, //ok
34+
kCalo, //N/A
35+
kCaloTrigger, //N/A
36+
kMuon, //N/A
37+
kMuonCls, //N/A
38+
kZdc, //N/A
39+
kFV0A, //N/A
40+
kFV0C, //N/A
41+
kFT0, //N/A
42+
kFDD, //N/A
43+
kV0s, //may be ok (requires tuning)
44+
kCascades, //may be ok (requires tuning)
45+
kTOF, //N/A... for now
46+
kMcParticle, //MC operation
47+
kMcCollision, //MC operation
48+
kMcTrackLabel, //MC operation
49+
kMcCaloLabel, //N/A
50+
kMcCollisionLabel, //MC operation
51+
kBC, //N/A
52+
kTrees //N/A
53+
};
54+
55+
enum TrackTypeEnum : uint8_t {
56+
GlobalTrack = 0,
57+
ITSStandalone,
58+
MFTStandalone,
59+
Run2GlobalTrack = 254,
60+
Run2Tracklet = 255
61+
}; // corresponds to O2/Core/Framework/include/Framework/DataTypes.h
62+
enum TrackFlagsRun2Enum {
63+
ITSrefit = 0x1,
64+
TPCrefit = 0x2,
65+
GoldenChi2 = 0x4
66+
}; // corresponds to O2/Core/Framework/include/Framework/DataTypes.h
67+
enum MCParticleFlags : uint8_t {
68+
ProducedInTransport = 1 // Bit 0: 0 = from generator; 1 = from transport
69+
};
70+
71+
const TString gTreeName[kTrees] = {"O2collision", "DbgEventExtra", "O2track", "O2calo", "O2calotrigger", "O2muon", "O2muoncluster", "O2zdc", "O2fv0a", "O2fv0c", "O2ft0", "O2fdd", "O2v0", "O2cascade", "O2tof", "O2mcparticle", "O2mccollision", "O2mctracklabel", "O2mccalolabel", "O2mccollisionlabel", "O2bc"};
72+
const TString gTreeTitle[kTrees] = {"Collision tree", "Collision extra", "Barrel tracks", "Calorimeter cells", "Calorimeter triggers", "MUON tracks", "MUON clusters", "ZDC", "FV0A", "FV0C", "FT0", "FDD", "V0s", "Cascades", "TOF hits", "Kinematics", "MC collisions", "MC track labels", "MC calo labels", "MC collision labels", "BC info"};
73+
74+
const Bool_t gSaveTree[kTrees] = {kTRUE, kFALSE, kTRUE, kFALSE, kFALSE, kFALSE, kFALSE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE,
75+
//V0 and cascade (not done for now)
76+
kFALSE, kFALSE,
77+
//TOF
78+
kFALSE,
79+
//MC information (not done for now)
80+
kTRUE, kTRUE, kTRUE, kFALSE, kTRUE, kTRUE};
81+
82+
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
83+
// structs for AO2D convenience
84+
// straight from AO2D converter
85+
struct {
86+
// Event data
87+
Int_t fBCsID = 0u; /// Index to BC table
88+
// Primary vertex position
89+
Float_t fPosX = -999.f; /// Primary vertex x coordinate
90+
Float_t fPosY = -999.f; /// Primary vertex y coordinate
91+
Float_t fPosZ = -999.f; /// Primary vertex z coordinate
92+
// Primary vertex covariance matrix
93+
Float_t fCovXX = 999.f; /// cov[0]
94+
Float_t fCovXY = 0.f; /// cov[1]
95+
Float_t fCovXZ = 0.f; /// cov[2]
96+
Float_t fCovYY = 999.f; /// cov[3]
97+
Float_t fCovYZ = 0.f; /// cov[4]
98+
Float_t fCovZZ = 999.f; /// cov[5]
99+
// Quality parameters
100+
Float_t fChi2 = 999.f; /// Chi2 of the vertex
101+
UInt_t fN = 0u; /// Number of contributors
102+
103+
// The calculation of event time certainly will be modified in Run3
104+
// The prototype below can be switched on request
105+
Float_t fCollisionTime = 10; /// Event time (t0) obtained with different methods (best, T0, T0-TOF, ...)
106+
Float_t fCollisionTimeRes = 1e-3; /// Resolution on the event time (t0) obtained with different methods (best, T0, T0-TOF, ...)
107+
UChar_t fCollisionTimeMask = 0u; /// Mask with the method used to compute the event time (0x1=T0-TOF,0x2=T0A,0x3=TOC) for each momentum bins
108+
109+
} collision; //! structure to keep the primary vertex (avoid name conflicts)
110+
111+
struct {
112+
// Start indices and numbers of elements for data in the other trees matching this vertex.
113+
// Needed for random access of collision-related data, allowing skipping data discarded by the user
114+
Int_t fStart[kTrees] = {0}; /// Start entry indices for data in the other trees matching this vertex
115+
Int_t fNentries[kTrees] = {0}; /// Numbers of entries for data in the other trees matching this vertex
116+
} eventextra; //! structure for benchmarking information
117+
118+
struct {
119+
int fRunNumber = -1; /// Run number
120+
ULong64_t fGlobalBC = 0u; /// Unique bunch crossing id. Contains period, orbit and bunch crossing numbers
121+
ULong64_t fTriggerMask = 0u; /// Trigger class mask
122+
} bc; //! structure to keep trigger-related info
123+
124+
struct {
125+
// Track data
126+
127+
Int_t fCollisionsID = -1; /// The index of the collision vertex in the TF, to which the track is attached
128+
129+
uint8_t fTrackType = 0; // Type of track: global, ITS standalone, tracklet, ...
130+
131+
// In case we need connection to TOF clusters, activate next lines
132+
// Int_t fTOFclsIndex; /// The index of the associated TOF cluster
133+
// Int_t fNTOFcls; /// The number of TOF clusters
134+
135+
// Coordinate system parameters
136+
Float_t fX = -999.f; /// X coordinate for the point of parametrisation
137+
Float_t fAlpha = -999.f; /// Local <--> global coor.system rotation angle
138+
139+
// Track parameters
140+
Float_t fY = -999.f; /// fP[0] local Y-coordinate of a track (cm)
141+
Float_t fZ = -999.f; /// fP[1] local Z-coordinate of a track (cm)
142+
Float_t fSnp = -999.f; /// fP[2] local sine of the track momentum azimuthal angle
143+
Float_t fTgl = -999.f; /// fP[3] tangent of the track momentum dip angle
144+
Float_t fSigned1Pt = -999.f; /// fP[4] 1/pt (1/(GeV/c))
145+
146+
// "Covariance matrix"
147+
// The diagonal elements represent the errors = Sqrt(C[i,i])
148+
// The off-diagonal elements are the correlations = C[i,j]/Sqrt(C[i,i])/Sqrt(C[j,j])
149+
// The off-diagonal elements are multiplied by 128 (7bits) and packed in Char_t
150+
Float_t fSigmaY = -999.f; /// Sqrt(fC[0])
151+
Float_t fSigmaZ = -999.f; /// Sqrt(fC[2])
152+
Float_t fSigmaSnp = -999.f; /// Sqrt(fC[5])
153+
Float_t fSigmaTgl = -999.f; /// Sqrt(fC[9])
154+
Float_t fSigma1Pt = -999.f; /// Sqrt(fC[14])
155+
Char_t fRhoZY = 0; /// 128*fC[1]/SigmaZ/SigmaY
156+
Char_t fRhoSnpY = 0; /// 128*fC[3]/SigmaSnp/SigmaY
157+
Char_t fRhoSnpZ = 0; /// 128*fC[4]/SigmaSnp/SigmaZ
158+
Char_t fRhoTglY = 0; /// 128*fC[6]/SigmaTgl/SigmaY
159+
Char_t fRhoTglZ = 0; /// 128*fC[7]/SigmaTgl/SigmaZ
160+
Char_t fRhoTglSnp = 0; /// 128*fC[8]/SigmaTgl/SigmaSnp
161+
Char_t fRho1PtY = 0; /// 128*fC[10]/Sigma1Pt/SigmaY
162+
Char_t fRho1PtZ = 0; /// 128*fC[11]/Sigma1Pt/SigmaZ
163+
Char_t fRho1PtSnp = 0; /// 128*fC[12]/Sigma1Pt/SigmaSnp
164+
Char_t fRho1PtTgl = 0; /// 128*fC[13]/Sigma1Pt/SigmaTgl
165+
166+
// Additional track parameters
167+
Float_t fTPCinnerP = -999.f; /// Full momentum at the inner wall of TPC for dE/dx PID
168+
169+
// Track quality parameters
170+
UInt_t fFlags = 0u; /// Reconstruction status flags
171+
172+
// Clusters and tracklets
173+
UChar_t fITSClusterMap = 0u; /// ITS map of clusters, one bit per a layer
174+
UChar_t fTPCNClsFindable = 0u; /// number of clusters that could be assigned in the TPC
175+
Char_t fTPCNClsFindableMinusFound = 0; /// difference between foundable and found clusters
176+
Char_t fTPCNClsFindableMinusCrossedRows = 0; /// difference between foundable clsuters and crossed rows
177+
UChar_t fTPCNClsShared = 0u; /// Number of shared clusters
178+
UChar_t fTRDPattern = 0u; /// Bit 0-5 if tracklet from TRD layer used for this track
179+
180+
// Chi2
181+
Float_t fITSChi2NCl = -999.f; /// chi2/Ncl ITS
182+
Float_t fTPCChi2NCl = -999.f; /// chi2/Ncl TPC
183+
Float_t fTRDChi2 = -999.f; /// chi2 TRD match (?)
184+
Float_t fTOFChi2 = -999.f; /// chi2 TOF match (?)
185+
186+
// PID
187+
Float_t fTPCSignal = -999.f; /// dE/dX TPC
188+
Float_t fTRDSignal = -999.f; /// dE/dX TRD
189+
Float_t fTOFSignal = -999.f; /// TOFsignal
190+
Float_t fLength = -999.f; /// Int.Lenght @ TOF
191+
Float_t fTOFExpMom = -999.f; /// TOF Expected momentum based on the expected time of pions
192+
193+
// Track extrapolation to EMCAL surface
194+
Float_t fTrackEtaEMCAL = -999.f; /// Track eta at the EMCAL surface
195+
Float_t fTrackPhiEMCAL = -999.f; /// Track phi at the EMCAL surface
196+
} tracks; //! structure to keep track information
197+
198+
struct {
199+
// MC collision
200+
Int_t fBCsID = 0u; /// Index to BC table
201+
Short_t fGeneratorsID = 0u; /// Generator ID used for the MC
202+
Float_t fPosX = -999.f; /// Primary vertex x coordinate from MC
203+
Float_t fPosY = -999.f; /// Primary vertex y coordinate from MC
204+
Float_t fPosZ = -999.f; /// Primary vertex z coordinate from MC
205+
Float_t fT = -999.f; /// Time of the collision from MC
206+
Float_t fWeight = -999.f; /// Weight from MC
207+
// Generation details (HepMC3 in the future)
208+
Float_t fImpactParameter = -999.f; /// Impact parameter from MC
209+
} mccollision; //! MC collisions = vertices
210+
211+
struct {
212+
// Track label to find the corresponding MC particle
213+
UInt_t fLabel = 0; /// Track label
214+
UShort_t fLabelMask = 0; /// Bit mask to indicate detector mismatches (bit ON means mismatch)
215+
/// Bit 0-6: mismatch at ITS layer
216+
/// Bit 7-9: # of TPC mismatches in the ranges 0, 1, 2-3, 4-7, 8-15, 16-31, 32-63, >64
217+
/// Bit 10: TRD, bit 11: TOF, bit 15: negative label sign
218+
} mctracklabel; //! Track labels
219+
220+
struct {
221+
// MC particle
222+
223+
Int_t fMcCollisionsID = -1; /// The index of the MC collision vertex
224+
225+
// MC information (modified version of TParticle
226+
Int_t fPdgCode = -99999; /// PDG code of the particle
227+
Int_t fStatusCode = -99999; /// generation status code
228+
uint8_t fFlags = 0; /// See enum MCParticleFlags
229+
Int_t fMother0 = 0; /// Indices of the mother particles
230+
Int_t fMother1 = 0;
231+
Int_t fDaughter0 = 0; /// Indices of the daughter particles
232+
Int_t fDaughter1 = 0;
233+
Float_t fWeight = 1; /// particle weight from the generator or ML
234+
235+
Float_t fPx = -999.f; /// x component of momentum
236+
Float_t fPy = -999.f; /// y component of momentum
237+
Float_t fPz = -999.f; /// z component of momentum
238+
Float_t fE = -999.f; /// Energy (covers the case of resonances, no need for calculated mass)
239+
240+
Float_t fVx = -999.f; /// x of production vertex
241+
Float_t fVy = -999.f; /// y of production vertex
242+
Float_t fVz = -999.f; /// z of production vertex
243+
Float_t fVt = -999.f; /// t of production vertex
244+
// We do not use the polarisation so far
245+
} mcparticle; //! MC particles from the kinematics tree
246+
247+
struct {
248+
// MC collision label
249+
UInt_t fLabel = 0; /// Collision label
250+
UShort_t fLabelMask = 0; /// Bit mask to indicate collision mismatches (bit ON means mismatch)
251+
/// bit 15: negative label sign
252+
} mccollisionlabel; //! Collision labels
253+
254+
struct {
255+
/// FDD (AD)
256+
Int_t fBCsID = 0u; /// Index to BC table
257+
Float_t fAmplitudeA[4] = {0.f}; /// Multiplicity for each A-side channel
258+
Float_t fAmplitudeC[4] = {0.f}; /// Multiplicity for each C-side channel
259+
Float_t fTimeA = 56.7f; /// Average A-side time
260+
Float_t fTimeC = 65.3f; /// Average C-side time
261+
uint8_t fTriggerMask = 0; /// Trigger info
262+
} fdd;
263+
264+
struct {
265+
/// V0A (32 cells in Run2, 48 cells in Run3)
266+
Int_t fBCsID = 0u; /// Index to BC table
267+
Float_t fAmplitude[48] = {0.f}; /// Multiplicity for each channel
268+
Float_t fTime = 11.f; /// Average A-side time
269+
uint8_t fTriggerMask = 0; /// Trigger info
270+
} fv0a; //! structure to keep V0A information
271+
272+
struct {
273+
/// V0C (32 cells in Run2)
274+
Int_t fBCsID = 0u; /// Index to BC table
275+
Float_t fAmplitude[32] = {0.f}; /// Multiplicity for each channel
276+
Float_t fTime = 3.6f; /// Average C-side time
277+
} fv0c; //! structure to keep V0C information
278+
279+
struct {
280+
/// FT0 (12+12 channels in Run2, 96+112 channels in Run3)
281+
Int_t fBCsID = 0u; /// Index to BC table
282+
Float_t fAmplitudeA[96] = {0.f}; /// Multiplicity for each A-side channel
283+
Float_t fAmplitudeC[112] = {0.f}; /// Multiplicity for each C-side channel
284+
Float_t fTimeA = 0.02f; /// Average A-side time
285+
Float_t fTimeC = 0.03f; /// Average C-side time
286+
uint8_t fTriggerMask = 0; /// Trigger info
287+
} ft0; //! structure to keep FT0 information
288+
289+
struct {
290+
Int_t fBCsID = 0u; /// Index to BC table
291+
Float_t fEnergyZEM1 = 0.f; ///< E in ZEM1
292+
Float_t fEnergyZEM2 = 0.f; ///< E in ZEM2
293+
Float_t fEnergyCommonZNA = 0.f; ///< E in common ZNA PMT - high gain chain
294+
Float_t fEnergyCommonZNC = 0.f; ///< E in common ZNC PMT - high gain chain
295+
Float_t fEnergyCommonZPA = 0.f; ///< E in common ZPA PMT - high gain chain
296+
Float_t fEnergyCommonZPC = 0.f; ///< E in common ZPC PMT - high gain chain
297+
Float_t fEnergySectorZNA[4] = {0.f}; ///< E in 4 ZNA sectors - high gain chain
298+
Float_t fEnergySectorZNC[4] = {0.f}; ///< E in 4 ZNC sectors - high gain chain
299+
Float_t fEnergySectorZPA[4] = {0.f}; ///< E in 4 ZPA sectors - high gain chain
300+
Float_t fEnergySectorZPC[4] = {0.f}; ///< E in 4 ZPC sectors - high gain chain
301+
Float_t fTimeZEM1 = 0.f; ///< Corrected time in ZEM1
302+
Float_t fTimeZEM2 = 0.f; ///< Corrected time in ZEM2
303+
Float_t fTimeZNA = 0.055f; ///< Corrected time in ZNA
304+
Float_t fTimeZNC = -0.049f; ///< Corrected time in ZNC
305+
Float_t fTimeZPA = 0.f; ///< Corrected time in ZPA
306+
Float_t fTimeZPC = 0.f; ///< Corrected time in ZPC
307+
} zdc;
308+
//! structure to keep ZDC information
309+
} // namespace upgrades_utils
310+
} // namespace o2
311+
312+
#endif
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#include "UpgradesAODUtils/Run2LikeAO2D.h"
12+
13+
namespace o2
14+
{
15+
namespace upgrades_utils
16+
{
17+
18+
void __dummy_instance__()
19+
{ // will eventually become the class implementation
20+
TreeIndex Instance;
21+
}
22+
23+
} // namespace upgrades_utils
24+
} // namespace o2
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#ifdef __CLING__
12+
13+
#pragma link off all globals;
14+
#pragma link off all classes;
15+
#pragma link off all functions;
16+
17+
#endif

Detectors/Upgrades/ALICE3/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
# submit itself to any jurisdiction.
1010

1111
add_subdirectory(Passive)
12-
add_subdirectory(TRK)
12+
add_subdirectory(TRK)
13+
add_subdirectory(AOD)

0 commit comments

Comments
 (0)