From 02bef0d7531b8c7b75c4e5c903ff93b90279f076 Mon Sep 17 00:00:00 2001 From: Bruno Alves Date: Thu, 5 Jan 2023 09:17:12 +0100 Subject: [PATCH 1/2] add orientation and partials' type for each wafer Co-authored-by: bfontana <20703947+b-fontana@users.noreply.github.com> --- .../test/HGCalTriggerGeomTesterV9Imp3.cc | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc index 93309557c6133..2760dcdfa7fe0 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc @@ -122,6 +122,8 @@ class HGCalTriggerGeomTesterV9Imp3 : public edm::stream::EDAnalyzer<> { int triggerCellLayer_ = 0; int triggerCellWaferU_ = 0; int triggerCellWaferV_ = 0; + int triggerCellWaferPart_ = -1; + int triggerCellWaferOrient_ = -1; int triggerCellU_ = 0; int triggerCellV_ = 0; int triggerCellIEta_ = 0; @@ -300,6 +302,8 @@ HGCalTriggerGeomTesterV9Imp3::HGCalTriggerGeomTesterV9Imp3(const edm::ParameterS treeTriggerCells_->Branch("layer", &triggerCellLayer_, "layer/I"); treeTriggerCells_->Branch("waferu", &triggerCellWaferU_, "waferu/I"); treeTriggerCells_->Branch("waferv", &triggerCellWaferV_, "waferv/I"); + treeTriggerCells_->Branch("waferpart", &triggerCellWaferPart_, "waferpart/I"); + treeTriggerCells_->Branch("waferorient", &triggerCellWaferOrient_, "waferorient/I"); treeTriggerCells_->Branch("triggercellu", &triggerCellU_, "triggercellu/I"); treeTriggerCells_->Branch("triggercellv", &triggerCellV_, "triggercellv/I"); treeTriggerCells_->Branch("triggercellieta", &triggerCellIEta_, "triggercellieta/I"); @@ -977,7 +981,12 @@ void HGCalTriggerGeomTesterV9Imp3::fillTriggerGeometry() // Loop over trigger cells edm::LogPrint("TreeFilling") << "Filling trigger cells tree"; for (const auto& triggercell_cells : trigger_cells) { + if (!triggercell_cells.second.size()) { + throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: No cells in trigger cell!"; + } + DetId id(triggercell_cells.first); + std::tuple wafertype; GlobalPoint position = triggerGeometry_->getTriggerCellPosition(triggercell_cells.first); triggerCellId_ = id.rawId(); if (id.det() == DetId::HGCalHSc) { @@ -989,6 +998,8 @@ void HGCalTriggerGeomTesterV9Imp3::fillTriggerGeometry() triggerCellIPhi_ = id_sc.iphi(); triggerCellWaferU_ = 0; triggerCellWaferV_ = 0; + triggerCellWaferPart_ = -1; + triggerCellWaferOrient_ = -1; triggerCellU_ = 0; triggerCellV_ = 0; } else if (HFNoseTriggerDetId(triggercell_cells.first).det() == DetId::HGCalTrigger && @@ -1001,6 +1012,8 @@ void HGCalTriggerGeomTesterV9Imp3::fillTriggerGeometry() triggerCellIPhi_ = 0; triggerCellWaferU_ = id_nose_trig.waferU(); triggerCellWaferV_ = id_nose_trig.waferV(); + triggerCellWaferPart_ = -1; + triggerCellWaferOrient_ = -1; triggerCellU_ = id_nose_trig.triggerCellU(); triggerCellV_ = id_nose_trig.triggerCellV(); } else { @@ -1014,6 +1027,18 @@ void HGCalTriggerGeomTesterV9Imp3::fillTriggerGeometry() triggerCellWaferV_ = id_si_trig.waferV(); triggerCellU_ = id_si_trig.triggerCellU(); triggerCellV_ = id_si_trig.triggerCellV(); + + const HGCSiliconDetId& firstCellId(*triggercell_cells.second.begin()); + if (firstCellId.det() == DetId::HGCalEE) { + wafertype = triggerGeometry_->eeTopology().dddConstants().waferType(firstCellId); + } else if (firstCellId.det() == DetId::HGCalHSi) { + wafertype = triggerGeometry_->hsiTopology().dddConstants().waferType(firstCellId); + } else { + throw cms::Exception("BadGeometry") + << "HGCalTriggerGeometry: Found inconsistency in cell <-> trigger cell type mapping"; + } + triggerCellWaferPart_ = std::get<1>(wafertype); + triggerCellWaferOrient_ = std::get<2>(wafertype); } triggerCellX_ = position.x(); triggerCellY_ = position.y(); From 4ef2e83cfaea76ebfe50311997c8a4197003a6ed Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Fri, 22 Dec 2023 14:52:25 +0100 Subject: [PATCH 2/2] Propagate change in HGCalDDDConstants::waferType() interface --- L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc index 2760dcdfa7fe0..1265197703e1a 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc @@ -1030,9 +1030,9 @@ void HGCalTriggerGeomTesterV9Imp3::fillTriggerGeometry() const HGCSiliconDetId& firstCellId(*triggercell_cells.second.begin()); if (firstCellId.det() == DetId::HGCalEE) { - wafertype = triggerGeometry_->eeTopology().dddConstants().waferType(firstCellId); + wafertype = triggerGeometry_->eeTopology().dddConstants().waferType(firstCellId, false); } else if (firstCellId.det() == DetId::HGCalHSi) { - wafertype = triggerGeometry_->hsiTopology().dddConstants().waferType(firstCellId); + wafertype = triggerGeometry_->hsiTopology().dddConstants().waferType(firstCellId, false); } else { throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Found inconsistency in cell <-> trigger cell type mapping";