Skip to content
Snippets Groups Projects
Commit d9a9f622 authored by Adam Edward Barton's avatar Adam Edward Barton :speech_balloon:
Browse files

Merge branch 'trapezoidalBounds' into 'main'

trapezoidal bounds for the chambers

See merge request !70706
parents a2fe0334 d63a9fee
No related branches found
No related tags found
34 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77733Draft: add new HLT NN JVT, augmented with additional tracking information,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method,!75729New implementation of ZDC nonlinear FADC correction.,!75703Draft: Update to HI han config for HLT jets,!75184Draft: Update file heavyions_run.config,!74430Draft: Fixing upper bound for Delayed Jet Triggers,!73963Changing the path of the histograms to "Expert" area,!73875updating ID ART reference plots,!73874AtlasCLHEP_RandomGenerators: Fix cppcheck warnings.,!73449Add muon detectors to DarkJetPEBTLA partial event building,!73343Draft: [TrigEgamma] Add photon ringer chains on bootstrap mechanism,!72972Update L1Calo Jet Trigger Efficiency Monitoring algorithm,!72336Fixed TRT calibration crash,!72176Draft: Improving L1TopoOnline chain that now gets no-empty plots. Activating it by default,!72012Draft: Separate JiveXMLConfig.py into Config files,!71876Fix MET trigger name in MissingETMonitoring,!71820Draft: Adding new TLA End-Of-Fill (EOF) chains and removing obsolete DIPZ chains,!71279Draft: ATR-29330: Move L1_4J15 and the HLT chains seeded by it in the MC Menu,!70990Updates to pulse analysis to support new 2016 p+Pb analysis and 2023 Pb+Pb analysis,!70948[TrigEGam] Adding egamma chains to be monitored,!70777Draft: sTGC offline raw monitoring: strip efficiency re-implementation,!70706trapezoidal bounds for the chambers
......@@ -28,10 +28,11 @@ class ChamberAssembleTool : public AthAlgTool,
ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{
this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
PublicToolHandle<IMuonGeoUtilityTool> m_geoUtilTool{this,"GeoUtilTool", "" };
};
}
#endif
#endif
......@@ -129,10 +129,13 @@ StatusCode ChamberAssembleTool::buildReadOutElements(MuonDetectorManager &mgr) {
const Amg::Transform3D axisRotation{Amg::getRotateZ3D(-90. * Gaudi::Units::deg) *
Amg::getRotateY3D(-90. * Gaudi::Units::deg)};
constexpr double margin = 1.*Gaudi::Units::cm;
for (defineArgs& candidate : muonChamberCandidates) {
std::vector<Amg::Vector3D> edgePoints{};
std::vector<Identifier> reIds{};
double minPhi{1.e6};
const Amg::Transform3D toCenter = axisRotation * candidate.readoutEles[0]->globalToLocalTrans(gctx);
for (const MuonReadoutElement* re : candidate.readoutEles) {
const GeoShape* readOutShape = re->getMaterialGeom()->getLogVol()->getShape();
......@@ -151,7 +154,7 @@ StatusCode ChamberAssembleTool::buildReadOutElements(MuonDetectorManager &mgr) {
reIds.push_back(re->identify());
}
double minX{1.e6}, minY{1.e6}, minZ{1.e6}, maxX{-1.e6}, maxY{-1.e6}, maxZ{-1.e6};
double minX{1.e6}, minY{1.e6}, minZ{1.e6}, maxX{-1.e6}, maxY{-1.e6}, maxZ{-1.e6}, maxXNegY{-1.e6};;
/// Determine the height and the width of the trapezoidal volume bounds
for (const Amg::Vector3D& edge : edgePoints) {
......@@ -166,14 +169,48 @@ StatusCode ChamberAssembleTool::buildReadOutElements(MuonDetectorManager &mgr) {
const double midY = 0.5*(minY + maxY);
const double midZ = 0.5*(minZ + maxZ);
candidate.halfY = 0.5*(maxY - minY);
candidate.halfZ = 0.5*(maxZ - minZ);
candidate.halfXShort = candidate.halfXLong = 0.5*(maxX - minX);
const double hLengthY = 0.5 * (maxY - minY);
const double hLengthZ = 0.5 * (maxZ - minZ);
candidate.centerTrans = axisRotation.inverse() * Amg::Translation3D{midX, midY, midZ};
for (const Amg::Vector3D &edge : edgePoints) {
// translate the edges to the local frame of the chamber
const Amg::Vector2D &localedge =
(Amg::getTranslate3D(-midX, -midY, -midZ) * edge)
.block<2, 1>(0, 0);
if (std::abs(localedge.y() + hLengthY) < 15. * Gaudi::Units::cm) {
maxXNegY = std::max(maxXNegY, localedge.x());
}
}
const Amg::Vector2D refEdge{maxXNegY, -hLengthY};
// find the minimum angle between the edge points to define the
// trapezoidal bounds of the chamber
for (const Amg::Vector3D &edge : edgePoints) {
const Amg::Vector2D &localedge =
(Amg::getTranslate3D(-midX, -midY, -midZ) * edge)
.block<2, 1>(0, 0);
if (std::abs(localedge.y() - refEdge.y()) < 1.e-10) continue;
if (localedge.x() > refEdge.x() ||
std::abs(localedge.x() - refEdge.x()) < 1.e-10) {
double phi = std::atan2((localedge.y() - refEdge.y()),
(localedge.x() - refEdge.x()));
minPhi = std::min(minPhi, phi);
}
}
// Define the trapezoidal bounds of the chamber
candidate.halfXShort = maxXNegY + margin;
candidate.halfY = hLengthY + margin;
candidate.halfZ = hLengthZ + margin;
candidate.halfXLong =
candidate.halfXShort + 2 * candidate.halfY / std::tan(minPhi) + margin;
if(msgLvl(MSG::VERBOSE)) {
std::stringstream debugStream{};
debugStream<<"minY: "<<minY<<", maxY: "<<maxY<<", minZ: "<<minZ<<", maxZ: "<<maxZ<<" -- ";
......
......@@ -81,7 +81,7 @@ std::shared_ptr<Acts::Volume> MuonChamber::boundingVolume(const ActsGeometryCont
return std::make_shared<Acts::Volume>(localToGlobalTrans(gctx), bounds());
}
std::shared_ptr<Acts::TrapezoidVolumeBounds> MuonChamber::bounds() const {
return std::make_shared<Acts::TrapezoidVolumeBounds>(halfXLong(), halfXShort(), halfY(), halfZ());
return std::make_shared<Acts::TrapezoidVolumeBounds>(halfXShort(), halfXLong(), halfY(), halfZ());
}
std::ostream& operator<<(std::ostream& ostr,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment