CMS 3D CMS Logo

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

#include <ECALpedestalPCLHarvester.h>

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

 ECALpedestalPCLHarvester (const edm::ParameterSet &ps)
 
void endRun (edm::Run const &run, edm::EventSetup const &isetup) 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

bool checkStatusCode (const DetId &id)
 
bool checkVariation (const EcalPedestalsMap &oldPedestals, const EcalPedestalsMap &newPedestals)
 
void dqmEndJob (DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_) override
 
void dqmPlots (const EcalPedestals &newpeds, DQMStore::IBooker &ibooker)
 
bool isGood (const DetId &id)
 

Private Attributes

const edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcdchannelsStatusToken_
 
const EcalChannelStatuschannelStatus_
 
const bool checkAnomalies_
 
std::vector< int > chStatusToExclude_
 
const EcalPedestalscurrentPedestals_
 
const std::string dqmDir_
 
int entriesEB_ [EBDetId::kSizeForDenseIndexing]
 
int entriesEE_ [EEDetId::kSizeForDenseIndexing]
 
const EcalPedestalsg6g1Pedestals_
 
const edm::ESGetToken< EcalPedestals, EcalPedestalsRcdg6g1PedestalsToken_
 
const std::string labelG6G1_
 
const int minEntries_
 
const double nSigma_
 
const edm::ESGetToken< EcalPedestals, EcalPedestalsRcdpedestalsToken_
 
const float threshChannelsAnalyzed_
 
const float threshDiffEB_
 
const float threshDiffEE_
 
const double thresholdAnomalies_
 

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
 
- 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 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: Fill DQM histograms with pedestals. Intended to be used on laser data from the TestEnablesEcalHcal dataset

Definition at line 35 of file ECALpedestalPCLHarvester.h.

Constructor & Destructor Documentation

◆ ECALpedestalPCLHarvester()

ECALpedestalPCLHarvester::ECALpedestalPCLHarvester ( const edm::ParameterSet ps)
explicit

Definition at line 13 of file ECALpedestalPCLHarvester.cc.

References chStatusToExclude_, and edm::ParameterSet::getParameter().

14  : minEntries_(ps.getParameter<int>("MinEntries")),
15  checkAnomalies_(ps.getParameter<bool>("checkAnomalies")),
16  nSigma_(ps.getParameter<double>("nSigma")),
17  thresholdAnomalies_(ps.getParameter<double>("thresholdAnomalies")),
18  dqmDir_(ps.getParameter<std::string>("dqmDir")),
19  labelG6G1_(ps.getParameter<std::string>("labelG6G1")),
20  threshDiffEB_(ps.getParameter<double>("threshDiffEB")),
21  threshDiffEE_(ps.getParameter<double>("threshDiffEE")),
22  threshChannelsAnalyzed_(ps.getParameter<double>("threshChannelsAnalyzed")),
23  channelsStatusToken_(esConsumes<edm::Transition::EndRun>()),
24  pedestalsToken_(esConsumes<edm::Transition::EndRun>()),
25  g6g1PedestalsToken_(esConsumes<edm::Transition::EndRun>(edm::ESInputTag("", labelG6G1_))),
26  currentPedestals_(nullptr),
27  g6g1Pedestals_(nullptr),
28  channelStatus_(nullptr) {
29  chStatusToExclude_ = StringToEnumValue<EcalChannelStatusCode::Code>(
30  ps.getParameter<std::vector<std::string> >("ChannelStatusToExclude"));
31 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > g6g1PedestalsToken_
const EcalPedestals * g6g1Pedestals_
std::vector< int > chStatusToExclude_
const edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > pedestalsToken_
const EcalChannelStatus * channelStatus_
const EcalPedestals * currentPedestals_
const edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > channelsStatusToken_

Member Function Documentation

◆ checkStatusCode()

bool ECALpedestalPCLHarvester::checkStatusCode ( const DetId id)
private

Definition at line 163 of file ECALpedestalPCLHarvester.cc.

References channelStatus_, chStatusToExclude_, spr::find(), EcalCondObjectContainer< T >::find(), EcalCondObjectContainer< T >::getMap(), and nano_mu_digi_cff::rawId.

Referenced by dqmEndJob().

163  {
165  dbstatusPtr = channelStatus_->getMap().find(id.rawId());
166  EcalChannelStatusCode::Code dbstatus = dbstatusPtr->getStatusCode();
167 
168  std::vector<int>::const_iterator res = std::find(chStatusToExclude_.begin(), chStatusToExclude_.end(), dbstatus);
169  if (res != chStatusToExclude_.end())
170  return false;
171 
172  return true;
173 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Definition: Electron.h:6
std::vector< int > chStatusToExclude_
const_iterator find(uint32_t rawId) const
const EcalChannelStatus * channelStatus_
std::vector< Item >::const_iterator const_iterator

◆ checkVariation()

bool ECALpedestalPCLHarvester::checkVariation ( const EcalPedestalsMap oldPedestals,
const EcalPedestalsMap newPedestals 
)
private

Definition at line 186 of file ECALpedestalPCLHarvester.cc.

References funct::abs(), EBDetId::detIdFromDenseIndex(), EEDetId::detIdFromDenseIndex(), EcalCondObjectContainer< T >::find(), mps_fire::i, EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, EcalPedestal::mean_x12, nSigma_, nano_mu_digi_cff::rawId, EcalPedestal::rms_x12, and thresholdAnomalies_.

Referenced by dqmEndJob().

187  {
188  uint32_t nAnomaliesEB = 0;
189  uint32_t nAnomaliesEE = 0;
190 
191  for (uint16_t i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) {
193  const EcalPedestal& newped = *newPedestals.find(id.rawId());
194  const EcalPedestal& oldped = *oldPedestals.find(id.rawId());
195 
196  if (std::abs(newped.mean_x12 - oldped.mean_x12) > nSigma_ * oldped.rms_x12)
197  nAnomaliesEB++;
198  }
199 
200  for (uint16_t i = 0; i < EEDetId::kSizeForDenseIndexing; ++i) {
202  const EcalPedestal& newped = *newPedestals.find(id.rawId());
203  const EcalPedestal& oldped = *oldPedestals.find(id.rawId());
204 
205  if (std::abs(newped.mean_x12 - oldped.mean_x12) > nSigma_ * oldped.rms_x12)
206  nAnomaliesEE++;
207  }
208 
211  return true;
212 
213  return false;
214 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const_iterator find(uint32_t rawId) const
Definition: DetId.h:17

◆ dqmEndJob()

void ECALpedestalPCLHarvester::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
overrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 33 of file ECALpedestalPCLHarvester.cc.

References funct::abs(), checkAnomalies_, checkStatusCode(), checkVariation(), currentPedestals_, cond::service::PoolDBOutputService::currentTime(), EBDetId::detIdFromDenseIndex(), EEDetId::detIdFromDenseIndex(), change_name::diff, dqmDir_, dqmPlots(), entriesEB_, entriesEE_, EcalCondObjectContainer< T >::find(), g6g1Pedestals_, dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getEntries(), dqm::impl::MonitorElement::getMean(), dqm::impl::MonitorElement::getRMS(), mps_fire::i, edm::Service< T >::isAvailable(), EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, SiStripPI::mean, EcalPedestal::mean_x1, EcalPedestal::mean_x12, EcalPedestal::mean_x6, minEntries_, nano_mu_digi_cff::rawId, SiStripPI::rms, EcalPedestal::rms_x1, EcalPedestal::rms_x12, EcalPedestal::rms_x6, EcalCondObjectContainer< T >::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, threshChannelsAnalyzed_, threshDiffEB_, threshDiffEE_, to_string(), and cond::service::PoolDBOutputService::writeOneIOV().

33  {
34  // calculate pedestals and fill db record
35  EcalPedestals pedestals;
36  float kBarrelSize = 61200;
37  float kEndcapSize = 2 * 7324;
38  float skipped_channels_EB = 0;
39  float skipped_channels_EE = 0;
40 
41  for (uint16_t i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) {
42  std::string hname = dqmDir_ + "/EB/" + std::to_string(int(i / 100)) + "/eb_" + std::to_string(i);
43  MonitorElement* ch = igetter_.get(hname);
44  if (ch == nullptr) {
45  edm::LogWarning("MissingMonitorElement") << "failed to find MonitorElement " << hname;
46  entriesEB_[i] = 0;
47  continue;
48  }
49  double mean = ch->getMean();
50  double rms = ch->getRMS();
51  entriesEB_[i] = ch->getEntries();
52 
54  EcalPedestal ped;
55  EcalPedestal oldped = *currentPedestals_->find(id.rawId());
56  EcalPedestal g6g1ped = *g6g1Pedestals_->find(id.rawId());
57 
58  ped.mean_x12 = mean;
59  ped.rms_x12 = rms;
60 
61  float diff = std::abs(mean - oldped.mean_x12);
62 
63  // if bad channel or low stat skip or the difference is too large wrt to previous record
64  if (ch->getEntries() < minEntries_ || !checkStatusCode(id) || diff > threshDiffEB_) {
65  ped.mean_x12 = oldped.mean_x12;
66  ped.rms_x12 = oldped.rms_x12;
67 
68  skipped_channels_EB++;
69  }
70 
71  // copy g6 and g1 from the corressponding record
72  ped.mean_x6 = g6g1ped.mean_x6;
73  ped.rms_x6 = g6g1ped.rms_x6;
74  ped.mean_x1 = g6g1ped.mean_x1;
75  ped.rms_x1 = g6g1ped.rms_x1;
76 
77  pedestals.setValue(id.rawId(), ped);
78  }
79 
80  for (uint16_t i = 0; i < EEDetId::kSizeForDenseIndexing; ++i) {
81  std::string hname = dqmDir_ + "/EE/" + std::to_string(int(i / 100)) + "/ee_" + std::to_string(i);
82 
83  MonitorElement* ch = igetter_.get(hname);
84  if (ch == nullptr) {
85  edm::LogWarning("MissingMonitorElement") << "failed to find MonitorElement " << hname;
86  entriesEE_[i] = 0;
87  continue;
88  }
89  double mean = ch->getMean();
90  double rms = ch->getRMS();
91  entriesEE_[i] = ch->getEntries();
92 
94  EcalPedestal ped;
95  EcalPedestal oldped = *currentPedestals_->find(id.rawId());
96  EcalPedestal g6g1ped = *g6g1Pedestals_->find(id.rawId());
97 
98  ped.mean_x12 = mean;
99  ped.rms_x12 = rms;
100 
101  float diff = std::abs(mean - oldped.mean_x12);
102 
103  // if bad channel or low stat skip or the difference is too large wrt to previous record
104  if (ch->getEntries() < minEntries_ || !checkStatusCode(id) || diff > threshDiffEE_) {
105  ped.mean_x12 = oldped.mean_x12;
106  ped.rms_x12 = oldped.rms_x12;
107 
108  skipped_channels_EE++;
109  }
110 
111  // copy g6 and g1 pedestals from corresponding record
112  ped.mean_x6 = g6g1ped.mean_x6;
113  ped.rms_x6 = g6g1ped.rms_x6;
114  ped.mean_x1 = g6g1ped.mean_x1;
115  ped.rms_x1 = g6g1ped.rms_x1;
116 
117  pedestals.setValue(id.rawId(), ped);
118  }
119 
120  bool enough_stat = false;
121  if ((kBarrelSize - skipped_channels_EB) / kBarrelSize > threshChannelsAnalyzed_ &&
122  (kEndcapSize - skipped_channels_EE) / kEndcapSize > threshChannelsAnalyzed_) {
123  enough_stat = true;
124  }
125 
126  dqmPlots(pedestals, ibooker_);
127 
128  // check if there are large variations wrt exisiting pedstals
129 
130  if (checkAnomalies_) {
131  if (checkVariation(*currentPedestals_, pedestals)) {
132  edm::LogError("Large Variations found wrt to old pedestals, no file created");
133  return;
134  }
135  }
136 
137  if (!enough_stat)
138  return;
139 
140  // write out pedestal record
142 
143  if (!poolDbService.isAvailable()) {
144  throw std::runtime_error("PoolDBService required.");
145  }
146 
147  poolDbService->writeOneIOV(pedestals, poolDbService->currentTime(), "EcalPedestalsRcd");
148 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
int entriesEE_[EEDetId::kSizeForDenseIndexing]
bool checkVariation(const EcalPedestalsMap &oldPedestals, const EcalPedestalsMap &newPedestals)
Log< level::Error, false > LogError
static std::string to_string(const XMLCh *ch)
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
void setValue(const uint32_t id, const Item &item)
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
const EcalPedestals * g6g1Pedestals_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
virtual double getEntries() const
get # of entries
void dqmPlots(const EcalPedestals &newpeds, DQMStore::IBooker &ibooker)
const_iterator find(uint32_t rawId) const
Definition: DetId.h:17
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
bool checkStatusCode(const DetId &id)
const EcalPedestals * currentPedestals_
bool isAvailable() const
Definition: Service.h:40
Log< level::Warning, false > LogWarning
int entriesEB_[EBDetId::kSizeForDenseIndexing]

◆ dqmPlots()

void ECALpedestalPCLHarvester::dqmPlots ( const EcalPedestals newpeds,
DQMStore::IBooker ibooker 
)
private

Definition at line 216 of file ECALpedestalPCLHarvester.cc.

References funct::abs(), dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), EBDetId::detIdFromDenseIndex(), EEDetId::detIdFromDenseIndex(), dqmDir_, entriesEB_, entriesEE_, dqm::impl::MonitorElement::Fill(), cond::hash, EBDetId::ieta(), EBDetId::iphi(), isGood(), EEDetId::ix(), EEDetId::iy(), EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, SiStripPI::mean, SiStripPI::rms, dqm::implementation::NavigatorBase::setCurrentFolder(), and EEDetId::zside().

Referenced by dqmEndJob().

216  {
217  ibooker.cd();
218  ibooker.setCurrentFolder(dqmDir_ + "/Summary");
219 
220  MonitorElement* pmeb = ibooker.book2D("meaneb", "Pedestal Means EB", 360, 1., 361., 171, -85., 86.);
221  MonitorElement* preb = ibooker.book2D("rmseb", "Pedestal RMS EB ", 360, 1., 361., 171, -85., 86.);
222 
223  MonitorElement* pmeep = ibooker.book2D("meaneep", "Pedestal Means EEP", 100, 1, 101, 100, 1, 101);
224  MonitorElement* preep = ibooker.book2D("rmseep", "Pedestal RMS EEP", 100, 1, 101, 100, 1, 101);
225 
226  MonitorElement* pmeem = ibooker.book2D("meaneem", "Pedestal Means EEM", 100, 1, 101, 100, 1, 101);
227  MonitorElement* preem = ibooker.book2D("rmseem", "Pedestal RMS EEM", 100, 1, 101, 100, 1, 101);
228 
229  MonitorElement* pmebd = ibooker.book2D("meanebdiff", "Abs Rel Pedestal Means Diff EB", 360, 1., 361., 171, -85., 86.);
230  MonitorElement* prebd = ibooker.book2D("rmsebdiff", "Abs Rel Pedestal RMS Diff E ", 360, 1., 361., 171, -85., 86.);
231 
232  MonitorElement* pmeepd = ibooker.book2D("meaneepdiff", "Abs Rel Pedestal Means Diff EEP", 100, 1, 101, 100, 1, 101);
233  MonitorElement* preepd = ibooker.book2D("rmseepdiff", "Abs Rel Pedestal RMS Diff EEP", 100, 1, 101, 100, 1, 101);
234 
235  MonitorElement* pmeemd = ibooker.book2D("meaneemdiff", "Abs Rel Pedestal Means Diff EEM", 100, 1, 101, 100, 1, 101);
236  MonitorElement* preemd = ibooker.book2D("rmseemdiff", "Abs RelPedestal RMS Diff EEM", 100, 1, 101, 100, 1, 101);
237 
238  MonitorElement* poeb = ibooker.book2D("occeb", "Occupancy EB", 360, 1., 361., 171, -85., 86.);
239  MonitorElement* poeep = ibooker.book2D("occeep", "Occupancy EEP", 100, 1, 101, 100, 1, 101);
240  MonitorElement* poeem = ibooker.book2D("occeem", "Occupancy EEM", 100, 1, 101, 100, 1, 101);
241 
242  MonitorElement* hdiffeb = ibooker.book1D("diffeb", "Pedestal Differences EB", 100, -2.5, 2.5);
243  MonitorElement* hdiffee = ibooker.book1D("diffee", "Pedestal Differences EE", 100, -2.5, 2.5);
244 
245  for (int hash = 0; hash < EBDetId::kSizeForDenseIndexing; ++hash) {
247  float mean = newpeds[di].mean_x12;
248  float rms = newpeds[di].rms_x12;
249 
250  float cmean = (*currentPedestals_)[di].mean_x12;
251  float crms = (*currentPedestals_)[di].rms_x12;
252 
253  if (!isGood(di))
254  continue; // only good channels are plotted
255 
256  pmeb->Fill(di.iphi(), di.ieta(), mean);
257  preb->Fill(di.iphi(), di.ieta(), rms);
258  if (cmean)
259  pmebd->Fill(di.iphi(), di.ieta(), std::abs(mean - cmean) / cmean);
260  if (crms)
261  prebd->Fill(di.iphi(), di.ieta(), std::abs(rms - crms) / crms);
262  poeb->Fill(di.iphi(), di.ieta(), entriesEB_[hash]);
263  hdiffeb->Fill(mean - cmean);
264  }
265 
266  for (int hash = 0; hash < EEDetId::kSizeForDenseIndexing; ++hash) {
268  float mean = newpeds[di].mean_x12;
269  float rms = newpeds[di].rms_x12;
270  float cmean = (*currentPedestals_)[di].mean_x12;
271  float crms = (*currentPedestals_)[di].rms_x12;
272 
273  if (!isGood(di))
274  continue; // only good channels are plotted
275 
276  if (di.zside() > 0) {
277  pmeep->Fill(di.ix(), di.iy(), mean);
278  preep->Fill(di.ix(), di.iy(), rms);
279  poeep->Fill(di.ix(), di.iy(), entriesEE_[hash]);
280  if (cmean)
281  pmeepd->Fill(di.ix(), di.iy(), std::abs(mean - cmean) / cmean);
282  if (crms)
283  preepd->Fill(di.ix(), di.iy(), std::abs(rms - crms) / crms);
284  } else {
285  pmeem->Fill(di.ix(), di.iy(), mean);
286  preem->Fill(di.ix(), di.iy(), rms);
287  if (cmean)
288  pmeemd->Fill(di.ix(), di.iy(), std::abs(mean - cmean) / cmean);
289  poeem->Fill(di.ix(), di.iy(), entriesEE_[hash]);
290  if (crms)
291  preemd->Fill(di.ix(), di.iy(), std::abs(rms - crms) / crms);
292  }
293  hdiffee->Fill(mean - cmean);
294  }
295 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
int entriesEE_[EEDetId::kSizeForDenseIndexing]
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
int ix() const
Definition: EEDetId.h:77
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
void Fill(long long x)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int zside() const
Definition: EEDetId.h:71
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:212
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
int entriesEB_[EBDetId::kSizeForDenseIndexing]
int iy() const
Definition: EEDetId.h:83

◆ endRun()

void ECALpedestalPCLHarvester::endRun ( edm::Run const &  run,
edm::EventSetup const &  isetup 
)
override

Definition at line 157 of file ECALpedestalPCLHarvester.cc.

References channelsStatusToken_, channelStatus_, currentPedestals_, g6g1Pedestals_, g6g1PedestalsToken_, edm::EventSetup::getData(), and pedestalsToken_.

157  {
158  channelStatus_ = &isetup.getData(channelsStatusToken_);
159  currentPedestals_ = &isetup.getData(pedestalsToken_);
160  g6g1Pedestals_ = &isetup.getData(g6g1PedestalsToken_);
161 }
const edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > g6g1PedestalsToken_
const EcalPedestals * g6g1Pedestals_
const edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > pedestalsToken_
const EcalChannelStatus * channelStatus_
const EcalPedestals * currentPedestals_
const edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > channelsStatusToken_

◆ fillDescriptions()

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

Definition at line 151 of file ECALpedestalPCLHarvester.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

151  {
153  desc.setUnknown();
154  descriptions.addDefault(desc);
155 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ isGood()

bool ECALpedestalPCLHarvester::isGood ( const DetId id)
private

Definition at line 175 of file ECALpedestalPCLHarvester.cc.

References channelStatus_, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), EcalCondObjectContainer< T >::getMap(), and nano_mu_digi_cff::rawId.

Referenced by dqmPlots().

175  {
177  dbstatusPtr = channelStatus_->getMap().find(id.rawId());
178  if (dbstatusPtr == channelStatus_->getMap().end())
179  edm::LogError("Invalid DetId supplied");
180  EcalChannelStatusCode::Code dbstatus = dbstatusPtr->getStatusCode();
181  if (dbstatus == 0)
182  return true;
183  return false;
184 }
const_iterator find(uint32_t rawId) const
const EcalChannelStatus * channelStatus_
std::vector< Item >::const_iterator const_iterator
const_iterator end() const

Member Data Documentation

◆ channelsStatusToken_

const edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> ECALpedestalPCLHarvester::channelsStatusToken_
private

Definition at line 65 of file ECALpedestalPCLHarvester.h.

Referenced by endRun().

◆ channelStatus_

const EcalChannelStatus* ECALpedestalPCLHarvester::channelStatus_
private

Definition at line 71 of file ECALpedestalPCLHarvester.h.

Referenced by checkStatusCode(), endRun(), and isGood().

◆ checkAnomalies_

const bool ECALpedestalPCLHarvester::checkAnomalies_
private

Definition at line 55 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob().

◆ chStatusToExclude_

std::vector<int> ECALpedestalPCLHarvester::chStatusToExclude_
private

Definition at line 50 of file ECALpedestalPCLHarvester.h.

Referenced by checkStatusCode(), and ECALpedestalPCLHarvester().

◆ currentPedestals_

const EcalPedestals* ECALpedestalPCLHarvester::currentPedestals_
private

Definition at line 69 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and endRun().

◆ dqmDir_

const std::string ECALpedestalPCLHarvester::dqmDir_
private

Definition at line 58 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and dqmPlots().

◆ entriesEB_

int ECALpedestalPCLHarvester::entriesEB_[EBDetId::kSizeForDenseIndexing]
private

Definition at line 53 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and dqmPlots().

◆ entriesEE_

int ECALpedestalPCLHarvester::entriesEE_[EEDetId::kSizeForDenseIndexing]
private

Definition at line 54 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and dqmPlots().

◆ g6g1Pedestals_

const EcalPedestals* ECALpedestalPCLHarvester::g6g1Pedestals_
private

Definition at line 70 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and endRun().

◆ g6g1PedestalsToken_

const edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> ECALpedestalPCLHarvester::g6g1PedestalsToken_
private

Definition at line 67 of file ECALpedestalPCLHarvester.h.

Referenced by endRun().

◆ labelG6G1_

const std::string ECALpedestalPCLHarvester::labelG6G1_
private

Definition at line 59 of file ECALpedestalPCLHarvester.h.

◆ minEntries_

const int ECALpedestalPCLHarvester::minEntries_
private

Definition at line 51 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob().

◆ nSigma_

const double ECALpedestalPCLHarvester::nSigma_
private

Definition at line 56 of file ECALpedestalPCLHarvester.h.

Referenced by checkVariation().

◆ pedestalsToken_

const edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> ECALpedestalPCLHarvester::pedestalsToken_
private

Definition at line 66 of file ECALpedestalPCLHarvester.h.

Referenced by endRun().

◆ threshChannelsAnalyzed_

const float ECALpedestalPCLHarvester::threshChannelsAnalyzed_
private

Definition at line 62 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob().

◆ threshDiffEB_

const float ECALpedestalPCLHarvester::threshDiffEB_
private

Definition at line 60 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob().

◆ threshDiffEE_

const float ECALpedestalPCLHarvester::threshDiffEE_
private

Definition at line 61 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob().

◆ thresholdAnomalies_

const double ECALpedestalPCLHarvester::thresholdAnomalies_
private

Definition at line 57 of file ECALpedestalPCLHarvester.h.

Referenced by checkVariation().