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 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
276 int xBin =
i < 4 ? 1 : 2;
277 int yBin =
i % 4 + 1;
278 float numDeadROCs = 0.;
279 float numFilledROCs = 0.;
280 float fracFilledROCs = 1.;
281 unsigned int lastTrendBin = 0;
282 int numEmptyBins = 0;
283 float sumOf5Bins = 0.;
284 std::vector<float> last5TrendBinsValue = {0., 0., 0., 0., 0.};
292 lastTrendBin = lumiSec / 10;
293 if (lastTrendBin >= 5) {
295 for (
unsigned int n = 0;
n < 5;
n++)
296 last5TrendBinsValue[
n] = tempProfile->GetBinContent(lastTrendBin - 5 +
n + 1);
299 for (
unsigned int n = 0;
n < lastTrendBin;
n++)
300 last5TrendBinsValue[
n] = tempProfile->GetBinContent(
n + 1);
303 for (
unsigned int n = 0;
n < 5;
n++)
304 if (last5TrendBinsValue[
n] == 0)
306 if (numEmptyBins == 0) {
308 std::sort(last5TrendBinsValue.begin(), last5TrendBinsValue.end());
309 numDeadROCs = last5TrendBinsValue[2];
310 }
else if (numEmptyBins != 5) {
312 for (
unsigned int n = 0;
n < 5;
n++)
313 sumOf5Bins += last5TrendBinsValue[
n];
314 numDeadROCs = sumOf5Bins / (5 - numEmptyBins);
319 numDeadROCs = tempProfile->GetBinContent(
i + 1);
322 numFilledROCs = nRocsPerTrend[
i] - numDeadROCs;
324 fracFilledROCs = numFilledROCs / nRocsPerTrend[
i];
331 float sumOfNonNegBins = 0.;
335 for (
int i = 0;
i < 12;
i++) {
337 edm::LogWarning(
"SiPixelPhase1Summary") <<
"Grand summary does not exist!";
340 for (
int j = 0;
j < 4;
j++) {
346 auto name = mapInfo.first;
354 if (
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1) > -0.1)
355 sumOfNonNegBins +=
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1);
364 for (
int i = 0;
i < 2;
i++) {
366 edm::LogWarning(
"SiPixelPhase1Summary") <<
"Grand summary does not exist!";
369 for (
int j = 0;
j < 4;
j++) {
371 if (
i == 1 &&
j > 1) {
377 sumOfNonNegBins +=
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1);
389 if (lumiSec % 10 != 0)
393 MonitorElement* nClustersAll = iGetter.
get(
"PixelPhase1/Phase1_MechanicalView/num_clusters_per_Lumisection_PXAll");
394 if (nClustersAll ==
nullptr) {
395 edm::LogWarning(
"SiPixelPhase1Summary") <<
"All pixel cluster trend plot not available!!";
398 if (nClustersAll->
getTH1()->GetBinContent(lumiSec) < 100)
406 std::vector<int> nFilledROCs(trendOrder.size(), 0);
407 std::vector<int> hiEffROCs(trendOrder.size(), 0);
408 std::vector<int> nRocsPerTrend = {1536, 3584, 5632, 8192, 4224, 6528};
409 std::vector<string> trendNames = {};
411 for (
auto it : {1, 2, 3, 4}) {
412 histName =
"PXBarrel/digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_" +
std::to_string(
it);
413 trendNames.push_back(histName);
415 for (
auto it : {1, 2}) {
416 histName =
"PXForward/digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_" +
std::to_string(
it);
417 trendNames.push_back(histName);
420 for (
unsigned int trendIt = 0; trendIt < trendOrder.size(); trendIt++) {
422 histName =
"PixelPhase1/Phase1_MechanicalView/" + trendNames[trendIt];
424 if (tempLayerME ==
nullptr)
426 float lowEffValue = 0.25 * (tempLayerME->
getTH1()->Integral() / nRocsPerTrend[trendIt]);
427 for (
int i = 1;
i <= tempLayerME->
getTH1()->GetXaxis()->GetNbins();
i++) {
428 for (
int j = 1;
j <= tempLayerME->
getTH1()->GetYaxis()->GetNbins();
j++) {
430 nFilledROCs[trendIt]++;
432 hiEffROCs[trendIt]++;
436 tempLayerME->
Reset();
441 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
446 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
447 deadROCTrends_[trendOrder[
i]]->Fill(lumiSec - 1, nRocsPerTrend[
i] - nFilledROCs[
i]);
455 for (
auto it : {1, 2, 3, 4}) {
456 histName =
"PixelPhase1/Phase1_MechanicalView/PXBarrel/clusterposition_zphi_PXLayer_" +
std::to_string(
it);
458 if (toReset !=
nullptr) {
462 for (
auto it : {
"-3",
"-2",
"-1",
"+1",
"+2",
"+3"}) {
463 histName =
"PixelPhase1/Phase1_MechanicalView/PXForward/clusterposition_xy_PXDisk_" +
std::string(
it);
465 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)