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::TrigPrimClient

Public Types

enum  ProcessType { kLumi, kRun, nProcessType }
 
enum  Quality {
  kBad = 0, kGood = 1, kUnknown = 2, kMBad = 3,
  kMGood = 4, kMUnknown = 5
}
 

Public Member Functions

void bookMEs (DQMStore &) 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 const &, ProcessType)
 
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 &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 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=kRun) 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

std::set< std::string > qualitySummaries_
 
MESetCollection sources_
 
StatusManager const * statusManager_
 
- Protected Attributes inherited from ecaldqm::DQWorker
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 
kRun 
nProcessType 

Definition at line 16 of file DQWorkerClient.h.

Enumerator
kBad 
kGood 
kUnknown 
kMBad 
kMGood 
kMUnknown 

Definition at line 40 of file DQWorkerClient.h.

Constructor & Destructor Documentation

ecaldqm::DQWorkerClient::DQWorkerClient ( )

Definition at line 18 of file DQWorkerClient.cc.

18  :
19  DQWorker(),
20  sources_(),
23  {
24  }
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
MESetCollection sources_
virtual ecaldqm::DQWorkerClient::~DQWorkerClient ( )
inlinevirtual

Definition at line 23 of file DQWorkerClient.h.

23 {}

Member Function Documentation

void ecaldqm::DQWorkerClient::bookMEs ( DQMStore _store)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 78 of file DQWorkerClient.cc.

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

79  {
80  DQWorker::bookMEs(_store);
81  resetMEs();
82  }
virtual void bookMEs(DQMStore &)
Definition: DQWorker.cc:83
void ecaldqm::DQWorkerClient::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 65 of file DQWorkerClient.cc.

References sources_.

66  {
67 // MESetChannel class removed until concurrency issue is finalized
68 #if 0
69  for(MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr){
70  if(!sItr->second->getLumiFlag()) continue;
71  MESetChannel const* channel(dynamic_cast<MESetChannel const*>(sItr->second));
72  if(channel) channel->checkDirectory();
73  }
74 #endif
75  }
MESetCollection sources_
void ecaldqm::DQWorkerClient::fillDescriptions ( edm::ParameterSetDescription _desc)
static

Definition at line 28 of file DQWorkerClient.cc.

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

Referenced by EcalDQMonitorClient::fillDescriptions().

29  {
31  _desc.addWildcardUntracked<std::vector<std::string> >("*");
32 
33  edm::ParameterSetDescription sourceParameters;
34  edm::ParameterSetDescription sourceNodeParameters;
35  fillMESetDescriptions(sourceNodeParameters);
36  sourceParameters.addNode(edm::ParameterWildcard<edm::ParameterSetDescription>("*", edm::RequireZeroOrMore, false, sourceNodeParameters));
37  _desc.addUntracked("sources", sourceParameters);
38  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterWildcardBase * addWildcardUntracked(U const &pattern)
static void fillDescriptions(edm::ParameterSetDescription &_desc)
Definition: DQWorker.cc:30
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 85 of file DQWorkerClient.cc.

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

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

Definition at line 92 of file DQWorkerClient.cc.

References sources_.

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

93  {
94  for(MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr)
95  sItr->second->clear();
96  }
MESetCollection sources_
void ecaldqm::DQWorkerClient::resetMEs ( )

Definition at line 119 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().

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

Definition at line 99 of file DQWorkerClient.cc.

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

Referenced by EcalDQMonitorClient::runWorkers().

100  {
101  int ready(-1);
102 
103  std::string failedPath;
104  for(MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr){
105  if(_type == kLumi && !sItr->second->getLumiFlag()) continue;
106  if(verbosity_ > 1) edm::LogInfo("EcalDQM") << name_ << ": Retrieving source " << sItr->first;
107  if(!sItr->second->retrieve(_store, &failedPath)){
108  ready = 0;
109  if(verbosity_ > 1) edm::LogWarning("EcalDQM") << name_ << ": Could not find source " << sItr->first << "@" << failedPath;
110  break;
111  }
112  ready = 1;
113  }
114 
115  return ready == 1;
116  }
MESetCollection sources_
std::string name_
Definition: DQWorker.h:75
void ecaldqm::DQWorkerClient::setME ( edm::ParameterSet const &  _ps)
inlinefinalprotectedvirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 50 of file DQWorkerClient.h.

References ecaldqm::DQWorker::setME().

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 41 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_.

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

Definition at line 38 of file DQWorkerClient.h.

References statusManager_.

Referenced by EcalDQMonitorClient::EcalDQMonitorClient().

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

Definition at line 152 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().

153  {
154  bool isQuality(_threshold > 0.);
155 
156  MESet::iterator tEnd(_target.end());
157  for(MESet::iterator tItr(_target.beginChannel()); tItr != tEnd; tItr.toNextChannel()){
158  DetId towerId(tItr->getId());
159 
160  std::vector<DetId> cryIds;
161  if(towerId.subdetId() == EcalTriggerTower)
163  else{
165  }
166 
167  if(cryIds.size() == 0) return;
168 
169  float mean(0.);
170  float nValid(0.);
171  bool masked(false);
172  for(unsigned iId(0); iId < cryIds.size(); ++iId){
173  float content(_source.getBinContent(cryIds[iId]));
174  if(isQuality){
175  if(content < 0. || content == 2.) continue;
176  if(content == 5.) masked = true;
177  else{
178  nValid += 1;
179  if(content > 2.){
180  masked = true;
181  mean += content - 3.;
182  }
183  else
184  mean += content;
185  }
186  }
187  else{
188  mean += content;
189  nValid += 1.;
190  }
191  }
192 
193  if(isQuality){
194  if(nValid < 1.) tItr->setBinContent(masked ? 5. : 2.);
195  else{
196  mean /= nValid;
197  if(mean < _threshold) tItr->setBinContent(masked ? 3. : 0.);
198  else tItr->setBinContent(masked ? 4. : 1.);
199  }
200  }
201  else
202  tItr->setBinContent(nValid < 1. ? 0. : mean / nValid);
203  }
204  }
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 = kRun 
) const
inlineprotected

Definition at line 53 of file DQWorkerClient.h.

References kRun, and sources_.

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

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

Member Data Documentation

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