30 #include "TGraphAsymmErrors.h" 34 #include "TEfficiency.h" 38 #define LOGPRINT edm::LogPrint("SiStripHitEfficiencyHarvester") 68 std::unique_ptr<TrackerTopology>
tTopo_;
87 const std::array<long, bounds::k_END_OF_LAYERS>& layerTotal)
const;
90 unsigned int countTotalHits(
const std::vector<MonitorElement*>& maps);
98 : inputFolder_(conf.getParameter<
std::
string>(
"inputFolder")),
99 isAtPCL_(conf.getParameter<
bool>(
"isAtPCL")),
100 autoIneffModTagging_(conf.getUntrackedParameter<
bool>(
"AutoIneffModTagging",
false)),
101 doStoreOnDB_(conf.getParameter<
bool>(
"doStoreOnDB")),
102 doStoreOnTree_(conf.getUntrackedParameter<
bool>(
"doStoreOnTree")),
103 showRings_(conf.getUntrackedParameter<
bool>(
"ShowRings",
false)),
104 showEndcapSides_(conf.getUntrackedParameter<
bool>(
"ShowEndcapSides",
true)),
105 showTOB6TEC9_(conf.getUntrackedParameter<
bool>(
"ShowTOB6TEC9",
false)),
106 showOnlyGoodModules_(conf.getUntrackedParameter<
bool>(
"ShowOnlyGoodModules",
false)),
107 nTEClayers_(showRings_ ? 7 : 9),
108 threshold_(conf.getParameter<double>(
"Threshold")),
109 nModsMin_(conf.getParameter<
int>(
"nModsMin")),
110 effPlotMin_(conf.getUntrackedParameter<double>(
"EffPlotMin", 0.9)),
111 tkMapMin_(conf.getUntrackedParameter<double>(
"TkMapMin", 0.9)),
112 title_(conf.getParameter<
std::
string>(
"Title")),
113 record_(conf.getParameter<
std::
string>(
"Record")),
119 for (
int l = 0;
l < bounds::k_END_OF_LAYS_AND_RINGS;
l++) {
139 for (
const auto& det : tkGeom.detUnits()) {
140 if (dynamic_cast<const StripGeomDetUnit*>(det)) {
149 std::vector<bool> isThere;
150 isThere.reserve(maps.size());
151 std::transform(maps.begin() + 1, maps.end(), std::back_inserter(isThere), [](
auto&
x) {
return !(
x ==
nullptr); });
154 for (
const auto& it : isThere) {
156 LogDebug(
"SiStripHitEfficiencyHarvester") <<
" layer: " <<
count <<
" " << it << std::endl;
158 LogDebug(
"SiStripHitEfficiencyHarvester") <<
"resolving to " << maps[
count]->getName() << std::endl;
162 bool areMapsAvailable{
true};
164 for (
const auto& it : isThere) {
168 <<
type <<
" TkHistoMap for layer " << layerCount <<
" was not found.\n -> Aborting!";
169 areMapsAvailable =
false;
173 return areMapsAvailable;
188 tree =
fs->make<TTree>(
"ModEff",
"ModEff");
191 tree->Branch(
"FoundHits", &
t_found,
"FoundHits/i");
201 LOGPRINT <<
"A module is bad if the upper limit on the efficiency is < to the avg in the layer - " <<
threshold_ 202 <<
" and has at least " <<
nModsMin_ <<
" nModsMin.";
204 auto h_module_total = std::make_unique<TkHistoMap>(
tkDetMap_.get());
206 auto h_module_found = std::make_unique<TkHistoMap>(
tkDetMap_.get());
210 const auto& totalMaps = h_module_total->getAllMaps();
211 const auto& foundMaps = h_module_found->getAllMaps();
213 LogDebug(
"SiStripHitEfficiencyHarvester")
214 <<
"totalMaps.size(): " << totalMaps.size() <<
" foundMaps.size() " << foundMaps.size() << std::endl;
220 LogDebug(
"SiStripHitEfficiencyHarvester")
221 <<
"isTotalMapAvailable: " << isTotalMapAvailable <<
" isFoundMapAvailable " << isFoundMapAvailable << std::endl;
224 if (!isTotalMapAvailable
or !isFoundMapAvailable)
227 LogDebug(
"SiStripHitEfficiencyHarvester")
228 <<
"Entries in total TkHistoMap for layer 3: " << h_module_total->getMap(3)->getEntries() <<
", found " 229 << h_module_found->getMap(3)->getEntries();
235 for (
size_t i = 1;
i < totalMaps.size();
i++) {
236 h_module_total->getMap(
i)->setOption(
"colz");
237 h_module_found->getMap(
i)->setOption(
"colz");
243 std::vector<MonitorElement*> hEffInLayer(std::size_t(1),
nullptr);
244 hEffInLayer.reserve(bounds::k_END_OF_LAYERS);
245 for (std::size_t
i = 1;
i != bounds::k_END_OF_LAYERS; ++
i) {
247 hEffInLayer.push_back(booker.
book1D(
248 Form(
"eff_layer%i",
int(
i)), Form(
"Module efficiency in layer %s", lyrName.c_str()), 201, 0, 1.005));
250 std::array<long, bounds::k_END_OF_LAYERS> layerTotal{};
251 std::array<long, bounds::k_END_OF_LAYERS> layerFound{};
263 TrackerMap tkMapDen{
" Detector denominator "};
264 std::map<unsigned int, double> badModules;
271 "perModule_FEDErrors");
277 LogDebug(
"SiStripHitEfficiencyHarvester")
278 << __PRETTY_FUNCTION__ <<
" bad module from FEDError " << badId <<
"," <<
fraction << std::endl;
283 const auto num = h_module_found->getValue(det);
284 const auto denom = h_module_total->getValue(det);
289 hEffInLayer[
layer]->Fill(eff);
293 badModules[det] = eff;
294 tkMapBad.fillc(det, 255, 0, 0);
296 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom;
299 tkMapBad.fillc(det, 255, 255, 255);
303 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom;
307 << det.rawId() <<
" is under occupancy at " <<
denom;
322 tkMap.fill(det, 1. - eff);
323 tkMapEff.fill(det, eff);
324 tkMapNum.fill(det,
num);
325 tkMapDen.fill(det,
denom);
332 if (
layer <= bounds::k_LayersAtTOBEnd) {
335 }
else if (
layer > bounds::k_LayersAtTOBEnd &&
layer <= bounds::k_LayersAtTIDEnd) {
336 if (
tTopo_->tidSide(det) == 1) {
339 }
else if (
tTopo_->tidSide(det) == 2) {
343 }
else if (
layer > bounds::k_LayersAtTIDEnd &&
layer <= bounds::k_LayersAtTECEnd) {
344 if (
tTopo_->tecSide(det) == 1) {
347 }
else if (
tTopo_->tecSide(det) == 2) {
355 if (
layer <= bounds::k_LayersAtTOBEnd) {
358 }
else if (
layer > bounds::k_LayersAtTOBEnd &&
layer <= bounds::k_LayersAtTIDEnd) {
359 if (
tTopo_->tidSide(det) == 1) {
362 }
else if (
tTopo_->tidSide(det) == 2) {
366 }
else if (
layer > bounds::k_LayersAtTIDEnd &&
layer <= bounds::k_LayersAtTECEnd) {
367 if (
tTopo_->tecSide(det) == 1) {
370 }
else if (
tTopo_->tecSide(det) == 2) {
380 for (Long_t
i = 1;
i <= k_LayersAtTECEnd;
i++) {
382 hEffInLayer[
i]->getTH1()->GetXaxis()->SetRange(
383 3, hEffInLayer[
i]->getNbinsX() + 1);
384 const double layer_min_eff = hEffInLayer[
i]->getMean() -
std::max(2.5 * hEffInLayer[
i]->getRMS(),
threshold_);
385 LOGPRINT <<
"Layer " <<
i <<
" threshold for bad modules: <" << layer_min_eff
386 <<
" (layer mean: " << hEffInLayer[
i]->getMean() <<
" rms: " << hEffInLayer[
i]->getRMS() <<
")";
388 hEffInLayer[
i]->getTH1()->GetXaxis()->SetRange(1, hEffInLayer[
i]->getNbinsX() + 1);
393 const auto layer = ::checkLayer(det,
tTopo_.get());
395 const auto num = h_module_found->getValue(det);
396 const auto denom = h_module_total->getValue(det);
399 const auto eff_up = TEfficiency::Bayesian(
denom,
num, .99, 1, 1,
true);
403 badModules[det] = eff;
404 tkMapBad.fillc(det, 255, 0, 0);
410 tkMapBad.fillc(det, 255, 255, 255);
415 if (eff_up < layer_min_eff + 0.08) {
418 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom 419 <<
" , upper limit: " << eff_up;
423 << det.rawId() <<
" layer " <<
layer <<
" is under occupancy at " <<
denom;
441 tkMap.save(
true, 0, 0,
"SiStripHitEffTKMap_NEW.png");
442 tkMapBad.save(
true, 0, 0,
"SiStripHitEffTKMapBad_NEW.png");
443 tkMapEff.save(
true,
tkMapMin_, 1.,
"SiStripHitEffTKMapEff_NEW.png");
444 tkMapNum.save(
true, 0, 0,
"SiStripHitEffTKMapNum_NEW.png");
445 tkMapDen.save(
true, 0, 0,
"SiStripHitEffTKMapDen_NEW.png");
453 for (
const auto it : badModules) {
454 const auto det = it.first;
455 std::vector<unsigned int> badStripList;
460 badStripList.push_back(pQuality.encode(0,
nStrips, 0));
462 LOGPRINT <<
"ID1 shoudl match list of modules above " << det;
463 pQuality.compact(det, badStripList);
466 pQuality.fillBadComponents();
468 if (totalHits > 0u) {
472 << __PRETTY_FUNCTION__ <<
" There are no SiStrip hits for a valid measurement, skipping!";
475 edm::LogInfo(
"SiStripHitEfficiencyHarvester") <<
"Will not produce payload!";
494 const std::array<long, bounds::k_END_OF_LAYERS>& layerFound,
495 const std::array<long, bounds::k_END_OF_LAYERS>& layerTotal)
const {
503 for (Long_t
i = 1;
i < 5;
i++) {
508 for (Long_t
i = 1;
i <= bounds::k_LayersAtTECEnd;
i++) {
509 layereff = double(layerFound[
i]) / double(layerTotal[
i]);
511 << layereff <<
" " << layerFound[
i] <<
"/" << layerTotal[
i];
512 totalfound += layerFound[
i];
513 totaltotal += layerTotal[
i];
514 if (
i <= bounds::k_LayersAtTIBEnd) {
515 subdetfound[1] += layerFound[
i];
516 subdettotal[1] += layerTotal[
i];
518 if (
i > bounds::k_LayersAtTIBEnd &&
i <= bounds::k_LayersAtTOBEnd) {
519 subdetfound[2] += layerFound[
i];
520 subdettotal[2] += layerTotal[
i];
522 if (
i > bounds::k_LayersAtTOBEnd &&
i <= bounds::k_LayersAtTIDEnd) {
523 subdetfound[3] += layerFound[
i];
524 subdettotal[3] += layerTotal[
i];
526 if (
i > bounds::k_LayersAtTIDEnd) {
527 subdetfound[4] += layerFound[
i];
528 subdettotal[4] += layerTotal[
i];
532 LOGPRINT <<
"The total efficiency is " << double(totalfound) / double(totaltotal);
533 LOGPRINT <<
" TIB: " << double(subdetfound[1]) / subdettotal[1] <<
" " << subdetfound[1] <<
"/" 535 LOGPRINT <<
" TOB: " << double(subdetfound[2]) / subdettotal[2] <<
" " << subdetfound[2] <<
"/" 537 LOGPRINT <<
" TID: " << double(subdetfound[3]) / subdettotal[3] <<
" " << subdetfound[3] <<
"/" 539 LOGPRINT <<
" TEC: " << double(subdetfound[4]) / subdettotal[4] <<
" " << subdetfound[4] <<
"/" 545 const auto pQdvBegin =
quality.getDataVectorBegin();
546 for (
auto rIt =
quality.getRegistryVectorBegin(); rIt !=
quality.getRegistryVectorEnd(); ++rIt) {
548 if (!pBadStrip.put(rIt->detid,
range))
549 edm::LogError(
"SiStripHitEfficiencyHarvester") <<
"detid already exists in SiStripBadStrip";
574 TH1F* found2 =
fs.make<TH1F>(
"found2",
"found2",
nLayers + 1, 0,
nLayers + 1);
577 found->SetBinContent(0, -1);
578 all->SetBinContent(0, 1);
581 for (
unsigned int i = 1;
i <
nLayers + 2; ++
i) {
583 all->SetBinContent(
i, 1);
584 found2->SetBinContent(
i, 1
e-6);
585 all2->SetBinContent(
i, 1);
588 TCanvas* c7 =
new TCanvas(
"c7",
" test ", 10, 10, 800, 600);
592 unsigned int nLayers_max =
nLayers + 1;
595 for (
unsigned int i = 1;
i < nLayers_max; ++
i) {
612 for (
unsigned int i = 11;
i < 14; ++
i) {
627 LOGPRINT <<
"Fill only good modules layer " <<
i - 3
634 LOGPRINT <<
"Filling all modules layer " <<
i - 3
650 TGraphAsymmErrors* gr =
fs.make<TGraphAsymmErrors>(
nLayers + 1);
651 gr->SetName(
"eff_good");
654 TGraphAsymmErrors* gr2 =
fs.make<TGraphAsymmErrors>(
nLayers + 1);
655 gr2->SetName(
"eff_all");
656 gr2->BayesDivide(found2, all2);
658 for (
unsigned int j = 0;
j <
nLayers + 1;
j++) {
659 gr->SetPointError(
j, 0., 0., gr->GetErrorYlow(
j), gr->GetErrorYhigh(
j));
660 gr2->SetPointError(
j, 0., 0., gr2->GetErrorYlow(
j), gr2->GetErrorYhigh(
j));
663 gr->GetXaxis()->SetLimits(0,
nLayers);
664 gr->SetMarkerColor(2);
665 gr->SetMarkerSize(1.2);
668 gr->SetMarkerStyle(20);
670 gr->SetMaximum(1.001);
671 gr->GetYaxis()->SetTitle(
"Efficiency");
672 gStyle->SetTitleFillColor(0);
673 gStyle->SetTitleBorderSize(0);
674 gr->SetTitle(
title_.c_str());
676 gr2->GetXaxis()->SetLimits(0,
nLayers);
677 gr2->SetMarkerColor(1);
678 gr2->SetMarkerSize(1.2);
679 gr2->SetLineColor(1);
680 gr2->SetLineWidth(4);
681 gr2->SetMarkerStyle(21);
683 gr2->SetMaximum(1.001);
684 gr2->GetYaxis()->SetTitle(
"Efficiency");
685 gr2->SetTitle(
title_.c_str());
703 gr->GetXaxis()->SetBinLabel(((
k + 1) * 100 + 2) / (
nLayers)-4,
label);
704 gr2->GetXaxis()->SetBinLabel(((
k + 1) * 100 + 2) / (
nLayers)-4,
label);
706 gr->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-6,
label);
707 gr2->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-6,
label);
711 gr->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-4,
label);
712 gr2->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-4,
label);
714 gr->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-7,
label);
715 gr2->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-7,
label);
721 gr->GetXaxis()->SetNdivisions(36);
724 TPad*
overlay =
new TPad(
"overlay",
"", 0, 0, 1, 1);
727 overlay->SetFrameFillStyle(4000);
733 TLegend* leg =
new TLegend(0.70, 0.27, 0.88, 0.40);
734 leg->AddEntry(gr,
"Good Modules",
"p");
736 leg->AddEntry(gr2,
"All Modules",
"p");
737 leg->SetTextSize(0.020);
738 leg->SetFillColor(0);
741 c7->SaveAs(
"Summary.png");
742 c7->SaveAs(
"Summary.root");
750 for (
unsigned int iLayer = 1; iLayer != (
showRings_ ? 20 : 22); ++iLayer) {
754 if (hfound ==
nullptr or htotal ==
nullptr) {
755 if (hfound ==
nullptr)
758 if (htotal ==
nullptr)
765 if (!hfound->GetSumw2())
767 if (!htotal->GetSumw2())
769 for (Long_t
i = 0;
i != hfound->GetNbinsX() + 1; ++
i) {
770 if (hfound->GetBinContent(
i) == 0)
771 hfound->SetBinContent(
i, 1
e-6);
772 if (htotal->GetBinContent(
i) == 0)
773 htotal->SetBinContent(
i, 1);
775 LogDebug(
"SiStripHitEfficiencyHarvester")
776 <<
"Total hits for layer " << iLayer <<
" (vs lumi): " << htotal->GetEntries() <<
", found " 777 << hfound->GetEntries();
788 std::stringstream ssV[4][19],
797 ssV[
i][
comp] <<
" \t " << ((bc.
BadApvs) & 0
x1) <<
" " << ((bc.BadApvs >> 1) & 0
x1) <<
" ";
799 ssV[
i][
comp] <<
"x x " << ((bc.BadApvs >> 2) & 0
x1) <<
" " << ((bc.BadApvs >> 3) & 0
x1);
801 ssV[
i][
comp] << ((bc.BadApvs >> 2) & 0
x1) <<
" " << ((bc.BadApvs >> 3) & 0
x1) <<
" " << ((bc.BadApvs >> 4) & 0
x1)
802 <<
" " << ((bc.BadApvs >> 5) & 0
x1) <<
" ";
805 nBad[
i][0][2] += ((bc.BadApvs >> 5) & 0
x1) + ((bc.BadApvs >> 4) & 0
x1) + ((bc.BadApvs >> 3) & 0
x1) +
806 ((bc.BadApvs >> 2) & 0
x1) + ((bc.BadApvs >> 1) & 0
x1) + ((bc.BadApvs) & 0
x1);
807 nBad[
i][
comp][2] += ((bc.BadApvs >> 5) & 0
x1) + ((bc.BadApvs >> 4) & 0
x1) + ((bc.BadApvs >> 3) & 0
x1) +
808 ((bc.BadApvs >> 2) & 0
x1) + ((bc.BadApvs >> 1) & 0
x1) + ((bc.BadApvs) & 0
x1);
811 nBad[
i][0][1] += ((bc.BadFibers >> 2) & 0
x1) + ((bc.BadFibers >> 1) & 0
x1) + ((bc.BadFibers) & 0
x1);
812 nBad[
i][
comp][1] += ((bc.BadFibers >> 2) & 0
x1) + ((bc.BadFibers >> 1) & 0
x1) + ((bc.BadFibers) & 0
x1);
827 int nBadComp[4][19][4];
831 std::stringstream ssV[4][19];
833 for (
int i = 0;
i < 4; ++
i) {
835 for (
int j = 0;
j < 19; ++
j) {
837 for (
int k = 0;
k < 4; ++
k)
838 nBadComp[
i][
j][
k] = 0;
842 for (
const auto& bc :
quality.getBadComponentList()) {
847 nTkBadComp[1] += ((bc.BadFibers >> 2) & 0
x1) + ((bc.BadFibers >> 1) & 0
x1) + ((bc.BadFibers) & 0
x1);
849 nTkBadComp[2] += ((bc.BadApvs >> 5) & 0
x1) + ((bc.BadApvs >> 4) & 0
x1) + ((bc.BadApvs >> 3) & 0
x1) +
850 ((bc.BadApvs >> 2) & 0
x1) + ((bc.BadApvs >> 1) & 0
x1) + ((bc.BadApvs) & 0
x1);
884 for (
auto rp =
quality.getRegistryVectorBegin(); rp !=
quality.getRegistryVectorEnd(); ++rp) {
885 DetId det{rp->detid};
887 int component = -999;
888 switch (det.subdetId()) {
891 component =
tTopo_->tibLayer(det);
895 component =
tTopo_->tidSide(det) == 2 ?
tTopo_->tidWheel(det) :
tTopo_->tidWheel(det) + 3;
899 component =
tTopo_->tobLayer(det);
903 component =
tTopo_->tecSide(det) == 2 ?
tTopo_->tecWheel(det) :
tTopo_->tecWheel(det) + 9;
909 const auto pQdvBegin =
quality.getDataVectorBegin();
911 float percentage = 0;
912 for (
int it = 0; it < sqrange.second - sqrange.first; it++) {
913 unsigned int range =
quality.decode(*(sqrange.first + it)).range;
914 nTkBadComp[3] +=
range;
915 nBadComp[subdet][0][3] +=
range;
916 nBadComp[subdet][component][3] +=
range;
922 edm::LogError(
"SiStripHitEfficiencyHarvester") <<
"PROBLEM detid " << det.rawId() <<
" value " << percentage;
926 std::ostringstream
ss;
927 ss <<
"\n-----------------\nGlobal Info\n-----------------";
928 ss <<
"\nBadComp \t Modules \tFibers " 929 "\tApvs\tStrips\n----------------------------------------------------------------";
930 ss <<
"\nTracker:\t\t" << nTkBadComp[0] <<
"\t" << nTkBadComp[1] <<
"\t" << nTkBadComp[2] <<
"\t" << nTkBadComp[3];
931 ss <<
"\nTIB:\t\t\t" << nBadComp[0][0][0] <<
"\t" << nBadComp[0][0][1] <<
"\t" << nBadComp[0][0][2] <<
"\t" 932 << nBadComp[0][0][3];
933 ss <<
"\nTID:\t\t\t" << nBadComp[1][0][0] <<
"\t" << nBadComp[1][0][1] <<
"\t" << nBadComp[1][0][2] <<
"\t" 934 << nBadComp[1][0][3];
935 ss <<
"\nTOB:\t\t\t" << nBadComp[2][0][0] <<
"\t" << nBadComp[2][0][1] <<
"\t" << nBadComp[2][0][2] <<
"\t" 936 << nBadComp[2][0][3];
937 ss <<
"\nTEC:\t\t\t" << nBadComp[3][0][0] <<
"\t" << nBadComp[3][0][1] <<
"\t" << nBadComp[3][0][2] <<
"\t" 938 << nBadComp[3][0][3];
941 for (
int i = 1;
i < 5; ++
i)
942 ss <<
"\nTIB Layer " <<
i <<
" :\t\t" << nBadComp[0][
i][0] <<
"\t" << nBadComp[0][
i][1] <<
"\t" << nBadComp[0][
i][2]
943 <<
"\t" << nBadComp[0][
i][3];
945 for (
int i = 1;
i < 4; ++
i)
946 ss <<
"\nTID+ Disk " <<
i <<
" :\t\t" << nBadComp[1][
i][0] <<
"\t" << nBadComp[1][
i][1] <<
"\t" << nBadComp[1][
i][2]
947 <<
"\t" << nBadComp[1][
i][3];
948 for (
int i = 4;
i < 7; ++
i)
949 ss <<
"\nTID- Disk " <<
i - 3 <<
" :\t\t" << nBadComp[1][
i][0] <<
"\t" << nBadComp[1][
i][1] <<
"\t" 950 << nBadComp[1][
i][2] <<
"\t" << nBadComp[1][
i][3];
952 for (
int i = 1;
i < 7; ++
i)
953 ss <<
"\nTOB Layer " <<
i <<
" :\t\t" << nBadComp[2][
i][0] <<
"\t" << nBadComp[2][
i][1] <<
"\t" << nBadComp[2][
i][2]
954 <<
"\t" << nBadComp[2][
i][3];
956 for (
int i = 1;
i < 10; ++
i)
957 ss <<
"\nTEC+ Disk " <<
i <<
" :\t\t" << nBadComp[3][
i][0] <<
"\t" << nBadComp[3][
i][1] <<
"\t" << nBadComp[3][
i][2]
958 <<
"\t" << nBadComp[3][
i][3];
959 for (
int i = 10;
i < 19; ++
i)
960 ss <<
"\nTEC- Disk " <<
i - 9 <<
" :\t\t" << nBadComp[3][
i][0] <<
"\t" << nBadComp[3][
i][1] <<
"\t" 961 << nBadComp[3][
i][2] <<
"\t" << nBadComp[3][
i][3];
964 ss <<
"\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers " 965 "Apvs\n----------------------------------------------------------------";
966 for (
int i = 1;
i < 5; ++
i)
967 ss <<
"\nTIB Layer " <<
i <<
" :" << ssV[0][
i].
str();
969 for (
int i = 1;
i < 4; ++
i)
970 ss <<
"\nTID+ Disk " <<
i <<
" :" << ssV[1][
i].
str();
971 for (
int i = 4;
i < 7; ++
i)
972 ss <<
"\nTID- Disk " <<
i - 3 <<
" :" << ssV[1][
i].
str();
974 for (
int i = 1;
i < 7; ++
i)
975 ss <<
"\nTOB Layer " <<
i <<
" :" << ssV[2][
i].
str();
977 for (
int i = 1;
i < 10; ++
i)
978 ss <<
"\nTEC+ Disk " <<
i <<
" :" << ssV[3][
i].
str();
979 for (
int i = 10;
i < 19; ++
i)
980 ss <<
"\nTEC- Disk " <<
i - 9 <<
" :" << ssV[3][
i].
str();
985 std::ofstream badModules;
986 badModules.open(
"BadModules_NEW.log");
987 badModules <<
"\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers " 988 "Apvs\n----------------------------------------------------------------";
989 for (
int i = 1;
i < 5; ++
i)
990 badModules <<
"\nTIB Layer " <<
i <<
" :" << ssV[0][
i].
str();
992 for (
int i = 1;
i < 4; ++
i)
993 badModules <<
"\nTID+ Disk " <<
i <<
" :" << ssV[1][
i].
str();
994 for (
int i = 4;
i < 7; ++
i)
995 badModules <<
"\nTID- Disk " <<
i - 3 <<
" :" << ssV[1][
i].
str();
997 for (
int i = 1;
i < 7; ++
i)
998 badModules <<
"\nTOB Layer " <<
i <<
" :" << ssV[2][
i].
str();
1000 for (
int i = 1;
i < 10; ++
i)
1001 badModules <<
"\nTEC+ Disk " <<
i <<
" :" << ssV[3][
i].
str();
1002 for (
int i = 10;
i < 19; ++
i)
1003 badModules <<
"\nTEC- Disk " <<
i - 9 <<
" :" << ssV[3][
i].
str();
1009 desc.add<
std::string>(
"inputFolder",
"AlCaReco/SiStripHitEfficiency");
1010 desc.add<
bool>(
"isAtPCL",
false);
1011 desc.add<
bool>(
"doStoreOnDB",
false);
1013 desc.add<
double>(
"Threshold", 0.1);
1015 desc.add<
int>(
"nModsMin", 5);
1016 desc.addUntracked<
bool>(
"doStoreOnTree",
false);
1017 desc.addUntracked<
bool>(
"AutoIneffModTagging",
false);
1018 desc.addUntracked<
double>(
"TkMapMin", 0.9);
1019 desc.addUntracked<
double>(
"EffPlotMin", 0.9);
1020 desc.addUntracked<
bool>(
"ShowRings",
false);
1021 desc.addUntracked<
bool>(
"ShowEndcapSides",
true);
1022 desc.addUntracked<
bool>(
"ShowTOB6TEC9",
false);
1023 desc.addUntracked<
bool>(
"ShowOnlyGoodModules",
false);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const bool doStoreOnTree_
constexpr char const * layerName[numberOfLayers]
int goodlayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
int goodlayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
virtual void setCurrentFolder(std::string const &fullpath)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::unique_ptr< TrackerTopology > tTopo_
void endRun(edm::Run const &, edm::EventSetup const &) override
int alllayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
void printAndWriteBadModules(const SiStripQuality &quality, const SiStripDetInfo &detInfo) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void makeSummaryVsLumi(DQMStore::IGetter &getter) const
const bool autoIneffModTagging_
Log< level::Error, false > LogError
std::unordered_map< uint32_t, int > fedErrorCounts
const bool showEndcapSides_
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
std::unique_ptr< TkHistoMap > FEDErrorOccupancy
constexpr std::array< uint8_t, layerIndexSize > layer
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
def overlay(hists, ytitle, header, addon)
std::unique_ptr< TkDetMap > tkDetMap_
cond::Time_t currentTime() const
std::vector< DetId > stripDetIds_
const bool checkFedError(const DetId det)
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
unsigned int countTotalHits(const std::vector< MonitorElement *> &maps)
void writeBadStripPayload(const SiStripQuality &quality) const
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
#define DEFINE_FWK_MODULE(type)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void makeSummaryVsBX(DQMStore::IGetter &getter, TFileService &fs) const
SiStripDetInfo read(std::string filePath)
bool getData(T &iHolder) const
void makeSummaryVsCM(DQMStore::IGetter &getter, TFileService &fs) const
Log< level::Warning, true > LogPrint
SiStripHitEfficiencyHarvester(const edm::ParameterSet &)
Log< level::Info, false > LogInfo
void setBadComponents(int i, int component, const SiStripQuality::BadComponent &BC, int NBadComponent[4][19][4])
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
void fillMapFromTkMap(const int nevents, const float threshold, const std::vector< DetId > &stripDetIds)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
Constants and enumerated types for FED/FEC systems.
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
~SiStripHitEfficiencyHarvester() override=default
const unsigned int nTEClayers_
const std::string inputFolder_
const bool showOnlyGoodModules_
static const uint16_t STRIPS_PER_APV
std::pair< ContainerIterator, ContainerIterator > Range
std::unique_ptr< SiStripQuality > stripQuality_
int alllayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
static constexpr char const *const kDefaultFile
const edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
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
const std::string record_
virtual double getBinContent(int binx) const
get content of bin (1-D)
SiStripHitEffData calibData_