CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::PresampleClient Class Reference

#include <PresampleClient.h>

Inheritance diagram for ecaldqm::PresampleClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

 PresampleClient ()
 
void producePlots (ProcessType) override
 
 ~PresampleClient ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
void bookMEs (DQMStore::IBooker &) override
 
 DQWorkerClient ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void releaseMEs () override
 
void releaseSource ()
 
virtual void resetMEs ()
 
bool retrieveSource (DQMStore::IGetter &, ProcessType)
 
bool runsOn (ProcessType _type) const
 
void setStatusManager (StatusManager const &_manager)
 
virtual ~DQWorkerClient ()
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQWorker ()
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
std::string const & getName () const
 
bool onlineMode () const
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setTime (time_t _t)
 
virtual ~DQWorker ()
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

float expectedMean_
 
int minChannelEntries_
 
float toleranceMean_
 
float toleranceRMS_
 
float toleranceRMSFwd_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerClient
enum  ProcessType { kLumi, kJob, nProcessType }
 
enum  Quality {
  kBad = 0, kGood = 1, kUnknown = 2, kMBad = 3,
  kMGood = 4, kMUnknown = 5
}
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerClient
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Protected Member Functions inherited from ecaldqm::DQWorkerClient
void setME (edm::ParameterSet const &_ps) final
 
void setSource (edm::ParameterSet const &) override
 
void towerAverage_ (MESet &, MESet const &, float)
 
bool using_ (std::string const &_name, ProcessType _type=kJob) const
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorkerClient
bool hasLumiPlots_
 
std::set< std::string > qualitySummaries_
 
MESetCollection sources_
 
StatusManager const * statusManager_
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 8 of file PresampleClient.h.

Constructor & Destructor Documentation

ecaldqm::PresampleClient::PresampleClient ( )

Definition at line 14 of file PresampleClient.cc.

References ecaldqm::DQWorkerClient::qualitySummaries_.

14  :
17  expectedMean_(0.),
18  toleranceMean_(0.),
19  toleranceRMS_(0.),
21  {
22  qualitySummaries_.insert("Quality");
23  qualitySummaries_.insert("QualitySummary");
24  }
std::set< std::string > qualitySummaries_
ecaldqm::PresampleClient::~PresampleClient ( )
inline

Definition at line 11 of file PresampleClient.h.

11 {}

Member Function Documentation

void ecaldqm::PresampleClient::producePlots ( ProcessType  )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 37 of file PresampleClient.cc.

References funct::abs(), ecaldqm::dccId(), EcalBarrel, EcalEndcap, expectedMean_, ecaldqm::MESet::fill(), ecaldqm::MESet::ConstBin::getBinContent(), ecaldqm::MESet::ConstBin::getBinEntries(), ecaldqm::MESet::ConstBin::getBinError(), ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::isForward(), ecaldqm::DQWorkerClient::kBad, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, ecaldqm::DQWorkerClient::kMUnknown, EcalChannelStatusCode::kOk, ecaldqm::DQWorkerClient::kUnknown, timingPdfMaker::mean, ecaldqm::DQWorker::MEs_, minChannelEntries_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, plotscripts::rms(), ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), ecaldqm::DQWorkerClient::statusManager_, ecaldqm::DQWorker::timestamp_, toleranceMean_, toleranceRMS_, toleranceRMSFwd_, ecaldqm::MESet::iterator::toNextChannel(), and ecaldqm::DQWorkerClient::towerAverage_().

38  {
39  MESet& meQualitySummary(MEs_.at("QualitySummary"));
40  MESet& meQuality(MEs_.at("Quality"));
41  MESet& meErrorsSummary(MEs_.at("ErrorsSummary"));
42  MESet& meMean(MEs_.at("Mean"));
43  MESet& meRMS(MEs_.at("RMS"));
44  MESet& meRMSMap(MEs_.at("RMSMap"));
45  MESet& meRMSMapAll(MEs_.at("RMSMapAll"));
46 
47  MESet const& sPedestal(sources_.at("Pedestal"));
48  MESet const& sPedestalByLS(sources_.at("PedestalByLS"));
49  MESet const& sChStatus(sources_.at("ChStatus"));
50 
53 
54  MESet::iterator qEnd(meQuality.end());
55 
56  MESet::const_iterator pItr(sPedestal);
57  MESet::const_iterator pLSItr(sPedestalByLS);
58  double maxEB(0.), minEB(0.), maxEE(0.), minEE(0.);
59  double rmsMaxEB(0.), rmsMaxEE(0.);
60  for(MESet::iterator qItr(meQuality.beginChannel()); qItr != qEnd; qItr.toNextChannel()){
61 
62  pItr = qItr;
63 
64  DetId id(qItr->getId());
65 
66  bool doMask(meQuality.maskMatches(id, mask, statusManager_));
67 
68  double rmsThresh(toleranceRMS_);
69 
70  if(isForward(id)) rmsThresh = toleranceRMSFwd_;
71 
72  double entries(pItr->getBinEntries());
73 
74  if(entries < minChannelEntries_){
75  qItr->setBinContent(doMask ? kMUnknown : kUnknown);
76  meQualitySummary.setBinContent(id, doMask ? kMUnknown : kUnknown);
77  meRMSMap.setBinContent(id, -1.);
78  continue;
79  }
80 
81  double mean(pItr->getBinContent());
82  double rms(pItr->getBinError() * std::sqrt(entries));
83 
84  int dccid(dccId(id));
85 
86  meMean.fill(dccid, mean);
87  meRMS.fill(dccid, rms);
88  meRMSMap.setBinContent(id, rms);
89 
90  if(std::abs(mean - expectedMean_) > toleranceMean_ || rms > rmsThresh){
91  qItr->setBinContent(doMask ? kMBad : kBad);
92  meQualitySummary.setBinContent(id, doMask ? kMBad : kBad);
93  if(!doMask) meErrorsSummary.fill(id);
94  }
95  else{
96  qItr->setBinContent(doMask ? kMGood : kGood);
97  meQualitySummary.setBinContent(id, doMask ? kMGood : kGood);
98  }
99 
100  // Fill Presample Trend plots:
101  // Use PedestalByLS which only contains digis from "current" LS
102  pLSItr = qItr;
103  double entriesLS( pLSItr->getBinEntries() );
104  double meanLS( pLSItr->getBinContent() );
105  double rmsLS( pLSItr->getBinError() * std::sqrt(entries) );
106  float chStatus( sChStatus.getBinContent(id) );
107 
108  if ( entriesLS < minChannelEntries_ ) continue;
109  if ( chStatus != EcalChannelStatusCode::kOk ) continue; // exclude problematic channels
110 
111  // Get max/min
112  // Min is effectively just 0
113  if( id.subdetId() == EcalBarrel ){
114  if( meanLS > maxEB ) maxEB = meanLS;
115  if( meanLS < minEB ) minEB = meanLS;
116  if( rmsLS > rmsMaxEB ) rmsMaxEB = rmsLS;
117  }
118  else {
119  if( meanLS > maxEE ) maxEE = meanLS;
120  if( meanLS < minEE ) minEE = meanLS;
121  if( rmsLS > rmsMaxEE ) rmsMaxEE = rmsLS;
122  }
123 
124  } // qItr
125 
126  towerAverage_(meRMSMapAll, meRMSMap, -1.);
127 
128  MESet& meTrendMean(MEs_.at("TrendMean"));
129  MESet& meTrendRMS(MEs_.at("TrendRMS"));
130  meTrendMean.fill(EcalBarrel, double(timestamp_.iLumi), maxEB - minEB);
131  meTrendMean.fill(EcalEndcap, double(timestamp_.iLumi), maxEE - minEE);
132  meTrendRMS.fill(EcalBarrel, double(timestamp_.iLumi), rmsMaxEB);
133  meTrendRMS.fill(EcalEndcap, double(timestamp_.iLumi), rmsMaxEE);
134  }
void towerAverage_(MESet &, MESet const &, float)
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
bool isForward(DetId const &)
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
T sqrt(T t)
Definition: SSEVec.h:18
StatusManager const * statusManager_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MESetCollection sources_
Definition: DetId.h:18
Timestamp timestamp_
Definition: DQWorker.h:78
static const int PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
MESetCollection MEs_
Definition: DQWorker.h:75
unsigned dccId(DetId const &)
void ecaldqm::PresampleClient::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 27 of file PresampleClient.cc.

References expectedMean_, edm::ParameterSet::getUntrackedParameter(), minChannelEntries_, toleranceMean_, toleranceRMS_, and toleranceRMSFwd_.

28  {
29  minChannelEntries_ = _params.getUntrackedParameter<int>("minChannelEntries");
30  expectedMean_ = _params.getUntrackedParameter<double>("expectedMean");
31  toleranceMean_ = _params.getUntrackedParameter<double>("toleranceMean");
32  toleranceRMS_ = _params.getUntrackedParameter<double>("toleranceRMS");
33  toleranceRMSFwd_ = _params.getUntrackedParameter<double>("toleranceRMSFwd");
34  }

Member Data Documentation

float ecaldqm::PresampleClient::expectedMean_
private

Definition at line 19 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

int ecaldqm::PresampleClient::minChannelEntries_
private

Definition at line 18 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

float ecaldqm::PresampleClient::toleranceMean_
private

Definition at line 20 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

float ecaldqm::PresampleClient::toleranceRMS_
private

Definition at line 21 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

float ecaldqm::PresampleClient::toleranceRMSFwd_
private

Definition at line 22 of file PresampleClient.h.

Referenced by producePlots(), and setParams().