Skip to content

Commit

Permalink
Add check on the ROC range
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Feb 3, 2024
1 parent a1207ea commit 0b45749
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void MeasurementTrackerEventProducer::updatePixels(const edm::Event& event,

edm::Handle<PixelFEDChannelCollection> pixelFEDChannelCollectionHandle;
for (const edm::EDGetTokenT<PixelFEDChannelCollection>& tk : theBadPixelFEDChannelsLabels) {
if (!event.getByToken(tk, pixelFEDChannelCollectionHandle))
if (not event.getByToken(tk, pixelFEDChannelCollectionHandle))
continue;
int i = 0;
for (const auto& disabledChannels : *pixelFEDChannelCollectionHandle) {
Expand All @@ -189,7 +189,8 @@ void MeasurementTrackerEventProducer::updatePixels(const edm::Event& event,
// PixelFEDChannelCollection addresses the ROCs by their 'idInDetUnit' (from 0 to 15), ROCs also know their on 'idInDetUnit',
// however the cabling map uses a numbering [1,numberOfROCs], see sipixelobjects::PixelFEDLink::roc(unsigned int id), not necessarily sorted in the same direction.
// PixelFEDChannelCollection MUST be filled such that ch.roc_first (ch.roc_last) correspond to the lowest (highest) 'idInDetUnit' in the channel
for (path.roc = 1; path.roc <= (ch.roc_last - ch.roc_first) + 1; path.roc++) {
assert(ch.roc_last >= ch.roc_first);
for (path.roc = 1; path.roc <= (ch.roc_last - ch.roc_first) + 1; ++path.roc) {
const sipixelobjects::PixelROC* roc = cablingMap.findItem(path);
if (roc == nullptr)
continue;
Expand Down Expand Up @@ -217,7 +218,7 @@ void MeasurementTrackerEventProducer::updatePixels(const edm::Event& event,
LocalPoint ur(std::max(lp1.x(), lp2.x()), std::max(lp1.y(), lp2.y()), std::max(lp1.z(), lp2.z()));
positions.push_back(std::make_pair(ll, ur));
} // loop on channels
if (!positions.empty()) {
if (not positions.empty()) {
i = thePxDets.find(disabledChannels.detId(), i);
assert(i != thePxDets.size() && thePxDets.id(i) == disabledChannels.detId());
thePxDets.addBadFEDChannelPositions(i, positions);
Expand Down

0 comments on commit 0b45749

Please sign in to comment.