CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 44 of file DQWorkerTask.h.

Constructor & Destructor Documentation

ecaldqm::DependencySet::DependencySet ( )
inline

Definition at line 45 of file DQWorkerTask.h.

45 : set_() {}
std::vector< Dependency > set_
Definition: DQWorkerTask.h:66

Member Function Documentation

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

Definition at line 55 of file DQWorkerTask.h.

References spr::find(), formSequenceFragment_(), and set_.

Referenced by EcalDQMonitorTask::EcalDQMonitorTask().

55  {
56  std::vector<Collections> sequence;
57  for (unsigned iD(0); iD < set_.size(); iD++) {
58  if (std::find(sequence.begin(), sequence.end(), set_[iD].dependant) != sequence.end())
59  continue;
60  formSequenceFragment_(set_[iD], sequence, sequence.end());
61  }
62  return sequence;
63  }
void formSequenceFragment_(Dependency const &, std::vector< Collections > &, std::vector< Collections >::iterator) const
Definition: DQWorkerTask.cc:22
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< Dependency > set_
Definition: DQWorkerTask.h:66
void ecaldqm::DependencySet::formSequenceFragment_ ( Dependency const &  _d,
std::vector< Collections > &  _sequence,
std::vector< Collections >::iterator  _maxPos 
) const
private

Definition at line 22 of file DQWorkerTask.cc.

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

Referenced by formSequence().

24  {
25  Collections col(_d.dependant);
26  std::vector<Collections>::iterator pos(std::find(_sequence.begin(), _sequence.end(), col));
27  if (pos == _sequence.end())
28  _sequence.insert(_maxPos, col);
29  else if (pos < _maxPos)
30  return;
31  else
32  throw cms::Exception("InvalidConfiguration") << "Circular dependency of collections";
33 
34  for (std::set<Collections>::const_iterator rItr(_d.requisite.begin()); rItr != _d.requisite.end(); ++rItr) {
35  for (std::vector<Dependency>::const_iterator dItr(set_.begin()); dItr != set_.end(); ++dItr) {
36  if (dItr->dependant != *rItr)
37  continue;
38  pos = std::find(_sequence.begin(), _sequence.end(), col);
39  formSequenceFragment_(*dItr, _sequence, pos);
40  break;
41  }
42  }
43  }
void formSequenceFragment_(Dependency const &, std::vector< Collections > &, std::vector< Collections >::iterator) const
Definition: DQWorkerTask.cc:22
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< Dependency > set_
Definition: DQWorkerTask.h:66
int col
Definition: cuy.py:1009
void ecaldqm::DependencySet::push_back ( Dependency const &  _d)
inline

Definition at line 46 of file DQWorkerTask.h.

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

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

46  {
47  std::vector<Dependency>::iterator dItr(set_.begin());
48  std::vector<Dependency>::iterator dEnd(set_.end());
49  for (; dItr != dEnd; ++dItr)
50  if (dItr->dependant == _d.dependant)
51  dItr->append(_d.requisite);
52  if (dItr == dEnd)
53  set_.push_back(_d);
54  }
std::vector< Dependency > set_
Definition: DQWorkerTask.h:66

Member Data Documentation

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

Definition at line 66 of file DQWorkerTask.h.

Referenced by formSequence(), formSequenceFragment_(), and push_back().