CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
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 ()
 

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_
 

Detailed Description

Definition at line 14 of file DQWorkerClient.h.

Member Enumeration Documentation

Enumerator
kLumi 
kJob 
nProcessType 

Definition at line 16 of file DQWorkerClient.h.

Enumerator
kBad 
kGood 
kUnknown 
kMBad 
kMGood 
kMUnknown 

Definition at line 41 of file DQWorkerClient.h.

Constructor & Destructor Documentation

ecaldqm::DQWorkerClient::DQWorkerClient ( )

Definition at line 18 of file DQWorkerClient.cc.

References hasLumiPlots_, and ecaldqm::DQWorker::MEs_.

18  :
19  DQWorker(),
20  sources_(),
22  hasLumiPlots_(false),
24  {
25  for(MESetCollection::iterator mItr(MEs_.begin()); mItr != MEs_.end(); ++mItr){
26  if(mItr->second->getLumiFlag()){
27  hasLumiPlots_ = true;
28  break;
29  }
30  }
31  }
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
MESetCollection sources_
MESetCollection MEs_
Definition: DQWorker.h:75
virtual ecaldqm::DQWorkerClient::~DQWorkerClient ( )
inlinevirtual

Definition at line 23 of file DQWorkerClient.h.

23 {}

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 85 of file DQWorkerClient.cc.

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

Referenced by EcalDQMonitorClient::dqmEndLuminosityBlock().

86  {
87  DQWorker::bookMEs(_ibooker);
88  resetMEs();
89  }
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:85
void ecaldqm::DQWorkerClient::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Reimplemented in ecaldqm::TowerStatusTask.

Definition at line 72 of file DQWorkerClient.cc.

References sources_.

73  {
74 // MESetChannel class removed until concurrency issue is finalized
75 #if 0
76  for(MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr){
77  if(!sItr->second->getLumiFlag()) continue;
78  MESetChannel const* channel(dynamic_cast<MESetChannel const*>(sItr->second));
79  if(channel) channel->checkDirectory();
80  }
81 #endif
82  }
MESetCollection sources_
void ecaldqm::DQWorkerClient::fillDescriptions ( edm::ParameterSetDescription _desc)
static

Definition at line 35 of file DQWorkerClient.cc.

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

Referenced by EcalDQMonitorClient::fillDescriptions().

36  {
38  _desc.addWildcardUntracked<std::vector<std::string> >("*");
39 
40  edm::ParameterSetDescription sourceParameters;
41  edm::ParameterSetDescription sourceNodeParameters;
42  fillMESetDescriptions(sourceNodeParameters);
43  sourceParameters.addNode(edm::ParameterWildcard<edm::ParameterSetDescription>("*", edm::RequireZeroOrMore, false, sourceNodeParameters));
44  _desc.addUntracked("sources", sourceParameters);
45  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterWildcardBase * addWildcardUntracked(U const &pattern)
static void fillDescriptions(edm::ParameterSetDescription &_desc)
Definition: DQWorker.cc:31
void fillMESetDescriptions(edm::ParameterSetDescription &)
Definition: MESetUtils.cc:129
virtual void ecaldqm::DQWorkerClient::producePlots ( ProcessType  )
pure virtual
void ecaldqm::DQWorkerClient::releaseMEs ( )
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 92 of file DQWorkerClient.cc.

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

93  {
95  releaseSource();
96  }
virtual void releaseMEs()
Definition: DQWorker.cc:77
void ecaldqm::DQWorkerClient::releaseSource ( )

Definition at line 99 of file DQWorkerClient.cc.

References sources_.

Referenced by releaseMEs(), and EcalDQMonitorClient::runWorkers().

100  {
101  for(MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr)
102  sItr->second->clear();
103  }
MESetCollection sources_
void ecaldqm::DQWorkerClient::resetMEs ( )

Definition at line 122 of file DQWorkerClient.cc.

References MonitorElement::DQM_KIND_TH2F, ecaldqm::MESet::getKind(), ecaldqm::MESetMulti::getMultiplicity(), kUnknown, ecaldqm::DQWorker::MEs_, trackerHitRTTI::multi, qualitySummaries_, ecaldqm::MESetMulti::reset(), ecaldqm::MESet::reset(), ecaldqm::MESetMulti::resetAll(), ecaldqm::MESet::resetAll(), and ecaldqm::MESetMulti::use().

Referenced by bookMEs(), and EcalDQMonitorClient::runWorkers().

123  {
124  for(MESetCollection::iterator mItr(MEs_.begin()); mItr != MEs_.end(); ++mItr){
125  MESet* meset(mItr->second);
126 
127  if(qualitySummaries_.find(mItr->first) != qualitySummaries_.end()){
128  MESetMulti* multi(dynamic_cast<MESetMulti*>(meset));
129  if(multi){
130  for(unsigned iS(0); iS < multi->getMultiplicity(); ++iS){
131  multi->use(iS);
132  if(multi->getKind() == MonitorElement::DQM_KIND_TH2F){
133  multi->resetAll(-1.);
134  multi->reset(kUnknown);
135  }
136  else
137  multi->reset(-1.);
138  }
139  }
140  else{
141  if(meset->getKind() == MonitorElement::DQM_KIND_TH2F){
142  meset->resetAll(-1.);
143  meset->reset(kUnknown);
144  }
145  else
146  meset->reset(-1.);
147  }
148  }
149  else
150  meset->reset();
151  }
152  }
std::set< std::string > qualitySummaries_
MESetCollection MEs_
Definition: DQWorker.h:75
bool ecaldqm::DQWorkerClient::retrieveSource ( DQMStore::IGetter _igetter,
ProcessType  _type 
)

Definition at line 106 of file DQWorkerClient.cc.

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

Referenced by EcalDQMonitorClient::runWorkers().

107  {
108  std::string failedPath;
109  for(MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr){
110  if(!onlineMode_ && _type == kLumi && !sItr->second->getLumiFlag()) continue;
111  if(verbosity_ > 1) edm::LogInfo("EcalDQM") << name_ << ": Retrieving source " << sItr->first;
112  if(!sItr->second->retrieve(_igetter, &failedPath)){
113  if(verbosity_ > 1) edm::LogWarning("EcalDQM") << name_ << ": Could not find source " << sItr->first << "@" << failedPath;
114  return false;
115  }
116  }
117 
118  return true;
119  }
MESetCollection sources_
std::string name_
Definition: DQWorker.h:74
bool ecaldqm::DQWorkerClient::runsOn ( ProcessType  _type) const
inline
void ecaldqm::DQWorkerClient::setME ( edm::ParameterSet const &  _ps)
inlinefinalprotectedvirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 51 of file DQWorkerClient.h.

References ecaldqm::DQWorker::setME().

51 { DQWorker::setME(_ps); }
virtual void setME(edm::ParameterSet const &)
Definition: DQWorker.cc:56
void ecaldqm::DQWorkerClient::setSource ( edm::ParameterSet const &  _params)
overrideprotectedvirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 48 of file DQWorkerClient.cc.

References ecaldqm::createMESet(), edm::ParameterSet::getParameterNames(), edm::ParameterSet::getUntrackedParameterSet(), mergeVDriftHistosByStation::name, ecaldqm::DQWorker::name_, ecaldqm::DQWorker::onlineMode_, sources_, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::DQWorker::verbosity_.

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

Definition at line 39 of file DQWorkerClient.h.

References statusManager_.

Referenced by EcalDQMonitorClient::EcalDQMonitorClient().

39 { statusManager_ = &_manager; }
StatusManager const * statusManager_
void ecaldqm::DQWorkerClient::towerAverage_ ( MESet _target,
MESet const &  _source,
float  _threshold 
)
protected

Definition at line 155 of file DQWorkerClient.cc.

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

156  {
157  bool isQuality(_threshold > 0.);
158 
159  MESet::iterator tEnd(_target.end());
160  for(MESet::iterator tItr(_target.beginChannel()); tItr != tEnd; tItr.toNextChannel()){
161  DetId towerId(tItr->getId());
162 
163  std::vector<DetId> cryIds;
164  if(towerId.subdetId() == EcalTriggerTower)
166  else{
168  }
169 
170  if(cryIds.size() == 0) return;
171 
172  float mean(0.);
173  float nValid(0.);
174  bool masked(false);
175  for(unsigned iId(0); iId < cryIds.size(); ++iId){
176  float content(_source.getBinContent(cryIds[iId]));
177  if(isQuality){
178  if(content < 0. || content == 2.) continue;
179  if(content == 5.) masked = true;
180  else{
181  nValid += 1;
182  if(content > 2.){
183  masked = true;
184  mean += content - 3.;
185  }
186  else
187  mean += content;
188  }
189  }
190  else{
191  mean += content;
192  nValid += 1.;
193  }
194  }
195 
196  if(isQuality){
197  if(nValid < 1.) tItr->setBinContent(masked ? 5. : 2.);
198  else{
199  mean /= nValid;
200  if(mean < _threshold) tItr->setBinContent(masked ? 3. : 0.);
201  else tItr->setBinContent(masked ? 4. : 1.);
202  }
203  }
204  else
205  tItr->setBinContent(nValid < 1. ? 0. : mean / nValid);
206  }
207  }
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
unsigned towerId(DetId const &)
Definition: DetId.h:18
std::vector< DetId > scConstituents(EcalScDetId const &)
bool ecaldqm::DQWorkerClient::using_ ( std::string const &  _name,
ProcessType  _type = kJob 
) const
inlineprotected

Definition at line 54 of file DQWorkerClient.h.

References kJob, and sources_.

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

55  {
56  MESetCollection::const_iterator itr(sources_.find(_name));
57  if(itr == sources_.end()) return false;
58  if(_type == kJob) return true;
59  else return itr->second->getLumiFlag();
60  }
MESetCollection sources_

Member Data Documentation

bool ecaldqm::DQWorkerClient::hasLumiPlots_
protected

Definition at line 67 of file DQWorkerClient.h.

Referenced by DQWorkerClient(), and runsOn().

std::set<std::string> ecaldqm::DQWorkerClient::qualitySummaries_
protected
MESetCollection ecaldqm::DQWorkerClient::sources_
protected
StatusManager const* ecaldqm::DQWorkerClient::statusManager_
protected