CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | 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::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 }
 
enum  Quality {
  kBad = 0, kGood = 1, kUnknown = 2, kMBad = 3,
  kMGood = 4, kMUnknown = 5
}
 

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)
 
 ~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 &)
 
 DQWorker ()
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
const std::string & 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 () 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)
 

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

- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Detailed Description

Definition at line 13 of file DQWorkerClient.h.

Member Enumeration Documentation

◆ ProcessType

Enumerator
kLumi 
kJob 
nProcessType 

Definition at line 15 of file DQWorkerClient.h.

15 { kLumi, kJob, nProcessType };

◆ Quality

Enumerator
kBad 
kGood 
kUnknown 
kMBad 
kMGood 
kMUnknown 

Definition at line 37 of file DQWorkerClient.h.

37 { kBad = 0, kGood = 1, kUnknown = 2, kMBad = 3, kMGood = 4, kMUnknown = 5 };

Constructor & Destructor Documentation

◆ DQWorkerClient()

ecaldqm::DQWorkerClient::DQWorkerClient ( )

Definition at line 17 of file DQWorkerClient.cc.

18  : DQWorker(), sources_(), qualitySummaries_(), hasLumiPlots_(false), statusManager_(nullptr) {}

◆ ~DQWorkerClient()

ecaldqm::DQWorkerClient::~DQWorkerClient ( )
inlineoverride

Definition at line 18 of file DQWorkerClient.h.

18 {}

Member Function Documentation

◆ bookMEs()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 81 of file DQWorkerClient.cc.

81  {
82  DQWorker::bookMEs(_ibooker);
83  resetMEs();
84  }

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

◆ endLuminosityBlock()

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

Reimplemented from ecaldqm::DQWorker.

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

Definition at line 70 of file DQWorkerClient.cc.

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  }

References sources_.

◆ fillDescriptions()

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

Definition at line 21 of file DQWorkerClient.cc.

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  }

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

Referenced by EcalDQMonitorClient::fillDescriptions().

◆ 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.

86  {
88  releaseSource();
89  }

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

◆ releaseSource()

void ecaldqm::DQWorkerClient::releaseSource ( )

Definition at line 91 of file DQWorkerClient.cc.

91  {
92  for (MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr)
93  sItr->second->clear();
94  }

References sources_.

Referenced by releaseMEs().

◆ resetMEs()

void ecaldqm::DQWorkerClient::resetMEs ( )
virtual

Reimplemented in ecaldqm::SummaryClient.

Definition at line 113 of file DQWorkerClient.cc.

113  {
114  for (MESetCollection::iterator mItr(MEs_.begin()); mItr != MEs_.end(); ++mItr) {
115  MESet* meset(mItr->second);
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(kUnknown);
130  } else
131  multi->reset(-1.);
132  }
133  } else {
134  if (meset->getKind() == MonitorElement::Kind::TH2F) {
135  meset->resetAll(-1.);
136  meset->reset(kUnknown);
137  } else
138  meset->reset(-1.);
139  }
140  } else
141  meset->reset();
142  }
143  }

References ecaldqm::MESet::getBinType(), ecaldqm::MESet::getKind(), ecaldqm::binning::kTrend, kUnknown, ecaldqm::DQWorker::MEs_, trackerHitRTTI::multi, qualitySummaries_, ecaldqm::MESet::reset(), ecaldqm::MESet::resetAll(), and MonitorElementData::TH2F.

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

◆ resetPerLumi()

void ecaldqm::DQWorkerClient::resetPerLumi ( )

Definition at line 145 of file DQWorkerClient.cc.

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  }

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

◆ retrieveSource()

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

Definition at line 96 of file DQWorkerClient.cc.

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(_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  }

References kLumi, ecaldqm::DQWorker::name_, ecaldqm::DQWorker::onlineMode_, sources_, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::DQWorker::verbosity_.

◆ runsOn()

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

Definition at line 31 of file DQWorkerClient.h.

31 { return _type == kJob || hasLumiPlots_; }

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.

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 (MESetCollection::iterator mItr(MEs_.begin()); mItr != MEs_.end(); ++mItr) {
40  if (mItr->second->getLumiFlag()) {
41  hasLumiPlots_ = true;
42  break;
43  }
44  }
45  }

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

◆ setSource()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 47 of file DQWorkerClient.cc.

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 
57  sources_.insert(name, createMESet(params));
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  }

References l1extraParticles_cfi::_params, ecaldqm::createMESet(), Skims_PA_cff::name, ecaldqm::DQWorker::name_, ecaldqm::DQWorker::onlineMode_, CalibrationSummaryClient_cfi::params, sources_, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::DQWorker::verbosity_.

◆ setStatusManager()

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

Definition at line 35 of file DQWorkerClient.h.

35 { statusManager_ = &_manager; }

References statusManager_.

◆ towerAverage_()

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

Definition at line 159 of file DQWorkerClient.cc.

159  {
160  bool isQuality(_threshold > 0.);
161 
162  MESet::iterator tEnd(_target.end());
163  for (MESet::iterator tItr(_target.beginChannel()); tItr != tEnd; tItr.toNextChannel()) {
164  DetId towerId(tItr->getId());
165 
166  std::vector<DetId> cryIds;
167  if (towerId.subdetId() == EcalTriggerTower)
169  else {
171  }
172 
173  if (cryIds.empty())
174  return;
175 
176  float mean(0.);
177  float nValid(0.);
178  bool masked(false);
179  for (unsigned iId(0); iId < cryIds.size(); ++iId) {
180  float content(_source.getBinContent(cryIds[iId]));
181  if (isQuality) {
182  if (content < 0. || content == 2.)
183  continue;
184  if (content == 5.)
185  masked = true;
186  else {
187  nValid += 1;
188  if (content > 2.) {
189  masked = true;
190  mean += content - 3.;
191  } else
192  mean += content;
193  }
194  } else {
195  mean += content;
196  nValid += 1.;
197  }
198  }
199 
200  if (isQuality) {
201  if (nValid < 1.)
202  tItr->setBinContent(masked ? 5. : 2.);
203  else {
204  mean /= nValid;
205  if (mean < _threshold)
206  tItr->setBinContent(masked ? 3. : 0.);
207  else
208  tItr->setBinContent(masked ? 4. : 1.);
209  }
210  } else
211  tItr->setBinContent(nValid < 1. ? 0. : mean / nValid);
212  }
213  }

References ecaldqm::MESet::beginChannel(), EcalTrigTowerConstituentsMap::constituentsOf(), Skims_PA_cff::content, EcalTriggerTower, ecaldqm::MESet::end(), ecaldqm::MESet::getBinContent(), ecaldqm::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().

◆ using_()

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

Definition at line 43 of file DQWorkerClient.h.

43  {
44  MESetCollection::const_iterator itr(sources_.find(_name));
45  if (itr == sources_.end())
46  return false;
47  if (_type == kJob)
48  return true;
49  else
50  return itr->second->getLumiFlag();
51  }

References kJob, and sources_.

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

Member Data Documentation

◆ hasLumiPlots_

bool ecaldqm::DQWorkerClient::hasLumiPlots_
protected

Definition at line 58 of file DQWorkerClient.h.

Referenced by runsOn(), and setME().

◆ qualitySummaries_

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

◆ sources_

MESetCollection ecaldqm::DQWorkerClient::sources_
protected

◆ statusManager_

StatusManager const* ecaldqm::DQWorkerClient::statusManager_
protected
mps_fire.i
i
Definition: mps_fire.py:355
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
ecaldqm::DQWorker::name_
std::string name_
Definition: DQWorker.h:77
edm::ParameterWildcard
Definition: ParameterWildcard.h:23
ecaldqm::fillMESetDescriptions
void fillMESetDescriptions(edm::ParameterSetDescription &)
Definition: MESetUtils.cc:144
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::DQWorkerClient::statusManager_
StatusManager const * statusManager_
Definition: DQWorkerClient.h:60
ecaldqm::DQWorker::bookMEs
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:66
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
ecaldqm::DQWorkerClient::hasLumiPlots_
bool hasLumiPlots_
Definition: DQWorkerClient.h:58
ecaldqm::DQWorker::releaseMEs
virtual void releaseMEs()
Definition: DQWorker.cc:60
MonitorElementData::Kind::TH2F
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DetId
Definition: DetId.h:17
ecaldqm::DQWorkerClient::qualitySummaries_
std::set< std::string > qualitySummaries_
Definition: DQWorkerClient.h:56
ecaldqm::DQWorkerClient::kJob
Definition: DQWorkerClient.h:15
EcalScDetId
Definition: EcalScDetId.h:24
ecaldqm::DQWorker::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &_desc)
Definition: DQWorker.cc:19
edm::ParameterSetDescription::addWildcardUntracked
ParameterWildcardBase * addWildcardUntracked(U const &pattern)
Definition: ParameterSetDescription.h:204
ecaldqm::DQWorkerClient::kLumi
Definition: DQWorkerClient.h:15
ecaldqm::DQWorkerClient::resetMEs
virtual void resetMEs()
Definition: DQWorkerClient.cc:113
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:78
ecaldqm::DQWorkerClient::kMBad
Definition: DQWorkerClient.h:37
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ecaldqm::DQWorkerClient::kUnknown
Definition: DQWorkerClient.h:37
ecaldqm::DQWorkerClient::kBad
Definition: DQWorkerClient.h:37
edm::LogWarning
Definition: MessageLogger.h:141
ecaldqm::DQWorker::onlineMode_
bool onlineMode_
Definition: DQWorker.h:85
ecaldqm::DQWorkerClient::sources_
MESetCollection sources_
Definition: DQWorkerClient.h:55
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
ecaldqm::DQWorkerClient::kMGood
Definition: DQWorkerClient.h:37
Skims_PA_cff.content
content
Definition: Skims_PA_cff.py:19
edm::ParameterSet
Definition: ParameterSet.h:36
ecaldqm::DQWorkerClient::nProcessType
Definition: DQWorkerClient.h:15
ecaldqm::DQWorkerClient::kMUnknown
Definition: DQWorkerClient.h:37
trackerHitRTTI::multi
Definition: trackerHitRTTI.h:14
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
ecaldqm::getTrigTowerMap
const EcalTrigTowerConstituentsMap * getTrigTowerMap()
Definition: EcalDQMCommonUtils.cc:458
ecaldqm::DQWorker::setME
virtual void setME(edm::ParameterSet const &)
Definition: DQWorker.cc:41
ecaldqm::scConstituents
std::vector< DetId > scConstituents(EcalScDetId const &)
Definition: EcalDQMCommonUtils.cc:173
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition: EcalDQMCommonUtils.cc:79
EcalTriggerTower
Definition: EcalSubdetector.h:10
EcalTrigTowerConstituentsMap::constituentsOf
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
Definition: EcalTrigTowerConstituentsMap.cc:162
ecaldqm::createMESet
MESet * createMESet(edm::ParameterSet const &)
Definition: MESetUtils.cc:18
ecaldqm::DQWorkerClient::kGood
Definition: DQWorkerClient.h:37
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
ecaldqm::DQWorker::verbosity_
int verbosity_
Definition: DQWorker.h:82
ecaldqm::binning::kTrend
Definition: MESetBinningUtils.h:52
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:56
edm::RequireZeroOrMore
Definition: ParameterWildcardBase.h:17
ecaldqm::DQWorker::DQWorker
DQWorker()
Definition: DQWorker.cc:13
ecaldqm::DQWorkerClient::releaseSource
void releaseSource()
Definition: DQWorkerClient.cc:91