Skip to content

Commit

Permalink
Merge pull request #41831 from abhih1/Fixlogicalmask_131X
Browse files Browse the repository at this point in the history
Fix logical error in the check of mask flag bits [13_1_X]
  • Loading branch information
cmsbuild authored Jun 4, 2023
2 parents 97a64af + 4a93e2d commit 231f2e7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
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

0 comments on commit 231f2e7

Please sign in to comment.