Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:10:00

0001 #include "DQM/EcalMonitorTasks/interface/DQWorkerTask.h"
0002 
0003 #include "FWCore/Utilities/interface/Exception.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0006 
0007 namespace ecaldqm {
0008   DQWorkerTask::DQWorkerTask() : DQWorker() {}
0009 
0010   /*static*/
0011   void DQWorkerTask::fillDescriptions(edm::ParameterSetDescription& _desc) { DQWorker::fillDescriptions(_desc); }
0012 
0013   void DQWorkerTask::setME(edm::ParameterSet const& _ps) {
0014     DQWorker::setME(_ps);
0015 
0016     for (MESetCollection::iterator mItr(MEs_.begin()); mItr != MEs_.end(); ++mItr) {
0017       if (willConvertToEDM_)
0018         mItr->second->setBatchMode();
0019     }
0020   }
0021 
0022   void DependencySet::formSequenceFragment_(Dependency const& _d,
0023                                             std::vector<Collections>& _sequence,
0024                                             std::vector<Collections>::iterator _maxPos) const {
0025     Collections col(_d.dependant);
0026     std::vector<Collections>::iterator pos(std::find(_sequence.begin(), _sequence.end(), col));
0027     if (pos == _sequence.end())
0028       _sequence.insert(_maxPos, col);
0029     else if (pos < _maxPos)
0030       return;
0031     else
0032       throw cms::Exception("InvalidConfiguration") << "Circular dependency of collections";
0033 
0034     for (std::set<Collections>::const_iterator rItr(_d.requisite.begin()); rItr != _d.requisite.end(); ++rItr) {
0035       for (std::vector<Dependency>::const_iterator dItr(set_.begin()); dItr != set_.end(); ++dItr) {
0036         if (dItr->dependant != *rItr)
0037           continue;
0038         pos = std::find(_sequence.begin(), _sequence.end(), col);
0039         formSequenceFragment_(*dItr, _sequence, pos);
0040         break;
0041       }
0042     }
0043   }
0044 
0045 }  // namespace ecaldqm