Skip to content

Commit 5b20cd5

Browse files
authored
[ALICE3] FastTracker update: streamline for LUT maker (#11285)
1 parent 86ee63d commit 5b20cd5

File tree

4 files changed

+82
-28
lines changed

4 files changed

+82
-28
lines changed

ALICE3/Core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ o2physics_target_root_dictionary(ALICE3Core
2323

2424
o2physics_add_library(FastTracker
2525
SOURCES FastTracker.cxx
26+
DetLayer.cxx
2627
PUBLIC_LINK_LIBRARIES O2::Framework
2728
O2Physics::AnalysisCore)
2829

2930
o2physics_target_root_dictionary(FastTracker
3031
HEADERS FastTracker.h
32+
DetLayer.h
3133
LINKDEF FastTrackerLinkDef.h)

ALICE3/Core/DetLayer.cxx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
12+
///
13+
/// \file DetLayer.cxx
14+
/// \author David Dobrigkeit Chinellato
15+
/// \since 11/03/2021
16+
/// \brief Basic struct to hold information regarding a detector layer to be used in fast simulation
17+
///
18+
19+
#include "DetLayer.h"

ALICE3/Core/FastTracker.cxx

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void FastTracker::AddLayer(TString name, float r, float z, float x0, float xrho,
6060
layers.push_back(newLayer);
6161
}
6262

63-
DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers)
63+
DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers) const
6464
{
6565
int layerIdx = layer;
6666
if (ignoreBarrelLayers) {
@@ -74,6 +74,18 @@ DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers)
7474
return layers[layerIdx];
7575
}
7676

77+
int FastTracker::GetLayerIndex(std::string name) const
78+
{
79+
int i = 0;
80+
for (const auto& layer : layers) {
81+
if (layer.name == name) {
82+
return i;
83+
}
84+
i++;
85+
}
86+
return -1;
87+
}
88+
7789
void FastTracker::Print()
7890
{
7991
// print out layer setup
@@ -100,18 +112,18 @@ void FastTracker::AddSiliconALICE3v4(std::vector<float> pixelResolution)
100112
float resRPhiOT = pixelResolution[2];
101113
float resZOT = pixelResolution[3];
102114

103-
layers.push_back(DetLayer{"bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0}); // 150 mum Be
104-
layers.push_back(DetLayer{"ddd0", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
105-
layers.push_back(DetLayer{"ddd1", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
106-
layers.push_back(DetLayer{"ddd2", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
107-
layers.push_back(DetLayer{"bpipe1", 5.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0}); // 500 mum Be
108-
layers.push_back(DetLayer{"ddd3", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
109-
layers.push_back(DetLayer{"ddd4", 10., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
110-
layers.push_back(DetLayer{"ddd5", 13., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
111-
layers.push_back(DetLayer{"ddd6", 16., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
112-
layers.push_back(DetLayer{"ddd7", 25., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
113-
layers.push_back(DetLayer{"ddd8", 40., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
114-
layers.push_back(DetLayer{"ddd9", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
115+
AddLayer("bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0); // 150 mum Be
116+
AddLayer("ddd0", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
117+
AddLayer("ddd1", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
118+
AddLayer("ddd2", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
119+
AddLayer("bpipe1", 5.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0); // 500 mum Be
120+
AddLayer("ddd3", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
121+
AddLayer("ddd4", 10., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
122+
AddLayer("ddd5", 13., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
123+
AddLayer("ddd6", 16., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
124+
AddLayer("ddd7", 25., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
125+
AddLayer("ddd8", 40., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
126+
AddLayer("ddd9", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
115127
}
116128

117129
void FastTracker::AddSiliconALICE3v2(std::vector<float> pixelResolution)
@@ -128,19 +140,19 @@ void FastTracker::AddSiliconALICE3v2(std::vector<float> pixelResolution)
128140
float resRPhiOT = pixelResolution[2];
129141
float resZOT = pixelResolution[3];
130142

131-
layers.push_back(DetLayer{"bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0}); // 150 mum Be
132-
layers.push_back(DetLayer{"B00", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
133-
layers.push_back(DetLayer{"B01", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
134-
layers.push_back(DetLayer{"B02", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
135-
layers.push_back(DetLayer{"bpipe1", 3.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0}); // 500 mum Be
136-
layers.push_back(DetLayer{"B03", 3.75, 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
137-
layers.push_back(DetLayer{"B04", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
138-
layers.push_back(DetLayer{"B05", 12., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
139-
layers.push_back(DetLayer{"B06", 20., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
140-
layers.push_back(DetLayer{"B07", 30., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
141-
layers.push_back(DetLayer{"B08", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
142-
layers.push_back(DetLayer{"B09", 60., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
143-
layers.push_back(DetLayer{"B10", 80., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
143+
AddLayer("bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0); // 150 mum Be
144+
AddLayer("B00", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
145+
AddLayer("B01", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
146+
AddLayer("B02", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
147+
AddLayer("bpipe1", 3.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0); // 500 mum Be
148+
AddLayer("B03", 3.75, 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
149+
AddLayer("B04", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
150+
AddLayer("B05", 12., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
151+
AddLayer("B06", 20., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
152+
AddLayer("B07", 30., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
153+
AddLayer("B08", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
154+
AddLayer("B09", 60., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
155+
AddLayer("B10", 80., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
144156
}
145157

146158
void FastTracker::AddTPC(float phiResMean, float zResMean)
@@ -333,7 +345,6 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
333345
// was there a problem on this layer?
334346
if (!ok && il > 0) { // may fail to reach target layer due to the eloss
335347
float rad2 = inputTrack.getX() * inputTrack.getX() + inputTrack.getY() * inputTrack.getY();
336-
float fMinRadTrack = 132.;
337348
float maxR = layers[il - 1].r + kTrackingMargin * 2;
338349
float minRad = (fMinRadTrack > 0 && fMinRadTrack < maxR) ? fMinRadTrack : maxR;
339350
if (rad2 - minRad * minRad < kTrackingMargin * kTrackingMargin) { // check previously reached layer

ALICE3/Core/FastTracker.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class FastTracker
3535
virtual ~FastTracker() {}
3636

3737
void AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi = 0.0f, float resZ = 0.0f, float eff = 0.0f, int type = 0);
38-
DetLayer GetLayer(const int layer, bool ignoreBarrelLayers = true);
38+
DetLayer GetLayer(const int layer, bool ignoreBarrelLayers = true) const;
39+
int GetLayerIndex(const std::string name) const;
3940

4041
void AddSiliconALICE3v4(std::vector<float> pixelResolution);
4142
void AddSiliconALICE3v2(std::vector<float> pixelResolution);
@@ -55,6 +56,15 @@ class FastTracker
5556
// Definition of detector layers
5657
std::vector<DetLayer> layers;
5758
std::vector<std::vector<float>> hits; // bookkeep last added hits
59+
void SetRadiationLength(const std::string layerName, float x0) { layers[GetLayerIndex(layerName)].x0 = x0; }
60+
void SetRadius(const std::string layerName, float r) { layers[GetLayerIndex(layerName)].r = r; }
61+
void SetResolutionRPhi(const std::string layerName, float resRPhi) { layers[GetLayerIndex(layerName)].resRPhi = resRPhi; }
62+
void SetResolutionZ(const std::string layerName, float resZ) { layers[GetLayerIndex(layerName)].resZ = resZ; }
63+
void SetResolution(const std::string layerName, float resRPhi, float resZ)
64+
{
65+
SetResolutionRPhi(layerName, resRPhi);
66+
SetResolutionZ(layerName, resZ);
67+
}
5868

5969
// operational
6070
bool applyZacceptance; // check z acceptance or not
@@ -75,6 +85,17 @@ class FastTracker
7585
float avgRapidity;
7686
float lhcUPCScale;
7787
float upcBackgroundMultiplier;
88+
float fMinRadTrack = 132.;
89+
90+
// Setters and getters
91+
void SetIntegrationTime(float t) { integrationTime = t; }
92+
void SetMaxRadiusOfSlowDetectors(float r) { maxRadiusSlowDet = r; }
93+
void SetAvgRapidity(float y) { avgRapidity = y; }
94+
void SetdNdEtaCent(float d) { dNdEtaCent = d; }
95+
void SetLhcUPCscale(float s) { lhcUPCScale = s; }
96+
void SetBField(float b) { magneticField = b; }
97+
void SetMinRadTrack(float r) { fMinRadTrack = r; }
98+
// void SetAtLeastHits(int n) { fMinRadTrack = n; }
7899

79100
uint64_t covMatOK; // cov mat has negative eigenvals
80101
uint64_t covMatNotOK; // cov mat has negative eigenvals
@@ -84,6 +105,7 @@ class FastTracker
84105
int nSiliconPoints; // silicon-based space points added to track
85106
int nGasPoints; // tpc-based space points added to track
86107
std::vector<float> goodHitProbability;
108+
float GetGoodHitProb(int layer) const { return goodHitProbability[layer]; }
87109

88110
ClassDef(FastTracker, 1);
89111
};

0 commit comments

Comments
 (0)