CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::DependencySet Struct Reference

#include <DQWorkerTask.h>

Public Member Functions

 DependencySet ()
 
std::vector< CollectionsformSequence () const
 
void push_back (Dependency const &_d)
 

Private Member Functions

void formSequenceFragment_ (Dependency const &, std::vector< Collections > &, std::vector< Collections >::iterator) const
 

Private Attributes

std::vector< Dependencyset_
 

Detailed Description

Definition at line 46 of file DQWorkerTask.h.

Constructor & Destructor Documentation

ecaldqm::DependencySet::DependencySet ( )
inline

Definition at line 47 of file DQWorkerTask.h.

47  :
48  set_()
49  {}
std::vector< Dependency > set_
Definition: DQWorkerTask.h:69

Member Function Documentation

std::vector<Collections> ecaldqm::DependencySet::formSequence ( ) const
inline

Definition at line 58 of file DQWorkerTask.h.

References spr::find(), and lumiContext::sequence.

Referenced by EcalDQMonitorTask::EcalDQMonitorTask().

59  {
60  std::vector<Collections> sequence;
61  for(unsigned iD(0); iD < set_.size(); iD++){
62  if(std::find(sequence.begin(), sequence.end(), set_[iD].dependant) != sequence.end()) continue;
63  formSequenceFragment_(set_[iD], sequence, sequence.end());
64  }
65  return sequence;
66  }
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
std::vector< Dependency > set_
Definition: DQWorkerTask.h:69
void ecaldqm::DependencySet::formSequenceFragment_ ( Dependency const &  _d,
std::vector< Collections > &  _sequence,
std::vector< Collections >::iterator  _maxPos 
) const
private

Definition at line 57 of file DQWorkerTask.cc.

References cuy::col, ecaldqm::Dependency::dependant, Exception, spr::find(), and ecaldqm::Dependency::requisite.

58  {
59  Collections col(_d.dependant);
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  }
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
std::vector< Dependency > set_
Definition: DQWorkerTask.h:69
col
Definition: cuy.py:1008
void ecaldqm::DependencySet::push_back ( Dependency const &  _d)
inline

Definition at line 50 of file DQWorkerTask.h.

References ecaldqm::Dependency::dependant, and ecaldqm::Dependency::requisite.

Referenced by ecaldqm::RawDataTask::addDependencies(), ecaldqm::LaserTask::addDependencies(), ecaldqm::LedTask::addDependencies(), ecaldqm::TrigPrimTask::addDependencies(), ecaldqm::RecoSummaryTask::addDependencies(), ecaldqm::TestPulseTask::addDependencies(), ecaldqm::SelectiveReadoutTask::addDependencies(), ecaldqm::ClusterTask::addDependencies(), and EcalDQMonitorTask::EcalDQMonitorTask().

51  {
52  std::vector<Dependency>::iterator dItr(set_.begin());
53  std::vector<Dependency>::iterator dEnd(set_.end());
54  for(; dItr != dEnd; ++dItr)
55  if(dItr->dependant == _d.dependant) dItr->append(_d.requisite);
56  if(dItr == dEnd) set_.push_back(_d);
57  }
std::vector< Dependency > set_
Definition: DQWorkerTask.h:69

Member Data Documentation

std::vector<Dependency> ecaldqm::DependencySet::set_
private

Definition at line 69 of file DQWorkerTask.h.