Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit calibration channels and invalid data in HCAL TP emulation #19105

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions SimCalorimetry/HcalTrigPrimAlgos/src/HcalTriggerPrimitiveAlgo.cc
Expand Up @@ -197,6 +197,10 @@ void HcalTriggerPrimitiveAlgo::addSignal(const HFDataFrame & frame) {
void
HcalTriggerPrimitiveAlgo::addSignal(const QIE10DataFrame& frame)
{
HcalDetId detId = frame.detid();
// prevent QIE10 calibration channels from entering TP emulation
if(detId.subdet() != HcalForward) return;

auto ids = theTrigTowerGeometry->towerIds(frame.id());
for (const auto& id: ids) {
if (id.version() == 0) {
Expand Down Expand Up @@ -228,6 +232,9 @@ void
HcalTriggerPrimitiveAlgo::addSignal(const QIE11DataFrame& frame)
{
HcalDetId detId(frame.id());
// prevent QIE11 calibration channels from entering TP emulation
if(detId.subdet() != HcalEndcap && detId.subdet() != HcalBarrel) return;

std::vector<HcalTrigTowerDetId> ids = theTrigTowerGeometry->towerIds(detId);
assert(ids.size() == 1 || ids.size() == 2);
IntegerCaloSamples samples1(ids[0], int(frame.samples()));
Expand Down Expand Up @@ -527,6 +534,9 @@ void HcalTriggerPrimitiveAlgo::analyzeHF2016(
bool
HcalTriggerPrimitiveAlgo::validChannel(const QIE10DataFrame& digi, int ts) const
{
// channels with invalid data should not contribute to the sum
if(digi.linkError() || ts>=digi.samples() || !digi[ts].ok()) return false;

auto mask = conditions_->getHcalTPChannelParameter(HcalDetId(digi.id()))->getMask();
if (mask)
return false;
Expand Down