Skip to content

Commit

Permalink
Merge pull request #37378 from abhih1/LEDQuality_Master
Browse files Browse the repository at this point in the history
Change quality criteria for some supercrystals in the Ecal Endcaps for LED Quality plots [Master]
  • Loading branch information
cmsbuild committed Mar 30, 2022
2 parents 8aa9d30 + d9f03c2 commit 04bb4f6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions DQM/EcalMonitorClient/interface/LedClient.h
Expand Up @@ -27,6 +27,7 @@ namespace ecaldqm {
double tolerancePNAmp_;
double tolerancePNRMSRatio_;
float forwardFactor_;
std::vector<uint32_t> SClist_;
};
} // namespace ecaldqm

Expand Down
35 changes: 29 additions & 6 deletions DQM/EcalMonitorClient/src/LedClient.cc
Expand Up @@ -10,7 +10,7 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include <cmath>

#include <fstream>
namespace ecaldqm {
LedClient::LedClient()
: DQWorkerClient(),
Expand Down Expand Up @@ -72,6 +72,17 @@ namespace ecaldqm {
expectedPNAmplitude_[iME] = inExpectedPNAmplitude[iWL];
}

//Get the list of known problematic Supercrystal ids and store them in the vector SClist_
std::string SClistpath = edm::FileInPath("DQM/EcalMonitorClient/data/LedTowers/SClist.dat").fullPath();
std::ifstream infile;
infile.open((SClistpath).c_str());
uint32_t detid;
int ix, iy, iz;
while (!infile.eof()) {
infile >> ix >> iy >> iz >> detid;
SClist_.push_back(detid);
}

qualitySummaries_.insert("Quality");
qualitySummaries_.insert("QualitySummary");
qualitySummaries_.insert("PNQualitySummary");
Expand Down Expand Up @@ -153,11 +164,23 @@ namespace ecaldqm {
intensity /= forwardFactor_;

float aRmsThr(sqrt(pow(aMean * toleranceAmpRMSRatio_, 2) + pow(3., 2)));
if (intensity < toleranceAmplitude_ || aRms > aRmsThr ||
std::abs(tMean - expectedTiming_[wlItr->second]) > toleranceTiming_ || tRms > toleranceTimRMS_)
qItr->setBinContent(doMask ? kMBad : kBad);
else
qItr->setBinContent(doMask ? kMGood : kGood);

EcalScDetId scid = EEDetId(id).sc(); //Get the Endcap SC id for the given crystal id.

//For the known bad Supercrystals in the SClist, bad quality flag is only set based on the amplitude RMS
//and everything else is ignored.
if (std::find(SClist_.begin(), SClist_.end(), int(scid)) != SClist_.end()) {
if (aRms > aRmsThr)
qItr->setBinContent(doMask ? kMBad : kBad);
else
qItr->setBinContent(doMask ? kMGood : kGood);
} else {
if (intensity < toleranceAmplitude_ || aRms > aRmsThr ||
std::abs(tMean - expectedTiming_[wlItr->second]) > toleranceTiming_ || tRms > toleranceTimRMS_)
qItr->setBinContent(doMask ? kMBad : kBad);
else
qItr->setBinContent(doMask ? kMGood : kGood);
}
}

towerAverage_(meQualitySummary, meQuality, 0.2);
Expand Down

0 comments on commit 04bb4f6

Please sign in to comment.