CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SiPixelQualityPlotter Class Reference

#include <CondTools/SiPixel/plugins/SiPixelQualityPlotter.cc>

Inheritance diagram for SiPixelQualityPlotter:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void CMS_lumi (TPad *pad, float lumi)
 
 SiPixelQualityPlotter (const edm::ParameterSet &)
 
 ~SiPixelQualityPlotter () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

const bool addLumiInfo_
 
const std::string analyzedTag_
 
std::map< uint32_t, std::bitset< 16 > > cachedPayload_
 
std::array< TH2D *, n_layersh_bpix_occ
 
std::array< TH2D *, n_ringsh_fpix_occ
 
int IOVcount_
 
cond::Time_t lastIOVtime_
 
const unsigned int lastRun_
 
const edm::InputTag lumiInputTag_
 
float lumiSinceLastReset_
 
const edm::EDGetTokenT< LumiInfolumiToken_
 
const edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcdqualEsToken_
 
edm::ESWatcher< SiPixelQualityFromDbRcdSiPixelQualityWatcher_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoEsToken_
 
float totalLumi_
 
const bool useLogScale_
 

Static Private Attributes

static const int n_layers = 4
 
static const int n_rings = 2
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 165 of file SiPixelQualityPlotter.cc.

Constructor & Destructor Documentation

◆ SiPixelQualityPlotter()

SiPixelQualityPlotter::SiPixelQualityPlotter ( const edm::ParameterSet iConfig)
explicit

Definition at line 211 of file SiPixelQualityPlotter.cc.

References h_bpix_occ, h_fpix_occ, IOVcount_, lastIOVtime_, lumiSinceLastReset_, dqmiodumpmetadata::n, n_layers, n_rings, Skims_PA_cff::name, relativeConstraints::ring, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, to_string(), totalLumi_, and y.

214  useLogScale_(iConfig.getParameter<bool>("useLogScale")),
215  addLumiInfo_(iConfig.getParameter<bool>("addLumiInfo")),
216  analyzedTag_(iConfig.getParameter<std::string>("analyzedTag")),
217  lastRun_(iConfig.getUntrackedParameter<unsigned int>("maxRun", 999999)),
218  lumiInputTag_(iConfig.getUntrackedParameter<edm::InputTag>("lumiInputTag")),
219  lumiToken_(consumes<LumiInfo>(lumiInputTag_)) {
220  // initialize the counters
221 
222  IOVcount_ = 0;
223  totalLumi_ = 0.f;
224  lumiSinceLastReset_ = 0.f;
225  lastIOVtime_ = 0;
226 
227  // --------------------- BOOK HISTOGRAMS
228  // BPIX
229  int nlad_list[n_layers] = {6, 14, 22, 32};
230  int divide_roc = 1;
231 
232  for (unsigned int lay = 1; lay <= n_layers; lay++) {
233  int nlad = nlad_list[lay - 1];
234 
235  std::string name = "occ_Layer_" + std::to_string(lay);
236  std::string title = "; BPix Layer " + std::to_string(lay) + " Module # ; BPix Layer " + std::to_string(lay) +
237  " Ladder # ; fraction of bad luminosity per component (%)";
238  h_bpix_occ[lay - 1] = new TH2D(
239  name.c_str(), title.c_str(), 72 * divide_roc, -4.5, 4.5, (nlad * 4 + 2) * divide_roc, -nlad - 0.5, nlad + 0.5);
240  }
241 
242  // FPIX
243  for (unsigned int ring = 1; ring <= n_rings; ring++) {
244  int n = ring == 1 ? 92 : 140;
245  float y = ring == 1 ? 11.5 : 17.5;
246  std::string name = "occ_ring_" + std::to_string(ring);
247  std::string title = "; FPix Ring " + std::to_string(ring) + " Disk # ; FPix Ring " + std::to_string(ring) +
248  " Blade/Panel # ; fraction of bad luminosity per component (%)";
249 
250  h_fpix_occ[ring - 1] = new TH2D(name.c_str(), title.c_str(), 56 * divide_roc, -3.5, 3.5, n * divide_roc, -y, y);
251  }
252 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static std::string to_string(const XMLCh *ch)
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoEsToken_
const edm::EDGetTokenT< LumiInfo > lumiToken_
const edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcd > qualEsToken_
std::array< TH2D *, n_rings > h_fpix_occ
const std::string analyzedTag_
std::array< TH2D *, n_layers > h_bpix_occ
const edm::InputTag lumiInputTag_

◆ ~SiPixelQualityPlotter()

SiPixelQualityPlotter::~SiPixelQualityPlotter ( )
override

Definition at line 254 of file SiPixelQualityPlotter.cc.

References h_bpix_occ, h_fpix_occ, n_layers, n_rings, and relativeConstraints::ring.

254  {
255  // delete the histograms
256  for (unsigned int lay = 1; lay <= n_layers; lay++) {
257  delete h_bpix_occ[lay - 1];
258  }
259 
260  for (unsigned int ring = 1; ring <= n_rings; ring++) {
261  delete h_fpix_occ[ring - 1];
262  }
263 }
std::array< TH2D *, n_rings > h_fpix_occ
std::array< TH2D *, n_layers > h_bpix_occ

Member Function Documentation

◆ analyze()

void SiPixelQualityPlotter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 270 of file SiPixelQualityPlotter.cc.

References newFWLiteAna::bin, cachedPayload_, edm::ESWatcher< T >::check(), MillePedeFileConverter_cfg::e, Exception, SiPixelQuality::getBadComponentList(), edm::EventSetup::getData(), h_bpix_occ, h_fpix_occ, iEvent, IOVcount_, SiPixelPI::isBPixOuterLadder(), PVValHelper::ladder, lastIOVtime_, lastRun_, nano_mu_digi_cff::layer, LogDebug, lumiSinceLastReset_, lumiToken_, payloadPlotting::maskedBarrelRocsToBins(), payloadPlotting::maskedForwardRocsToBins(), mod(), cond::time::pack(), jetsAK4_Puppi_cff::payload, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, qualEsToken_, relativeConstraints::ring, SiPixelPI::ring(), SiPixelPI::signed_blade(), SiPixelPI::signed_blade_panel(), SiPixelPI::signed_disk(), SiPixelPI::signed_ladder(), SiPixelPI::signed_module(), SiPixelQualityWatcher_, DetId::subdetId(), topoEsToken_, totalLumi_, x, and y.

270  {
271  using namespace edm;
272 
273  unsigned int RunNumber_ = iEvent.eventAuxiliary().run();
274  unsigned int LuminosityBlockNumber_ = iEvent.eventAuxiliary().luminosityBlock();
275 
276  cond::UnpackedTime localtime = std::make_pair(RunNumber_, LuminosityBlockNumber_);
277  cond::Time_t packedtime = cond::time::pack(localtime);
278 
279  bool hasQualityIOV = SiPixelQualityWatcher_.check(iSetup);
280 
281  const auto& m_trackerTopo = iSetup.getData(topoEsToken_);
282 
283  if (hasQualityIOV || RunNumber_ > lastRun_) {
284  IOVcount_++;
285  lastIOVtime_ = packedtime;
286 
287  edm::LogVerbatim("SiPixelQualityPlotter")
288  << "New IOV, Run: " << RunNumber_ << " LS:" << LuminosityBlockNumber_ << std::endl;
289  edm::LogVerbatim("SiPixelQualityPlotter")
290  << "Accumulated Luminosity: " << lumiSinceLastReset_ << " | Total Luminosity: " << totalLumi_ << std::endl;
291 
292  for (const auto [mod, payload] : cachedPayload_) {
293  int subid = DetId(mod).subdetId();
294  if (subid == PixelSubdetector::PixelBarrel) {
295  auto layer = m_trackerTopo.pxbLayer(DetId(mod));
296  auto s_ladder = SiPixelPI::signed_ladder(DetId(mod), m_trackerTopo, true);
297  auto s_module = SiPixelPI::signed_module(DetId(mod), m_trackerTopo, true);
298 
299  bool isFlipped = !SiPixelPI::isBPixOuterLadder(DetId(mod), m_trackerTopo, false);
300  if ((layer > 1 && s_module < 0))
301  isFlipped = !isFlipped;
302 
303  auto ladder = m_trackerTopo.pxbLadder(DetId(mod));
304  auto module = m_trackerTopo.pxbModule(DetId(mod));
305  LogDebug("SiPixelQualityPlotter")
306  << "layer:" << layer << " ladder:" << ladder << " module:" << module << " signed ladder: " << s_ladder
307  << " signed module: " << s_module << std::endl;
308 
309  auto bpix_rocsToMask = payloadPlotting::maskedBarrelRocsToBins(layer, s_ladder, s_module, payload, isFlipped);
310  for (const auto& bin : bpix_rocsToMask) {
311  double x = h_bpix_occ[layer - 1]->GetXaxis()->GetBinCenter(std::get<0>(bin));
312  double y = h_bpix_occ[layer - 1]->GetYaxis()->GetBinCenter(std::get<1>(bin));
313  h_bpix_occ[layer - 1]->Fill(x, y, lumiSinceLastReset_);
314  }
315  } else if (subid == PixelSubdetector::PixelEndcap) {
316  auto ring = SiPixelPI::ring(DetId(mod), m_trackerTopo, true);
317  auto s_blade = SiPixelPI::signed_blade(DetId(mod), m_trackerTopo, true);
318  auto s_disk = SiPixelPI::signed_disk(DetId(mod), m_trackerTopo, true);
319  auto s_blade_panel = SiPixelPI::signed_blade_panel(DetId(mod), m_trackerTopo, true);
320  auto panel = m_trackerTopo.pxfPanel(mod);
321 
322  bool isFlipped = (s_disk > 0) ? (panel == 1) : (panel == 2);
323 
324  LogDebug("SiPixelQualityPlotter")
325  << "ring:" << ring << " blade: " << s_blade << " panel: " << panel
326  << " signed blade/panel: " << s_blade_panel << " disk: " << s_disk << std::endl;
327 
328  auto fpix_rocsToMask =
329  payloadPlotting::maskedForwardRocsToBins(ring, s_blade, panel, s_disk, payload, isFlipped);
330  for (const auto& bin : fpix_rocsToMask) {
331  double x = h_fpix_occ[ring - 1]->GetXaxis()->GetBinCenter(std::get<0>(bin));
332  double y = h_fpix_occ[ring - 1]->GetYaxis()->GetBinCenter(std::get<1>(bin));
333  h_fpix_occ[ring - 1]->Fill(x, y, lumiSinceLastReset_);
334  }
335  } else {
336  throw cms::Exception("LogicError") << "Unknown Pixel SubDet ID " << std::endl;
337  }
338  }
339 
340  // clear the chached payload from memory
341  cachedPayload_.clear();
342 
343  //Retrieve the pixel quality from conditions
344  const SiPixelQuality* siPixelQuality_ = &iSetup.getData(qualEsToken_);
345 
346  // cache the new payload
347  auto theDisabledModules = siPixelQuality_->getBadComponentList();
348  for (const auto& mod : theDisabledModules) {
349  int coded_badRocs = mod.BadRocs;
350  std::bitset<16> bad_rocs(coded_badRocs);
351  // cache the payload
352  cachedPayload_.insert(std::make_pair(mod.DetID, bad_rocs));
353  }
354  // reset the luminosity count to zero
356  } // if there has been a new IOV
357 
358  if (RunNumber_ > lastRun_)
359  return;
360 
361  // retrieve the luminosity
362  const LumiInfo& lumi = iEvent.get(lumiToken_);
363  totalLumi_ += (lumi.integLuminosity() * 1e-9); // convert /ub to /fb
364  lumiSinceLastReset_ += (lumi.integLuminosity() * 1e-9); // convert /ub to /fb
365 }
Log< level::Info, true > LogVerbatim
std::vector< std::tuple< int, int, int > > maskedForwardRocsToBins(int ring, int blade, int panel, int disk, std::bitset< 16 > bad_rocs, bool isFlipped)
std::vector< std::tuple< int, int, int > > maskedBarrelRocsToBins(int layer, int ladder, int module, std::bitset< 16 > bad_rocs, bool isFlipped)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
int signed_blade_panel(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
cond::Time_t pack(cond::UnpackedTime iValue)
int signed_ladder(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoEsToken_
int iEvent
Definition: GenABIO.cc:224
const std::vector< disabledModuleType > getBadComponentList() const
unsigned long long Time_t
Definition: Time.h:14
int signed_disk(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
int signed_blade(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
const edm::EDGetTokenT< LumiInfo > lumiToken_
const edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcd > qualEsToken_
std::array< TH2D *, n_rings > h_fpix_occ
int ring(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: DetId.h:17
int signed_module(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
std::map< uint32_t, std::bitset< 16 > > cachedPayload_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
std::array< TH2D *, n_layers > h_bpix_occ
std::pair< unsigned int, unsigned int > UnpackedTime
Definition: Time.h:15
HLT enums.
bool isBPixOuterLadder(const DetId &detid, const TrackerTopology &tTopo, bool isPhase0)
edm::ESWatcher< SiPixelQualityFromDbRcd > SiPixelQualityWatcher_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
#define LogDebug(id)

◆ beginJob()

void SiPixelQualityPlotter::beginJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 368 of file SiPixelQualityPlotter.cc.

368  {
369  // please remove this method if not needed
370 }

◆ CMS_lumi()

void SiPixelQualityPlotter::CMS_lumi ( TPad *  pad,
float  lumi 
)

Definition at line 491 of file SiPixelQualityPlotter.cc.

References str.

Referenced by endJob().

491  {
492  auto ltx = TLatex();
493  ltx.SetTextColor(1);
494  ltx.SetTextSize(0.045);
495  ltx.SetTextAlign(11);
496  char str[200];
497  sprintf(str, "#font[42]{L = %.3f fb^{-1}}", lumi);
498  ltx.DrawLatexNDC(gPad->GetLeftMargin(), 1 - gPad->GetTopMargin() + 0.01, str);
499 }
#define str(s)

◆ endJob()

void SiPixelQualityPlotter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 373 of file SiPixelQualityPlotter.cc.

References addLumiInfo_, analyzedTag_, CMS_lumi(), SiPixelPI::dress_occup_plot(), h_bpix_occ, h_fpix_occ, mps_fire::i, IOVcount_, lastIOVtime_, SiPixelPI::makeNicePlotStyle(), n_layers, n_rings, relativeConstraints::ring, to_string(), totalLumi_, cond::time::unpack(), and useLogScale_.

373  {
375  edm::LogVerbatim("SiPixelQualityPlotter")
376  << "\n=============================================\n"
377  << "Last Analyzed LS: " << unpackedtime.first << "," << unpackedtime.second << std::endl;
378  edm::LogVerbatim("SiPixelQualityPlotter") << "A total of " << IOVcount_ << " IOVs have been analyzed!" << std::endl;
379 
380  gStyle->SetOptStat(0);
381  //=========================
382  std::vector<TCanvas*> vCanvasBarrel(n_layers);
383  TCanvas canvasB("SummaryBarrel", "SummaryBarrel", 1400, 1200);
384  canvasB.Divide(2, 2);
385  for (unsigned int i = 1; i <= n_layers; i++) {
386  canvasB.cd(i)->SetTopMargin(0.06);
387  canvasB.cd(i)->SetBottomMargin(0.11);
388  canvasB.cd(i)->SetLeftMargin(0.12);
389  canvasB.cd(i)->SetRightMargin(0.16);
390  vCanvasBarrel[i - 1] = new TCanvas(Form("Layer_%i", i), Form("Layer_%i", i), 700, 600);
391  vCanvasBarrel[i - 1]->cd()->SetTopMargin(0.08);
392  vCanvasBarrel[i - 1]->cd()->SetBottomMargin(0.11);
393  vCanvasBarrel[i - 1]->cd()->SetLeftMargin(0.12);
394  vCanvasBarrel[i - 1]->cd()->SetRightMargin(0.16);
395  }
396 
397  for (unsigned int lay = 1; lay <= n_layers; lay++) {
398  h_bpix_occ[lay - 1]->Scale((100. / totalLumi_));
400  h_bpix_occ[lay - 1]->GetYaxis()->SetTitleOffset(1.2);
401  h_bpix_occ[lay - 1]->GetZaxis()->SetTitleOffset(1.3);
402  h_bpix_occ[lay - 1]->GetZaxis()->SetTitleSize(0.042);
403  h_bpix_occ[lay - 1]->GetZaxis()->CenterTitle();
404 
405  canvasB.cd(lay)->Modified();
406  SiPixelPI::dress_occup_plot(canvasB, h_bpix_occ[lay - 1], lay, 0, 1, true, true, true);
407 
408  if (useLogScale_) {
409  canvasB.cd(lay)->SetLogz();
410  }
411  if (addLumiInfo_) {
412  TPad* current_pad = static_cast<TPad*>(canvasB.cd(lay));
413  CMS_lumi(current_pad, totalLumi_);
414  }
415 
416  vCanvasBarrel[lay - 1]->cd()->Modified();
417  SiPixelPI::dress_occup_plot(*vCanvasBarrel[lay - 1], h_bpix_occ[lay - 1], lay, 0, 1, true, true, true);
418  if (useLogScale_) {
419  vCanvasBarrel[lay - 1]->cd()->SetLogz();
420  }
421  if (addLumiInfo_) {
422  TPad* current_pad = static_cast<TPad*>(vCanvasBarrel[lay - 1]->cd());
423  CMS_lumi(current_pad, totalLumi_);
424  }
425  }
426 
427  for (unsigned int lay = 1; lay <= n_layers; lay++) {
428  vCanvasBarrel[lay - 1]->SaveAs(("Barrel_L" + std::to_string(lay) + "_" + analyzedTag_ + ".png").c_str());
429  vCanvasBarrel[lay - 1]->SaveAs(("Barrel_L" + std::to_string(lay) + "_" + analyzedTag_ + ".pdf").c_str());
430  }
431 
432  canvasB.SaveAs(("SummaryBarrel_" + analyzedTag_ + ".png").c_str());
433  canvasB.SaveAs(("SummaryBarrel_" + analyzedTag_ + ".pdf").c_str());
434 
435  //=========================
436  std::vector<TCanvas*> vCanvasForward(2);
437  TCanvas canvasF("SummaryForward", "SummaryForward", 1400, 600);
438  canvasF.Divide(2, 1);
439  for (unsigned int i = 1; i <= n_rings; i++) {
440  canvasF.cd(i)->SetTopMargin(0.06);
441  canvasF.cd(i)->SetBottomMargin(0.11);
442  canvasF.cd(i)->SetLeftMargin(0.12);
443  canvasF.cd(i)->SetRightMargin(0.16);
444  vCanvasForward[i - 1] = new TCanvas(Form("Ring_%i", i), Form("Ring_%i", i), 700, 600);
445  vCanvasForward[i - 1]->cd()->SetTopMargin(0.08);
446  vCanvasForward[i - 1]->cd()->SetBottomMargin(0.11);
447  vCanvasForward[i - 1]->cd()->SetLeftMargin(0.12);
448  vCanvasForward[i - 1]->cd()->SetRightMargin(0.16);
449  }
450 
451  for (unsigned int ring = 1; ring <= n_rings; ring++) {
452  h_fpix_occ[ring - 1]->Scale((100. / totalLumi_));
454  h_fpix_occ[ring - 1]->GetYaxis()->SetTitleOffset(1.2);
455  h_fpix_occ[ring - 1]->GetZaxis()->SetTitleOffset(1.3);
456  h_fpix_occ[ring - 1]->GetZaxis()->SetTitleSize(0.042);
457  h_fpix_occ[ring - 1]->GetZaxis()->CenterTitle();
458 
459  canvasF.cd(ring)->Modified();
460  SiPixelPI::dress_occup_plot(canvasF, h_fpix_occ[ring - 1], 0, ring, 1, true, true, true);
461  if (useLogScale_) {
462  canvasF.cd(ring)->SetLogz();
463  }
464  if (addLumiInfo_) {
465  TPad* current_pad = static_cast<TPad*>(canvasF.cd(ring));
466  CMS_lumi(current_pad, totalLumi_);
467  }
468 
469  vCanvasForward[ring - 1]->cd()->Modified();
470  SiPixelPI::dress_occup_plot(*vCanvasForward[ring - 1], h_fpix_occ[ring - 1], 0, ring, 1, true, true, true);
471 
472  if (useLogScale_) {
473  vCanvasForward[ring - 1]->cd()->SetLogz();
474  }
475  if (addLumiInfo_) {
476  TPad* current_pad = static_cast<TPad*>(vCanvasForward[ring - 1]->cd());
477  CMS_lumi(current_pad, totalLumi_);
478  }
479  }
480 
481  for (unsigned int ring = 1; ring <= n_rings; ring++) {
482  vCanvasForward[ring - 1]->SaveAs(("Forward_R" + std::to_string(ring) + "_" + analyzedTag_ + ".png").c_str());
483  vCanvasForward[ring - 1]->SaveAs(("Forward_R" + std::to_string(ring) + "_" + analyzedTag_ + ".pdf").c_str());
484  }
485 
486  canvasF.SaveAs(("SummaryForward_" + analyzedTag_ + ".png").c_str());
487  canvasF.SaveAs(("SummaryForward_" + analyzedTag_ + ".pdf").c_str());
488 }
Log< level::Info, true > LogVerbatim
static std::string to_string(const XMLCh *ch)
void CMS_lumi(TPad *pad, float lumi)
std::array< TH2D *, n_rings > h_fpix_occ
void makeNicePlotStyle(TH1 *hist)
const std::string analyzedTag_
std::array< TH2D *, n_layers > h_bpix_occ
std::pair< unsigned int, unsigned int > UnpackedTime
Definition: Time.h:15
void dress_occup_plot(TCanvas &canv, TH2 *h, int lay, int ring=0, int phase=0, bool half_shift=true, bool mark_zero=true, bool standard_palette=true)
cond::UnpackedTime unpack(cond::Time_t iValue)

◆ fillDescriptions()

void SiPixelQualityPlotter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 502 of file SiPixelQualityPlotter.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

502  {
504  desc.add<bool>("useLogScale", false);
505  desc.add<bool>("addLumiInfo", true);
506  desc.add<std::string>("analyzedTag", "");
507  desc.addUntracked<unsigned int>("maxRun", 999999);
508  desc.addUntracked<edm::InputTag>("lumiInputTag", edm::InputTag(""));
509  descriptions.add("siPixelQualityPlotter", desc);
510 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ addLumiInfo_

const bool SiPixelQualityPlotter::addLumiInfo_
private

Definition at line 183 of file SiPixelQualityPlotter.cc.

Referenced by endJob().

◆ analyzedTag_

const std::string SiPixelQualityPlotter::analyzedTag_
private

Definition at line 184 of file SiPixelQualityPlotter.cc.

Referenced by endJob().

◆ cachedPayload_

std::map<uint32_t, std::bitset<16> > SiPixelQualityPlotter::cachedPayload_
private

Definition at line 205 of file SiPixelQualityPlotter.cc.

Referenced by analyze().

◆ h_bpix_occ

std::array<TH2D*, n_layers> SiPixelQualityPlotter::h_bpix_occ
private

◆ h_fpix_occ

std::array<TH2D*, n_rings> SiPixelQualityPlotter::h_fpix_occ
private

◆ IOVcount_

int SiPixelQualityPlotter::IOVcount_
private

Definition at line 190 of file SiPixelQualityPlotter.cc.

Referenced by analyze(), endJob(), and SiPixelQualityPlotter().

◆ lastIOVtime_

cond::Time_t SiPixelQualityPlotter::lastIOVtime_
private

Definition at line 195 of file SiPixelQualityPlotter.cc.

Referenced by analyze(), endJob(), and SiPixelQualityPlotter().

◆ lastRun_

const unsigned int SiPixelQualityPlotter::lastRun_
private

Definition at line 185 of file SiPixelQualityPlotter.cc.

Referenced by analyze().

◆ lumiInputTag_

const edm::InputTag SiPixelQualityPlotter::lumiInputTag_
private

Definition at line 187 of file SiPixelQualityPlotter.cc.

◆ lumiSinceLastReset_

float SiPixelQualityPlotter::lumiSinceLastReset_
private

Definition at line 194 of file SiPixelQualityPlotter.cc.

Referenced by analyze(), and SiPixelQualityPlotter().

◆ lumiToken_

const edm::EDGetTokenT<LumiInfo> SiPixelQualityPlotter::lumiToken_
private

Definition at line 188 of file SiPixelQualityPlotter.cc.

Referenced by analyze().

◆ n_layers

const int SiPixelQualityPlotter::n_layers = 4
staticprivate

Definition at line 198 of file SiPixelQualityPlotter.cc.

Referenced by endJob(), SiPixelQualityPlotter(), and ~SiPixelQualityPlotter().

◆ n_rings

const int SiPixelQualityPlotter::n_rings = 2
staticprivate

Definition at line 201 of file SiPixelQualityPlotter.cc.

Referenced by endJob(), SiPixelQualityPlotter(), and ~SiPixelQualityPlotter().

◆ qualEsToken_

const edm::ESGetToken<SiPixelQuality, SiPixelQualityFromDbRcd> SiPixelQualityPlotter::qualEsToken_
private

Definition at line 180 of file SiPixelQualityPlotter.cc.

Referenced by analyze().

◆ SiPixelQualityWatcher_

edm::ESWatcher<SiPixelQualityFromDbRcd> SiPixelQualityPlotter::SiPixelQualityWatcher_
private

Definition at line 191 of file SiPixelQualityPlotter.cc.

Referenced by analyze().

◆ topoEsToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiPixelQualityPlotter::topoEsToken_
private

Definition at line 179 of file SiPixelQualityPlotter.cc.

Referenced by analyze().

◆ totalLumi_

float SiPixelQualityPlotter::totalLumi_
private

Definition at line 193 of file SiPixelQualityPlotter.cc.

Referenced by analyze(), endJob(), and SiPixelQualityPlotter().

◆ useLogScale_

const bool SiPixelQualityPlotter::useLogScale_
private

Definition at line 182 of file SiPixelQualityPlotter.cc.

Referenced by endJob().