Skip to content

Commit 630ef49

Browse files
authored
Update
1 parent 5b17735 commit 630ef49

File tree

3 files changed

+61
-7
lines changed

3 files changed

+61
-7
lines changed

ALICE3/Core/DetLayer.cxx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616
/// \brief Basic struct to hold information regarding a detector layer to be used in fast simulation
1717
///
1818

19-
#include <vector>
20-
#include <string>
21-
2219
#include "DetLayer.h"
2320

21+
#include <CommonConstants/MathConstants.h>
22+
23+
#include <fairlogger/Logger.h>
24+
25+
#include <string>
26+
#include <vector>
27+
2428
namespace o2::fastsim
2529
{
2630

@@ -51,6 +55,27 @@ DetLayer::DetLayer(const DetLayer& other)
5155
{
5256
}
5357

58+
void DetLayer::addDeadPhiRegion(float phiStart, float phiEnd)
59+
{
60+
static constexpr float kDefaultValue = 2.f;
61+
static constexpr float kPhiTolerance = 1e-4f;
62+
if (mDeadPhiRegions == nullptr) {
63+
mDeadPhiRegions = new TGraph();
64+
mDeadPhiRegions->SetNameTitle(Form("deadPhiRegions_%s", name.Data()), Form("Dead phi regions for layer %s", name.Data()));
65+
mDeadPhiRegions->AddPoint(0, kDefaultValue);
66+
mDeadPhiRegions->AddPoint(o2::constants::math::TwoPI, kDefaultValue);
67+
}
68+
if (phiStart < 0 || phiStart >= o2::constants::math::TwoPI || phiEnd < 0 || phiEnd >= o2::constants::math::TwoPI) {
69+
LOG(fatal) << "Cannot add dead phi region with invalid range [" << phiStart << ", " << phiEnd << "] to layer " << name;
70+
return;
71+
}
72+
mDeadPhiRegions->AddPoint(phiStart, kDefaultValue);
73+
mDeadPhiRegions->AddPoint(phiEnd, kDefaultValue);
74+
mDeadPhiRegions->AddPoint(phiStart + kPhiTolerance, 0.f);
75+
mDeadPhiRegions->AddPoint(phiEnd - kPhiTolerance, 0.f);
76+
mDeadPhiRegions->Sort();
77+
}
78+
5479
std::string DetLayer::toString() const
5580
{
5681
std::string out = "";

ALICE3/Core/DetLayer.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
#ifndef ALICE3_CORE_DETLAYER_H_
2020
#define ALICE3_CORE_DETLAYER_H_
2121

22-
#include <string>
22+
#include <TGraph.h>
23+
#include <TString.h>
2324

24-
#include "TString.h"
25+
#include <string>
2526

2627
namespace o2::fastsim
2728
{
@@ -46,6 +47,7 @@ struct DetLayer {
4647
void setResolutionZ(float resZ_) { resZ = resZ_; }
4748
void setEfficiency(float eff_) { eff = eff_; }
4849
void setType(int type_) { type = type_; }
50+
void addDeadPhiRegion(float phiStart, float phiEnd);
4951

5052
// Getters
5153
float getRadius() const { return r; }
@@ -57,6 +59,7 @@ struct DetLayer {
5759
float getEfficiency() const { return eff; }
5860
int getType() const { return type; }
5961
const TString& getName() const { return name; }
62+
const TGraph* getDeadPhiRegions() const { return mDeadPhiRegions; }
6063

6164
// Check layer type
6265
bool isInert() const { return type == layerInert; }
@@ -70,6 +73,15 @@ struct DetLayer {
7073
os << layer.toString();
7174
return os;
7275
}
76+
/// @brief Check if a given phi angle is in a dead region
77+
/// @param phi The phi angle to check
78+
/// @return True if the phi angle is in a dead region, false otherwise
79+
bool isInDeadPhiRegion(float phi) const
80+
{
81+
if (mDeadPhiRegions == nullptr)
82+
return false;
83+
return mDeadPhiRegions->Eval(phi) > 1.f;
84+
};
7385

7486
private:
7587
// TString for holding name
@@ -90,6 +102,9 @@ struct DetLayer {
90102
// efficiency
91103
float eff; // detection efficiency
92104

105+
// dead regions in phi (in radians)
106+
TGraph* mDeadPhiRegions = nullptr;
107+
93108
// layer type
94109
int type; // 0: undefined/inert, 1: silicon, 2: gas/tpc
95110
static constexpr int layerInert = 0; // inert/undefined layer

ALICE3/Core/FastTracker.cxx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <TObject.h>
2323

2424
#include <fstream>
25-
#include <map>
2625
#include <string>
2726
#include <vector>
2827

@@ -55,6 +54,16 @@ void FastTracker::AddLayer(TString name, float r, float z, float x0, float xrho,
5554
layers.push_back(newLayer);
5655
}
5756

57+
void FastTracker::addDeadPhiRegionInLayer(const std::string& layerName, float phiStart, float phiEnd)
58+
{
59+
const int layerIdx = GetLayerIndex(layerName);
60+
if (layerIdx < 0) {
61+
LOG(fatal) << "Cannot add dead phi region to non-existing layer " << layerName;
62+
return;
63+
}
64+
layers[layerIdx].addDeadPhiRegion(phiStart, phiEnd);
65+
}
66+
5867
DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers) const
5968
{
6069
int layerIdx = layer;
@@ -185,7 +194,7 @@ void FastTracker::AddSiliconALICE3(float scaleX0VD, std::vector<float> pixelReso
185194
AddLayer("B03", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
186195
AddLayer("B04", 9., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
187196
AddLayer("B05", 12., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
188-
AddLayer("iTOF", 19, 250, x0iTOF, xrhoiTOF, resRPhiOT, resZOT, 0.0f, 0);
197+
AddLayer("iTOF", 19, 250, x0iTOF, xrhoiTOF, resRPhiOT, resZOT, eff, 0);
189198
AddLayer("B06", 20., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
190199
AddLayer("B07", 30., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
191200
AddLayer("B08", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
@@ -493,6 +502,11 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
493502
continue; // inert layer, skip
494503
}
495504

505+
if (layers[il].isInDeadPhiRegion(inputTrack.getPhi())) {
506+
LOGF(debug, "Track is in dead region of layer %d", il);
507+
continue; // dead region, skip
508+
}
509+
496510
// layer is reached
497511
if (firstLayerReached < 0) {
498512
LOGF(debug, "First layer reached: %d", il);

0 commit comments

Comments
 (0)