CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
SiPixelPhase1Summary Class Reference

#include <SiPixelPhase1Summary.h>

Inheritance diagram for SiPixelPhase1Summary:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiPixelPhase1Summary (const edm::ParameterSet &conf)
 
 ~SiPixelPhase1Summary () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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)
 

Protected Member Functions

void beginRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
void dqmEndJob (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c) override
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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)
 

Protected Attributes

bool runOnEndJob_
 
bool runOnEndLumi_
 
std::string topFolderName_
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Private Types

enum  trendPlots {
  offline, fpix, bpix, layer1,
  layer2, layer3, layer4, ring1,
  ring2
}
 

Private Member Functions

void bookSummaries (DQMStore::IBooker &iBooker)
 
void bookTrendPlots (DQMStore::IBooker &iBooker)
 
void fillSummaries (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
 
void fillTrendPlots (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
 

Private Attributes

edm::ParameterSet conf_
 
MonitorElementdeadROCSummary
 
std::vector< double > deadRocThresholds_
 
std::map< trendPlots, MonitorElement * > deadROCTrends_
 
std::vector< double > deadRocWarnThresholds_
 
bool firstLumi
 
std::map< trendPlots, MonitorElement * > ineffROCTrends_
 
MonitorElementreportSummary
 
edm::InputTag src_
 
std::map< std::string, MonitorElement * > summaryMap_
 
std::map< std::string, std::string > summaryPlotName_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Description: Summary map generation for the Phase 1 pixel

Usage: <usage>

Definition at line 35 of file SiPixelPhase1Summary.h.

Member Enumeration Documentation

◆ trendPlots

Constructor & Destructor Documentation

◆ SiPixelPhase1Summary()

SiPixelPhase1Summary::SiPixelPhase1Summary ( const edm::ParameterSet conf)
explicit

Definition at line 49 of file SiPixelPhase1Summary.cc.

References conf_, deadRocThresholds_, deadRocWarnThresholds_, edm::ParameterSet::getParameter(), runOnEndJob_, runOnEndLumi_, AlCaHLTBitMon_QueryRunRegistry::string, summaryPlotName_, and topFolderName_.

50  : DQMEDHarvester(iConfig), conf_(iConfig), firstLumi(true) {
51  LogInfo("PixelDQM") << "SiPixelPhase1Summary::SiPixelPhase1Summary: Got DQM BackEnd interface" << endl;
52  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
53  runOnEndLumi_ = conf_.getParameter<bool>("RunOnEndLumi");
54  runOnEndJob_ = conf_.getParameter<bool>("RunOnEndJob");
55 
56  std::vector<edm::ParameterSet> mapPSets = conf_.getParameter<std::vector<edm::ParameterSet> >("SummaryMaps");
57 
58  //Go through the configuration file and add in
59  for (auto const& mapPSet : mapPSets) {
60  summaryPlotName_[mapPSet.getParameter<std::string>("MapName")] = mapPSet.getParameter<std::string>("MapHist");
61  }
62  deadRocThresholds_ = conf_.getParameter<std::vector<double> >("DeadROCErrorThreshold");
63  deadRocWarnThresholds_ = conf_.getParameter<std::vector<double> >("DeadROCWarningThreshold");
64 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ParameterSet conf_
std::map< std::string, std::string > summaryPlotName_
Log< level::Info, false > LogInfo
std::vector< double > deadRocWarnThresholds_
std::vector< double > deadRocThresholds_

◆ ~SiPixelPhase1Summary()

SiPixelPhase1Summary::~SiPixelPhase1Summary ( )
override

Definition at line 66 of file SiPixelPhase1Summary.cc.

66  {
67  // do anything here that needs to be done at desctruction time
68  // (e.g. close files, deallocate resources etc.)
69  LogInfo("PixelDQM") << "SiPixelPhase1Summary::~SiPixelPhase1Summary: Destructor" << endl;
70 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ beginRun()

void SiPixelPhase1Summary::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 72 of file SiPixelPhase1Summary.cc.

72 {}

◆ bookSummaries()

void SiPixelPhase1Summary::bookSummaries ( DQMStore::IBooker iBooker)
private

Definition at line 114 of file SiPixelPhase1Summary.cc.

References dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookFloat(), dqm::implementation::NavigatorBase::cd(), deadROCSummary, dqm::impl::MonitorElement::Fill(), mps_fire::i, dqmiolumiharvest::j, Skims_PA_cff::name, reportSummary, runOnEndLumi_, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), summaryMap_, and summaryPlotName_.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

114  {
115  iBooker.cd();
116 
117  std::vector<std::string> xAxisLabels_ = {"BMO",
118  "BMI",
119  "BPO ",
120  "BPI",
121  "HCMO_1",
122  "HCMO_2",
123  "HCMI_1",
124  "HCMI_2",
125  "HCPO_1",
126  "HCPO_2",
127  "HCPI_1",
128  "HCPI_2"}; // why not having a global variable !?!?!?!
129  std::vector<std::string> yAxisLabels_ = {
130  "1",
131  "2",
132  "3",
133  "4"}; // why not having a global variable ?!?!?!!? - I originally did, but was told not to by David Lange!
134 
135  iBooker.setCurrentFolder("PixelPhase1/Summary");
136  //Book the summary plots for the variables as described in the config file
137  for (const auto& mapInfo : summaryPlotName_) {
138  auto name = mapInfo.first;
139  summaryMap_[name] = iBooker.book2D("pixel" + name + "Summary", "Pixel " + name + " Summary", 12, 0, 12, 4, 0, 4);
140  }
141  //Make the new 6 bin ROC summary
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"};
145  deadROCSummary->setAxisTitle("Subdetector", 1);
146  for (unsigned int i = 0; i < xAxisLabelsReduced_.size(); i++) {
147  deadROCSummary->setBinLabel(i + 1, xAxisLabelsReduced_[i]);
148  }
149 
150  //Book the summary plot
151  iBooker.setCurrentFolder("PixelPhase1/EventInfo");
152 
153  if (runOnEndLumi_) {
154  //New less granular summary plot - this is currently only done online
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++) {
160  summaryMap_["Grand"]->Fill(i, j, -1);
161  }
162  }
163  } else {
164  //Book the original summary plot, for now juts doing this one offline.
165  summaryMap_["Grand"] = iBooker.book2D("reportSummaryMap", "Pixel Summary Map", 12, 0, 12, 4, 0, 4);
166  }
167 
168  reportSummary = iBooker.bookFloat("reportSummary");
169 
170  //Now set up axis and bin labels
171  for (const auto& summaryMapEntry : summaryMap_) {
172  if (summaryMapEntry.first == "Grand")
173  continue;
174  auto summaryMap = summaryMapEntry.second;
175  for (unsigned int i = 0; i < xAxisLabels_.size(); i++) {
176  summaryMap->setBinLabel(i + 1, xAxisLabels_[i], 1);
177  }
178  for (unsigned int i = 0; i < yAxisLabels_.size(); i++) {
179  summaryMap->setBinLabel(i + 1, yAxisLabels_[i], 2);
180  }
181  summaryMap->setAxisTitle("Subdetector", 1);
182  summaryMap->setAxisTitle("Layer/disk", 2);
183  for (int i = 0; i < summaryMap->getTH1()->GetXaxis()->GetNbins(); i++) { // !??!?!? xAxisLabels_.size() ?!?!
184  for (int j = 0; j < summaryMap->getTH1()->GetYaxis()->GetNbins(); j++) { // !??!?!? yAxisLabels_.size() ?!?!?!
185  summaryMap->Fill(i, j, -1.);
186  }
187  }
188  }
189  reportSummary->Fill(-1.);
190 
191  //Reset the iBooker
192  iBooker.setCurrentFolder("PixelPhase1/");
193 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * deadROCSummary
void Fill(long long x)
std::map< std::string, std::string > summaryPlotName_
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
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
std::map< std::string, MonitorElement * > summaryMap_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ bookTrendPlots()

void SiPixelPhase1Summary::bookTrendPlots ( DQMStore::IBooker iBooker)
private

Definition at line 198 of file SiPixelPhase1Summary.cc.

References dqm::implementation::IBooker::bookProfile(), deadROCTrends_, mps_fire::i, ineffROCTrends_, layer1, layer2, layer3, layer4, offline, ring1, ring2, runOnEndLumi_, dqm::implementation::NavigatorBase::setCurrentFolder(), and multiplicitycorr_cfi::yMax.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

198  {
199  //We need different plots depending on if we're online (runOnEndLumi) or offline (!runOnEndLumi)
200  iBooker.setCurrentFolder("PixelPhase1/");
201  std::vector<string> binAxisLabels = {"Layer 1", "Layer 2", "Layer 3", "Layer 4", "Ring 1", "Ring 2"};
202  if (runOnEndLumi_) {
203  std::vector<trendPlots> histoOrder = {layer1, layer2, layer3, layer4, ring1, ring2};
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";
209  deadROCTrends_[histoOrder[i]] = iBooker.bookProfile(varNameStr, varTitle, 500, 0., 5000, 0., yMax[i], "");
210  varNameStr = "ineffRocTrend" + varName[i];
211  varTitle = binAxisLabels[i] + " inefficient ROC trend";
212  ineffROCTrends_[histoOrder[i]] = iBooker.bookProfile(varNameStr, varTitle, 500, 0., 5000, 0., yMax[i], "");
213  deadROCTrends_[histoOrder[i]]->setAxisTitle("Lumisection", 1);
214  ineffROCTrends_[histoOrder[i]]->setAxisTitle("Lumisection", 1);
215  }
216  } else {
217  deadROCTrends_[offline] = iBooker.bookProfile("deadRocTotal", "N dead ROCs", 6, 0., 6, 0., 8192, "");
218  ineffROCTrends_[offline] = iBooker.bookProfile("ineffRocTotal", "N inefficient ROCs", 6, 0., 6, 0., 8192, "");
219  deadROCTrends_[offline]->setAxisTitle("Subdetector", 1);
220  ineffROCTrends_[offline]->setAxisTitle("Subdetector", 1);
221  for (unsigned int i = 1; i <= binAxisLabels.size(); i++) {
222  deadROCTrends_[offline]->setBinLabel(i, binAxisLabels[i - 1]);
223  ineffROCTrends_[offline]->setBinLabel(i, binAxisLabels[i - 1]);
224  }
225  }
226 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< trendPlots, MonitorElement * > ineffROCTrends_
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())
Definition: DQMStore.h:408
std::map< trendPlots, MonitorElement * > deadROCTrends_

◆ dqmEndJob()

void SiPixelPhase1Summary::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 96 of file SiPixelPhase1Summary.cc.

References bookSummaries(), bookTrendPlots(), fillSummaries(), fillTrendPlots(), firstLumi, runOnEndJob_, and runOnEndLumi_.

96  {
97  if (firstLumi) { //Book the plots in the (maybe possible?) case that they aren't booked in the dqmEndLuminosityBlock method
98  bookSummaries(iBooker);
99  bookTrendPlots(iBooker);
100  firstLumi = false;
101  }
102  if (runOnEndJob_) {
103  if (!runOnEndLumi_)
105  iBooker,
106  iGetter); //If we're filling these plots at the end lumi step, it doesn't really make sense to also do them at the end job
107  fillSummaries(iBooker, iGetter);
108  }
109 }
void fillSummaries(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
void fillTrendPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
void bookTrendPlots(DQMStore::IBooker &iBooker)
void bookSummaries(DQMStore::IBooker &iBooker)

◆ dqmEndLuminosityBlock()

void SiPixelPhase1Summary::dqmEndLuminosityBlock ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 74 of file SiPixelPhase1Summary.cc.

References bookSummaries(), bookTrendPlots(), fillSummaries(), fillTrendPlots(), firstLumi, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), and runOnEndLumi_.

77  {
78  if (firstLumi) {
79  bookSummaries(iBooker);
80  bookTrendPlots(iBooker);
81  firstLumi = false;
82  }
83 
84  if (runOnEndLumi_) {
85  int lumiSec = lumiSeg.id().luminosityBlock();
86  fillTrendPlots(iBooker, iGetter, lumiSec);
87  fillSummaries(iBooker, iGetter, lumiSec);
88  }
89 
90  // iBooker.cd();
91 }
void fillSummaries(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
void fillTrendPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
void bookTrendPlots(DQMStore::IBooker &iBooker)
void bookSummaries(DQMStore::IBooker &iBooker)

◆ fillSummaries()

void SiPixelPhase1Summary::fillSummaries ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
int  lumiSeg = 0 
)
private

Definition at line 231 of file SiPixelPhase1Summary.cc.

References deadROCSummary, deadROCTrends_, relativeConstraints::empty, dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), mps_fire::i, dqmiolumiharvest::j, layer1, layer2, layer3, layer4, hlt_dqm_clientPB-live_cfg::me, reco::HaloData::minus, dqmiodumpmetadata::n, Skims_PA_cff::name, offline, SurfaceOrientation::outer, reportSummary, ring1, ring2, runOnEndLumi_, dqm::impl::MonitorElement::setBinContent(), jetUpdater_cfi::sort, AlCaHLTBitMon_QueryRunRegistry::string, summaryMap_, summaryPlotName_, topFolderName_, photonAnalyzer_cfi::xBin, and photonAnalyzer_cfi::yBin.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

231  {
232  //Firstly, we will fill the regular summary maps.
233  for (const auto& mapInfo : summaryPlotName_) {
234  auto name = mapInfo.first;
235  std::ostringstream histNameStream;
236  std::string histName;
237 
238  for (int i = 0; i < 12; i++) { // !??!?!? xAxisLabels_.size() ?!?!
239  for (int j = 0; j < 4; j++) { // !??!?!? yAxisLabels_.size() ?!?!?!
240  if (i > 3 && j == 3)
241  continue;
242  bool minus = i < 2 || (i > 3 && i < 8); // bleah !
243  int iOver2 = floor(i / 2.);
244  bool outer = (i > 3) ? iOver2 % 2 == 0 : i % 2 == 0;
245  //Complicated expression that creates the name of the histogram we are interested in.
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/") : "")
250  << summaryPlotName_[name].c_str() << "_PX" << ((i > 3) ? "Disk" : "Layer") << "_"
251  << ((i > 3) ? ((minus) ? "-" : "+") : "") << (j + 1);
252  histName = histNameStream.str();
253  MonitorElement* me = iGetter.get(histName);
254 
255  if (!me) {
256  edm::LogWarning("SiPixelPhase1Summary") << "ME " << histName << " is not available !!";
257  continue; // Ignore non-existing MEs, as this can cause the whole thing to crash
258  }
259 
260  if (summaryMap_[name] == nullptr) {
261  edm::LogWarning("SiPixelPhase1Summary") << "Summary map " << name << " is not available !!";
262  continue; // Based on reported errors it seems possible that we're trying to access a non-existant summary map, so if the map doesn't exist but we're trying to access it here we'll skip it instead.
263  }
264  if (!(me->getQReports()).empty())
265  summaryMap_[name]->setBinContent(i + 1, j + 1, (me->getQReports())[0]->getQTresult());
266  else
267  summaryMap_[name]->setBinContent(i + 1, j + 1, -1);
268  }
269  }
270  }
271 
272  //Fill the dead ROC summary
273  std::vector<trendPlots> trendOrder = {layer1, layer2, layer3, layer4, ring1, ring2};
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.};
286  if (runOnEndLumi_) { //Online case
287  TH1* tempProfile = deadROCTrends_[trendOrder[i]]->getTH1();
288 
289  // Old strategy: simply pick the last bin value (deadROCTrend: 1 bin every 10 LS)
290  //nROCs = tempProfile->GetBinContent(tempProfile->FindLastBinAbove());
291 
292  // New strategy, check last 5 bins and decide
293  lastTrendBin = lumiSec / 10;
294  if (lastTrendBin >= 5) {
295  // Fill vector with value of last 5 bins of deadROCTrend
296  for (unsigned int n = 0; n < 5; n++)
297  last5TrendBinsValue[n] = tempProfile->GetBinContent(lastTrendBin - 5 + n + 1);
298  } else {
299  // Fill vector with bins from 1 to last available bin
300  for (unsigned int n = 0; n < lastTrendBin; n++)
301  last5TrendBinsValue[n] = tempProfile->GetBinContent(n + 1);
302  }
303 
304  for (unsigned int n = 0; n < 5; n++)
305  if (last5TrendBinsValue[n] == 0)
306  numEmptyBins++;
307  if (numEmptyBins == 0) {
308  // If the last 5 bins are filled: take the median value (to suppress effect of peaks)
309  std::sort(last5TrendBinsValue.begin(), last5TrendBinsValue.end());
310  numDeadROCs = last5TrendBinsValue[2];
311  } else if (numEmptyBins != 5) {
312  //If there are some empty bins: take the average of the non-empty bins
313  for (unsigned int n = 0; n < 5; n++)
314  sumOf5Bins += last5TrendBinsValue[n];
315  numDeadROCs = sumOf5Bins / (5 - numEmptyBins);
316  }
317 
318  } else { //Offline case
319  TH1* tempProfile = deadROCTrends_[offline]->getTH1();
320  numDeadROCs = tempProfile->GetBinContent(i + 1);
321  }
322  // Filled ROCs = Total number - dead ROCs
323  numFilledROCs = nRocsPerTrend[i] - numDeadROCs;
324  //Fill with fraction of filled ROCs (with digis)
325  fracFilledROCs = numFilledROCs / (nRocsPerTrend[i] - nDisabledRocs[i]);
326  if (fracFilledROCs > 1)
327  fracFilledROCs = 1;
328  deadROCSummary->setBinContent(xBin, yBin, fracFilledROCs);
329  deadROCSummary->setBinContent(2, 3, -1);
330  deadROCSummary->setBinContent(2, 4, -1);
331  }
332 
333  //Sum of non-negative bins for the reportSummary
334  float sumOfNonNegBins = 0.;
335  //Now we will use the other summary maps to create the overall map.
336  //For now we only want to do this offline
337  if (!runOnEndLumi_) {
338  for (int i = 0; i < 12; i++) { // !??!?!? xAxisLabels_.size() ?!?!
339  if (summaryMap_["Grand"] == nullptr) {
340  edm::LogWarning("SiPixelPhase1Summary") << "Grand summary does not exist!";
341  break;
342  }
343  for (int j = 0; j < 4; j++) { // !??!?!? yAxisLabels_.size() ?!?!?!
344  summaryMap_["Grand"]->setBinContent(
345  i + 1,
346  j + 1,
347  1); // This resets the map to be good. We only then set it to 0 if there has been a problem in one of the other summaries.
348  for (auto const& mapInfo : summaryPlotName_) { //Check summary maps
349  auto name = mapInfo.first;
350  if (summaryMap_[name] == nullptr) {
351  edm::LogWarning("SiPixelPhase1Summary") << "Summary " << name << " does not exist!";
352  continue;
353  }
354  if (summaryMap_["Grand"]->getBinContent(i + 1, j + 1) > summaryMap_[name]->getBinContent(i + 1, j + 1))
355  summaryMap_["Grand"]->setBinContent(i + 1, j + 1, summaryMap_[name]->getBinContent(i + 1, j + 1));
356  }
357  if (summaryMap_["Grand"]->getBinContent(i + 1, j + 1) > -0.1)
358  sumOfNonNegBins += summaryMap_["Grand"]->getBinContent(i + 1, j + 1);
359  }
360  }
361  reportSummary->Fill(sumOfNonNegBins / 40.); // The average of the 40 useful bins in the summary map.
362  }
363 
364  //Fill the new overall map
365  // if (!runOnEndLumi_) return;
366  else { //Do this for online only
367  for (int i = 0; i < 2; i++) {
368  if (summaryMap_["Grand"] == nullptr) {
369  edm::LogWarning("SiPixelPhase1Summary") << "Grand summary does not exist!";
370  break;
371  }
372  for (int j = 0; j < 4; j++) { // !??!?!? yAxisLabels_.size() ?!?!?!
373  //Ignore the bins without detectors in them
374  if (i == 1 && j > 1) {
375  summaryMap_["Grand"]->setBinContent(i + 1, j + 1, -1);
376  } else {
377  //Copy dead ROC Summary into Online Pixel Summary
378  summaryMap_["Grand"]->setBinContent(i + 1, j + 1, deadROCSummary->getBinContent(i + 1, j + 1));
379 
380  sumOfNonNegBins += summaryMap_["Grand"]->getBinContent(i + 1, j + 1);
381  }
382  }
383  }
384  reportSummary->Fill(sumOfNonNegBins / 6.); // The average of the 6 useful bins in the summary map.
385  }
386 }
MonitorElement * deadROCSummary
void Fill(long long x)
std::map< std::string, std::string > summaryPlotName_
MonitorElement * reportSummary
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
std::map< trendPlots, MonitorElement * > deadROCTrends_
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
std::map< std::string, MonitorElement * > summaryMap_
Log< level::Warning, false > LogWarning
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ fillTrendPlots()

void SiPixelPhase1Summary::fillTrendPlots ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
int  lumiSeg = 0 
)
private

Definition at line 390 of file SiPixelPhase1Summary.cc.

References dqm::implementation::NavigatorBase::cd(), deadROCTrends_, dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::legacy::MonitorElement::getTH1(), mps_fire::i, ineffROCTrends_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, layer1, layer2, layer3, layer4, offline, dqm::impl::MonitorElement::Reset(), ring1, ring2, runOnEndLumi_, AlCaHLTBitMon_QueryRunRegistry::string, and to_string().

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

390  {
391  // If we're running in online mode and the lumi section is not modulo 10, return. Offline running always uses lumiSec=0, so it will pass this test.
392  if (lumiSec % 10 != 0)
393  return;
394 
395  if (runOnEndLumi_) {
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!!";
399  return;
400  }
401  if (nClustersAll->getTH1()->GetBinContent(lumiSec) < 100)
402  return;
403  }
404 
405  std::string histName;
406 
407  //Find the total number of filled bins and hi efficiency bins
408  std::vector<trendPlots> trendOrder = {layer1, layer2, layer3, layer4, ring1, ring2};
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 = {};
413 
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);
417  }
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);
421  }
422  //Loop over layers. This will also do the rings, but we'll skip the ring calculation for
423  for (unsigned int trendIt = 0; trendIt < trendOrder.size(); trendIt++) {
424  iGetter.cd();
425  histName = "PixelPhase1/Phase1_MechanicalView/" + trendNames[trendIt];
426  MonitorElement* tempLayerME = iGetter.get(histName);
427  if (tempLayerME == nullptr)
428  continue;
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++) {
432  if (tempLayerME->getBinContent(i, j) > 0.)
433  nFilledROCs[trendIt]++;
434  if (tempLayerME->getBinContent(i, j) > lowEffValue)
435  hiEffROCs[trendIt]++;
436  }
437  }
438  if (runOnEndLumi_) {
439  tempLayerME->Reset(); //If we're doing online monitoring, reset the digi maps.
440  }
441  } // Close layers/ring loop
442 
443  if (!runOnEndLumi_) { //offline
444  for (unsigned int i = 0; i < trendOrder.size(); i++) {
445  deadROCTrends_[offline]->Fill(i, nRocsPerTrend[i] - nFilledROCs[i]);
446  ineffROCTrends_[offline]->Fill(i, nFilledROCs[i] - hiEffROCs[i]);
447  }
448  } else { //online
449  for (unsigned int i = 0; i < trendOrder.size(); i++) {
450  deadROCTrends_[trendOrder[i]]->Fill(lumiSec - 1, nRocsPerTrend[i] - nFilledROCs[i]);
451  ineffROCTrends_[trendOrder[i]]->Fill(lumiSec - 1, nFilledROCs[i] - hiEffROCs[i]);
452  }
453  }
454 
455  if (!runOnEndLumi_)
456  return; // The following only occurs in the online
457  //Reset some MEs every 10LS here
458  for (auto it : {1, 2, 3, 4}) { //PXBarrel (Cluster position and Dead channels)
459  histName = "PixelPhase1/Phase1_MechanicalView/PXBarrel/clusterposition_zphi_PXLayer_" + std::to_string(it);
460  MonitorElement* toReset = iGetter.get(histName);
461  if (toReset != nullptr) {
462  toReset->Reset();
463  }
464  histName = "PixelPhase1/FED/Dead Channels per ROC_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_" +
466  MonitorElement* twoReset = iGetter.get(histName);
467  if (twoReset != nullptr) {
468  twoReset->Reset();
469  }
470  }
471  for (auto it : {"-3", "-2", "-1", "+1", "+2", "+3"}) { //PXForward (Cluster position)
472  histName = "PixelPhase1/Phase1_MechanicalView/PXForward/clusterposition_xy_PXDisk_" + std::string(it);
473  MonitorElement* toReset = iGetter.get(histName);
474  if (toReset != nullptr) {
475  toReset->Reset();
476  }
477  }
478  for (auto it : {1, 2}) { //PXForward (Dead channels)
479  histName = "PixelPhase1/FED/Dead Channels per ROC_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_" +
481  MonitorElement* twoReset = iGetter.get(histName);
482  if (twoReset != nullptr) {
483  twoReset->Reset();
484  }
485  }
486 }
std::map< trendPlots, MonitorElement * > ineffROCTrends_
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.
std::map< trendPlots, MonitorElement * > deadROCTrends_
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual TH1 * getTH1() const
Log< level::Warning, false > LogWarning
virtual double getBinContent(int binx) const
get content of bin (1-D)

Member Data Documentation

◆ conf_

edm::ParameterSet SiPixelPhase1Summary::conf_
private

Definition at line 60 of file SiPixelPhase1Summary.h.

Referenced by SiPixelPhase1Summary().

◆ deadROCSummary

MonitorElement* SiPixelPhase1Summary::deadROCSummary
private

Definition at line 65 of file SiPixelPhase1Summary.h.

Referenced by bookSummaries(), and fillSummaries().

◆ deadRocThresholds_

std::vector<double> SiPixelPhase1Summary::deadRocThresholds_
private

Definition at line 75 of file SiPixelPhase1Summary.h.

Referenced by SiPixelPhase1Summary().

◆ deadROCTrends_

std::map<trendPlots, MonitorElement*> SiPixelPhase1Summary::deadROCTrends_
private

Definition at line 71 of file SiPixelPhase1Summary.h.

Referenced by bookTrendPlots(), fillSummaries(), and fillTrendPlots().

◆ deadRocWarnThresholds_

std::vector<double> SiPixelPhase1Summary::deadRocWarnThresholds_
private

Definition at line 76 of file SiPixelPhase1Summary.h.

Referenced by SiPixelPhase1Summary().

◆ firstLumi

bool SiPixelPhase1Summary::firstLumi
private

Definition at line 62 of file SiPixelPhase1Summary.h.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

◆ ineffROCTrends_

std::map<trendPlots, MonitorElement*> SiPixelPhase1Summary::ineffROCTrends_
private

Definition at line 72 of file SiPixelPhase1Summary.h.

Referenced by bookTrendPlots(), and fillTrendPlots().

◆ reportSummary

MonitorElement* SiPixelPhase1Summary::reportSummary
private

Definition at line 66 of file SiPixelPhase1Summary.h.

Referenced by bookSummaries(), and fillSummaries().

◆ runOnEndJob_

bool SiPixelPhase1Summary::runOnEndJob_
protected

Definition at line 56 of file SiPixelPhase1Summary.h.

Referenced by dqmEndJob(), and SiPixelPhase1Summary().

◆ runOnEndLumi_

bool SiPixelPhase1Summary::runOnEndLumi_
protected

◆ src_

edm::InputTag SiPixelPhase1Summary::src_
private

Definition at line 61 of file SiPixelPhase1Summary.h.

◆ summaryMap_

std::map<std::string, MonitorElement*> SiPixelPhase1Summary::summaryMap_
private

Definition at line 64 of file SiPixelPhase1Summary.h.

Referenced by bookSummaries(), and fillSummaries().

◆ summaryPlotName_

std::map<std::string, std::string> SiPixelPhase1Summary::summaryPlotName_
private

Definition at line 68 of file SiPixelPhase1Summary.h.

Referenced by bookSummaries(), fillSummaries(), and SiPixelPhase1Summary().

◆ topFolderName_

std::string SiPixelPhase1Summary::topFolderName_
protected

Definition at line 54 of file SiPixelPhase1Summary.h.

Referenced by fillSummaries(), and SiPixelPhase1Summary().