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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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)
 
 ~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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 EcalChannelStatuschannelStatus_
 
bool checkAnomalies_
 
std::vector< int > chStatusToExclude_
 
const EcalPedestalscurrentPedestals_
 
std::string dqmDir_
 
int entriesEB_ [EBDetId::kSizeForDenseIndexing]
 
int entriesEE_ [EEDetId::kSizeForDenseIndexing]
 
const EcalPedestalsg6g1Pedestals_
 
std::string labelG6G1_
 
int minEntries_
 
double nSigma_
 
float threshChannelsAnalyzed_
 
float threshDiffEB_
 
float threshDiffEE_
 
double thresholdAnomalies_
 

Additional Inherited Members

- 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
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
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 ( const edm::ParameterSet ps)
explicit

Definition at line 18 of file ECALpedestalPCLHarvester.cc.

References checkAnomalies_, chStatusToExclude_, dqmDir_, edm::ParameterSet::getParameter(), labelG6G1_, minEntries_, nSigma_, AlCaHLTBitMon_QueryRunRegistry::string, threshChannelsAnalyzed_, threshDiffEB_, threshDiffEE_, and thresholdAnomalies_.

18  :
19  currentPedestals_(nullptr),channelStatus_(nullptr){
20 
21  chStatusToExclude_= StringToEnumValue<EcalChannelStatusCode::Code>(ps.getParameter<std::vector<std::string> >("ChannelStatusToExclude"));
22  minEntries_=ps.getParameter<int>("MinEntries");
23  checkAnomalies_ = ps.getParameter<bool>("checkAnomalies");
24  nSigma_ = ps.getParameter<double>("nSigma");
25  thresholdAnomalies_ = ps.getParameter<double>("thresholdAnomalies");
26  dqmDir_ = ps.getParameter<std::string>("dqmDir");
27  labelG6G1_ = ps.getParameter<std::string>("labelG6G1");
28  threshDiffEB_ = ps.getParameter<double>("threshDiffEB");
29  threshDiffEE_ = ps.getParameter<double>("threshDiffEE");
30  threshChannelsAnalyzed_ = ps.getParameter<double>("threshChannelsAnalyzed");
31 }
T getParameter(std::string const &) const
std::vector< int > chStatusToExclude_
const EcalChannelStatus * channelStatus_
const EcalPedestals * currentPedestals_

Member Function Documentation

bool ECALpedestalPCLHarvester::checkStatusCode ( const DetId id)
private

Definition at line 192 of file ECALpedestalPCLHarvester.cc.

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

Referenced by dqmEndJob().

192  {
193 
195  dbstatusPtr = channelStatus_->getMap().find(id.rawId());
196  EcalChannelStatusCode::Code dbstatus = dbstatusPtr->getStatusCode();
197 
198  std::vector<int>::const_iterator res =
199  std::find( chStatusToExclude_.begin(), chStatusToExclude_.end(), dbstatus );
200  if ( res != chStatusToExclude_.end() ) return false;
201 
202  return true;
203 }
const self & getMap() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
Definition: Electron.h:6
std::vector< int > chStatusToExclude_
const EcalChannelStatus * channelStatus_
std::vector< Item >::const_iterator const_iterator
const_iterator find(uint32_t rawId) const
bool ECALpedestalPCLHarvester::checkVariation ( const EcalPedestalsMap oldPedestals,
const EcalPedestalsMap newPedestals 
)
private

Definition at line 217 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_, EcalPedestal::rms_x12, and thresholdAnomalies_.

Referenced by dqmEndJob().

218  {
219 
220  uint32_t nAnomaliesEB =0;
221  uint32_t nAnomaliesEE =0;
222 
223  for (uint16_t i =0; i< EBDetId::kSizeForDenseIndexing; ++i) {
224 
226  const EcalPedestal& newped=* newPedestals.find(id.rawId());
227  const EcalPedestal& oldped=* oldPedestals.find(id.rawId());
228 
229  if (std::abs(newped.mean_x12 -oldped.mean_x12) > nSigma_ * oldped.rms_x12) nAnomaliesEB++;
230 
231  }
232 
233  for (uint16_t i =0; i< EEDetId::kSizeForDenseIndexing; ++i) {
234 
236  const EcalPedestal& newped=* newPedestals.find(id.rawId());
237  const EcalPedestal& oldped=* oldPedestals.find(id.rawId());
238 
239  if (std::abs(newped.mean_x12 -oldped.mean_x12) > nSigma_ * oldped.rms_x12) nAnomaliesEE++;
240 
241  }
242 
243  if (nAnomaliesEB > thresholdAnomalies_ * EBDetId::kSizeForDenseIndexing ||
244  nAnomaliesEE > thresholdAnomalies_ * EEDetId::kSizeForDenseIndexing)
245  return true;
246 
247  return false;
248 
249 
250 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:111
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: DetId.h:18
const_iterator find(uint32_t rawId) const
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(), diffTreeTool::diff, dqmDir_, dqmPlots(), entriesEB_, entriesEE_, EcalCondObjectContainer< T >::find(), g6g1Pedestals_, DQMStore::IGetter::get(), MonitorElement::getEntries(), MonitorElement::getMean(), 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_, SiStripPI::rms, EcalPedestal::rms_x1, EcalPedestal::rms_x12, EcalPedestal::rms_x6, EcalCondObjectContainer< T >::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, threshChannelsAnalyzed_, threshDiffEB_, threshDiffEE_, and cond::service::PoolDBOutputService::writeOne().

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

Definition at line 255 of file ECALpedestalPCLHarvester.cc.

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

Referenced by dqmEndJob().

255  {
256 
257  ibooker.cd();
258  ibooker.setCurrentFolder(dqmDir_+"/Summary");
259 
260  MonitorElement * pmeb = ibooker.book2D("meaneb","Pedestal Means EB",360, 1., 361., 171, -85., 86.);
261  MonitorElement * preb = ibooker.book2D("rmseb","Pedestal RMS EB ",360, 1., 361., 171, -85., 86.);
262 
263  MonitorElement * pmeep = ibooker.book2D("meaneep","Pedestal Means EEP",100,1,101,100,1,101);
264  MonitorElement * preep = ibooker.book2D("rmseep","Pedestal RMS EEP",100,1,101,100,1,101);
265 
266  MonitorElement * pmeem = ibooker.book2D("meaneem","Pedestal Means EEM",100,1,101,100,1,101);
267  MonitorElement * preem = ibooker.book2D("rmseem","Pedestal RMS EEM",100,1,101,100,1,101);
268 
269  MonitorElement * pmebd = ibooker.book2D("meanebdiff","Abs Rel Pedestal Means Diff EB",360,1., 361., 171, -85., 86.);
270  MonitorElement * prebd = ibooker.book2D("rmsebdiff","Abs Rel Pedestal RMS Diff E ",360, 1., 361., 171, -85., 86.);
271 
272  MonitorElement * pmeepd = ibooker.book2D("meaneepdiff","Abs Rel Pedestal Means Diff EEP",100,1,101,100,1,101);
273  MonitorElement * preepd = ibooker.book2D("rmseepdiff","Abs Rel Pedestal RMS Diff EEP",100,1,101,100,1,101);
274 
275  MonitorElement * pmeemd = ibooker.book2D("meaneemdiff","Abs Rel Pedestal Means Diff EEM",100,1,101,100,1,101);
276  MonitorElement * preemd = ibooker.book2D("rmseemdiff","Abs RelPedestal RMS Diff EEM",100,1,101,100,1,101);
277 
278  MonitorElement * poeb = ibooker.book2D("occeb","Occupancy EB",360, 1., 361., 171, -85., 86.);
279  MonitorElement * poeep = ibooker.book2D("occeep","Occupancy EEP",100,1,101,100,1,101);
280  MonitorElement * poeem = ibooker.book2D("occeem","Occupancy EEM",100,1,101,100,1,101);
281 
282 
283  MonitorElement * hdiffeb = ibooker.book1D("diffeb","Pedestal Differences EB",100,-2.5,2.5);
284  MonitorElement * hdiffee = ibooker.book1D("diffee","Pedestal Differences EE",100,-2.5,2.5);
285 
287 
289  float mean= newpeds[di].mean_x12;
290  float rms = newpeds[di].rms_x12;
291 
292  float cmean = (*currentPedestals_)[di].mean_x12;
293  float crms = (*currentPedestals_)[di].rms_x12;
294 
295  if (!isGood(di) ) continue; // only good channels are plotted
296 
297  pmeb->Fill(di.iphi(),di.ieta(),mean);
298  preb->Fill(di.iphi(),di.ieta(),rms);
299  if (cmean) pmebd->Fill(di.iphi(),di.ieta(),std::abs(mean-cmean)/cmean);
300  if (crms) prebd->Fill(di.iphi(),di.ieta(),std::abs(rms-crms)/crms);
301  poeb->Fill(di.iphi(),di.ieta(),entriesEB_[hash]);
302  hdiffeb->Fill(mean-cmean);
303  }
304 
305 
307 
309  float mean= newpeds[di].mean_x12;
310  float rms = newpeds[di].rms_x12;
311  float cmean = (*currentPedestals_)[di].mean_x12;
312  float crms = (*currentPedestals_)[di].rms_x12;
313 
314  if (!isGood(di) ) continue; // only good channels are plotted
315 
316  if (di.zside() >0){
317  pmeep->Fill(di.ix(),di.iy(),mean);
318  preep->Fill(di.ix(),di.iy(),rms);
319  poeep->Fill(di.ix(),di.iy(),entriesEE_[hash]);
320  if (cmean) pmeepd->Fill(di.ix(),di.iy(),std::abs(mean-cmean)/cmean);
321  if (crms) preepd->Fill(di.ix(),di.iy(),std::abs(rms-crms)/crms);
322  } else{
323  pmeem->Fill(di.ix(),di.iy(),mean);
324  preem->Fill(di.ix(),di.iy(),rms);
325  if (cmean) pmeemd->Fill(di.ix(),di.iy(),std::abs(mean-cmean)/cmean);
326  poeem->Fill(di.ix(),di.iy(),entriesEE_[hash]);
327  if (crms)preemd->Fill(di.ix(),di.iy(),std::abs(rms-crms)/crms);
328  }
329  hdiffee->Fill(mean-cmean);
330 
331  }
332 
333 
334 
335 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
int ix() const
Definition: EEDetId.h:76
int entriesEE_[EEDetId::kSizeForDenseIndexing]
void Fill(long long x)
int iphi() const
get the crystal iphi
Definition: EBDetId.h:53
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:111
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
int zside() const
Definition: EEDetId.h:70
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int iy() const
Definition: EEDetId.h:82
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
int entriesEB_[EBDetId::kSizeForDenseIndexing]
void ECALpedestalPCLHarvester::endRun ( edm::Run const &  run,
edm::EventSetup const &  isetup 
)
override

Definition at line 175 of file ECALpedestalPCLHarvester.cc.

References channelStatus_, currentPedestals_, g6g1Pedestals_, edm::EventSetup::get(), labelG6G1_, and edm::ESHandle< T >::product().

175  {
176 
177 
179  isetup.get<EcalChannelStatusRcd>().get(chStatus);
180  channelStatus_=chStatus.product();
181 
183  isetup.get<EcalPedestalsRcd>().get(peds);
184  currentPedestals_=peds.product();
185 
187  isetup.get<EcalPedestalsRcd>().get(labelG6G1_,g6g1peds);
188  g6g1Pedestals_=g6g1peds.product();
189 
190 }
const EcalPedestals * g6g1Pedestals_
const EcalChannelStatus * channelStatus_
const EcalPedestals * currentPedestals_
T const * product() const
Definition: ESHandle.h:86
void ECALpedestalPCLHarvester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 167 of file ECALpedestalPCLHarvester.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

167  {
168 
170  desc.setUnknown();
171  descriptions.addDefault(desc);
172 }
void addDefault(ParameterSetDescription const &psetDescription)
bool ECALpedestalPCLHarvester::isGood ( const DetId id)
private

Definition at line 205 of file ECALpedestalPCLHarvester.cc.

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

Referenced by dqmPlots().

205  {
206 
208  dbstatusPtr = channelStatus_->getMap().find(id.rawId());
209  if (dbstatusPtr == channelStatus_->getMap().end())
210  edm::LogError("Invalid DetId supplied");
211  EcalChannelStatusCode::Code dbstatus = dbstatusPtr->getStatusCode();
212  if (dbstatus ==0 ) return true;
213  return false;
214 }
const self & getMap() const
const EcalChannelStatus * channelStatus_
std::vector< Item >::const_iterator const_iterator
const_iterator find(uint32_t rawId) const
const_iterator end() const

Member Data Documentation

const EcalChannelStatus* ECALpedestalPCLHarvester::channelStatus_
private

Definition at line 50 of file ECALpedestalPCLHarvester.h.

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

bool ECALpedestalPCLHarvester::checkAnomalies_
private

Definition at line 61 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and ECALpedestalPCLHarvester().

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

Definition at line 55 of file ECALpedestalPCLHarvester.h.

Referenced by checkStatusCode(), and ECALpedestalPCLHarvester().

const EcalPedestals* ECALpedestalPCLHarvester::currentPedestals_
private

Definition at line 48 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and endRun().

std::string ECALpedestalPCLHarvester::dqmDir_
private

Definition at line 64 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), dqmPlots(), and ECALpedestalPCLHarvester().

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

Definition at line 59 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and dqmPlots().

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

Definition at line 60 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and dqmPlots().

const EcalPedestals* ECALpedestalPCLHarvester::g6g1Pedestals_
private

Definition at line 49 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and endRun().

std::string ECALpedestalPCLHarvester::labelG6G1_
private

Definition at line 65 of file ECALpedestalPCLHarvester.h.

Referenced by ECALpedestalPCLHarvester(), and endRun().

int ECALpedestalPCLHarvester::minEntries_
private

Definition at line 56 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and ECALpedestalPCLHarvester().

double ECALpedestalPCLHarvester::nSigma_
private

Definition at line 62 of file ECALpedestalPCLHarvester.h.

Referenced by checkVariation(), and ECALpedestalPCLHarvester().

float ECALpedestalPCLHarvester::threshChannelsAnalyzed_
private

Definition at line 68 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and ECALpedestalPCLHarvester().

float ECALpedestalPCLHarvester::threshDiffEB_
private

Definition at line 66 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and ECALpedestalPCLHarvester().

float ECALpedestalPCLHarvester::threshDiffEE_
private

Definition at line 67 of file ECALpedestalPCLHarvester.h.

Referenced by dqmEndJob(), and ECALpedestalPCLHarvester().

double ECALpedestalPCLHarvester::thresholdAnomalies_
private

Definition at line 63 of file ECALpedestalPCLHarvester.h.

Referenced by checkVariation(), and ECALpedestalPCLHarvester().