144 LOGPRINT <<
"A module is bad if the upper limit on the efficiency is < to the avg in the layer - " <<
threshold_ 145 <<
" and has at least " <<
nModsMin_ <<
" nModsMin.";
147 auto h_module_total = std::make_unique<TkHistoMap>(
tkDetMap_.get());
149 auto h_module_found = std::make_unique<TkHistoMap>(
tkDetMap_.get());
153 const auto& totalMaps = h_module_total->getAllMaps();
154 const auto& foundMaps = h_module_found->getAllMaps();
156 LogDebug(
"SiStripHitEfficiencyHarvester")
157 <<
"totalMaps.size(): " << totalMaps.size() <<
" foundMaps.size() " << foundMaps.size() << std::endl;
163 LogDebug(
"SiStripHitEfficiencyHarvester")
164 <<
"isTotalMapAvailable: " << isTotalMapAvailable <<
" isFoundMapAvailable " << isFoundMapAvailable << std::endl;
167 if (!isTotalMapAvailable
or !isFoundMapAvailable)
170 LogDebug(
"SiStripHitEfficiencyHarvester")
171 <<
"Entries in total TkHistoMap for layer 3: " << h_module_total->getMap(3)->getEntries() <<
", found " 172 << h_module_found->getMap(3)->getEntries();
177 std::vector<MonitorElement*> hEffInLayer(std::size_t(1),
nullptr);
178 hEffInLayer.reserve(bounds::k_END_OF_LAYERS);
179 for (std::size_t
i = 1;
i != bounds::k_END_OF_LAYERS; ++
i) {
181 hEffInLayer.push_back(booker.
book1D(
182 Form(
"eff_layer%i",
int(
i)), Form(
"Module efficiency in layer %s", lyrName.c_str()), 201, 0, 1.005));
184 std::array<long, bounds::k_END_OF_LAYERS> layerTotal{};
185 std::array<long, bounds::k_END_OF_LAYERS> layerFound{};
197 TrackerMap tkMapDen{
" Detector denominator "};
198 std::map<unsigned int, double> badModules;
202 const auto num = h_module_found->getValue(det);
203 const auto denom = h_module_total->getValue(det);
206 hEffInLayer[
layer]->Fill(eff);
210 badModules[det] = eff;
211 tkMapBad.fillc(det, 255, 0, 0);
213 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom;
216 tkMapBad.fillc(det, 255, 255, 255);
220 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom;
224 << det.rawId() <<
" is under occupancy at " <<
denom;
228 tkMap.fill(det, 1. - eff);
229 tkMapEff.fill(det, eff);
230 tkMapNum.fill(det,
num);
231 tkMapDen.fill(det,
denom);
239 for (Long_t
i = 1;
i <= k_LayersAtTECEnd;
i++) {
241 hEffInLayer[
i]->getTH1()->GetXaxis()->SetRange(
242 3, hEffInLayer[
i]->getNbinsX() + 1);
243 const double layer_min_eff = hEffInLayer[
i]->getMean() -
std::max(2.5 * hEffInLayer[
i]->getRMS(),
threshold_);
244 LOGPRINT <<
"Layer " <<
i <<
" threshold for bad modules: <" << layer_min_eff
245 <<
" (layer mean: " << hEffInLayer[
i]->getMean() <<
" rms: " << hEffInLayer[
i]->getRMS() <<
")";
247 hEffInLayer[
i]->getTH1()->GetXaxis()->SetRange(1, hEffInLayer[
i]->getNbinsX() + 1);
250 const auto layer = ::checkLayer(det,
tTopo_.get());
252 const auto num = h_module_found->getValue(det);
253 const auto denom = h_module_total->getValue(det);
256 const auto eff_up = TEfficiency::Bayesian(
denom,
num, .99, 1, 1,
true);
260 badModules[det] = eff;
261 tkMapBad.fillc(det, 255, 0, 0);
264 tkMapBad.fillc(det, 255, 255, 255);
266 if (eff_up < layer_min_eff + 0.08)
269 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom 270 <<
" , upper limit: " << eff_up;
273 << det.rawId() <<
" layer " <<
layer <<
" is under occupancy at " <<
denom;
281 tkMap.save(
true, 0, 0,
"SiStripHitEffTKMap_NEW.png");
282 tkMapBad.save(
true, 0, 0,
"SiStripHitEffTKMapBad_NEW.png");
283 tkMapEff.save(
true,
tkMapMin_, 1.,
"SiStripHitEffTKMapEff_NEW.png");
284 tkMapNum.save(
true, 0, 0,
"SiStripHitEffTKMapNum_NEW.png");
285 tkMapDen.save(
true, 0, 0,
"SiStripHitEffTKMapDen_NEW.png");
293 for (
const auto it : badModules) {
294 const auto det = it.first;
295 std::vector<unsigned int> badStripList;
300 badStripList.push_back(pQuality.encode(0,
nStrips, 0));
302 LOGPRINT <<
"ID1 shoudl match list of modules above " << det;
303 pQuality.compact(det, badStripList);
306 pQuality.fillBadComponents();
310 edm::LogInfo(
"SiStripHitEfficiencyHarvester") <<
"Will not produce payload!";
constexpr char const * layerName[numberOfLayers]
virtual void setCurrentFolder(std::string const &fullpath)
std::unique_ptr< TrackerTopology > tTopo_
void printAndWriteBadModules(const SiStripQuality &quality, const SiStripDetInfo &detInfo) const
void makeSummaryVsLumi(DQMStore::IGetter &getter) const
const bool autoIneffModTagging_
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
constexpr std::array< uint8_t, layerIndexSize > layer
std::unique_ptr< TkDetMap > tkDetMap_
std::vector< DetId > stripDetIds_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void printTotalStatistics(const std::array< long, bounds::k_END_OF_LAYERS > &layerFound, const std::array< long, bounds::k_END_OF_LAYERS > &layerTotal) const
void writeBadStripPayload(const SiStripQuality &quality) const
void makeSummaryVsBX(DQMStore::IGetter &getter, TFileService &fs) const
SiStripDetInfo read(std::string filePath)
void makeSummaryVsCM(DQMStore::IGetter &getter, TFileService &fs) const
Log< level::Info, false > LogInfo
const unsigned int nTEClayers_
const std::string inputFolder_
static const uint16_t STRIPS_PER_APV
std::pair< ContainerIterator, ContainerIterator > Range
static constexpr char const *const kDefaultFile
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
bool checkMapsValidity(const std::vector< MonitorElement *> &maps, const std::string &type) const
void makeSummary(DQMStore::IGetter &getter, TFileService &fs) const