Skip to content

Commit b546038

Browse files
committed
[ALICE3] Add segmentation of TF3
1 parent d95be4d commit b546038

File tree

5 files changed

+212
-63
lines changed

5 files changed

+212
-63
lines changed

Detectors/Upgrades/ALICE3/IOTOF/base/include/IOTOFBase/IOTOFBaseParam.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ struct IOTOFBaseParam : public o2::conf::ConfigurableParamHelper<IOTOFBaseParam>
2626
bool enableForwardTOF = true;
2727
bool enableBackwardTOF = true;
2828
std::string detectorPattern = "";
29+
bool segmentedInnerTOF = false; // If the inner TOF layer is segmented
30+
bool segmentedOuterTOF = false; // If the outer TOF layer is segmented
2931

3032
O2ParamDef(IOTOFBaseParam, "IOTOFBase");
3133
};

Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Detector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Detector : public o2::base::DetImpl<Detector>
6060
return nullptr;
6161
}
6262

63-
void configLayers(bool itof = true, bool otof = true, bool ftof = true, bool btof = true, std::string pattern = "");
63+
void configLayers(bool itof = true, bool otof = true, bool ftof = true, bool btof = true, std::string pattern = "", bool itofSegmented = false, bool otofSegmented = false);
6464

6565
void configServices();
6666
void createMaterials();

Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Layer.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include <TGeoManager.h>
1616
#include <Rtypes.h>
17+
#include <string>
18+
#include <vector>
1719

1820
namespace o2
1921
{
@@ -23,7 +25,7 @@ class Layer
2325
{
2426
public:
2527
Layer() = default;
26-
Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0, bool isBarrel = true);
28+
Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0, int layout = kBarrel, int nSegments = 0);
2729
~Layer() = default;
2830

2931
auto getInnerRadius() const { return mInnerRadius; }
@@ -33,9 +35,14 @@ class Layer
3335
auto getx2X0() const { return mX2X0; }
3436
auto getChipThickness() const { return mChipThickness; }
3537
auto getName() const { return mLayerName; }
36-
auto getIsBarrel() const { return mIsBarrel; }
38+
auto getLayout() const { return mLayout; }
39+
auto getSegments() const { return mSegments; }
40+
static constexpr int kBarrel = 0;
41+
static constexpr int kDisk = 1;
42+
static constexpr int kBarrelSegmented = 2;
43+
static constexpr int kDiskSegmented = 3;
3744

38-
virtual void createLayer(TGeoVolume* motherVolume){};
45+
virtual void createLayer(TGeoVolume* motherVolume) {};
3946

4047
protected:
4148
std::string mLayerName;
@@ -45,21 +52,25 @@ class Layer
4552
float mZOffset{0.f}; // Of use when fwd layers
4653
float mX2X0;
4754
float mChipThickness;
48-
bool mIsBarrel{true};
55+
int mLayout{kBarrel};
56+
// To be used only in case of the segmented layout, to define the number of segments in phi (for barrel) or in r (for disk)
57+
int mSegments{0};
4958
};
5059

5160
class ITOFLayer : public Layer
5261
{
5362
public:
5463
using Layer::Layer;
5564
virtual void createLayer(TGeoVolume* motherVolume) override;
65+
static std::vector<std::string> mRegister;
5666
};
5767

5868
class OTOFLayer : public Layer
5969
{
6070
public:
6171
using Layer::Layer;
6272
virtual void createLayer(TGeoVolume* motherVolume) override;
73+
static std::vector<std::string> mRegister;
6374
};
6475

6576
class FTOFLayer : public Layer

Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Detector::Detector(bool active)
4040
auto& iotofPars = IOTOFBaseParam::Instance();
4141
configLayers(iotofPars.enableInnerTOF, iotofPars.enableOuterTOF,
4242
iotofPars.enableForwardTOF, iotofPars.enableBackwardTOF,
43-
iotofPars.detectorPattern);
43+
iotofPars.detectorPattern,
44+
iotofPars.segmentedInnerTOF, iotofPars.segmentedOuterTOF);
4445
}
4546

4647
Detector::~Detector()
@@ -56,7 +57,7 @@ void Detector::ConstructGeometry()
5657
createGeometry();
5758
}
5859

59-
void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::string pattern)
60+
void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::string pattern, bool itofSegmented, bool otofSegmented)
6061
{
6162

6263
float radiusInnerTof = 19.f;
@@ -94,16 +95,22 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
9495
LOG(fatal) << "IOTOF layer pattern " << pattern << " not recognized, exiting";
9596
}
9697
if (itof) {
97-
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, true); // iTOF
98+
if (itofSegmented)
99+
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrelSegmented, 236); // iTOF
100+
else
101+
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrel); // iTOF
98102
}
99103
if (otof) {
100-
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, true); // oTOF
104+
if (otofSegmented)
105+
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrelSegmented, 124); // oTOF
106+
else
107+
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrel); // oTOF
101108
}
102109
if (ftof) {
103-
mFTOFLayer = FTOFLayer(std::string{GeometryTGeo::getFTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, zForwardTof, 0.02f, false); // fTOF
110+
mFTOFLayer = FTOFLayer(std::string{GeometryTGeo::getFTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, zForwardTof, 0.02f, FTOFLayer::kDisk); // fTOF
104111
}
105112
if (btof) {
106-
mBTOFLayer = BTOFLayer(std::string{GeometryTGeo::getBTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, -zForwardTof, 0.02f, false); // bTOF
113+
mBTOFLayer = BTOFLayer(std::string{GeometryTGeo::getBTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, -zForwardTof, 0.02f, BTOFLayer::kDisk); // bTOF
107114
}
108115
}
109116

@@ -186,14 +193,18 @@ void Detector::defineSensitiveVolumes()
186193
// The names of the IOTOF sensitive volumes have the format: IOTOFLayer(0...mLayers.size()-1)
187194
auto& iotofPars = IOTOFBaseParam::Instance();
188195
if (iotofPars.enableInnerTOF) {
189-
v = geoManager->GetVolume(GeometryTGeo::getITOFSensorPattern());
190-
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
191-
AddSensitiveVolume(v);
196+
for (const std::string& itofSensor : ITOFLayer::mRegister) {
197+
v = geoManager->GetVolume(itofSensor.c_str());
198+
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
199+
AddSensitiveVolume(v);
200+
}
192201
}
193202
if (iotofPars.enableOuterTOF) {
194-
v = geoManager->GetVolume(GeometryTGeo::getOTOFSensorPattern());
195-
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
196-
AddSensitiveVolume(v);
203+
for (const std::string& otofSensor : OTOFLayer::mRegister) {
204+
v = geoManager->GetVolume(otofSensor.c_str());
205+
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
206+
AddSensitiveVolume(v);
207+
}
197208
}
198209
if (iotofPars.enableForwardTOF) {
199210
v = geoManager->GetVolume(GeometryTGeo::getFTOFSensorPattern());

0 commit comments

Comments
 (0)