CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
HcalDigisClient Class Reference

#include <Validation/HcalDigisClient/src/HcalDigisClient.cc>

Inheritance diagram for HcalDigisClient:
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

Classes

struct  HistLim
 

Public Member Functions

 HcalDigisClient (const edm::ParameterSet &)
 
 ~HcalDigisClient () 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 dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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)
 

Private Member Functions

void book1D (DQMStore::IBooker &ib, std::string name, int n, double min, double max)
 
void book1D (DQMStore::IBooker &ib, std::string name, const HistLim &limX)
 
void book2D (DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
 
void bookPf (DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
 
void bookPf (DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY, const char *option)
 
void dqmEndJob (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
 
void fill1D (std::string name, double X, double weight=1)
 
void fill2D (std::string name, double X, double Y, double weight=1)
 
void fillPf (std::string name, double X, double Y)
 
int HcalDigisEndjob (const std::vector< MonitorElement *> &hcalMEs, std::string subdet_, DQMStore::IBooker &ib)
 
double integralMETH2D (MonitorElement *ME, int i0, int i1, int j0, int j1)
 
MonitorElementmonitor (std::string name)
 
virtual void runClient (DQMStore::IBooker &ib, DQMStore::IGetter &ig)
 
void scaleMETH2D (MonitorElement *ME, double s)
 
std::string str (int x)
 

Private Attributes

std::string dirName_
 
std::map< std::string, MonitorElement * > * msm_
 
std::string outputFile_
 

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)
 
- 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 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<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 inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 26 of file HcalDigisClient.h.

Constructor & Destructor Documentation

◆ HcalDigisClient()

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

Definition at line 22 of file HcalDigisClient.cc.

References dirName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), msm_, outputFile_, and AlCaHLTBitMon_QueryRunRegistry::string.

22  {
23  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "HcalDigisClient.root");
24  dirName_ = iConfig.getParameter<std::string>("DQMDirName");
25  msm_ = new std::map<std::string, MonitorElement*>();
26 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::map< std::string, MonitorElement * > * msm_
std::string dirName_
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFile_

◆ ~HcalDigisClient()

HcalDigisClient::~HcalDigisClient ( )
override

Definition at line 28 of file HcalDigisClient.cc.

References msm_.

28 { delete msm_; }
std::map< std::string, MonitorElement * > * msm_

Member Function Documentation

◆ book1D() [1/2]

void HcalDigisClient::book1D ( DQMStore::IBooker ib,
std::string  name,
int  n,
double  min,
double  max 
)
inlineprivate

Definition at line 50 of file HcalDigisClient.h.

References cuy::ib, SiStripPI::max, SiStripPI::min, msm_, dqmiodumpmetadata::n, and Skims_PA_cff::name.

Referenced by HcalDigisEndjob().

50  {
51  if (!msm_->count(name))
52  (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), n, min, max);
53  }
std::map< std::string, MonitorElement * > * msm_
ib
Definition: cuy.py:661

◆ book1D() [2/2]

void HcalDigisClient::book1D ( DQMStore::IBooker ib,
std::string  name,
const HistLim limX 
)
inlineprivate

Definition at line 55 of file HcalDigisClient.h.

References cuy::ib, HcalDigisClient::HistLim::max, HcalDigisClient::HistLim::min, msm_, HcalDigisClient::HistLim::n, and Skims_PA_cff::name.

55  {
56  if (!msm_->count(name))
57  (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max);
58  }
std::map< std::string, MonitorElement * > * msm_
ib
Definition: cuy.py:661

◆ book2D()

void HcalDigisClient::book2D ( DQMStore::IBooker ib,
std::string  name,
const HistLim limX,
const HistLim limY 
)
inlineprivate

Definition at line 62 of file HcalDigisClient.h.

References cuy::ib, HcalDigisClient::HistLim::max, HcalDigisClient::HistLim::min, msm_, HcalDigisClient::HistLim::n, and Skims_PA_cff::name.

62  {
63  if (!msm_->count(name))
64  (*msm_)[name] = ib.book2D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
65  }
std::map< std::string, MonitorElement * > * msm_
ib
Definition: cuy.py:661

◆ bookPf() [1/2]

void HcalDigisClient::bookPf ( DQMStore::IBooker ib,
std::string  name,
const HistLim limX,
const HistLim limY 
)
inlineprivate

Definition at line 69 of file HcalDigisClient.h.

References cuy::ib, HcalDigisClient::HistLim::max, HcalDigisClient::HistLim::min, msm_, HcalDigisClient::HistLim::n, and Skims_PA_cff::name.

69  {
70  if (!msm_->count(name))
71  (*msm_)[name] =
72  ib.bookProfile(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
73  }
std::map< std::string, MonitorElement * > * msm_
ib
Definition: cuy.py:661

◆ bookPf() [2/2]

void HcalDigisClient::bookPf ( DQMStore::IBooker ib,
std::string  name,
const HistLim limX,
const HistLim limY,
const char *  option 
)
inlineprivate

Definition at line 75 of file HcalDigisClient.h.

References cuy::ib, HcalDigisClient::HistLim::max, HcalDigisClient::HistLim::min, msm_, HcalDigisClient::HistLim::n, Skims_PA_cff::name, and fileinputsource_cfi::option.

75  {
76  if (!msm_->count(name))
77  (*msm_)[name] =
78  ib.bookProfile(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max, option);
79  }
std::map< std::string, MonitorElement * > * msm_
ib
Definition: cuy.py:661

◆ dqmEndJob()

void HcalDigisClient::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
inlineoverrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 33 of file HcalDigisClient.h.

References dirName_, runClient(), and dqm::implementation::NavigatorBase::setCurrentFolder().

33  {
34  igetter.setCurrentFolder(dirName_); // This sets the DQMStore (should apply to ibooker as well
35  runClient(ibooker, igetter);
36  }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::string dirName_
virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig)

◆ fill1D()

void HcalDigisClient::fill1D ( std::string  name,
double  X,
double  weight = 1 
)
inlineprivate

Definition at line 60 of file HcalDigisClient.h.

References msm_, Skims_PA_cff::name, and X.

60 { msm_->find(name)->second->Fill(X, weight); }
std::map< std::string, MonitorElement * > * msm_
#define X(str)
Definition: MuonsGrabber.cc:38
Definition: weight.py:1

◆ fill2D()

void HcalDigisClient::fill2D ( std::string  name,
double  X,
double  Y,
double  weight = 1 
)
inlineprivate

Definition at line 67 of file HcalDigisClient.h.

References msm_, Skims_PA_cff::name, X, and BeamSpotPI::Y.

67 { msm_->find(name)->second->Fill(X, Y, weight); }
std::map< std::string, MonitorElement * > * msm_
#define X(str)
Definition: MuonsGrabber.cc:38
Definition: weight.py:1

◆ fillPf()

void HcalDigisClient::fillPf ( std::string  name,
double  X,
double  Y 
)
inlineprivate

Definition at line 81 of file HcalDigisClient.h.

References msm_, Skims_PA_cff::name, X, and BeamSpotPI::Y.

81 { msm_->find(name)->second->Fill(X, Y); }
std::map< std::string, MonitorElement * > * msm_
#define X(str)
Definition: MuonsGrabber.cc:38

◆ HcalDigisEndjob()

int HcalDigisClient::HcalDigisEndjob ( const std::vector< MonitorElement *> &  hcalMEs,
std::string  subdet_,
DQMStore::IBooker ib 
)
private

Definition at line 56 of file HcalDigisClient.cc.

References book1D(), Skims_PA_cff::content, LEDCalibrationChannels::depth, HLT_2022v15_cff::depths, MillePedeFileConverter_cfg::e, mps_fire::end, makeMEIFBenchmarkPlots::ev, spr::find(), dqmMemoryStats::float, dqm::impl::MonitorElement::getEntries(), ForwardName::getName(), mps_fire::i, cuy::ib, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, dqmiolumiharvest::j, msm_, position, mathSSE::sqrt(), str(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by runClient().

58  {
59  using namespace std;
60  string strtmp;
61 
62  MonitorElement* nevtot(nullptr);
63 
64  std::vector<MonitorElement*> ieta_iphi_occupancy_maps;
65  std::vector<std::string> depthID;
66 
67  edm::LogVerbatim("HcalDigisClient") << " Number of histos " << hcalMEs.size();
68 
69  for (unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
70  if (hcalMEs[ih]->getName() == "nevtot") {
71  nevtot = hcalMEs[ih];
72  continue;
73  }
74 
75  //We search the occupancy maps corresponding to this subdetector
76  if ((hcalMEs[ih]->getName().find("HcalDigiTask_ieta_iphi_occupancy_map_depth") != std::string::npos) &&
77  (hcalMEs[ih]->getName().find(subdet_) != std::string::npos)) {
78  ieta_iphi_occupancy_maps.push_back(hcalMEs[ih]);
79 
80  std::string start = "depth";
81  std::string end = "_H";
82 
83  int position = hcalMEs[ih]->getName().find(start) + start.length();
84  int length = hcalMEs[ih]->getName().find(end) - position;
85 
86  depthID.push_back(hcalMEs[ih]->getName().substr(position, length));
87 
88  continue;
89  }
90  }
91 
92  if (hcalMEs.empty()) {
93  edm::LogError("HcalDigisClient") << "No nevtot or maps histo found...";
94  return 0;
95  }
96  if (!nevtot) {
97  edm::LogError("HcalDigisClient") << "No nevtot histoo found...";
98  return 0;
99  }
100  if (ieta_iphi_occupancy_maps.empty()) {
101  edm::LogError("HcalDigisClient") << "No maps histos found...";
102  return 0;
103  }
104 
105  int ev = nevtot->getEntries();
106 
107  if (ev <= 0) {
108  edm::LogError("HcalDigisClient") << "normalization factor <= 0!";
109  return 0;
110  }
111 
112  float fev = (float)nevtot->getEntries();
113 
114  int depths = ieta_iphi_occupancy_maps.size();
115 
116  HistLim ietaLim(85, -42.5, 42.5);
117 
118  for (int depth = 1; depth <= depths; depth++) {
119  strtmp = "HcalDigiTask_occupancy_vs_ieta_depth" + str(depth) + "_" + subdet_;
120  book1D(ib, strtmp, ietaLim);
121  }
122 
123  std::vector<float> sumphi(depths, 0);
124  std::vector<float> sumphie(depths, 0);
125 
126  float phi_factor;
127  float cnorm;
128  float enorm;
129 
130  for (int depth = 1; depth <= depths; depth++) {
131  int nx = ieta_iphi_occupancy_maps[depth - 1]->getNbinsX();
132  int ny = ieta_iphi_occupancy_maps[depth - 1]->getNbinsY();
133 
134  for (int i = 1; i <= nx; i++) {
135  for (int j = 1; j <= ny; j++) {
136  // occupancies
137  cnorm = ieta_iphi_occupancy_maps[depth - 1]->getBinContent(i, j) / fev;
138  enorm = ieta_iphi_occupancy_maps[depth - 1]->getBinError(i, j) / fev;
139  ieta_iphi_occupancy_maps[depth - 1]->setBinContent(i, j, cnorm);
140  ieta_iphi_occupancy_maps[depth - 1]->setBinError(i, j, enorm);
141 
142  } //for loop over NbinsYU
143  } //for loop over NbinsX
144  } //for loop over the occupancy maps
145 
146  for (int i = 1; i <= 82; i++) {
147  int ieta = i - 42; // -41 -1, 0 40
148  if (ieta >= 0)
149  ieta += 1; // -41 -1, 1 41 - to make it detector-like
150 
151  if (ieta >= -20 && ieta <= 20) {
152  phi_factor = 72.;
153  } else {
154  if (ieta >= 40 || ieta <= -40)
155  phi_factor = 18.;
156  else
157  phi_factor = 36.;
158  }
159 
160  //zero the sumphi and sumphie vector at the start of each ieta ring
161  sumphi.assign(depths, 0);
162  sumphie.assign(depths, 0);
163 
164  for (int iphi = 1; iphi <= 72; iphi++) {
165  for (int depth = 1; depth <= depths; depth++) {
166  int binIeta = ieta_iphi_occupancy_maps[depth - 1]->getTH2F()->GetXaxis()->FindBin(ieta);
167  int binIphi = ieta_iphi_occupancy_maps[depth - 1]->getTH2F()->GetYaxis()->FindBin(iphi);
168 
169  float content = ieta_iphi_occupancy_maps[depth - 1]->getBinContent(binIeta, binIphi);
170  float econtent = ieta_iphi_occupancy_maps[depth - 1]->getBinError(binIeta, binIphi);
171 
172  sumphi[depth - 1] += content;
173  sumphie[depth - 1] += econtent * econtent;
174 
175  } //for loop over depths
176  } //for loop over phi
177 
178  //double deta = double(ieta);
179 
180  // occupancies vs ieta
181  for (int depth = 1; depth <= depths; depth++) {
182  strtmp = "HcalDigiTask_occupancy_vs_ieta_depth" + depthID[depth - 1] + "_" + subdet_;
183  MonitorElement* ME = msm_->find(strtmp)->second;
184  int ietabin = ME->getTH1F()->GetXaxis()->FindBin(float(ieta));
185 
186  if (sumphi[depth - 1] > 1.e-30) {
187  cnorm = sumphi[depth - 1] / phi_factor;
188  enorm = sqrt(sumphie[depth - 1]) / phi_factor;
189  ME->setBinContent(ietabin, cnorm);
190  ME->setBinError(ietabin, enorm);
191  }
192  }
193  } // end of i-loop
194 
195  return 1;
196 }
Definition: start.py:1
Log< level::Info, true > LogVerbatim
std::map< std::string, MonitorElement * > * msm_
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Definition: ME.h:11
T sqrt(T t)
Definition: SSEVec.h:19
std::string str(int x)
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)
static int position[264][3]
Definition: ReadPGInfo.cc:289
std::string getName(const G4String &)
Definition: ForwardName.cc:3
ib
Definition: cuy.py:661

◆ integralMETH2D()

double HcalDigisClient::integralMETH2D ( MonitorElement ME,
int  i0,
int  i1,
int  j0,
int  j1 
)
private

Definition at line 211 of file HcalDigisClient.cc.

References mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, and dqmiolumiharvest::j.

211  {
212  double sum(0);
213  for (int i = i0; i <= i1; i++) {
214  for (int j = j0; j <= j1; j++) {
215  sum += ME->getBinContent(i, j);
216  }
217  }
218 
219  return sum;
220 }
Definition: ME.h:11

◆ monitor()

HcalDigisClient::MonitorElement * HcalDigisClient::monitor ( std::string  name)
private

Definition at line 198 of file HcalDigisClient.cc.

References msm_, and Skims_PA_cff::name.

198  {
199  if (!msm_->count(name))
200  return nullptr;
201  else
202  return msm_->find(name)->second;
203 }
std::map< std::string, MonitorElement * > * msm_

◆ runClient()

void HcalDigisClient::runClient ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
privatevirtual

Definition at line 30 of file HcalDigisClient.cc.

References dirName_, dqm::implementation::IGetter::getContents(), dqm::implementation::IGetter::getSubdirs(), HcalDigisEndjob(), mps_fire::i, cuy::ib, dqmiolumiharvest::j, and dqm::implementation::NavigatorBase::setCurrentFolder().

Referenced by dqmEndJob().

30  {
32  std::vector<MonitorElement*> hcalMEs;
33  // Since out folders are fixed to three, we can just go over these three folders
34  // i.e., CaloTowersV/CaloTowersTask, HcalRecHitsV/HcalRecHitTask, NoiseRatesV/NoiseRatesTask.
35  std::vector<std::string> fullPathHLTFolders = ig.getSubdirs();
36  for (unsigned int i = 0; i < fullPathHLTFolders.size(); i++) {
37  ig.setCurrentFolder(fullPathHLTFolders[i]);
38  std::vector<std::string> fullSubPathHLTFolders = ig.getSubdirs();
39  for (unsigned int j = 0; j < fullSubPathHLTFolders.size(); j++) {
40  if (strcmp(fullSubPathHLTFolders[j].c_str(), "HcalDigisV/HcalDigiTask") == 0) {
41  hcalMEs = ig.getContents(fullSubPathHLTFolders[j]);
42  ig.setCurrentFolder("HcalDigisV/HcalDigiTask");
43  if (!HcalDigisEndjob(hcalMEs, "HB", ib))
44  edm::LogError("HcalDigisClient") << "Error in HcalDigisEndjob! HB";
45  if (!HcalDigisEndjob(hcalMEs, "HE", ib))
46  edm::LogError("HcalDigisClient") << "Error in HcalDigisEndjob! HE";
47  if (!HcalDigisEndjob(hcalMEs, "HO", ib))
48  edm::LogError("HcalDigisClient") << "Error in HcalDigisEndjob! HO";
49  if (!HcalDigisEndjob(hcalMEs, "HF", ib))
50  edm::LogError("HcalDigisClient") << "Error in HcalDigisEndjob! HF";
51  }
52  }
53  }
54 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::string dirName_
Log< level::Error, false > LogError
int HcalDigisEndjob(const std::vector< MonitorElement *> &hcalMEs, std::string subdet_, DQMStore::IBooker &ib)
ib
Definition: cuy.py:661
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:610
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:724

◆ scaleMETH2D()

void HcalDigisClient::scaleMETH2D ( MonitorElement ME,
double  s 
)
private

Definition at line 222 of file HcalDigisClient.cc.

References Skims_PA_cff::content, relativeConstraints::error, mps_fire::i, dqmiolumiharvest::j, and alignCSCRings::s.

222  {
223  int nx = ME->getNbinsX();
224  int ny = ME->getNbinsY();
225 
226  double content(0);
227  double error(0);
228  for (int i = 1; i <= nx; i++) {
229  for (int j = 1; j <= ny; j++) {
230  content = ME->getBinContent(i, j);
231  error = ME->getBinError(i, j);
232  content *= s;
233  error *= s;
234  ME->setBinContent(i, j, content);
235  ME->setBinError(i, j, error);
236  }
237  }
238 }
Definition: ME.h:11

◆ str()

std::string HcalDigisClient::str ( int  x)
private

Definition at line 205 of file HcalDigisClient.cc.

References MillePedeFileConverter_cfg::out, and x.

Referenced by HcalDigisEndjob().

205  {
206  std::stringstream out;
207  out << x;
208  return out.str();
209 }

Member Data Documentation

◆ dirName_

std::string HcalDigisClient::dirName_
private

Definition at line 89 of file HcalDigisClient.h.

Referenced by dqmEndJob(), HcalDigisClient(), and runClient().

◆ msm_

std::map<std::string, MonitorElement *>* HcalDigisClient::msm_
private

◆ outputFile_

std::string HcalDigisClient::outputFile_
private

Definition at line 88 of file HcalDigisClient.h.

Referenced by HcalDigisClient().