50 LogInfo(
"PixelDQM") <<
"SiPixelPhase1Summary::SiPixelPhase1Summary: Got DQM BackEnd interface" << endl;
55 std::vector<edm::ParameterSet> mapPSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"SummaryMaps");
58 for (
auto const mapPSet : mapPSets) {
67 LogInfo(
"PixelDQM") <<
"SiPixelPhase1Summary::~SiPixelPhase1Summary: Destructor" << endl;
115 std::vector<std::string> xAxisLabels_ = {
"BMO",
127 std::vector<std::string> yAxisLabels_ = {
136 auto name = mapInfo.first;
140 deadROCSummary = iBooker.
book2D(
"deadROCSummary",
"Percentage of dead ROCs per layer/ring", 2, 0, 2, 4, 0, 4);
141 std::vector<std::string> xAxisLabelsReduced_ = {
"Barrel",
"Forward"};
143 for (
unsigned int i = 0;
i < xAxisLabelsReduced_.size();
i++) {
152 summaryMap_[
"Grand"] = iBooker.
book2D(
"reportSummaryMap",
"Pixel Summary Map", 2, 0, 2, 4, 0, 4);
153 summaryMap_[
"Grand"]->setAxisTitle(
"Subdetector", 1);
154 for (
unsigned int i = 0;
i < xAxisLabelsReduced_.size();
i++) {
155 summaryMap_[
"Grand"]->setBinLabel(
i + 1, xAxisLabelsReduced_[
i]);
156 for (
unsigned int j = 0;
j < 4;
j++) {
162 summaryMap_[
"Grand"] = iBooker.
book2D(
"reportSummaryMap",
"Pixel Summary Map", 12, 0, 12, 4, 0, 4);
169 if (summaryMapEntry.first ==
"Grand")
171 auto summaryMap = summaryMapEntry.second;
172 for (
unsigned int i = 0;
i < xAxisLabels_.size();
i++) {
175 for (
unsigned int i = 0;
i < yAxisLabels_.size();
i++) {
176 summaryMap->setBinLabel(
i + 1, yAxisLabels_[
i], 2);
178 summaryMap->setAxisTitle(
"Subdetector", 1);
179 summaryMap->setAxisTitle(
"Layer/disk", 2);
180 for (
int i = 0;
i < summaryMap->getTH1()->GetXaxis()->GetNbins();
i++) {
181 for (
int j = 0;
j < summaryMap->getTH1()->GetYaxis()->GetNbins();
j++) {
182 summaryMap->Fill(
i,
j, -1.);
198 std::vector<string> binAxisLabels = {
"Layer 1",
"Layer 2",
"Layer 3",
"Layer 4",
"Ring 1",
"Ring 2"};
201 std::vector<string> varName = {
"Layer_1",
"Layer_2",
"Layer_3",
"Layer_4",
"Ring_1",
"Ring_2"};
202 std::vector<int>
yMax = {1536, 3584, 5632, 8192, 4224, 6528};
203 for (
unsigned int i = 0;
i < histoOrder.size();
i++) {
204 string varNameStr =
"deadRocTrend" + varName[
i];
205 string varTitle = binAxisLabels[
i] +
" dead ROC trend";
207 varNameStr =
"ineffRocTrend" + varName[
i];
208 varTitle = binAxisLabels[
i] +
" inefficient ROC trend";
218 for (
unsigned int i = 1;
i <= binAxisLabels.size();
i++) {
231 auto name = mapInfo.first;
232 std::ostringstream histNameStream;
235 for (
int i = 0;
i < 12;
i++) {
236 for (
int j = 0;
j < 4;
j++) {
239 bool minus = i < 2 || (i > 3 &&
i < 8);
240 int iOver2 = floor(
i / 2.);
241 bool outer = (
i > 3) ? iOver2 % 2 == 0 :
i % 2 == 0;
243 histNameStream.str(
"");
244 histNameStream <<
topFolderName_.c_str() <<
"PX" << ((
i > 3) ?
"Forward" :
"Barrel") <<
"/" 245 << ((
i > 3) ?
"HalfCylinder" :
"Shell") <<
"_" << (minus ?
"m" :
"p") << ((outer) ?
"O" :
"I")
246 <<
"/" << ((
i > 3) ? ((
i % 2 == 0) ?
"PXRing_1/" :
"PXRing_2/") :
"")
247 << summaryPlotName_[
name].c_str() <<
"_PX" << ((
i > 3) ?
"Disk" :
"Layer") <<
"_" 248 << ((
i > 3) ? ((minus) ?
"-" :
"+") :
"") << (
j + 1);
249 histName = histNameStream.str();
253 edm::LogWarning(
"SiPixelPhase1Summary") <<
"ME " << histName <<
" is not available !!";
258 edm::LogWarning(
"SiPixelPhase1Summary") <<
"Summary map " <<
name <<
" is not available !!";
271 std::vector<int> nRocsPerTrend = {1536, 3584, 5632, 8192, 4224, 6528};
272 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
273 int xBin =
i < 4 ? 1 : 2;
274 int yBin =
i % 4 + 1;
278 nROCs = tempProfile->GetBinContent(tempProfile->FindLastBinAbove());
281 nROCs = tempProfile->GetBinContent(
i + 1);
287 float sumOfNonNegBins = 0.;
291 for (
int i = 0;
i < 12;
i++) {
293 edm::LogWarning(
"SiPixelPhase1Summary") <<
"Grand summary does not exist!";
296 for (
int j = 0;
j < 4;
j++) {
301 for (
auto const mapInfo : summaryPlotName_) {
302 auto name = mapInfo.first;
310 if (
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1) > -0.1)
311 sumOfNonNegBins +=
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1);
320 for (
int i = 0;
i < 2;
i++) {
322 edm::LogWarning(
"SiPixelPhase1Summary") <<
"Grand summary does not exist!";
325 for (
int j = 0;
j < 4;
j++) {
335 sumOfNonNegBins +=
summaryMap_[
"Grand"]->getBinContent(
i + 1,
j + 1);
346 if (lumiSec % 10 != 0)
350 MonitorElement* nClustersAll = iGetter.
get(
"PixelPhase1/Phase1_MechanicalView/num_clusters_per_Lumisection_PXAll");
351 if (nClustersAll ==
nullptr) {
352 edm::LogWarning(
"SiPixelPhase1Summary") <<
"All pixel cluster trend plot not available!!";
355 if (nClustersAll->
getTH1()->GetBinContent(lumiSec) < 100)
363 std::vector<int> nFilledROCs(trendOrder.size(), 0);
364 std::vector<int> hiEffROCs(trendOrder.size(), 0);
365 std::vector<int> nRocsPerTrend = {1536, 3584, 5632, 8192, 4224, 6528};
366 std::vector<string> trendNames = {};
368 for (
auto it : {1, 2, 3, 4}) {
369 histName =
"PXBarrel/digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_" + std::to_string(it);
370 trendNames.push_back(histName);
372 for (
auto it : {1, 2}) {
373 histName =
"PXForward/digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_" + std::to_string(it);
374 trendNames.push_back(histName);
377 for (
unsigned int trendIt = 0; trendIt < trendOrder.size(); trendIt++) {
379 histName =
"PixelPhase1/Phase1_MechanicalView/" + trendNames[trendIt];
381 if (tempLayerME ==
nullptr)
383 float lowEffValue = 0.25 * (tempLayerME->
getTH1()->Integral() / nRocsPerTrend[trendIt]);
384 for (
int i = 1;
i <= tempLayerME->
getTH1()->GetXaxis()->GetNbins();
i++) {
385 for (
int j = 1;
j <= tempLayerME->
getTH1()->GetYaxis()->GetNbins();
j++) {
387 nFilledROCs[trendIt]++;
389 hiEffROCs[trendIt]++;
393 tempLayerME->
Reset();
398 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
403 for (
unsigned int i = 0;
i < trendOrder.size();
i++) {
404 deadROCTrends_[trendOrder[
i]]->Fill(lumiSec - 1, nRocsPerTrend[
i] - nFilledROCs[
i]);
405 ineffROCTrends_[trendOrder[
i]]->Fill(lumiSec - 1, nFilledROCs[i] - hiEffROCs[i]);
412 for (
auto it : {1, 2, 3, 4}) {
413 histName =
"PixelPhase1/Phase1_MechanicalView/PXBarrel/clusterposition_zphi_PXLayer_" + std::to_string(it);
415 if (toReset !=
nullptr) {
419 for (
auto it : {
"-3",
"-2",
"-1",
"+1",
"+2",
"+3"}) {
420 histName =
"PixelPhase1/Phase1_MechanicalView/PXForward/clusterposition_xy_PXDisk_" +
std::string(it);
422 if (toReset !=
nullptr) {
LuminosityBlockID id() const
T getParameter(std::string const &) const
SiPixelPhase1Summary(const edm::ParameterSet &conf)
MonitorElement * bookFloat(TString const &name)
MonitorElement * deadROCSummary
std::string topFolderName_
void setCurrentFolder(std::string const &fullpath)
std::map< trendPlots, MonitorElement * > ineffROCTrends_
void fillSummaries(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
~SiPixelPhase1Summary() override
void fillTrendPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
virtual void Reset()
reset ME (ie. contents, errors, etc)
#define DEFINE_FWK_MODULE(type)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
std::map< std::string, std::string > summaryPlotName_
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)
virtual double getBinContent(int binx) const
get content of bin (1-D)
std::vector< QReport * > getQReports() const
get map of QReports
MonitorElement * reportSummary
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
std::map< trendPlots, MonitorElement * > deadROCTrends_
LuminosityBlockNumber_t luminosityBlock() const
void dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
std::map< std::string, MonitorElement * > summaryMap_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
void bookSummaries(DQMStore::IBooker &iBooker)
void dqmEndLuminosityBlock(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c) override
MonitorElement * get(std::string const &path)
std::vector< double > deadRocThresholds_
virtual TH1 * getTH1() const
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)