51 LogInfo(
"PixelDQM") <<
"SiPixelPhase1Summary::SiPixelPhase1Summary: Got DQM BackEnd interface" << endl;
56 std::vector<edm::ParameterSet> mapPSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"SummaryMaps");
59 for (
auto const& mapPSet : mapPSets) {
69 LogInfo(
"PixelDQM") <<
"SiPixelPhase1Summary::~SiPixelPhase1Summary: Destructor" << endl;
117 std::vector<std::string> xAxisLabels_ = {
"BMO",
129 std::vector<std::string> yAxisLabels_ = {
138 auto name = mapInfo.first;
143 iBooker.
book2D(
"deadROCSummary",
"Percentage of filled ROCs (with digis) per layer/ring", 2, 0, 2, 4, 0, 4);
144 std::vector<std::string> xAxisLabelsReduced_ = {
"Barrel",
"Forward"};
146 for (
unsigned int i = 0;
i < xAxisLabelsReduced_.size();
i++) {
155 summaryMap_[
"Grand"] = iBooker.
book2D(
"reportSummaryMap",
"Pixel Summary Map", 2, 0, 2, 4, 0, 4);
156 summaryMap_[
"Grand"]->setAxisTitle(
"Subdetector", 1);
157 for (
unsigned int i = 0;
i < xAxisLabelsReduced_.size();
i++) {
158 summaryMap_[
"Grand"]->setBinLabel(
i + 1, xAxisLabelsReduced_[
i]);
159 for (
unsigned int j = 0;
j < 4;
j++) {
165 summaryMap_[
"Grand"] = iBooker.
book2D(
"reportSummaryMap",
"Pixel Summary Map", 12, 0, 12, 4, 0, 4);
172 if (summaryMapEntry.first ==
"Grand")
174 auto summaryMap = summaryMapEntry.second;
175 for (
unsigned int i = 0;
i < xAxisLabels_.size();
i++) {
178 for (
unsigned int i = 0;
i < yAxisLabels_.size();
i++) {
179 summaryMap->setBinLabel(
i + 1, yAxisLabels_[
i], 2);
181 summaryMap->setAxisTitle(
"Subdetector", 1);
182 summaryMap->setAxisTitle(
"Layer/disk", 2);
183 for (
int i = 0;
i < summaryMap->getTH1()->GetXaxis()->GetNbins();
i++) {
184 for (
int j = 0;
j < summaryMap->getTH1()->GetYaxis()->GetNbins();
j++) {
185 summaryMap->Fill(
i,
j, -1.);
201 std::vector<string> binAxisLabels = {
"Layer 1",
"Layer 2",
"Layer 3",
"Layer 4",
"Ring 1",
"Ring 2"};
204 std::vector<string> varName = {
"Layer_1",
"Layer_2",
"Layer_3",
"Layer_4",
"Ring_1",
"Ring_2"};
205 std::vector<int>
yMax = {1536, 3584, 5632, 8192, 4224, 6528};
206 for (
unsigned int i = 0;
i < histoOrder.size();
i++) {
207 string varNameStr =
"deadRocTrend" + varName[
i];
208 string varTitle = binAxisLabels[
i] +
" dead ROC trend";
210 varNameStr =
"ineffRocTrend" + varName[
i];
211 varTitle = binAxisLabels[
i] +
" inefficient ROC trend";
221 for (
unsigned int i = 1;
i <= binAxisLabels.size();
i++) {
234 auto name = mapInfo.first;
235 std::ostringstream histNameStream;
238 for (
int i = 0;
i < 12;
i++) {
239 for (
int j = 0;
j < 4;
j++) {
242 bool minus = i < 2 || (i > 3 &&
i < 8);
243 int iOver2 = floor(
i / 2.);
244 bool outer = (
i > 3) ? iOver2 % 2 == 0 :
i % 2 == 0;
246 histNameStream.str(
"");
247 histNameStream <<
topFolderName_.c_str() <<
"PX" << ((
i > 3) ?
"Forward" :
"Barrel") <<
"/" 248 << ((
i > 3) ?
"HalfCylinder" :
"Shell") <<
"_" << (
minus ?
"m" :
"p") << ((
outer) ?
"O" :
"I")
249 <<
"/" << ((
i > 3) ? ((
i % 2 == 0) ?
"PXRing_1/" :
"PXRing_2/") :
"")
251 << ((
i > 3) ? ((
minus) ?
"-" :
"+") :
"") << (
j + 1);
252 histName = histNameStream.str();
256 edm::LogWarning(
"SiPixelPhase1Summary") <<
"ME " << histName <<
" is not available !!";
261 edm::LogWarning(
"SiPixelPhase1Summary") <<
"Summary map " <<
name <<
" is not available !!";
264 if (!(
me->getQReports()).
empty())
274 std::vector<int> nRocsPerTrend = {1536, 3584, 5632, 8192, 4224, 6528};
275 std::vector<int> nDisabledRocs = {12, 128, 240, 320, 96, 120};
276 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
277 int xBin =
i < 4 ? 1 : 2;
278 int yBin =
i % 4 + 1;
279 float numDeadROCs = 0.;
280 float numFilledROCs = 0.;
281 float fracFilledROCs = 1.;
282 unsigned int lastTrendBin = 0;
283 int numEmptyBins = 0;
284 float sumOf5Bins = 0.;
285 std::vector<float> last5TrendBinsValue = {0., 0., 0., 0., 0.};
293 lastTrendBin = lumiSec / 10;
294 if (lastTrendBin >= 5) {
296 for (
unsigned int n = 0;
n < 5;
n++)
297 last5TrendBinsValue[
n] = tempProfile->GetBinContent(lastTrendBin - 5 +
n + 1);
300 for (
unsigned int n = 0;
n < lastTrendBin;
n++)
301 last5TrendBinsValue[
n] = tempProfile->GetBinContent(
n + 1);
304 for (
unsigned int n = 0;
n < 5;
n++)
305 if (last5TrendBinsValue[
n] == 0)
307 if (numEmptyBins == 0) {
309 std::sort(last5TrendBinsValue.begin(), last5TrendBinsValue.end());
310 numDeadROCs = last5TrendBinsValue[2];
311 }
else if (numEmptyBins != 5) {
313 for (
unsigned int n = 0;
n < 5;
n++)
314 sumOf5Bins += last5TrendBinsValue[
n];
315 numDeadROCs = sumOf5Bins / (5 - numEmptyBins);
320 numDeadROCs = tempProfile->GetBinContent(
i + 1);
323 numFilledROCs = nRocsPerTrend[
i] - numDeadROCs;
325 fracFilledROCs = numFilledROCs / (nRocsPerTrend[
i] - nDisabledRocs[
i]);
326 if (fracFilledROCs > 1)
334 float sumOfNonNegBins = 0.;
338 for (
int i = 0;
i < 12;
i++) {
340 edm::LogWarning(
"SiPixelPhase1Summary") <<
"Grand summary does not exist!";
343 for (
int j = 0;
j < 4;
j++) {
349 auto name = mapInfo.first;
357 if (
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1) > -0.1)
358 sumOfNonNegBins +=
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1);
367 for (
int i = 0;
i < 2;
i++) {
369 edm::LogWarning(
"SiPixelPhase1Summary") <<
"Grand summary does not exist!";
372 for (
int j = 0;
j < 4;
j++) {
374 if (
i == 1 &&
j > 1) {
380 sumOfNonNegBins +=
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1);
392 if (lumiSec % 10 != 0)
396 MonitorElement* nClustersAll = iGetter.
get(
"PixelPhase1/Phase1_MechanicalView/num_clusters_per_Lumisection_PXAll");
397 if (nClustersAll ==
nullptr) {
398 edm::LogWarning(
"SiPixelPhase1Summary") <<
"All pixel cluster trend plot not available!!";
401 if (nClustersAll->
getTH1()->GetBinContent(lumiSec) < 100)
409 std::vector<int> nFilledROCs(trendOrder.size(), 0);
410 std::vector<int> hiEffROCs(trendOrder.size(), 0);
411 std::vector<int> nRocsPerTrend = {1536, 3584, 5632, 8192, 4224, 6528};
412 std::vector<string> trendNames = {};
414 for (
auto it : {1, 2, 3, 4}) {
415 histName =
"PXBarrel/digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_" +
std::to_string(
it);
416 trendNames.push_back(histName);
418 for (
auto it : {1, 2}) {
419 histName =
"PXForward/digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_" +
std::to_string(
it);
420 trendNames.push_back(histName);
423 for (
unsigned int trendIt = 0; trendIt < trendOrder.size(); trendIt++) {
425 histName =
"PixelPhase1/Phase1_MechanicalView/" + trendNames[trendIt];
427 if (tempLayerME ==
nullptr)
429 float lowEffValue = 0.25 * (tempLayerME->
getTH1()->Integral() / nRocsPerTrend[trendIt]);
430 for (
int i = 1;
i <= tempLayerME->
getTH1()->GetXaxis()->GetNbins();
i++) {
431 for (
int j = 1;
j <= tempLayerME->
getTH1()->GetYaxis()->GetNbins();
j++) {
433 nFilledROCs[trendIt]++;
435 hiEffROCs[trendIt]++;
439 tempLayerME->
Reset();
444 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
449 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
450 deadROCTrends_[trendOrder[
i]]->Fill(lumiSec - 1, nRocsPerTrend[
i] - nFilledROCs[
i]);
458 for (
auto it : {1, 2, 3, 4}) {
459 histName =
"PixelPhase1/Phase1_MechanicalView/PXBarrel/clusterposition_zphi_PXLayer_" +
std::to_string(
it);
461 if (toReset !=
nullptr) {
465 for (
auto it : {
"-3",
"-2",
"-1",
"+1",
"+2",
"+3"}) {
466 histName =
"PixelPhase1/Phase1_MechanicalView/PXForward/clusterposition_xy_PXDisk_" +
std::string(
it);
468 if (toReset !=
nullptr) {
LuminosityBlockNumber_t luminosityBlock() const
T getParameter(std::string const &) const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
SiPixelPhase1Summary(const edm::ParameterSet &conf)
void fillSummaries(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * deadROCSummary
std::string topFolderName_
std::map< trendPlots, MonitorElement * > ineffROCTrends_
~SiPixelPhase1Summary() override
void fillTrendPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
static std::string to_string(const XMLCh *ch)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
std::map< std::string, std::string > summaryPlotName_
#define DEFINE_FWK_MODULE(type)
void bookTrendPlots(DQMStore::IBooker &iBooker)
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * reportSummary
Log< level::Info, false > LogInfo
std::vector< double > deadRocWarnThresholds_
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
LuminosityBlockID id() const
std::map< trendPlots, MonitorElement * > deadROCTrends_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
virtual MonitorElement * get(std::string const &fullpath) const
std::map< std::string, MonitorElement * > summaryMap_
virtual TH1 * getTH1() const
Log< level::Warning, false > LogWarning
void bookSummaries(DQMStore::IBooker &iBooker)
void dqmEndLuminosityBlock(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c) override
std::vector< double > deadRocThresholds_
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)