Skip to content

Commit

Permalink
Moving muon-system backwards to avoid overlap with DR-Calo
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoudali2 authored and BrieucF committed Oct 2, 2024
1 parent 50380ee commit 0a4177c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
8 changes: 4 additions & 4 deletions FCCee/IDEA/compact/IDEA_o1_v03/DectDimensions_IDEA_o1_v03.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@
<!-- Muon System Parameters-->
<constant name = "numberOfSides" value = "8"/> <!-- The number of sides of the muon system e.g (Octagon, Hexagon, ...)-->
<!-- Barrel -->
<constant name = "BarrelFirstLayerRadius" value = "4500*mm"/> <!-- 1st Barrel microRWELL detector inner radius-> its the start point of thicknesses of the microRWELL material. In our case the shape is Polygon, so the radius is in the middle of the polygon side. -->
<constant name = "BarrelLength" value = "9000*mm"/> <!--Barrel detector length, in the description of the detctor we always use the half-length -->
<constant name = "BarrelFirstLayerRadius" value = "4530*mm"/> <!-- 1st Barrel microRWELL detector inner radius-> its the start point of thicknesses of the microRWELL material. In our case the shape is Polygon, so the radius is in the middle of the polygon side. -->
<constant name = "BarrelLength" value = "9060*mm"/> <!--Barrel detector length, in the description of the detctor we always use the half-length -->
<!-- Endcap -->
<constant name = "EndcapFirstLayerZOffset" value = "4500*mm"/> <!-- 1st Endcap microRWELL detector inner ZOffset-> its the start point of thicknesses of the microRWELL volume -->
<constant name = "EndcapFirstLayerZOffset" value = "4530*mm"/> <!-- 1st Endcap microRWELL detector inner ZOffset-> its the start point of thicknesses of the microRWELL volume -->
<constant name = "EndcapLayersInnerRadius" value = "700*mm"/> <!--Endcap detector inner radius, its the start point of thicknesses of the detector material ** it applies for both detector layers and yoke-->
<constant name = "EndcapLayersOuterRadius" value = "5320*mm"/> <!--Endcap detector outer radius, its the end point of thicknesses of the detector material ** it applies for both detector layers and yoke-->
<constant name = "EndcapLayersOuterRadius" value = "5350*mm"/> <!--Endcap detector outer radius, its the end point of thicknesses of the detector material ** it applies for both detector layers and yoke-->
<!-- End of Muon system Parameters-->
</define>

Expand Down
26 changes: 16 additions & 10 deletions detector/muonSystem/muonSystemMuRWELL_o1_v01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,24 +309,27 @@ static dd4hep::Ref_t createmuonSystemMuRWELL_o1_v01(dd4hep::Detector& lcdd,
for (int chamberIndex = 0; chamberIndex < (numChambersInRectangle + 1); chamberIndex++) {

std::stringstream barrelNameStream;
barrelNameStream << "MuRWELL_Barrel_" << barrelIdCounter++;
std::string BarrelChamberName = barrelNameStream.str();
barrelNameStream << "-MuRWELL_Barrel_" << barrelIdCounter++;
std::string BarrelChamberName = name + barrelNameStream.str();

dd4hep::Box envelope(dimensions.x(), dimensions.y(), remainderZ * dimensions.z());
dd4hep::Volume envVolume(BarrelChamberName, envelope, lcdd.material(dimensions.materialStr()));

double rectangleRemainderY;
double rectangleRemainderREnvYPos;
if (numChambersInRectangle == 0){
rectangleRemainderY = std::abs(std::fmod((2 * rectangleEnvY - clearance), (2 * dimensions.y() - clearance))) / (2 * dimensions.y());
rectangleRemainderREnvYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + rectangleRemainderY * dimensions.y() + clearance/20;
}else {
rectangleRemainderY = std::fmod(2 * (rectangleEnvY - clearance), (2 * dimensions.y() - overlapY)) / (2 * dimensions.y());
rectangleRemainderREnvYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + rectangleRemainderY * dimensions.y() + 1.5 * clearance;
}

dd4hep::Box rectangleRemainderYEnvelope(dimensions.x(), rectangleRemainderY * dimensions.y(), remainderZ * dimensions.z());
dd4hep::Volume rectangleRemainderYEnvVolume(BarrelChamberName + "rectangleRemainderY", rectangleRemainderYEnvelope, lcdd.material(dimensions.materialStr()));

double envYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + dimensions.y() + clearance/20.0 ; // found that the positioning of the chambers inside the rectangle had an overlap with the mother volume ~ 45 um.
double rectangleRemainderREnvYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + rectangleRemainderY * dimensions.y() + clearance/20.0;
//double rectangleRemainderREnvYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + rectangleRemainderY * dimensions.y() + 1.5 * clearance;

double zRotation;
double rectangleRemainderZRotation;
Expand All @@ -335,7 +338,7 @@ static dd4hep::Ref_t createmuonSystemMuRWELL_o1_v01(dd4hep::Detector& lcdd,
rectangleRemainderZRotation = 0.0;
} else {
zRotation = std::atan(dimensions.x() / (dimensions.y() - (2 * overlapY)));
rectangleRemainderZRotation = std::atan(dimensions.x() / (rectangleRemainderY * dimensions.y() - (2 * overlapY))); // Y and Z are reversed in local remainder
rectangleRemainderZRotation = std::atan(dimensions.x() / (rectangleRemainderY * dimensions.y() - overlapY * 1.5)); // Y and Z are reversed in local remainder
}

dd4hep::RotationZ chamberRotation(zRotation);
Expand Down Expand Up @@ -450,24 +453,27 @@ static dd4hep::Ref_t createmuonSystemMuRWELL_o1_v01(dd4hep::Detector& lcdd,
for (int chamberIndex = 0; chamberIndex < (numChambersInRectangle + 1); chamberIndex++) {

std::stringstream barrelNameStream;
barrelNameStream << "MuRWELL_Barrel_" << barrelIdCounter++;
std::string BarrelChamberName = barrelNameStream.str();
barrelNameStream << "-MuRWELL_Barrel_" << barrelIdCounter++;
std::string BarrelChamberName = name + barrelNameStream.str();

dd4hep::Box envelope(dimensions.x(), dimensions.y(), dimensions.z());
dd4hep::Volume envVolume(BarrelChamberName, envelope, lcdd.material(dimensions.materialStr()));

double rectangleRemainderY;
double rectangleRemainderREnvYPos;
if (numChambersInRectangle == 0){
rectangleRemainderY = std::abs(std::fmod((2 * rectangleEnvY - clearance), (2 * dimensions.y() - clearance))) / (2 * dimensions.y());
rectangleRemainderREnvYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + rectangleRemainderY * dimensions.y() + clearance/20;
}else {
rectangleRemainderY = std::fmod(2 * (rectangleEnvY - clearance), (2 * dimensions.y() - overlapY)) / (2 * dimensions.y());
rectangleRemainderREnvYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + rectangleRemainderY * dimensions.y() + 1.5 * clearance;
}

dd4hep::Box rectangleRemainderYEnvelope(dimensions.x(), rectangleRemainderY * dimensions.y(), dimensions.z());
dd4hep::Volume rectangleRemainderYEnvVolume(BarrelChamberName + "rectangleRemainderY", rectangleRemainderYEnvelope, lcdd.material(dimensions.materialStr()));

double envYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + dimensions.y() + clearance/20.0 ; // found that the positioning of the chambers inside the rectangle had an overlap with the mother volume ~ 45 um.
double rectangleRemainderREnvYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + rectangleRemainderY * dimensions.y() + clearance/20.0;
//double rectangleRemainderREnvYPos = (chamberIndex * 2 * dimensions.y()) - (overlapY * chamberIndex) + dimensions.y_offset() - rectangleEnvY + rectangleRemainderY * dimensions.y() + 1.5 * clearance;

double zRotation;
double rectangleRemainderZRotation;
Expand All @@ -476,7 +482,7 @@ static dd4hep::Ref_t createmuonSystemMuRWELL_o1_v01(dd4hep::Detector& lcdd,
rectangleRemainderZRotation = 0.0;
} else {
zRotation = std::atan(dimensions.x() / (dimensions.y() - (2 * overlapY)));
rectangleRemainderZRotation = std::atan(dimensions.x() / (rectangleRemainderY * dimensions.y() - (2 * overlapY))); // Y and Z are reversed in local remainder
rectangleRemainderZRotation = std::atan(dimensions.x() / (rectangleRemainderY * dimensions.y() - overlapY * 1.5)); // Y and Z are reversed in local remainder
}

dd4hep::RotationZ chamberRotation(zRotation);
Expand Down Expand Up @@ -826,8 +832,8 @@ static dd4hep::Ref_t createmuonSystemMuRWELL_o1_v01(dd4hep::Detector& lcdd,
for (int chamberIndex = 0; chamberIndex < (numChambersInRectangle + 1); chamberIndex++) {

std::stringstream endcapNameStream;
endcapNameStream << "MuRWELL_Endcap_" << endcapIdCounter++;
std::string EndcapChamberName = endcapNameStream.str();
endcapNameStream << "-MuRWELL_Endcap_" << endcapIdCounter++;
std::string EndcapChamberName = name + endcapNameStream.str();

dd4hep::Box envelope;
if (rectangle == numRectangles) {
Expand Down

0 comments on commit 0a4177c

Please sign in to comment.