Skip to content

Commit c49b142

Browse files
committed
Update DetLayer indices
1 parent f2fb3b5 commit c49b142

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

ALICE3/Core/DetLayer.cxx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,21 @@ std::string DetLayer::toString() const
131131
out.append(std::to_string(eff));
132132
out.append(" | type: ");
133133
switch (type) {
134-
case layerInert:
134+
case kLayerInert:
135135
out.append("Inert");
136136
break;
137-
case layerSilicon:
137+
case kLayerSilicon:
138138
out.append("Silicon");
139139
break;
140-
case layerGas:
140+
case kLayerGas:
141141
out.append("Gas/TPC");
142142
break;
143+
case kLayerTOF:
144+
out.append("TOF");
145+
break;
146+
case kLayerVertex:
147+
out.append("Vertex");
148+
break;
143149
default:
144150
out.append("Unknown");
145151
break;

ALICE3/Core/DetLayer.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct DetLayer {
3333
DetLayer() = default;
3434
// Parametric constructor
3535
DetLayer(const TString& name_, float r_, float z_, float x0_, float xrho_,
36-
float resRPhi_ = 0.0f, float resZ_ = 0.0f, float eff_ = 0.0f, int type_ = layerInert);
36+
float resRPhi_ = 0.0f, float resZ_ = 0.0f, float eff_ = 0.0f, int type_ = kLayerInert);
3737
// Copy constructor
3838
DetLayer(const DetLayer& other);
3939

@@ -72,9 +72,12 @@ struct DetLayer {
7272
const TGraph* getDeadPhiRegions() const { return mDeadPhiRegions; }
7373

7474
// Check layer type
75-
bool isInert() const { return type == layerInert; }
76-
bool isSilicon() const { return type == layerSilicon; }
77-
bool isGas() const { return type == layerGas; }
75+
bool isInert() const { return type == kLayerInert; }
76+
bool isSilicon() const { return type == kLayerSilicon; }
77+
bool isGas() const { return type == kLayerGas; }
78+
bool isTOF() const { return type == kLayerTOF; }
79+
bool isVertex() const { return type == kLayerVertex; }
80+
bool isActive() const { return type != kLayerInert; } // active layers are not inert
7881

7982
// Utilities
8083
std::string toString() const;
@@ -93,6 +96,12 @@ struct DetLayer {
9396
return mDeadPhiRegions->Eval(phi) > 1.f;
9497
};
9598

99+
static constexpr int kLayerVertex = -1; // vertex layer type (not used in tracking)
100+
static constexpr int kLayerInert = 0; // inert/undefined layer
101+
static constexpr int kLayerSilicon = 1; // silicon layer
102+
static constexpr int kLayerGas = 2; // gas/tpc layer
103+
static constexpr int kLayerTOF = 3; // TOF layer type (not used in tracking)
104+
96105
private:
97106
// TString for holding name
98107
TString name;
@@ -117,9 +126,6 @@ struct DetLayer {
117126

118127
// layer type
119128
int type; // 0: undefined/inert, 1: silicon, 2: gas/tpc
120-
static constexpr int layerInert = 0; // inert/undefined layer
121-
static constexpr int layerSilicon = 1; // silicon layer
122-
static constexpr int layerGas = 2; // gas/tpc layer
123129
};
124130

125131
} // namespace o2::fastsim

0 commit comments

Comments
 (0)