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

Change quality criteria for some supercrystals in the Ecal Endcaps for LED Quality plots [Master] #37378

Merged
merged 1 commit into from Mar 30, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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