Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ struct IOTOFBaseParam : public o2::conf::ConfigurableParamHelper<IOTOFBaseParam>
bool enableForwardTOF = true;
bool enableBackwardTOF = true;
std::string detectorPattern = "";
bool segmentedInnerTOF = false; // If the inner TOF layer is segmented
bool segmentedOuterTOF = false; // If the outer TOF layer is segmented

O2ParamDef(IOTOFBaseParam, "IOTOFBase");
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Detector : public o2::base::DetImpl<Detector>
return nullptr;
}

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

void configServices();
void createMaterials();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <TGeoManager.h>
#include <Rtypes.h>
#include <string>
#include <vector>

namespace o2
{
Expand All @@ -23,7 +25,8 @@ class Layer
{
public:
Layer() = default;
Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0, bool isBarrel = true);
Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0,
int layout = kBarrel, int nSegments = 0, float segmentSize = 0.0, int nSensorsPerSegment = 0, double tiltAngle = 0.0);
~Layer() = default;

auto getInnerRadius() const { return mInnerRadius; }
Expand All @@ -33,9 +36,14 @@ class Layer
auto getx2X0() const { return mX2X0; }
auto getChipThickness() const { return mChipThickness; }
auto getName() const { return mLayerName; }
auto getIsBarrel() const { return mIsBarrel; }
auto getLayout() const { return mLayout; }
auto getSegments() const { return mSegments; }
static constexpr int kBarrel = 0;
static constexpr int kDisk = 1;
static constexpr int kBarrelSegmented = 2;
static constexpr int kDiskSegmented = 3;

virtual void createLayer(TGeoVolume* motherVolume){};
virtual void createLayer(TGeoVolume* motherVolume) {};

protected:
std::string mLayerName;
Expand All @@ -45,21 +53,27 @@ class Layer
float mZOffset{0.f}; // Of use when fwd layers
float mX2X0;
float mChipThickness;
bool mIsBarrel{true};
int mLayout{kBarrel}; // Identifier of the type of layer layout (barrel, disk, barrel segmented, disk segmented)
// 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)
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
int mSensorsPerSegment{0}; // Number of sensors along a segment
double mTiltAngle{0.0}; // Tilt angle in degrees to be applied as a rotation around the local center of the segment
};

class ITOFLayer : public Layer
{
public:
using Layer::Layer;
virtual void createLayer(TGeoVolume* motherVolume) override;
static std::vector<std::string> mRegister;
};

class OTOFLayer : public Layer
{
public:
using Layer::Layer;
virtual void createLayer(TGeoVolume* motherVolume) override;
static std::vector<std::string> mRegister;
};

class FTOFLayer : public Layer
Expand Down
40 changes: 27 additions & 13 deletions Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Detector::Detector(bool active)
auto& iotofPars = IOTOFBaseParam::Instance();
configLayers(iotofPars.enableInnerTOF, iotofPars.enableOuterTOF,
iotofPars.enableForwardTOF, iotofPars.enableBackwardTOF,
iotofPars.detectorPattern);
iotofPars.detectorPattern,
iotofPars.segmentedInnerTOF, iotofPars.segmentedOuterTOF);
}

Detector::~Detector()
Expand All @@ -56,7 +57,7 @@ void Detector::ConstructGeometry()
createGeometry();
}

void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::string pattern)
void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::string pattern, bool itofSegmented, bool otofSegmented)
{

float radiusInnerTof = 19.f;
Expand All @@ -65,9 +66,10 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
float lengthOuterTof = 680.f;
std::pair<float, float> radiusRangeDiskTof = {15.f, 100.f};
float zForwardTof = 370.f;
LOG(info) << "Configuring IOTOF layers with '" << pattern << "' pattern";
if (pattern == "") {
LOG(info) << "Default pattern";
} else if (pattern == "v3b") {
LOG(info) << "Configuring IOTOF layers with v3b pattern";
ftof = false;
btof = false;
} else if (pattern == "v3b1a") {
Expand All @@ -94,16 +96,24 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
LOG(fatal) << "IOTOF layer pattern " << pattern << " not recognized, exiting";
}
if (itof) {
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, true); // iTOF
if (itofSegmented)
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrelSegmented,
24, 5.42, 80, 10); // iTOF
else
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrel); // iTOF
}
if (otof) {
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, true); // oTOF
if (otofSegmented)
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrelSegmented,
62, 9.74, 432, 5); // oTOF
else
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrel); // oTOF
}
if (ftof) {
mFTOFLayer = FTOFLayer(std::string{GeometryTGeo::getFTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, zForwardTof, 0.02f, false); // fTOF
mFTOFLayer = FTOFLayer(std::string{GeometryTGeo::getFTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, zForwardTof, 0.02f, FTOFLayer::kDisk); // fTOF
}
if (btof) {
mBTOFLayer = BTOFLayer(std::string{GeometryTGeo::getBTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, -zForwardTof, 0.02f, false); // bTOF
mBTOFLayer = BTOFLayer(std::string{GeometryTGeo::getBTOFLayerPattern()}, radiusRangeDiskTof.first, radiusRangeDiskTof.second, 0.f, -zForwardTof, 0.02f, BTOFLayer::kDisk); // bTOF
}
}

Expand Down Expand Up @@ -186,14 +196,18 @@ void Detector::defineSensitiveVolumes()
// The names of the IOTOF sensitive volumes have the format: IOTOFLayer(0...mLayers.size()-1)
auto& iotofPars = IOTOFBaseParam::Instance();
if (iotofPars.enableInnerTOF) {
v = geoManager->GetVolume(GeometryTGeo::getITOFSensorPattern());
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
AddSensitiveVolume(v);
for (const std::string& itofSensor : ITOFLayer::mRegister) {
v = geoManager->GetVolume(itofSensor.c_str());
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
AddSensitiveVolume(v);
}
}
if (iotofPars.enableOuterTOF) {
v = geoManager->GetVolume(GeometryTGeo::getOTOFSensorPattern());
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
AddSensitiveVolume(v);
for (const std::string& otofSensor : OTOFLayer::mRegister) {
v = geoManager->GetVolume(otofSensor.c_str());
LOGP(info, "Adding IOTOF Sensitive Volume {}", v->GetName());
AddSensitiveVolume(v);
}
}
if (iotofPars.enableForwardTOF) {
v = geoManager->GetVolume(GeometryTGeo::getFTOFSensorPattern());
Expand Down
Loading