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 ()
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

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)
 
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_
 
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
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 40 of file SiPixelPhase1Summary.h.

Member Enumeration Documentation

◆ trendPlots

Enumerator
offline 
fpix 
bpix 
layer1 
layer2 
layer3 
layer4 
ring1 
ring2 

Definition at line 64 of file SiPixelPhase1Summary.h.

Constructor & Destructor Documentation

◆ SiPixelPhase1Summary()

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

Definition at line 49 of file SiPixelPhase1Summary.cc.

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 }

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

◆ ~SiPixelPhase1Summary()

SiPixelPhase1Summary::~SiPixelPhase1Summary ( )
override

Definition at line 65 of file SiPixelPhase1Summary.cc.

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

Member Function Documentation

◆ beginRun()

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

Definition at line 71 of file SiPixelPhase1Summary.cc.

71 {}

◆ bookSummaries()

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

Definition at line 113 of file SiPixelPhase1Summary.cc.

113  {
114  iBooker.cd();
115 
116  std::vector<std::string> xAxisLabels_ = {"BMO",
117  "BMI",
118  "BPO ",
119  "BPI",
120  "HCMO_1",
121  "HCMO_2",
122  "HCMI_1",
123  "HCMI_2",
124  "HCPO_1",
125  "HCPO_2",
126  "HCPI_1",
127  "HCPI_2"}; // why not having a global variable !?!?!?!
128  std::vector<std::string> yAxisLabels_ = {
129  "1",
130  "2",
131  "3",
132  "4"}; // why not having a global variable ?!?!?!!? - I originally did, but was told not to by David Lange!
133 
134  iBooker.setCurrentFolder("PixelPhase1/Summary");
135  //Book the summary plots for the variables as described in the config file
136  for (const auto& mapInfo : summaryPlotName_) {
137  auto name = mapInfo.first;
138  summaryMap_[name] = iBooker.book2D("pixel" + name + "Summary", "Pixel " + name + " Summary", 12, 0, 12, 4, 0, 4);
139  }
140  //Make the new 6 bin ROC summary
141  deadROCSummary = iBooker.book2D("deadROCSummary", "Percentage of dead ROCs per layer/ring", 2, 0, 2, 4, 0, 4);
142  std::vector<std::string> xAxisLabelsReduced_ = {"Barrel", "Forward"};
143  deadROCSummary->setAxisTitle("Subdetector", 1);
144  for (unsigned int i = 0; i < xAxisLabelsReduced_.size(); i++) {
145  deadROCSummary->setBinLabel(i + 1, xAxisLabelsReduced_[i]);
146  }
147 
148  //Book the summary plot
149  iBooker.setCurrentFolder("PixelPhase1/EventInfo");
150 
151  if (runOnEndLumi_) {
152  //New less granular summary plot - this is currently only done online
153  summaryMap_["Grand"] = iBooker.book2D("reportSummaryMap", "Pixel Summary Map", 2, 0, 2, 4, 0, 4);
154  summaryMap_["Grand"]->setAxisTitle("Subdetector", 1);
155  for (unsigned int i = 0; i < xAxisLabelsReduced_.size(); i++) {
156  summaryMap_["Grand"]->setBinLabel(i + 1, xAxisLabelsReduced_[i]);
157  for (unsigned int j = 0; j < 4; j++) {
158  summaryMap_["Grand"]->Fill(i, j, -1);
159  }
160  }
161  } else {
162  //Book the original summary plot, for now juts doing this one offline.
163  summaryMap_["Grand"] = iBooker.book2D("reportSummaryMap", "Pixel Summary Map", 12, 0, 12, 4, 0, 4);
164  }
165 
166  reportSummary = iBooker.bookFloat("reportSummary");
167 
168  //Now set up axis and bin labels
169  for (const auto& summaryMapEntry : summaryMap_) {
170  if (summaryMapEntry.first == "Grand")
171  continue;
172  auto summaryMap = summaryMapEntry.second;
173  for (unsigned int i = 0; i < xAxisLabels_.size(); i++) {
174  summaryMap->setBinLabel(i + 1, xAxisLabels_[i], 1);
175  }
176  for (unsigned int i = 0; i < yAxisLabels_.size(); i++) {
177  summaryMap->setBinLabel(i + 1, yAxisLabels_[i], 2);
178  }
179  summaryMap->setAxisTitle("Subdetector", 1);
180  summaryMap->setAxisTitle("Layer/disk", 2);
181  for (int i = 0; i < summaryMap->getTH1()->GetXaxis()->GetNbins(); i++) { // !??!?!? xAxisLabels_.size() ?!?!
182  for (int j = 0; j < summaryMap->getTH1()->GetYaxis()->GetNbins(); j++) { // !??!?!? yAxisLabels_.size() ?!?!?!
183  summaryMap->Fill(i, j, -1.);
184  }
185  }
186  }
187  reportSummary->Fill(-1.);
188 
189  //Reset the iBooker
190  iBooker.setCurrentFolder("PixelPhase1/");
191 }

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().

◆ bookTrendPlots()

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

Definition at line 196 of file SiPixelPhase1Summary.cc.

196  {
197  //We need different plots depending on if we're online (runOnEndLumi) or offline (!runOnEndLumi)
198  iBooker.setCurrentFolder("PixelPhase1/");
199  std::vector<string> binAxisLabels = {"Layer 1", "Layer 2", "Layer 3", "Layer 4", "Ring 1", "Ring 2"};
200  if (runOnEndLumi_) {
201  std::vector<trendPlots> histoOrder = {layer1, layer2, layer3, layer4, ring1, ring2};
202  std::vector<string> varName = {"Layer_1", "Layer_2", "Layer_3", "Layer_4", "Ring_1", "Ring_2"};
203  std::vector<int> yMax = {1536, 3584, 5632, 8192, 4224, 6528};
204  for (unsigned int i = 0; i < histoOrder.size(); i++) {
205  string varNameStr = "deadRocTrend" + varName[i];
206  string varTitle = binAxisLabels[i] + " dead ROC trend";
207  deadROCTrends_[histoOrder[i]] = iBooker.bookProfile(varNameStr, varTitle, 500, 0., 5000, 0., yMax[i], "");
208  varNameStr = "ineffRocTrend" + varName[i];
209  varTitle = binAxisLabels[i] + " inefficient ROC trend";
210  ineffROCTrends_[histoOrder[i]] = iBooker.bookProfile(varNameStr, varTitle, 500, 0., 5000, 0., yMax[i], "");
211  deadROCTrends_[histoOrder[i]]->setAxisTitle("Lumisection", 1);
212  ineffROCTrends_[histoOrder[i]]->setAxisTitle("Lumisection", 1);
213  }
214  } else {
215  deadROCTrends_[offline] = iBooker.bookProfile("deadRocTotal", "N dead ROCs", 6, 0., 6, 0., 8192, "");
216  ineffROCTrends_[offline] = iBooker.bookProfile("ineffRocTotal", "N inefficient ROCs", 6, 0., 6, 0., 8192, "");
217  deadROCTrends_[offline]->setAxisTitle("Subdetector", 1);
218  ineffROCTrends_[offline]->setAxisTitle("Subdetector", 1);
219  for (unsigned int i = 1; i <= binAxisLabels.size(); i++) {
220  deadROCTrends_[offline]->setBinLabel(i, binAxisLabels[i - 1]);
221  ineffROCTrends_[offline]->setBinLabel(i, binAxisLabels[i - 1]);
222  }
223  }
224 }

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().

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 95 of file SiPixelPhase1Summary.cc.

95  {
96  if (firstLumi) { //Book the plots in the (maybe possible?) case that they aren't booked in the dqmEndLuminosityBlock method
97  bookSummaries(iBooker);
98  bookTrendPlots(iBooker);
99  firstLumi = false;
100  }
101  if (runOnEndJob_) {
102  if (!runOnEndLumi_)
104  iBooker,
105  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
106  fillSummaries(iBooker, iGetter);
107  }
108 }

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

◆ 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 73 of file SiPixelPhase1Summary.cc.

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

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

◆ fillSummaries()

void SiPixelPhase1Summary::fillSummaries ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
private

Definition at line 229 of file SiPixelPhase1Summary.cc.

229  {
230  //Firstly, we will fill the regular summary maps.
231  for (const auto& mapInfo : summaryPlotName_) {
232  auto name = mapInfo.first;
233  std::ostringstream histNameStream;
234  std::string histName;
235 
236  for (int i = 0; i < 12; i++) { // !??!?!? xAxisLabels_.size() ?!?!
237  for (int j = 0; j < 4; j++) { // !??!?!? yAxisLabels_.size() ?!?!?!
238  if (i > 3 && j == 3)
239  continue;
240  bool minus = i < 2 || (i > 3 && i < 8); // bleah !
241  int iOver2 = floor(i / 2.);
242  bool outer = (i > 3) ? iOver2 % 2 == 0 : i % 2 == 0;
243  //Complicated expression that creates the name of the histogram we are interested in.
244  histNameStream.str("");
245  histNameStream << topFolderName_.c_str() << "PX" << ((i > 3) ? "Forward" : "Barrel") << "/"
246  << ((i > 3) ? "HalfCylinder" : "Shell") << "_" << (minus ? "m" : "p") << ((outer) ? "O" : "I")
247  << "/" << ((i > 3) ? ((i % 2 == 0) ? "PXRing_1/" : "PXRing_2/") : "")
248  << summaryPlotName_[name].c_str() << "_PX" << ((i > 3) ? "Disk" : "Layer") << "_"
249  << ((i > 3) ? ((minus) ? "-" : "+") : "") << (j + 1);
250  histName = histNameStream.str();
251  MonitorElement* me = iGetter.get(histName);
252 
253  if (!me) {
254  edm::LogWarning("SiPixelPhase1Summary") << "ME " << histName << " is not available !!";
255  continue; // Ignore non-existing MEs, as this can cause the whole thing to crash
256  }
257 
258  if (summaryMap_[name] == nullptr) {
259  edm::LogWarning("SiPixelPhase1Summary") << "Summary map " << name << " is not available !!";
260  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.
261  }
262  if (!(me->getQReports()).empty())
263  summaryMap_[name]->setBinContent(i + 1, j + 1, (me->getQReports())[0]->getQTresult());
264  else
265  summaryMap_[name]->setBinContent(i + 1, j + 1, -1);
266  }
267  }
268  }
269 
270  //Fill the dead ROC summary
271  std::vector<trendPlots> trendOrder = {layer1, layer2, layer3, layer4, ring1, ring2};
272  std::vector<int> nRocsPerTrend = {1536, 3584, 5632, 8192, 4224, 6528};
273  for (unsigned int i = 0; i < trendOrder.size(); i++) {
274  int xBin = i < 4 ? 1 : 2;
275  int yBin = i % 4 + 1;
276  float nROCs = 0.;
277  if (runOnEndLumi_) { //Online case
278  TH1* tempProfile = deadROCTrends_[trendOrder[i]]->getTH1();
279  nROCs = tempProfile->GetBinContent(tempProfile->FindLastBinAbove());
280  } else { //Offline case
281  TH1* tempProfile = deadROCTrends_[offline]->getTH1();
282  nROCs = tempProfile->GetBinContent(i + 1);
283  }
284  deadROCSummary->setBinContent(xBin, yBin, nROCs / nRocsPerTrend[i]);
285  }
286 
287  //Sum of non-negative bins for the reportSummary
288  float sumOfNonNegBins = 0.;
289  //Now we will use the other summary maps to create the overall map.
290  //For now we only want to do this offline
291  if (!runOnEndLumi_) {
292  for (int i = 0; i < 12; i++) { // !??!?!? xAxisLabels_.size() ?!?!
293  if (summaryMap_["Grand"] == nullptr) {
294  edm::LogWarning("SiPixelPhase1Summary") << "Grand summary does not exist!";
295  break;
296  }
297  for (int j = 0; j < 4; j++) { // !??!?!? yAxisLabels_.size() ?!?!?!
298  summaryMap_["Grand"]->setBinContent(
299  i + 1,
300  j + 1,
301  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.
302  for (auto const& mapInfo : summaryPlotName_) { //Check summary maps
303  auto name = mapInfo.first;
304  if (summaryMap_[name] == nullptr) {
305  edm::LogWarning("SiPixelPhase1Summary") << "Summary " << name << " does not exist!";
306  continue;
307  }
308  if (summaryMap_["Grand"]->getBinContent(i + 1, j + 1) > summaryMap_[name]->getBinContent(i + 1, j + 1))
309  summaryMap_["Grand"]->setBinContent(i + 1, j + 1, summaryMap_[name]->getBinContent(i + 1, j + 1));
310  }
311  if (summaryMap_["Grand"]->getBinContent(i + 1, j + 1) > -0.1)
312  sumOfNonNegBins += summaryMap_["Grand"]->getBinContent(i + 1, j + 1);
313  }
314  }
315  reportSummary->Fill(sumOfNonNegBins / 40.); // The average of the 40 useful bins in the summary map.
316  }
317 
318  //Fill the new overall map
319  // if (!runOnEndLumi_) return;
320  else { //Do this for online only
321  for (int i = 0; i < 2; i++) {
322  if (summaryMap_["Grand"] == nullptr) {
323  edm::LogWarning("SiPixelPhase1Summary") << "Grand summary does not exist!";
324  break;
325  }
326  for (int j = 0; j < 4; j++) { // !??!?!? yAxisLabels_.size() ?!?!?!
327  //Ignore the bins without detectors in them
328  if (i == 1 && j > 1)
329  continue;
330  summaryMap_["Grand"]->setBinContent(
331  i + 1,
332  j + 1,
333  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.
334  if (deadROCSummary->getBinContent(i + 1, j + 1) > deadRocThresholds_[i * 4 + j])
335  summaryMap_["Grand"]->setBinContent(i + 1, j + 1, 0);
336  sumOfNonNegBins += summaryMap_["Grand"]->getBinContent(i + 1, j + 1);
337  }
338  }
339  }
340 }

References deadROCSummary, deadRocThresholds_, 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, Skims_PA_cff::name, offline, SurfaceOrientation::outer, reportSummary, ring1, ring2, runOnEndLumi_, dqm::impl::MonitorElement::setBinContent(), AlCaHLTBitMon_QueryRunRegistry::string, summaryMap_, summaryPlotName_, topFolderName_, photonAnalyzer_cfi::xBin, and photonAnalyzer_cfi::yBin.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

◆ fillTrendPlots()

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

Definition at line 345 of file SiPixelPhase1Summary.cc.

345  {
346  // 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.
347  if (lumiSec % 10 != 0)
348  return;
349 
350  if (runOnEndLumi_) {
351  MonitorElement* nClustersAll = iGetter.get("PixelPhase1/Phase1_MechanicalView/num_clusters_per_Lumisection_PXAll");
352  if (nClustersAll == nullptr) {
353  edm::LogWarning("SiPixelPhase1Summary") << "All pixel cluster trend plot not available!!";
354  return;
355  }
356  if (nClustersAll->getTH1()->GetBinContent(lumiSec) < 100)
357  return;
358  }
359 
360  std::string histName;
361 
362  //Find the total number of filled bins and hi efficiency bins
363  std::vector<trendPlots> trendOrder = {layer1, layer2, layer3, layer4, ring1, ring2};
364  std::vector<int> nFilledROCs(trendOrder.size(), 0);
365  std::vector<int> hiEffROCs(trendOrder.size(), 0);
366  std::vector<int> nRocsPerTrend = {1536, 3584, 5632, 8192, 4224, 6528};
367  std::vector<string> trendNames = {};
368 
369  for (auto it : {1, 2, 3, 4}) {
370  histName = "PXBarrel/digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_" + std::to_string(it);
371  trendNames.push_back(histName);
372  }
373  for (auto it : {1, 2}) {
374  histName = "PXForward/digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_" + std::to_string(it);
375  trendNames.push_back(histName);
376  }
377  //Loop over layers. This will also do the rings, but we'll skip the ring calculation for
378  for (unsigned int trendIt = 0; trendIt < trendOrder.size(); trendIt++) {
379  iGetter.cd();
380  histName = "PixelPhase1/Phase1_MechanicalView/" + trendNames[trendIt];
381  MonitorElement* tempLayerME = iGetter.get(histName);
382  if (tempLayerME == nullptr)
383  continue;
384  float lowEffValue = 0.25 * (tempLayerME->getTH1()->Integral() / nRocsPerTrend[trendIt]);
385  for (int i = 1; i <= tempLayerME->getTH1()->GetXaxis()->GetNbins(); i++) {
386  for (int j = 1; j <= tempLayerME->getTH1()->GetYaxis()->GetNbins(); j++) {
387  if (tempLayerME->getBinContent(i, j) > 0.)
388  nFilledROCs[trendIt]++;
389  if (tempLayerME->getBinContent(i, j) > lowEffValue)
390  hiEffROCs[trendIt]++;
391  }
392  }
393  if (runOnEndLumi_) {
394  tempLayerME->Reset(); //If we're doing online monitoring, reset the digi maps.
395  }
396  } // Close layers/ring loop
397 
398  if (!runOnEndLumi_) { //offline
399  for (unsigned int i = 0; i < trendOrder.size(); i++) {
400  deadROCTrends_[offline]->Fill(i, nRocsPerTrend[i] - nFilledROCs[i]);
401  ineffROCTrends_[offline]->Fill(i, nFilledROCs[i] - hiEffROCs[i]);
402  }
403  } else { //online
404  for (unsigned int i = 0; i < trendOrder.size(); i++) {
405  deadROCTrends_[trendOrder[i]]->Fill(lumiSec - 1, nRocsPerTrend[i] - nFilledROCs[i]);
406  ineffROCTrends_[trendOrder[i]]->Fill(lumiSec - 1, nFilledROCs[i] - hiEffROCs[i]);
407  }
408  }
409 
410  if (!runOnEndLumi_)
411  return; // The following only occurs in the online
412  //Reset some MEs every 10LS here
413  for (auto it : {1, 2, 3, 4}) { //PXBarrel
414  histName = "PixelPhase1/Phase1_MechanicalView/PXBarrel/clusterposition_zphi_PXLayer_" + std::to_string(it);
415  MonitorElement* toReset = iGetter.get(histName);
416  if (toReset != nullptr) {
417  toReset->Reset();
418  }
419  }
420  for (auto it : {"-3", "-2", "-1", "+1", "+2", "+3"}) { //PXForward
421  histName = "PixelPhase1/Phase1_MechanicalView/PXForward/clusterposition_xy_PXDisk_" + std::string(it);
422  MonitorElement* toReset = iGetter.get(histName);
423  if (toReset != nullptr) {
424  toReset->Reset();
425  }
426  }
427 }

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

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

Member Data Documentation

◆ conf_

edm::ParameterSet SiPixelPhase1Summary::conf_
private

Definition at line 65 of file SiPixelPhase1Summary.h.

Referenced by SiPixelPhase1Summary().

◆ deadROCSummary

MonitorElement* SiPixelPhase1Summary::deadROCSummary
private

Definition at line 70 of file SiPixelPhase1Summary.h.

Referenced by bookSummaries(), and fillSummaries().

◆ deadRocThresholds_

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

Definition at line 80 of file SiPixelPhase1Summary.h.

Referenced by fillSummaries(), and SiPixelPhase1Summary().

◆ deadROCTrends_

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

Definition at line 76 of file SiPixelPhase1Summary.h.

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

◆ firstLumi

bool SiPixelPhase1Summary::firstLumi
private

Definition at line 67 of file SiPixelPhase1Summary.h.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

◆ ineffROCTrends_

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

Definition at line 77 of file SiPixelPhase1Summary.h.

Referenced by bookTrendPlots(), and fillTrendPlots().

◆ reportSummary

MonitorElement* SiPixelPhase1Summary::reportSummary
private

Definition at line 71 of file SiPixelPhase1Summary.h.

Referenced by bookSummaries(), and fillSummaries().

◆ runOnEndJob_

bool SiPixelPhase1Summary::runOnEndJob_
protected

Definition at line 61 of file SiPixelPhase1Summary.h.

Referenced by dqmEndJob(), and SiPixelPhase1Summary().

◆ runOnEndLumi_

bool SiPixelPhase1Summary::runOnEndLumi_
protected

◆ src_

edm::InputTag SiPixelPhase1Summary::src_
private

Definition at line 66 of file SiPixelPhase1Summary.h.

◆ summaryMap_

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

Definition at line 69 of file SiPixelPhase1Summary.h.

Referenced by bookSummaries(), and fillSummaries().

◆ summaryPlotName_

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

Definition at line 73 of file SiPixelPhase1Summary.h.

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

◆ topFolderName_

std::string SiPixelPhase1Summary::topFolderName_
protected

Definition at line 59 of file SiPixelPhase1Summary.h.

Referenced by fillSummaries(), and SiPixelPhase1Summary().

SiPixelPhase1Summary::ineffROCTrends_
std::map< trendPlots, MonitorElement * > ineffROCTrends_
Definition: SiPixelPhase1Summary.h:77
SiPixelPhase1Summary::runOnEndLumi_
bool runOnEndLumi_
Definition: SiPixelPhase1Summary.h:60
mps_fire.i
i
Definition: mps_fire.py:428
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
photonAnalyzer_cfi.xBin
xBin
Definition: photonAnalyzer_cfi.py:81
SiPixelPhase1Summary::layer4
Definition: SiPixelPhase1Summary.h:64
SiPixelPhase1Summary::fpix
Definition: SiPixelPhase1Summary.h:64
SiPixelPhase1Summary::reportSummary
MonitorElement * reportSummary
Definition: SiPixelPhase1Summary.h:71
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
SiPixelPhase1Summary::runOnEndJob_
bool runOnEndJob_
Definition: SiPixelPhase1Summary.h:61
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
photonAnalyzer_cfi.yBin
yBin
Definition: photonAnalyzer_cfi.py:85
reco::HaloData::minus
Definition: HaloData.h:14
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
SiPixelPhase1Summary::layer3
Definition: SiPixelPhase1Summary.h:64
SiPixelPhase1Summary::firstLumi
bool firstLumi
Definition: SiPixelPhase1Summary.h:67
SiPixelPhase1Summary::deadRocThresholds_
std::vector< double > deadRocThresholds_
Definition: SiPixelPhase1Summary.h:80
SiPixelPhase1Summary::bookTrendPlots
void bookTrendPlots(DQMStore::IBooker &iBooker)
Definition: SiPixelPhase1Summary.cc:196
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:345
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
dqm::implementation::IBooker::bookProfile
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:322
multiplicitycorr_cfi.yMax
yMax
Definition: multiplicitycorr_cfi.py:6
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:475
SiPixelPhase1Summary::summaryPlotName_
std::map< std::string, std::string > summaryPlotName_
Definition: SiPixelPhase1Summary.h:73
SiPixelPhase1Summary::layer1
Definition: SiPixelPhase1Summary.h:64
SiPixelPhase1Summary::deadROCSummary
MonitorElement * deadROCSummary
Definition: SiPixelPhase1Summary.h:70
SiPixelPhase1Summary::fillSummaries
void fillSummaries(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
Definition: SiPixelPhase1Summary.cc:229
SiPixelPhase1Summary::bookSummaries
void bookSummaries(DQMStore::IBooker &iBooker)
Definition: SiPixelPhase1Summary.cc:113
SiPixelPhase1Summary::ring1
Definition: SiPixelPhase1Summary.h:64
SiPixelPhase1Summary::conf_
edm::ParameterSet conf_
Definition: SiPixelPhase1Summary.h:65
DQMEDHarvester::DQMEDHarvester
DQMEDHarvester()
Definition: DQMEDHarvester.h:98
dqm::impl::MonitorElement::setBinLabel
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)
Definition: MonitorElement.cc:762
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelPhase1Summary::ring2
Definition: SiPixelPhase1Summary.h:64
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:682
SiPixelPhase1Summary::layer2
Definition: SiPixelPhase1Summary.h:64
dqm::implementation::IBooker::book2D
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:177
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
SiPixelPhase1Summary::topFolderName_
std::string topFolderName_
Definition: SiPixelPhase1Summary.h:59
SiPixelPhase1Summary::fillTrendPlots
void fillTrendPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumiSeg=0)
Definition: SiPixelPhase1Summary.cc:345
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelPhase1Summary::summaryMap_
std::map< std::string, MonitorElement * > summaryMap_
Definition: SiPixelPhase1Summary.h:69
SurfaceOrientation::outer
Definition: Surface.h:19
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:791
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:583
SiPixelPhase1Summary::offline
Definition: SiPixelPhase1Summary.h:64
SiPixelPhase1Summary::deadROCTrends_
std::map< trendPlots, MonitorElement * > deadROCTrends_
Definition: SiPixelPhase1Summary.h:76
SiPixelPhase1Summary::bpix
Definition: SiPixelPhase1Summary.h:64