CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
ecaldqm::DQWorkerClient Class Referenceabstract

#include <DQWorkerClient.h>

Inheritance diagram for ecaldqm::DQWorkerClient:
ecaldqm::DQWorker ecaldqm::CalibrationSummaryClient ecaldqm::CertificationClient ecaldqm::IntegrityClient ecaldqm::LaserClient ecaldqm::LedClient ecaldqm::MLClient ecaldqm::OccupancyClient ecaldqm::PedestalClient ecaldqm::PNIntegrityClient ecaldqm::PresampleClient ecaldqm::RawDataClient ecaldqm::SelectiveReadoutClient ecaldqm::SummaryClient ecaldqm::TestPulseClient ecaldqm::TimingClient ecaldqm::TowerStatusTask ecaldqm::TrigPrimClient

Public Types

enum  ProcessType { kLumi, kJob, nProcessType }
 

Public Member Functions

void bookMEs (DQMStore::IBooker &) override
 
 DQWorkerClient ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void producePlots (ProcessType)=0
 
void releaseMEs () override
 
void releaseSource ()
 
virtual void resetMEs ()
 
void resetPerLumi ()
 
bool retrieveSource (DQMStore::IGetter &, ProcessType)
 
bool runsOn (ProcessType _type) const
 
void setStatusManager (StatusManager const &_manager)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerClient () override
 
- 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 &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
bool onlineMode () const
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 

Static Public Attributes

static constexpr int kBad = 0
 
static constexpr int kGood = 1
 
static constexpr int kMBad = 3
 
static constexpr int kMGood = 4
 
static constexpr int kMUnknown = 5
 
static constexpr int kUnknown = 2
 

Protected Member Functions

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
 
virtual void setParams (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 

Protected Attributes

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_
 

Additional Inherited Members

- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Detailed Description

Definition at line 17 of file DQWorkerClient.h.

Member Enumeration Documentation

◆ ProcessType

Constructor & Destructor Documentation

◆ DQWorkerClient()

ecaldqm::DQWorkerClient::DQWorkerClient ( )

Definition at line 17 of file DQWorkerClient.cc.

18  : DQWorker(), sources_(), qualitySummaries_(), hasLumiPlots_(false), statusManager_(nullptr) {}
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
MESetCollection sources_

◆ ~DQWorkerClient()

ecaldqm::DQWorkerClient::~DQWorkerClient ( )
inlineoverride

Definition at line 22 of file DQWorkerClient.h.

22 {}

Member Function Documentation

◆ bookMEs()

void ecaldqm::DQWorkerClient::bookMEs ( DQMStore::IBooker _ibooker)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 81 of file DQWorkerClient.cc.

References ecaldqm::DQWorker::bookMEs(), and resetMEs().

81  {
82  DQWorker::bookMEs(_ibooker);
83  resetMEs();
84  }
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:96

◆ endLuminosityBlock()

void ecaldqm::DQWorkerClient::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Reimplemented in ecaldqm::TowerStatusTask, and ecaldqm::IntegrityClient.

Definition at line 70 of file DQWorkerClient.cc.

References ecaldqm::MESetCollection::begin(), ecaldqm::MESetCollection::end(), and sources_.

70  {
71 // MESetChannel class removed until concurrency issue is finalized
72 #if 0
73  for(MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr){
74  if(!sItr->second->getLumiFlag()) continue;
75  MESetChannel const* channel(dynamic_cast<MESetChannel const*>(sItr->second));
76  if(channel) channel->checkDirectory();
77  }
78 #endif
79  }
auto end() const
Definition: MESet.h:393
MESetCollection sources_
MESetColletionType::iterator iterator
Definition: MESet.h:384

◆ fillDescriptions()

void ecaldqm::DQWorkerClient::fillDescriptions ( edm::ParameterSetDescription _desc)
static

Definition at line 21 of file DQWorkerClient.cc.

References edm::ParameterSetDescription::addUntracked(), edm::ParameterSetDescription::addWildcardUntracked(), ecaldqm::DQWorker::fillDescriptions(), ecaldqm::fillMESetDescriptions(), and edm::RequireZeroOrMore.

Referenced by EcalDQMonitorClient::fillDescriptions().

21  {
23  _desc.addWildcardUntracked<std::vector<std::string> >("*");
24 
25  edm::ParameterSetDescription sourceParameters;
26  edm::ParameterSetDescription sourceNodeParameters;
27  fillMESetDescriptions(sourceNodeParameters);
28  sourceParameters.addNode(
30  _desc.addUntracked("sources", sourceParameters);
31  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterWildcardBase * addWildcardUntracked(U const &pattern)
static void fillDescriptions(edm::ParameterSetDescription &_desc)
Definition: DQWorker.cc:37
void fillMESetDescriptions(edm::ParameterSetDescription &)
Definition: MESetUtils.cc:144

◆ producePlots()

virtual void ecaldqm::DQWorkerClient::producePlots ( ProcessType  )
pure virtual

◆ releaseMEs()

void ecaldqm::DQWorkerClient::releaseMEs ( )
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 86 of file DQWorkerClient.cc.

References ecaldqm::DQWorker::releaseMEs(), and releaseSource().

86  {
88  releaseSource();
89  }
virtual void releaseMEs()
Definition: DQWorker.cc:90

◆ releaseSource()

void ecaldqm::DQWorkerClient::releaseSource ( )

Definition at line 91 of file DQWorkerClient.cc.

References ecaldqm::MESetCollection::begin(), ecaldqm::MESetCollection::end(), and sources_.

Referenced by releaseMEs().

91  {
92  for (MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr)
93  sItr->second->clear();
94  }
auto end() const
Definition: MESet.h:393
MESetCollection sources_
MESetColletionType::iterator iterator
Definition: MESet.h:384

◆ resetMEs()

void ecaldqm::DQWorkerClient::resetMEs ( )
virtual

Reimplemented in ecaldqm::SummaryClient.

Definition at line 113 of file DQWorkerClient.cc.

References ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::binning::kTrend, kUnknown, ecaldqm::DQWorker::MEs_, trackerHitRTTI::multi, qualitySummaries_, and MonitorElementData::TH2F.

Referenced by bookMEs(), and ecaldqm::SummaryClient::resetMEs().

113  {
114  for (auto& mItr : MEs_) {
115  MESet* meset(mItr.second.get());
116 
117  // Protects Trend-type Client MEs from being reset at the end of the LS
118  // See: EcalDQMonitorClient::runWorkers
119  if (meset->getBinType() == ecaldqm::binning::kTrend)
120  continue;
121 
122  if (qualitySummaries_.find(mItr.first) != qualitySummaries_.end()) {
123  MESetMulti* multi(dynamic_cast<MESetMulti*>(meset));
124  if (multi) {
125  for (unsigned iS(0); iS < multi->getMultiplicity(); ++iS) {
126  multi->use(iS);
127  if (multi->getKind() == MonitorElement::Kind::TH2F) {
128  multi->resetAll(-1.);
129  multi->reset(GetElectronicsMap(), kUnknown);
130  } else
131  multi->reset(GetElectronicsMap(), -1.);
132  }
133  } else {
134  if (meset->getKind() == MonitorElement::Kind::TH2F) {
135  meset->resetAll(-1.);
136  meset->reset(GetElectronicsMap(), kUnknown);
137  } else
138  meset->reset(GetElectronicsMap(), -1.);
139  }
140  } else
141  meset->reset(GetElectronicsMap());
142  }
143  }
static constexpr int kUnknown
std::set< std::string > qualitySummaries_
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
MESetCollection MEs_
Definition: DQWorker.h:131

◆ resetPerLumi()

void ecaldqm::DQWorkerClient::resetPerLumi ( )

Definition at line 145 of file DQWorkerClient.cc.

References mps_fire::i, hlt_dqm_clientPB-live_cfg::me, and ecaldqm::DQWorker::MEs_.

145  {
146  for (auto const& meset : MEs_) {
147  int i = 0;
148  while (auto me = meset.second->getME(i)) {
149  if (me->getLumiFlag()) {
150  // reset per-lumi histograms in offline harvesting so that they only show
151  // data of the current lumisection.
152  me->Reset();
153  }
154  i++;
155  }
156  }
157  }
MESetCollection MEs_
Definition: DQWorker.h:131

◆ retrieveSource()

bool ecaldqm::DQWorkerClient::retrieveSource ( DQMStore::IGetter _igetter,
ProcessType  _type 
)

Definition at line 96 of file DQWorkerClient.cc.

References ecaldqm::MESetCollection::begin(), ecaldqm::MESetCollection::end(), ecaldqm::DQWorker::GetElectronicsMap(), kLumi, ecaldqm::DQWorker::name_, ecaldqm::DQWorker::onlineMode_, sources_, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::DQWorker::verbosity_.

96  {
97  std::string failedPath;
98  for (MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr) {
99  if (!onlineMode_ && _type == kLumi && !sItr->second->getLumiFlag())
100  continue;
101  if (verbosity_ > 1)
102  edm::LogInfo("EcalDQM") << name_ << ": Retrieving source " << sItr->first;
103  if (!sItr->second->retrieve(GetElectronicsMap(), _igetter, &failedPath)) {
104  if (verbosity_ > 1)
105  edm::LogWarning("EcalDQM") << name_ << ": Could not find source " << sItr->first << "@" << failedPath;
106  return false;
107  }
108  }
109 
110  return true;
111  }
auto end() const
Definition: MESet.h:393
MESetCollection sources_
MESetColletionType::iterator iterator
Definition: MESet.h:384
Log< level::Info, false > LogInfo
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
Log< level::Warning, false > LogWarning
std::string name_
Definition: DQWorker.h:130

◆ runsOn()

bool ecaldqm::DQWorkerClient::runsOn ( ProcessType  _type) const
inline

Definition at line 35 of file DQWorkerClient.h.

References hasLumiPlots_, and kJob.

◆ setME()

void ecaldqm::DQWorkerClient::setME ( edm::ParameterSet const &  _ps)
finalprotectedvirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 33 of file DQWorkerClient.cc.

References hasLumiPlots_, ecaldqm::DQWorker::MEs_, and ecaldqm::DQWorker::setME().

33  {
34  DQWorker::setME(_ps);
35 
36  // Flags the Client ME to run as lumibased:
37  // In offline mode will save the ME client at the end of the LS
38  // See: EcalDQMonitorClient::dqmEndLuminosityBlock
39  for (auto& mItr : MEs_) {
40  if (mItr.second->getLumiFlag()) {
41  hasLumiPlots_ = true;
42  break;
43  }
44  }
45  }
virtual void setME(edm::ParameterSet const &)
Definition: DQWorker.cc:71
MESetCollection MEs_
Definition: DQWorker.h:131

◆ setSource()

void ecaldqm::DQWorkerClient::setSource ( edm::ParameterSet const &  _params)
overrideprotectedvirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 47 of file DQWorkerClient.cc.

References l1extraParticles_cfi::_params, ecaldqm::MESetCollection::begin(), ecaldqm::createMESet(), ecaldqm::MESetCollection::end(), ecaldqm::MESetCollection::insert(), Skims_PA_cff::name, ecaldqm::DQWorker::name_, ecaldqm::DQWorker::onlineMode_, submitPVValidationJobs::params, sources_, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::DQWorker::verbosity_.

47  {
48  std::vector<std::string> const& sourceNames(_params.getParameterNames());
49 
50  for (unsigned iS(0); iS < sourceNames.size(); iS++) {
51  std::string name(sourceNames[iS]);
52  edm::ParameterSet const& params(_params.getUntrackedParameterSet(name));
53 
54  if (onlineMode_ && params.getUntrackedParameter<bool>("online"))
55  continue;
56 
58  }
59 
60  if (verbosity_ > 1) {
61  std::stringstream ss;
62  ss << name_ << ": Using ";
63  for (MESetCollection::const_iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr)
64  ss << sItr->first << " ";
65  ss << "as sources";
66  edm::LogInfo("EcalDQM") << ss.str();
67  }
68  }
auto end() const
Definition: MESet.h:393
void insert(const std::string &key, MESet *ptr)
Definition: MESet.h:387
MESetColletionType::const_iterator const_iterator
Definition: MESet.h:385
MESetCollection sources_
MESet * createMESet(edm::ParameterSet const &)
Definition: MESetUtils.cc:18
std::string name_
Definition: DQWorker.h:130

◆ setStatusManager()

void ecaldqm::DQWorkerClient::setStatusManager ( StatusManager const &  _manager)
inline

Definition at line 42 of file DQWorkerClient.h.

References statusManager_.

42 { statusManager_ = &_manager; }
StatusManager const * statusManager_

◆ setTokens()

virtual void ecaldqm::DQWorkerClient::setTokens ( edm::ConsumesCollector )
inlinevirtual

Reimplemented in ecaldqm::TowerStatusTask, and ecaldqm::IntegrityClient.

Definition at line 40 of file DQWorkerClient.h.

Referenced by EcalDQMonitorClient::EcalDQMonitorClient().

40 {}

◆ towerAverage_()

void ecaldqm::DQWorkerClient::towerAverage_ ( MESet _target,
MESet const &  _source,
float  _threshold 
)
protected

Definition at line 159 of file DQWorkerClient.cc.

References ecaldqm::MESet::beginChannel(), EcalTrigTowerConstituentsMap::constituentsOf(), Skims_PA_cff::content, EcalTriggerTower, ecaldqm::MESet::end(), ecaldqm::MESet::getBinContent(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::DQWorker::GetTrigTowerMap(), SiStripPI::mean, ecaldqm::scConstituents(), ecaldqm::MESet::iterator::toNextChannel(), and ecaldqm::towerId().

Referenced by ecaldqm::LaserClient::producePlots(), ecaldqm::TestPulseClient::producePlots(), ecaldqm::PresampleClient::producePlots(), ecaldqm::PedestalClient::producePlots(), and ecaldqm::LedClient::producePlots().

159  {
160  bool isQuality(_threshold > 0.);
161 
162  MESet::iterator tEnd(_target.end(GetElectronicsMap()));
163  for (MESet::iterator tItr(_target.beginChannel(GetElectronicsMap())); tItr != tEnd;
164  tItr.toNextChannel(GetElectronicsMap())) {
165  DetId towerId(tItr->getId());
166 
167  std::vector<DetId> cryIds;
168  if (towerId.subdetId() == EcalTriggerTower)
170  else {
172  }
173 
174  if (cryIds.empty())
175  return;
176 
177  float mean(0.);
178  float nValid(0.);
179  bool masked(false);
180  for (unsigned iId(0); iId < cryIds.size(); ++iId) {
181  float content(_source.getBinContent(getEcalDQMSetupObjects(), cryIds[iId]));
182  if (isQuality) {
183  if (content < 0. || content == 2.)
184  continue;
185  if (content == 5.)
186  masked = true;
187  else {
188  nValid += 1;
189  if (content > 2.) {
190  masked = true;
191  mean += content - 3.;
192  } else
193  mean += content;
194  }
195  } else {
196  mean += content;
197  nValid += 1.;
198  }
199  }
200 
201  if (isQuality) {
202  if (nValid < 1.)
203  tItr->setBinContent(masked ? 5. : 2.);
204  else {
205  mean /= nValid;
206  if (mean < _threshold)
207  tItr->setBinContent(masked ? 3. : 0.);
208  else
209  tItr->setBinContent(masked ? 4. : 1.);
210  }
211  } else
212  tItr->setBinContent(nValid < 1. ? 0. : mean / nValid);
213  }
214  }
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
std::vector< DetId > scConstituents(EcalScDetId const &)
EcalTrigTowerConstituentsMap const * GetTrigTowerMap()
Definition: DQWorker.cc:155

◆ using_()

bool ecaldqm::DQWorkerClient::using_ ( std::string const &  _name,
ProcessType  _type = kJob 
) const
inlineprotected

Definition at line 50 of file DQWorkerClient.h.

References ecaldqm::MESetCollection::end(), ecaldqm::MESetCollection::find(), kJob, and sources_.

Referenced by ecaldqm::CalibrationSummaryClient::producePlots(), ecaldqm::SummaryClient::producePlots(), and ecaldqm::CalibrationSummaryClient::setParams().

50  {
52  if (itr == sources_.end())
53  return false;
54  if (_type == kJob)
55  return true;
56  else
57  return itr->second->getLumiFlag();
58  }
auto end() const
Definition: MESet.h:393
MESetColletionType::const_iterator const_iterator
Definition: MESet.h:385
const_iterator find(const std::string &key) const
Definition: MESet.h:395
MESetCollection sources_

Member Data Documentation

◆ hasLumiPlots_

bool ecaldqm::DQWorkerClient::hasLumiPlots_
protected

Definition at line 65 of file DQWorkerClient.h.

Referenced by runsOn(), and setME().

◆ kBad

constexpr int ecaldqm::DQWorkerClient::kBad = 0
static

◆ kGood

constexpr int ecaldqm::DQWorkerClient::kGood = 1
static

◆ kMBad

constexpr int ecaldqm::DQWorkerClient::kMBad = 3
static

◆ kMGood

constexpr int ecaldqm::DQWorkerClient::kMGood = 4
static

◆ kMUnknown

constexpr int ecaldqm::DQWorkerClient::kMUnknown = 5
static

◆ kUnknown

constexpr int ecaldqm::DQWorkerClient::kUnknown = 2
static

◆ qualitySummaries_

std::set<std::string> ecaldqm::DQWorkerClient::qualitySummaries_
protected

◆ sources_

MESetCollection ecaldqm::DQWorkerClient::sources_
protected

◆ statusManager_

StatusManager const* ecaldqm::DQWorkerClient::statusManager_
protected