Skip to content
Merged
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 @@ -128,7 +128,7 @@ void Detector::buildTRKMiddleOuterLayers()
LOGP(info, "TRKLayer created. Name: {}", GeometryTGeo::getTRKLayerPattern() + std::to_string(0));
mLayers.emplace_back(1, GeometryTGeo::getTRKLayerPattern() + std::to_string(1), 11.f, 10, 100.e-3);
mLayers.emplace_back(2, GeometryTGeo::getTRKLayerPattern() + std::to_string(2), 15.f, 10, 100.e-3);
mLayers.emplace_back(3, GeometryTGeo::getTRKLayerPattern() + std::to_string(3), 19.f, 10, 100.e-3);
mLayers.emplace_back(3, GeometryTGeo::getTRKLayerPattern() + std::to_string(3), 20.f, 10, 100.e-3);
mLayers.emplace_back(4, GeometryTGeo::getTRKLayerPattern() + std::to_string(4), 30.f, 10, 100.e-3);
mLayers.emplace_back(5, GeometryTGeo::getTRKLayerPattern() + std::to_string(5), 45.f, 20, 100.e-3);
mLayers.emplace_back(6, GeometryTGeo::getTRKLayerPattern() + std::to_string(6), 60.f, 20, 100.e-3);
Expand Down
35 changes: 20 additions & 15 deletions Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ TGeoVolume* TRKLayer::createChip(std::string type)

TGeoVolume* TRKLayer::createModule(std::string type)
{
TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$");
TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
std::string moduleName = GeometryTGeo::getTRKModulePattern() + std::to_string(mLayerNumber);

TGeoShape* module;
TGeoVolume* moduleVol;

if (type == "cylinder") {
module = new TGeoTube(mInnerRadius, mInnerRadius + mChipThickness, (constants::moduleMLOT::length * mNumberOfModules) / 2);
moduleVol = new TGeoVolume(moduleName.c_str(), module, medAir);
moduleVol = new TGeoVolume(moduleName.c_str(), module, medSi);

TGeoVolume* chipVol = createChip("cylinder");
LOGP(debug, "Inserting {} in {} ", chipVol->GetName(), moduleVol->GetName());
Expand All @@ -186,7 +186,7 @@ TGeoVolume* TRKLayer::createModule(std::string type)
double moduleLength = constants::moduleMLOT::length;

module = new TGeoBBox(moduleWidth / 2, mChipThickness / 2, moduleLength / 2); // TO BE CHECKED !!!
moduleVol = new TGeoVolume(moduleName.c_str(), module, medAir);
moduleVol = new TGeoVolume(moduleName.c_str(), module, medSi);

for (int iChip = 0; iChip < mHalfNumberOfChips; iChip++) {
TGeoVolume* chipVolLeft = createChip("flat");
Expand Down Expand Up @@ -223,15 +223,15 @@ TGeoVolume* TRKLayer::createModule(std::string type)

TGeoVolume* TRKLayer::createHalfStave(std::string type)
{
TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$");
TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
std::string halfStaveName = GeometryTGeo::getTRKHalfStavePattern() + std::to_string(mLayerNumber);

TGeoShape* halfStave;
TGeoVolume* halfStaveVol;

if (type == "cylinder") {
halfStave = new TGeoTube(mInnerRadius, mInnerRadius + mChipThickness, mChipLength / 2);
halfStaveVol = new TGeoVolume(halfStaveName.c_str(), halfStave, medAir);
halfStaveVol = new TGeoVolume(halfStaveName.c_str(), halfStave, medSi);

TGeoVolume* moduleVol = createModule("cylinder");
LOGP(debug, "Inserting {} in {} ", moduleVol->GetName(), halfStaveVol->GetName());
Expand All @@ -242,7 +242,7 @@ TGeoVolume* TRKLayer::createHalfStave(std::string type)
double halfStaveLength = constants::moduleMLOT::length * mNumberOfModules;

halfStave = new TGeoBBox(halfStaveWidth / 2, mChipThickness / 2, halfStaveLength / 2);
halfStaveVol = new TGeoVolume(halfStaveName.c_str(), halfStave, medAir);
halfStaveVol = new TGeoVolume(halfStaveName.c_str(), halfStave, medSi);

for (int iModule = 0; iModule < mNumberOfModules; iModule++) {
TGeoVolume* moduleVol = createModule("flat");
Expand All @@ -257,6 +257,9 @@ TGeoVolume* TRKLayer::createHalfStave(std::string type)
halfStaveVol->AddNode(moduleVol, iModule, trans);
}
}

halfStaveVol->SetLineColor(kYellow);

return halfStaveVol;
}

Expand Down Expand Up @@ -296,11 +299,11 @@ TGeoVolume* TRKLayer::createStave(std::string type)
staveVol->AddNode(moduleVol, iModule, trans);
}
} else if (type == "staggered") {
/*double moduleWidth = constants::moduleMLOT::width;
double moduleLength = constants::moduleMLOT::length;*/
double overlap = constants::moduleMLOT::gaps::outerEdgeLongSide + constants::moduleMLOT::chip::passiveEdgeReadOut + 0.1; // 1.5mm outer-edge + 1mm deadzone + 1mm (true)overlap
double shift = overlap / 2;

double halfstaveWidth = constants::ML::width;
double staveWidth = constants::OT::width; // Each stave has two modules (based on the LOI design)
double halfstaveWidth = constants::OT::halfstave::width;
double staveWidth = constants::OT::width - overlap;
double staveLength = constants::moduleMLOT::length * mNumberOfModules;

stave = new TGeoBBox(staveWidth / 2, mLogicalVolumeThickness / 2, staveLength / 2);
Expand All @@ -311,12 +314,12 @@ TGeoVolume* TRKLayer::createStave(std::string type)
TGeoVolume* halfStaveVolRight = createHalfStave("flat");

TGeoCombiTrans* transLeft = new TGeoCombiTrans();
transLeft->SetTranslation(-halfstaveWidth / 2 + 0.05, 0, 0); // TO BE CHECKED !!! 1mm overlap between the modules
transLeft->SetTranslation(-halfstaveWidth / 2 + shift, 0, 0); // TO BE CHECKED !!! 1mm overlap between the modules
LOGP(debug, "Inserting {} in {} ", halfStaveVolLeft->GetName(), staveVol->GetName());
staveVol->AddNode(halfStaveVolLeft, 0, transLeft);

TGeoCombiTrans* transRight = new TGeoCombiTrans();
transRight->SetTranslation(halfstaveWidth / 2 - 0.05, 0.2, 0); // TO BE CHECKED !!! 1mm overlap between the modules
transRight->SetTranslation(halfstaveWidth / 2 - shift, 0.2, 0); // TO BE CHECKED !!! 1mm overlap between the modules
LOGP(debug, "Inserting {} in {} ", halfStaveVolRight->GetName(), staveVol->GetName());
staveVol->AddNode(halfStaveVolRight, 1, transRight);
} else {
Expand Down Expand Up @@ -377,21 +380,23 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
// Put the staves in the correct position and orientation
TGeoCombiTrans* trans = new TGeoCombiTrans();
double theta = 360. * iStave / nStaves;
TGeoRotation* rot = new TGeoRotation("rot", theta + 90 + 3, 0, 0);
TGeoRotation* rot = new TGeoRotation("rot", theta - 90 + 3, 0, 0);
trans->SetRotation(rot);
trans->SetTranslation(mInnerRadius * std::cos(2. * TMath::Pi() * iStave / nStaves), mInnerRadius * std::sin(2 * TMath::Pi() * iStave / nStaves), 0);

LOGP(debug, "Inserting {} in {} ", staveVol->GetName(), layerVol->GetName());
layerVol->AddNode(staveVol, iStave, trans);
}
} else if (mLayout == kStaggered) {
double overlapInStave = constants::moduleMLOT::gaps::outerEdgeLongSide + constants::moduleMLOT::chip::passiveEdgeReadOut + 0.1; // 1.5mm outer-edge + 1mm deadzone + 1mm (true)overlap

double layerLength = constants::moduleMLOT::length * mNumberOfModules;
double staveWidth = constants::OT::width - overlapInStave;

layer = new TGeoTube(mInnerRadius - 0.333 * layerThickness, mInnerRadius + 0.667 * layerThickness, layerLength / 2);
layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);

// Compute the number of staves
double staveWidth = constants::OT::width; // Each stave has two modules (based on the LOI design)
int nStaves = (int)std::ceil(mInnerRadius * 2 * TMath::Pi() / staveWidth);
nStaves += nStaves % 2; // Require an even number of staves

Expand All @@ -410,7 +415,7 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
// Put the staves in the correct position and orientation
TGeoCombiTrans* trans = new TGeoCombiTrans();
double theta = 360. * iStave / nStaves;
TGeoRotation* rot = new TGeoRotation("rot", theta + 90, 0, 0);
TGeoRotation* rot = new TGeoRotation("rot", theta - 90 + 3, 0, 0);
trans->SetRotation(rot);
trans->SetTranslation(mInnerRadius * std::cos(2. * TMath::Pi() * iStave / nStaves), mInnerRadius * std::sin(2 * TMath::Pi() * iStave / nStaves), 0);

Expand Down
Loading