Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions EventFilter/SiPixelRawToDigi/src/PixelDataFormatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ void PixelDataFormatter::interpretRawData(
int link = -1;
int roc = -1;
int layer = 0;
unsigned int rawId = 0;
unsigned int nrawId = 0;
PixelROC const* rocp = nullptr;
bool skipROC = false;
edm::DetSet<PixelDigi>* detDigis = nullptr;
Expand Down Expand Up @@ -147,7 +149,7 @@ void PixelDataFormatter::interpretRawData(
skipROC = true;
continue;
}
auto rawId = rocp->rawId();
rawId = rocp->rawId();
bool barrel = PixelModuleName::isBarrel(rawId);
if (barrel)
layer = PixelROC::bpixLayerPhase1(rawId);
Expand All @@ -163,10 +165,6 @@ void PixelDataFormatter::interpretRawData(
skipROC = modulesToUnpack_ && (modulesToUnpack_->find(rawId) == modulesToUnpack_->end());
if (skipROC)
continue;

detDigis = &digis.find_or_insert(rawId);
if ((*detDigis).empty())
(*detDigis).data.reserve(32); // avoid the first relocations
}

// skip is roc to be skipped ot invalid
Expand Down Expand Up @@ -204,6 +202,14 @@ void PixelDataFormatter::interpretRawData(
local = std::make_unique<LocalPixel>(localDP); // local pixel coordinate
}

if (nrawId != rawId) {
nrawId = rawId;
detDigis = &digis.find_or_insert(rawId);
if ((*detDigis).empty()) {
(*detDigis).data.reserve(32); // avoid the first relocations
}
}

GlobalPixel global = rocp->toGlobal(*local); // global pixel coordinate (in module)
(*detDigis).data.emplace_back(global.row, global.col, adc);
LogTrace("") << (*detDigis).data.back();
Expand Down