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> isAvailable;
150 isAvailable.reserve(maps.size());
152 maps.begin() + 1, maps.end(), std::back_inserter(isAvailable), [](
auto&
x) {
return !(
x ==
nullptr); });
155 for (
const auto& it : isAvailable) {
157 LogDebug(
"SiStripHitEfficiencyHarvester") <<
" layer: " <<
count <<
" " << it << std::endl;
159 LogDebug(
"SiStripHitEfficiencyHarvester") <<
"resolving to " << maps[
count]->getName() << std::endl;
163 bool areMapsAvailable{
true};
165 for (
const auto& it : isAvailable) {
169 <<
type <<
" TkHistoMap for layer " << layerCount <<
" was not found.\n -> Aborting!";
170 areMapsAvailable =
false;
174 return areMapsAvailable;
189 tree =
fs->make<TTree>(
"ModEff",
"ModEff");
192 tree->Branch(
"FoundHits", &
t_found,
"FoundHits/i");
202 LOGPRINT <<
"A module is bad if the upper limit on the efficiency is < to the avg in the layer - " <<
threshold_ 203 <<
" and has at least " <<
nModsMin_ <<
" nModsMin.";
205 auto h_module_total = std::make_unique<TkHistoMap>(
tkDetMap_.get());
207 auto h_module_found = std::make_unique<TkHistoMap>(
tkDetMap_.get());
211 const auto& totalMaps = h_module_total->getAllMaps();
212 const auto& foundMaps = h_module_found->getAllMaps();
214 LogDebug(
"SiStripHitEfficiencyHarvester")
215 <<
"totalMaps.size(): " << totalMaps.size() <<
" foundMaps.size() " << foundMaps.size() << std::endl;
221 LogDebug(
"SiStripHitEfficiencyHarvester")
222 <<
"isTotalMapAvailable: " << isTotalMapAvailable <<
" isFoundMapAvailable " << isFoundMapAvailable << std::endl;
225 if (!isTotalMapAvailable
or !isFoundMapAvailable)
228 LogDebug(
"SiStripHitEfficiencyHarvester")
229 <<
"Entries in total TkHistoMap for layer 3: " << h_module_total->getMap(3)->getEntries() <<
", found " 230 << h_module_found->getMap(3)->getEntries();
236 for (
size_t i = 1;
i < totalMaps.size();
i++) {
237 h_module_total->getMap(
i)->setOption(
"colz");
238 h_module_found->getMap(
i)->setOption(
"colz");
244 std::vector<MonitorElement*> hEffInLayer(std::size_t(1),
nullptr);
245 hEffInLayer.reserve(bounds::k_END_OF_LAYERS);
246 for (std::size_t
i = 1;
i != bounds::k_END_OF_LAYERS; ++
i) {
248 hEffInLayer.push_back(booker.
book1D(
249 Form(
"eff_layer%i",
int(
i)), Form(
"Module efficiency in layer %s", lyrName.c_str()), 201, 0, 1.005));
251 std::array<long, bounds::k_END_OF_LAYERS> layerTotal{};
252 std::array<long, bounds::k_END_OF_LAYERS> layerFound{};
264 TrackerMap tkMapDen{
" Detector denominator "};
265 std::map<unsigned int, double> badModules;
269 const auto num = h_module_found->getValue(det);
270 const auto denom = h_module_total->getValue(det);
275 hEffInLayer[
layer]->Fill(eff);
279 badModules[det] = eff;
280 tkMapBad.fillc(det, 255, 0, 0);
282 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom;
285 tkMapBad.fillc(det, 255, 255, 255);
289 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom;
293 << det.rawId() <<
" is under occupancy at " <<
denom;
308 tkMap.fill(det, 1. - eff);
309 tkMapEff.fill(det, eff);
310 tkMapNum.fill(det,
num);
311 tkMapDen.fill(det,
denom);
318 if (
layer <= bounds::k_LayersAtTOBEnd) {
321 }
else if (
layer > bounds::k_LayersAtTOBEnd &&
layer <= bounds::k_LayersAtTIDEnd) {
322 if (
tTopo_->tidSide(det) == 1) {
325 }
else if (
tTopo_->tidSide(det) == 2) {
329 }
else if (
layer > bounds::k_LayersAtTIDEnd &&
layer <= bounds::k_LayersAtTECEnd) {
330 if (
tTopo_->tecSide(det) == 1) {
333 }
else if (
tTopo_->tecSide(det) == 2) {
341 if (
layer <= bounds::k_LayersAtTOBEnd) {
344 }
else if (
layer > bounds::k_LayersAtTOBEnd &&
layer <= bounds::k_LayersAtTIDEnd) {
345 if (
tTopo_->tidSide(det) == 1) {
348 }
else if (
tTopo_->tidSide(det) == 2) {
352 }
else if (
layer > bounds::k_LayersAtTIDEnd &&
layer <= bounds::k_LayersAtTECEnd) {
353 if (
tTopo_->tecSide(det) == 1) {
356 }
else if (
tTopo_->tecSide(det) == 2) {
366 for (Long_t
i = 1;
i <= k_LayersAtTECEnd;
i++) {
368 hEffInLayer[
i]->getTH1()->GetXaxis()->SetRange(
369 3, hEffInLayer[
i]->getNbinsX() + 1);
370 const double layer_min_eff = hEffInLayer[
i]->getMean() -
std::max(2.5 * hEffInLayer[
i]->getRMS(),
threshold_);
371 LOGPRINT <<
"Layer " <<
i <<
" threshold for bad modules: <" << layer_min_eff
372 <<
" (layer mean: " << hEffInLayer[
i]->getMean() <<
" rms: " << hEffInLayer[
i]->getRMS() <<
")";
374 hEffInLayer[
i]->getTH1()->GetXaxis()->SetRange(1, hEffInLayer[
i]->getNbinsX() + 1);
378 const auto layer = ::checkLayer(det,
tTopo_.get());
380 const auto num = h_module_found->getValue(det);
381 const auto denom = h_module_total->getValue(det);
384 const auto eff_up = TEfficiency::Bayesian(
denom,
num, .99, 1, 1,
true);
388 badModules[det] = eff;
389 tkMapBad.fillc(det, 255, 0, 0);
395 tkMapBad.fillc(det, 255, 255, 255);
400 if (eff_up < layer_min_eff + 0.08) {
403 << det.rawId() <<
" efficiency: " << eff <<
" , " <<
num <<
"/" <<
denom 404 <<
" , upper limit: " << eff_up;
408 << det.rawId() <<
" layer " <<
layer <<
" is under occupancy at " <<
denom;
426 tkMap.save(
true, 0, 0,
"SiStripHitEffTKMap_NEW.png");
427 tkMapBad.save(
true, 0, 0,
"SiStripHitEffTKMapBad_NEW.png");
428 tkMapEff.save(
true,
tkMapMin_, 1.,
"SiStripHitEffTKMapEff_NEW.png");
429 tkMapNum.save(
true, 0, 0,
"SiStripHitEffTKMapNum_NEW.png");
430 tkMapDen.save(
true, 0, 0,
"SiStripHitEffTKMapDen_NEW.png");
438 for (
const auto it : badModules) {
439 const auto det = it.first;
440 std::vector<unsigned int> badStripList;
445 badStripList.push_back(pQuality.encode(0,
nStrips, 0));
447 LOGPRINT <<
"ID1 shoudl match list of modules above " << det;
448 pQuality.compact(det, badStripList);
451 pQuality.fillBadComponents();
453 if (totalHits > 0u) {
457 << __PRETTY_FUNCTION__ <<
" There are no SiStrip hits for a valid measurement, skipping!";
460 edm::LogInfo(
"SiStripHitEfficiencyHarvester") <<
"Will not produce payload!";
479 const std::array<long, bounds::k_END_OF_LAYERS>& layerFound,
480 const std::array<long, bounds::k_END_OF_LAYERS>& layerTotal)
const {
488 for (Long_t
i = 1;
i < 5;
i++) {
493 for (Long_t
i = 1;
i <= bounds::k_LayersAtTECEnd;
i++) {
494 layereff = double(layerFound[
i]) / double(layerTotal[
i]);
496 << layereff <<
" " << layerFound[
i] <<
"/" << layerTotal[
i];
497 totalfound += layerFound[
i];
498 totaltotal += layerTotal[
i];
499 if (
i <= bounds::k_LayersAtTIBEnd) {
500 subdetfound[1] += layerFound[
i];
501 subdettotal[1] += layerTotal[
i];
503 if (
i > bounds::k_LayersAtTIBEnd &&
i <= bounds::k_LayersAtTOBEnd) {
504 subdetfound[2] += layerFound[
i];
505 subdettotal[2] += layerTotal[
i];
507 if (
i > bounds::k_LayersAtTOBEnd &&
i <= bounds::k_LayersAtTIDEnd) {
508 subdetfound[3] += layerFound[
i];
509 subdettotal[3] += layerTotal[
i];
511 if (
i > bounds::k_LayersAtTIDEnd) {
512 subdetfound[4] += layerFound[
i];
513 subdettotal[4] += layerTotal[
i];
517 LOGPRINT <<
"The total efficiency is " << double(totalfound) / double(totaltotal);
518 LOGPRINT <<
" TIB: " << double(subdetfound[1]) / subdettotal[1] <<
" " << subdetfound[1] <<
"/" 520 LOGPRINT <<
" TOB: " << double(subdetfound[2]) / subdettotal[2] <<
" " << subdetfound[2] <<
"/" 522 LOGPRINT <<
" TID: " << double(subdetfound[3]) / subdettotal[3] <<
" " << subdetfound[3] <<
"/" 524 LOGPRINT <<
" TEC: " << double(subdetfound[4]) / subdettotal[4] <<
" " << subdetfound[4] <<
"/" 530 const auto pQdvBegin =
quality.getDataVectorBegin();
531 for (
auto rIt =
quality.getRegistryVectorBegin(); rIt !=
quality.getRegistryVectorEnd(); ++rIt) {
533 if (!pBadStrip.put(rIt->detid,
range))
534 edm::LogError(
"SiStripHitEfficiencyHarvester") <<
"detid already exists in SiStripBadStrip";
559 TH1F* found2 =
fs.make<TH1F>(
"found2",
"found2",
nLayers + 1, 0,
nLayers + 1);
562 found->SetBinContent(0, -1);
563 all->SetBinContent(0, 1);
566 for (
unsigned int i = 1;
i <
nLayers + 2; ++
i) {
568 all->SetBinContent(
i, 1);
569 found2->SetBinContent(
i, 1
e-6);
570 all2->SetBinContent(
i, 1);
573 TCanvas* c7 =
new TCanvas(
"c7",
" test ", 10, 10, 800, 600);
577 unsigned int nLayers_max =
nLayers + 1;
580 for (
unsigned int i = 1;
i < nLayers_max; ++
i) {
597 for (
unsigned int i = 11;
i < 14; ++
i) {
612 LOGPRINT <<
"Fill only good modules layer " <<
i - 3
619 LOGPRINT <<
"Filling all modules layer " <<
i - 3
635 TGraphAsymmErrors* gr =
fs.make<TGraphAsymmErrors>(
nLayers + 1);
636 gr->SetName(
"eff_good");
639 TGraphAsymmErrors* gr2 =
fs.make<TGraphAsymmErrors>(
nLayers + 1);
640 gr2->SetName(
"eff_all");
641 gr2->BayesDivide(found2, all2);
643 for (
unsigned int j = 0;
j <
nLayers + 1;
j++) {
644 gr->SetPointError(
j, 0., 0., gr->GetErrorYlow(
j), gr->GetErrorYhigh(
j));
645 gr2->SetPointError(
j, 0., 0., gr2->GetErrorYlow(
j), gr2->GetErrorYhigh(
j));
648 gr->GetXaxis()->SetLimits(0,
nLayers);
649 gr->SetMarkerColor(2);
650 gr->SetMarkerSize(1.2);
653 gr->SetMarkerStyle(20);
655 gr->SetMaximum(1.001);
656 gr->GetYaxis()->SetTitle(
"Efficiency");
657 gStyle->SetTitleFillColor(0);
658 gStyle->SetTitleBorderSize(0);
659 gr->SetTitle(
title_.c_str());
661 gr2->GetXaxis()->SetLimits(0,
nLayers);
662 gr2->SetMarkerColor(1);
663 gr2->SetMarkerSize(1.2);
664 gr2->SetLineColor(1);
665 gr2->SetLineWidth(4);
666 gr2->SetMarkerStyle(21);
668 gr2->SetMaximum(1.001);
669 gr2->GetYaxis()->SetTitle(
"Efficiency");
670 gr2->SetTitle(
title_.c_str());
688 gr->GetXaxis()->SetBinLabel(((
k + 1) * 100 + 2) / (
nLayers)-4,
label);
689 gr2->GetXaxis()->SetBinLabel(((
k + 1) * 100 + 2) / (
nLayers)-4,
label);
691 gr->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-6,
label);
692 gr2->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-6,
label);
696 gr->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-4,
label);
697 gr2->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-4,
label);
699 gr->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-7,
label);
700 gr2->GetXaxis()->SetBinLabel((
k + 1) * 100 / (
nLayers)-7,
label);
706 gr->GetXaxis()->SetNdivisions(36);
709 TPad*
overlay =
new TPad(
"overlay",
"", 0, 0, 1, 1);
712 overlay->SetFrameFillStyle(4000);
718 TLegend* leg =
new TLegend(0.70, 0.27, 0.88, 0.40);
719 leg->AddEntry(gr,
"Good Modules",
"p");
721 leg->AddEntry(gr2,
"All Modules",
"p");
722 leg->SetTextSize(0.020);
723 leg->SetFillColor(0);
726 c7->SaveAs(
"Summary.png");
727 c7->SaveAs(
"Summary.root");
735 for (
unsigned int iLayer = 1; iLayer != (
showRings_ ? 20 : 22); ++iLayer) {
739 if (hfound ==
nullptr or htotal ==
nullptr) {
740 if (hfound ==
nullptr)
743 if (htotal ==
nullptr)
750 if (!hfound->GetSumw2())
752 if (!htotal->GetSumw2())
754 for (Long_t
i = 0;
i != hfound->GetNbinsX() + 1; ++
i) {
755 if (hfound->GetBinContent(
i) == 0)
756 hfound->SetBinContent(
i, 1
e-6);
757 if (htotal->GetBinContent(
i) == 0)
758 htotal->SetBinContent(
i, 1);
760 LogDebug(
"SiStripHitEfficiencyHarvester")
761 <<
"Total hits for layer " << iLayer <<
" (vs lumi): " << htotal->GetEntries() <<
", found " 762 << hfound->GetEntries();
773 std::stringstream ssV[4][19],
782 ssV[
i][
comp] <<
" \t " << ((bc.
BadApvs) & 0
x1) <<
" " << ((bc.BadApvs >> 1) & 0
x1) <<
" ";
784 ssV[
i][
comp] <<
"x x " << ((bc.BadApvs >> 2) & 0
x1) <<
" " << ((bc.BadApvs >> 3) & 0
x1);
786 ssV[
i][
comp] << ((bc.BadApvs >> 2) & 0
x1) <<
" " << ((bc.BadApvs >> 3) & 0
x1) <<
" " << ((bc.BadApvs >> 4) & 0
x1)
787 <<
" " << ((bc.BadApvs >> 5) & 0
x1) <<
" ";
790 nBad[
i][0][2] += ((bc.BadApvs >> 5) & 0
x1) + ((bc.BadApvs >> 4) & 0
x1) + ((bc.BadApvs >> 3) & 0
x1) +
791 ((bc.BadApvs >> 2) & 0
x1) + ((bc.BadApvs >> 1) & 0
x1) + ((bc.BadApvs) & 0
x1);
792 nBad[
i][
comp][2] += ((bc.BadApvs >> 5) & 0
x1) + ((bc.BadApvs >> 4) & 0
x1) + ((bc.BadApvs >> 3) & 0
x1) +
793 ((bc.BadApvs >> 2) & 0
x1) + ((bc.BadApvs >> 1) & 0
x1) + ((bc.BadApvs) & 0
x1);
796 nBad[
i][0][1] += ((bc.BadFibers >> 2) & 0
x1) + ((bc.BadFibers >> 1) & 0
x1) + ((bc.BadFibers) & 0
x1);
797 nBad[
i][
comp][1] += ((bc.BadFibers >> 2) & 0
x1) + ((bc.BadFibers >> 1) & 0
x1) + ((bc.BadFibers) & 0
x1);
812 int nBadComp[4][19][4];
816 std::stringstream ssV[4][19];
818 for (
int i = 0;
i < 4; ++
i) {
820 for (
int j = 0;
j < 19; ++
j) {
822 for (
int k = 0;
k < 4; ++
k)
823 nBadComp[
i][
j][
k] = 0;
827 for (
const auto& bc :
quality.getBadComponentList()) {
832 nTkBadComp[1] += ((bc.BadFibers >> 2) & 0
x1) + ((bc.BadFibers >> 1) & 0
x1) + ((bc.BadFibers) & 0
x1);
834 nTkBadComp[2] += ((bc.BadApvs >> 5) & 0
x1) + ((bc.BadApvs >> 4) & 0
x1) + ((bc.BadApvs >> 3) & 0
x1) +
835 ((bc.BadApvs >> 2) & 0
x1) + ((bc.BadApvs >> 1) & 0
x1) + ((bc.BadApvs) & 0
x1);
869 for (
auto rp =
quality.getRegistryVectorBegin(); rp !=
quality.getRegistryVectorEnd(); ++rp) {
870 DetId det{rp->detid};
872 int component = -999;
873 switch (det.subdetId()) {
876 component =
tTopo_->tibLayer(det);
880 component =
tTopo_->tidSide(det) == 2 ?
tTopo_->tidWheel(det) :
tTopo_->tidWheel(det) + 3;
884 component =
tTopo_->tobLayer(det);
888 component =
tTopo_->tecSide(det) == 2 ?
tTopo_->tecWheel(det) :
tTopo_->tecWheel(det) + 9;
894 const auto pQdvBegin =
quality.getDataVectorBegin();
896 float percentage = 0;
897 for (
int it = 0; it < sqrange.second - sqrange.first; it++) {
898 unsigned int range =
quality.decode(*(sqrange.first + it)).range;
899 nTkBadComp[3] +=
range;
900 nBadComp[subdet][0][3] +=
range;
901 nBadComp[subdet][component][3] +=
range;
907 edm::LogError(
"SiStripHitEfficiencyHarvester") <<
"PROBLEM detid " << det.rawId() <<
" value " << percentage;
911 std::ostringstream
ss;
912 ss <<
"\n-----------------\nGlobal Info\n-----------------";
913 ss <<
"\nBadComp \t Modules \tFibers " 914 "\tApvs\tStrips\n----------------------------------------------------------------";
915 ss <<
"\nTracker:\t\t" << nTkBadComp[0] <<
"\t" << nTkBadComp[1] <<
"\t" << nTkBadComp[2] <<
"\t" << nTkBadComp[3];
916 ss <<
"\nTIB:\t\t\t" << nBadComp[0][0][0] <<
"\t" << nBadComp[0][0][1] <<
"\t" << nBadComp[0][0][2] <<
"\t" 917 << nBadComp[0][0][3];
918 ss <<
"\nTID:\t\t\t" << nBadComp[1][0][0] <<
"\t" << nBadComp[1][0][1] <<
"\t" << nBadComp[1][0][2] <<
"\t" 919 << nBadComp[1][0][3];
920 ss <<
"\nTOB:\t\t\t" << nBadComp[2][0][0] <<
"\t" << nBadComp[2][0][1] <<
"\t" << nBadComp[2][0][2] <<
"\t" 921 << nBadComp[2][0][3];
922 ss <<
"\nTEC:\t\t\t" << nBadComp[3][0][0] <<
"\t" << nBadComp[3][0][1] <<
"\t" << nBadComp[3][0][2] <<
"\t" 923 << nBadComp[3][0][3];
926 for (
int i = 1;
i < 5; ++
i)
927 ss <<
"\nTIB Layer " <<
i <<
" :\t\t" << nBadComp[0][
i][0] <<
"\t" << nBadComp[0][
i][1] <<
"\t" << nBadComp[0][
i][2]
928 <<
"\t" << nBadComp[0][
i][3];
930 for (
int i = 1;
i < 4; ++
i)
931 ss <<
"\nTID+ Disk " <<
i <<
" :\t\t" << nBadComp[1][
i][0] <<
"\t" << nBadComp[1][
i][1] <<
"\t" << nBadComp[1][
i][2]
932 <<
"\t" << nBadComp[1][
i][3];
933 for (
int i = 4;
i < 7; ++
i)
934 ss <<
"\nTID- Disk " <<
i - 3 <<
" :\t\t" << nBadComp[1][
i][0] <<
"\t" << nBadComp[1][
i][1] <<
"\t" 935 << nBadComp[1][
i][2] <<
"\t" << nBadComp[1][
i][3];
937 for (
int i = 1;
i < 7; ++
i)
938 ss <<
"\nTOB Layer " <<
i <<
" :\t\t" << nBadComp[2][
i][0] <<
"\t" << nBadComp[2][
i][1] <<
"\t" << nBadComp[2][
i][2]
939 <<
"\t" << nBadComp[2][
i][3];
941 for (
int i = 1;
i < 10; ++
i)
942 ss <<
"\nTEC+ Disk " <<
i <<
" :\t\t" << nBadComp[3][
i][0] <<
"\t" << nBadComp[3][
i][1] <<
"\t" << nBadComp[3][
i][2]
943 <<
"\t" << nBadComp[3][
i][3];
944 for (
int i = 10;
i < 19; ++
i)
945 ss <<
"\nTEC- Disk " <<
i - 9 <<
" :\t\t" << nBadComp[3][
i][0] <<
"\t" << nBadComp[3][
i][1] <<
"\t" 946 << nBadComp[3][
i][2] <<
"\t" << nBadComp[3][
i][3];
949 ss <<
"\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers " 950 "Apvs\n----------------------------------------------------------------";
951 for (
int i = 1;
i < 5; ++
i)
952 ss <<
"\nTIB Layer " <<
i <<
" :" << ssV[0][
i].
str();
954 for (
int i = 1;
i < 4; ++
i)
955 ss <<
"\nTID+ Disk " <<
i <<
" :" << ssV[1][
i].
str();
956 for (
int i = 4;
i < 7; ++
i)
957 ss <<
"\nTID- Disk " <<
i - 3 <<
" :" << ssV[1][
i].
str();
959 for (
int i = 1;
i < 7; ++
i)
960 ss <<
"\nTOB Layer " <<
i <<
" :" << ssV[2][
i].
str();
962 for (
int i = 1;
i < 10; ++
i)
963 ss <<
"\nTEC+ Disk " <<
i <<
" :" << ssV[3][
i].
str();
964 for (
int i = 10;
i < 19; ++
i)
965 ss <<
"\nTEC- Disk " <<
i - 9 <<
" :" << ssV[3][
i].
str();
970 std::ofstream badModules;
971 badModules.open(
"BadModules_NEW.log");
972 badModules <<
"\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers " 973 "Apvs\n----------------------------------------------------------------";
974 for (
int i = 1;
i < 5; ++
i)
975 badModules <<
"\nTIB Layer " <<
i <<
" :" << ssV[0][
i].
str();
977 for (
int i = 1;
i < 4; ++
i)
978 badModules <<
"\nTID+ Disk " <<
i <<
" :" << ssV[1][
i].
str();
979 for (
int i = 4;
i < 7; ++
i)
980 badModules <<
"\nTID- Disk " <<
i - 3 <<
" :" << ssV[1][
i].
str();
982 for (
int i = 1;
i < 7; ++
i)
983 badModules <<
"\nTOB Layer " <<
i <<
" :" << ssV[2][
i].
str();
985 for (
int i = 1;
i < 10; ++
i)
986 badModules <<
"\nTEC+ Disk " <<
i <<
" :" << ssV[3][
i].
str();
987 for (
int i = 10;
i < 19; ++
i)
988 badModules <<
"\nTEC- Disk " <<
i - 9 <<
" :" << ssV[3][
i].
str();
995 desc.add<
bool>(
"isAtPCL",
false);
996 desc.add<
bool>(
"doStoreOnDB",
false);
998 desc.add<
double>(
"Threshold", 0.1);
1000 desc.add<
int>(
"nModsMin", 5);
1001 desc.addUntracked<
bool>(
"doStoreOnTree",
false);
1002 desc.addUntracked<
bool>(
"AutoIneffModTagging",
false);
1003 desc.addUntracked<
double>(
"TkMapMin", 0.9);
1004 desc.addUntracked<
double>(
"EffPlotMin", 0.9);
1005 desc.addUntracked<
bool>(
"ShowRings",
false);
1006 desc.addUntracked<
bool>(
"ShowEndcapSides",
true);
1007 desc.addUntracked<
bool>(
"ShowTOB6TEC9",
false);
1008 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]
#define DEFINE_FWK_MODULE(type)
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
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...
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_
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)
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
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_
SiStripHitEffData calibData_