File indexing completed on 2024-04-06 12:04:08
0001 #include "DataFormats/ForwardDetId/interface/HFNoseDetIdToModule.h"
0002
0003 HFNoseDetIdToModule::HFNoseDetIdToModule() {}
0004
0005 std::vector<HFNoseDetId> HFNoseDetIdToModule::getDetIds(HFNoseDetId const& id) const {
0006 std::vector<HFNoseDetId> ids;
0007 int nCells = (id.type() == 0) ? HFNoseDetId::HFNoseFineN : HFNoseDetId::HFNoseCoarseN;
0008 for (int u = 0; u < 2 * nCells; ++u) {
0009 for (int v = 0; v < 2 * nCells; ++v) {
0010 if (((v - u) < nCells) && (u - v) <= nCells) {
0011 HFNoseDetId newId(id.zside(), id.type(), id.layer(), id.waferU(), id.waferV(), u, v);
0012 ids.emplace_back(newId);
0013 }
0014 }
0015 }
0016 return ids;
0017 }
0018
0019 std::vector<HFNoseTriggerDetId> HFNoseDetIdToModule::getTriggerDetIds(HFNoseDetId const& id) const {
0020 std::vector<HFNoseTriggerDetId> ids;
0021 int nCells = HFNoseDetId::HFNoseFineN / HFNoseDetId::HFNoseFineTrigger;
0022 for (int u = 0; u < 2 * nCells; ++u) {
0023 for (int v = 0; v < 2 * nCells; ++v) {
0024 if (((v - u) < nCells) && (u - v) <= nCells) {
0025 HFNoseTriggerDetId newId(HFNoseTrigger, id.zside(), id.type(), id.layer(), id.waferU(), id.waferV(), u, v);
0026 ids.emplace_back(newId);
0027 }
0028 }
0029 }
0030 return ids;
0031 }