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

Fix logical error in the check of mask flag bits [13_1_X] #41831

Merged
merged 2 commits into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion DQM/EcalMonitorClient/src/MLClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace ecaldqm {
double pu = sPU.getFloatValue();

//Do not compute ML quality if PU is non existent.
if (pu < 0.) {
if (pu <= 0.) {
return;
}
uint32_t mask(1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR |
Expand Down
8 changes: 4 additions & 4 deletions DQM/EcalMonitorTasks/src/EnergyTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ namespace ecaldqm {
MESet& meHit(MEs_.at("Hit"));
MESet& meHitAll(MEs_.at("HitAll"));

uint32_t neitherGoodNorPoorCalib(~(0x1 << EcalRecHit::kGood | 0x1 << EcalRecHit::kPoorCalib));
uint32_t neitherGoodNorOOT(~(0x1 << EcalRecHit::kGood | 0x1 << EcalRecHit::kOutOfTime));
uint32_t goodORPoorCalibBits(0x1 << EcalRecHit::kGood | 0x1 << EcalRecHit::kPoorCalib);
uint32_t goodOROOTBits(0x1 << EcalRecHit::kGood | 0x1 << EcalRecHit::kOutOfTime);

for (EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr) {
if (isPhysicsRun_ && hitItr->checkFlagMask(neitherGoodNorPoorCalib))
if (isPhysicsRun_ && !hitItr->checkFlagMask(goodORPoorCalibBits))
continue;
if (!isPhysicsRun_ && hitItr->checkFlagMask(neitherGoodNorOOT))
if (!isPhysicsRun_ && !hitItr->checkFlagMask(goodOROOTBits))
continue;

float energy(hitItr->energy());
Expand Down
4 changes: 2 additions & 2 deletions DQM/EcalMonitorTasks/src/OccupancyTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ namespace ecaldqm {
MESet& meRecHitThr1D(MEs_.at("RecHitThr1D"));
MESet& meTrendNRecHitThr(MEs_.at("TrendNRecHitThr"));

uint32_t mask(~(0x1 << EcalRecHit::kGood));
uint32_t goodBits(0x1 << EcalRecHit::kGood);
double nFiltered(0.);

float nRHThrp(0), nRHThrm(0);
Expand All @@ -210,7 +210,7 @@ namespace ecaldqm {
meRecHitProjEta.fill(getEcalDQMSetupObjects(), id);
meRecHitProjPhi.fill(getEcalDQMSetupObjects(), id);

if (!hit.checkFlagMask(mask) && hit.energy() > recHitThreshold_) {
if (hit.checkFlagMask(goodBits) && hit.energy() > recHitThreshold_) {
meRecHitThrProjEta.fill(getEcalDQMSetupObjects(), id);
meRecHitThrProjPhi.fill(getEcalDQMSetupObjects(), id);
meRecHitThrAll.fill(getEcalDQMSetupObjects(), id);
Expand Down
4 changes: 2 additions & 2 deletions DQM/EcalMonitorTasks/src/TimingTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ namespace ecaldqm {
MESet& meTime1D(MEs_.at("Time1D"));
MESet& meChi2(MEs_.at("Chi2"));

uint32_t mask(~((0x1 << EcalRecHit::kGood) | (0x1 << EcalRecHit::kOutOfTime)));
uint32_t goodOROOTBits(0x1 << EcalRecHit::kGood | 0x1 << EcalRecHit::kOutOfTime);
int signedSubdet;

std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit) {
if (hit.checkFlagMask(mask))
if (!hit.checkFlagMask(goodOROOTBits))
return;

DetId id(hit.id());
Expand Down