Skip to content

Commit

Permalink
Merge pull request #43704 from hgc-tpg/hgc-tpg-integration-240112
Browse files Browse the repository at this point in the history
[HGCAL trigger] Update in geometry tester class
  • Loading branch information
cmsbuild authored Jan 22, 2024
2 parents 88f92ee + 4ef2e83 commit 8a30dff
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions L1Trigger/L1THGCal/test/HGCalTriggerGeomTesterV9Imp3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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<int, int, int> wafertype;
GlobalPoint position = triggerGeometry_->getTriggerCellPosition(triggercell_cells.first);
triggerCellId_ = id.rawId();
if (id.det() == DetId::HGCalHSc) {
Expand All @@ -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 &&
Expand All @@ -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 {
Expand All @@ -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, false);
} else if (firstCellId.det() == DetId::HGCalHSi) {
wafertype = triggerGeometry_->hsiTopology().dddConstants().waferType(firstCellId, false);
} 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();
Expand Down

0 comments on commit 8a30dff

Please sign in to comment.