Skip to content

Commit 16ee3b8

Browse files
authored
[ALICE3] Add proto segmentation of TF3 (#15081)
* Use TF3 CAD specifications
1 parent 4728518 commit 16ee3b8

File tree

6 files changed

+239
-69
lines changed

6 files changed

+239
-69
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: 18 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,8 @@ 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,
29+
int layout = kBarrel, int nSegments = 0, float segmentSize = 0.0, int nSensorsPerSegment = 0, double tiltAngle = 0.0);
2730
~Layer() = default;
2831

2932
auto getInnerRadius() const { return mInnerRadius; }
@@ -33,9 +36,14 @@ class Layer
3336
auto getx2X0() const { return mX2X0; }
3437
auto getChipThickness() const { return mChipThickness; }
3538
auto getName() const { return mLayerName; }
36-
auto getIsBarrel() const { return mIsBarrel; }
39+
auto getLayout() const { return mLayout; }
40+
auto getSegments() const { return mSegments; }
41+
static constexpr int kBarrel = 0;
42+
static constexpr int kDisk = 1;
43+
static constexpr int kBarrelSegmented = 2;
44+
static constexpr int kDiskSegmented = 3;
3745

38-
virtual void createLayer(TGeoVolume* motherVolume){};
46+
virtual void createLayer(TGeoVolume* motherVolume) {};
3947

4048
protected:
4149
std::string mLayerName;
@@ -45,21 +53,27 @@ class Layer
4553
float mZOffset{0.f}; // Of use when fwd layers
4654
float mX2X0;
4755
float mChipThickness;
48-
bool mIsBarrel{true};
56+
int mLayout{kBarrel}; // Identifier of the type of layer layout (barrel, disk, barrel segmented, disk segmented)
57+
// 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)
58+
std::pair<int, float> mSegments{0, 0.0f}; // Number and size of segments in phi (for barrel) or in r (for disk) in case of segmented layout
59+
int mSensorsPerSegment{0}; // Number of sensors along a segment
60+
double mTiltAngle{0.0}; // Tilt angle in degrees to be applied as a rotation around the local center of the segment
4961
};
5062

5163
class ITOFLayer : public Layer
5264
{
5365
public:
5466
using Layer::Layer;
5567
virtual void createLayer(TGeoVolume* motherVolume) override;
68+
static std::vector<std::string> mRegister;
5669
};
5770

5871
class OTOFLayer : public Layer
5972
{
6073
public:
6174
using Layer::Layer;
6275
virtual void createLayer(TGeoVolume* motherVolume) override;
76+
static std::vector<std::string> mRegister;
6377
};
6478

6579
class FTOFLayer : public Layer

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

Lines changed: 29 additions & 15 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;
@@ -65,9 +66,10 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
6566
float lengthOuterTof = 680.f;
6667
std::pair<float, float> radiusRangeDiskTof = {15.f, 100.f};
6768
float zForwardTof = 370.f;
69+
LOG(info) << "Configuring IOTOF layers with '" << pattern << "' pattern";
6870
if (pattern == "") {
71+
LOG(info) << "Default pattern";
6972
} else if (pattern == "v3b") {
70-
LOG(info) << "Configuring IOTOF layers with v3b pattern";
7173
ftof = false;
7274
btof = false;
7375
} else if (pattern == "v3b1a") {
@@ -93,17 +95,25 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
9395
} else {
9496
LOG(fatal) << "IOTOF layer pattern " << pattern << " not recognized, exiting";
9597
}
96-
if (itof) {
97-
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, true); // iTOF
98+
if (itof) { // iTOF
99+
mITOFLayer = itofSegmented ? ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()},
100+
radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrelSegmented,
101+
24, 5.42, 80, 10)
102+
: ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()},
103+
radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrel);
98104
}
99-
if (otof) {
100-
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, true); // oTOF
105+
if (otof) { // oTOF
106+
mOTOFLayer = otofSegmented ? OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()},
107+
radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrelSegmented,
108+
62, 9.74, 432, 5)
109+
: OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()},
110+
radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrel);
101111
}
102112
if (ftof) {
103-
mFTOFLayer = FTOFLayer(std::string{GeometryTGeo::getFTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, zForwardTof, 0.02f, false); // fTOF
113+
mFTOFLayer = FTOFLayer(std::string{GeometryTGeo::getFTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, zForwardTof, 0.02f, FTOFLayer::kDisk); // fTOF
104114
}
105115
if (btof) {
106-
mBTOFLayer = BTOFLayer(std::string{GeometryTGeo::getBTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, -zForwardTof, 0.02f, false); // bTOF
116+
mBTOFLayer = BTOFLayer(std::string{GeometryTGeo::getBTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, -zForwardTof, 0.02f, BTOFLayer::kDisk); // bTOF
107117
}
108118
}
109119

@@ -186,14 +196,18 @@ void Detector::defineSensitiveVolumes()
186196
// The names of the IOTOF sensitive volumes have the format: IOTOFLayer(0...mLayers.size()-1)
187197
auto& iotofPars = IOTOFBaseParam::Instance();
188198
if (iotofPars.enableInnerTOF) {
189-
v = geoManager->GetVolume(GeometryTGeo::getITOFSensorPattern());
190-
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
191-
AddSensitiveVolume(v);
199+
for (const std::string& itofSensor : ITOFLayer::mRegister) {
200+
v = geoManager->GetVolume(itofSensor.c_str());
201+
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
202+
AddSensitiveVolume(v);
203+
}
192204
}
193205
if (iotofPars.enableOuterTOF) {
194-
v = geoManager->GetVolume(GeometryTGeo::getOTOFSensorPattern());
195-
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
196-
AddSensitiveVolume(v);
206+
for (const std::string& otofSensor : OTOFLayer::mRegister) {
207+
v = geoManager->GetVolume(otofSensor.c_str());
208+
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
209+
AddSensitiveVolume(v);
210+
}
197211
}
198212
if (iotofPars.enableForwardTOF) {
199213
v = geoManager->GetVolume(GeometryTGeo::getFTOFSensorPattern());

0 commit comments

Comments
 (0)