CMS 3D CMS Logo

DQWorkerTask.cc
Go to the documentation of this file.
2 
6 
7 namespace ecaldqm
8 {
10  DQWorker(),
11  resettable_()
12  {
13  }
14 
15  /*static*/
16  void
18  {
20  }
21 
22  void
24  {
25  DQWorker::setME(_ps);
26 
27  for(MESetCollection::iterator mItr(MEs_.begin()); mItr != MEs_.end(); ++mItr){
28  if(willConvertToEDM_) mItr->second->setBatchMode();
29 
30  // TEMPORARY MEASURE - softReset does not accept variable bin size as of September 2012
31  // isVariableBinning is true for 1. MESetEcal or MESetNonObject with any custom binning or 2. MESetTrend
32  // In principle it is sufficient to protect the MESetTrends from being reset
33  if(mItr->second->getBinType() != ecaldqm::binning::kTrend &&
34  !mItr->second->isVariableBinning() &&
35  mItr->second->getKind() != MonitorElement::DQM_KIND_REAL)
36  resettable_.insert(mItr->first);
37  }
38  }
39 
40  void
42  {
43  std::for_each(resettable_.begin(), resettable_.end(), [this](std::string const& name){
44  this->MEs_.at(name).softReset();
45  });
46  }
47 
48  void
50  {
51  std::for_each(resettable_.begin(), resettable_.end(), [this](std::string const& name){
52  this->MEs_.at(name).recoverStats();
53  });
54  }
55 
56  void
57  DependencySet::formSequenceFragment_(Dependency const& _d, std::vector<Collections>& _sequence, std::vector<Collections>::iterator _maxPos) const
58  {
60  std::vector<Collections>::iterator pos(std::find(_sequence.begin(), _sequence.end(), col));
61  if(pos == _sequence.end()) _sequence.insert(_maxPos, col);
62  else if(pos < _maxPos) return;
63  else
64  throw cms::Exception("InvalidConfiguration") << "Circular dependency of collections";
65 
66  for(std::set<Collections>::const_iterator rItr(_d.requisite.begin()); rItr != _d.requisite.end(); ++rItr){
67  for(std::vector<Dependency>::const_iterator dItr(set_.begin()); dItr != set_.end(); ++dItr){
68  if(dItr->dependant != *rItr) continue;
69  pos = std::find(_sequence.begin(), _sequence.end(), col);
70  formSequenceFragment_(*dItr, _sequence, pos);
71  break;
72  }
73  }
74  }
75 
76 }
77 
Collections dependant
Definition: DQWorkerTask.h:22
static void fillDescriptions(edm::ParameterSetDescription &)
Definition: DQWorkerTask.cc:17
bool willConvertToEDM_
Definition: DQWorker.h:83
void formSequenceFragment_(Dependency const &, std::vector< Collections > &, std::vector< Collections >::iterator) const
Definition: DQWorkerTask.cc:57
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
virtual void setME(edm::ParameterSet const &)
Definition: DQWorker.cc:56
void setME(edm::ParameterSet const &) final
Definition: DQWorkerTask.cc:23
static void fillDescriptions(edm::ParameterSetDescription &_desc)
Definition: DQWorker.cc:31
MESetCollection MEs_
Definition: DQWorker.h:75
std::set< Collections > requisite
Definition: DQWorkerTask.h:23
std::set< std::string > resettable_
Definition: DQWorkerTask.h:103
col
Definition: cuy.py:1009