CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::eventsetup::NumberOfConcurrentIOVs Class Reference

#include <NumberOfConcurrentIOVs.h>

Public Member Functions

void clear ()
 
void fillRecordsNotAllowingConcurrentIOVs (EventSetupProvider const &)
 
 NumberOfConcurrentIOVs ()
 
unsigned int numberOfConcurrentIOVs (EventSetupRecordKey const &, bool printInfoMsg=false) const
 
void readConfigurationParameters (ParameterSet const *eventSetupPset)
 
void setMaxConcurrentIOVs (unsigned int nStreams, unsigned int nConcurrentLumis)
 

Private Attributes

std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
 
unsigned int maxConcurrentIOVs_ = 1
 
unsigned int numberConcurrentIOVs_
 
std::set< EventSetupRecordKeyrecordsNotAllowingConcurrentIOVs_
 

Detailed Description

Description: Calculates and holds the number of concurrent intervals of validity allowed for each record in the EventSetup.

Usage: Used internally by the Framework

Definition at line 35 of file NumberOfConcurrentIOVs.h.

Constructor & Destructor Documentation

edm::eventsetup::NumberOfConcurrentIOVs::NumberOfConcurrentIOVs ( )

Member Function Documentation

void edm::eventsetup::NumberOfConcurrentIOVs::clear ( void  )

Definition at line 75 of file NumberOfConcurrentIOVs.cc.

References forceNumberOfConcurrentIOVs_, numberConcurrentIOVs_, recordsNotAllowingConcurrentIOVs_, and edm::eventsetup::swap().

Referenced by Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), edm::eventsetup::EventSetupsController::finishConfiguration(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

75  {
76  // Mark this as invalid
78 
79  // Free up memory
81  std::vector<std::pair<EventSetupRecordKey, unsigned int>>().swap(forceNumberOfConcurrentIOVs_);
82  }
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_
void swap(DataKey &a, DataKey &b)
Definition: DataKey.h:85
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
void edm::eventsetup::NumberOfConcurrentIOVs::fillRecordsNotAllowingConcurrentIOVs ( EventSetupProvider const &  eventSetupProvider)

Definition at line 43 of file NumberOfConcurrentIOVs.cc.

References edm::eventsetup::EventSetupProvider::fillRecordsNotAllowingConcurrentIOVs(), and recordsNotAllowingConcurrentIOVs_.

Referenced by edm::eventsetup::EventSetupsController::finishConfiguration().

43  {
44  eventSetupProvider.fillRecordsNotAllowingConcurrentIOVs(recordsNotAllowingConcurrentIOVs_);
45  }
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_
unsigned int edm::eventsetup::NumberOfConcurrentIOVs::numberOfConcurrentIOVs ( EventSetupRecordKey const &  eventSetupKey,
bool  printInfoMsg = false 
) const

Definition at line 47 of file NumberOfConcurrentIOVs.cc.

References forceNumberOfConcurrentIOVs_, maxConcurrentIOVs_, min(), edm::eventsetup::EventSetupRecordKey::name(), numberConcurrentIOVs_, and recordsNotAllowingConcurrentIOVs_.

Referenced by edm::eventsetup::EventSetupProvider::finishConfiguration(), and edm::eventsetup::EventSetupsController::initializeEventSetupRecordIOVQueues().

48  {
49  assert(numberConcurrentIOVs_ != 0);
50  auto iter = std::lower_bound(forceNumberOfConcurrentIOVs_.begin(),
52  std::make_pair(eventSetupKey, 0u),
53  [](auto const& left, auto const& right) { return left.first < right.first; });
54  if (iter != forceNumberOfConcurrentIOVs_.end() && iter->first == eventSetupKey) {
55  if (printInfoMsg && iter->second > maxConcurrentIOVs_) {
56  LogInfo("Configuration") << "For record " << eventSetupKey.name() << " you have configured " << iter->second
57  << " concurrent IOVs.\n"
58  << "But you cannot have more concurrent IOVs than lumis or streams.\n"
59  << "There will not be more than " << maxConcurrentIOVs_ << " concurrent IOVs.\n";
60  }
61  return std::min(iter->second, maxConcurrentIOVs_);
62  }
64  return 1;
65  }
66  if (printInfoMsg && numberConcurrentIOVs_ > maxConcurrentIOVs_) {
67  LogInfo("Configuration") << "For record " << eventSetupKey.name() << " you have configured "
68  << numberConcurrentIOVs_ << " concurrent IOVs.\n"
69  << "But you cannot have more concurrent IOVs than lumis or streams.\n"
70  << "There will not be more than " << maxConcurrentIOVs_ << " concurrent IOVs.\n";
71  }
73  }
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
void edm::eventsetup::NumberOfConcurrentIOVs::readConfigurationParameters ( ParameterSet const *  eventSetupPset)

Definition at line 19 of file NumberOfConcurrentIOVs.cc.

References edm::eventsetup::heterocontainer::HCTypeTag::findType(), forceNumberOfConcurrentIOVs_, edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), numberConcurrentIOVs_, muonDTDigis_cfi::pset, and align_cfg::recordName.

Referenced by edm::eventsetup::EventSetupsController::makeProvider().

19  {
20  if (eventSetupPset) { // this condition is false for SubProcesses
21  numberConcurrentIOVs_ = eventSetupPset->getUntrackedParameter<unsigned int>("numberOfConcurrentIOVs");
22  if (numberConcurrentIOVs_ == 0) {
24  }
25 
26  ParameterSet const& pset(eventSetupPset->getUntrackedParameterSet("forceNumberOfConcurrentIOVs"));
27  std::vector<std::string> recordNames = pset.getParameterNames();
28  forceNumberOfConcurrentIOVs_.reserve(recordNames.size());
29  for (auto const& recordName : recordNames) {
31  forceNumberOfConcurrentIOVs_.emplace_back(recordKey, pset.getUntrackedParameter<unsigned int>(recordName));
32  }
33  std::sort(forceNumberOfConcurrentIOVs_.begin(),
35  [](auto const& left, auto const& right) { return left.first < right.first; });
36  }
37  }
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
void edm::eventsetup::NumberOfConcurrentIOVs::setMaxConcurrentIOVs ( unsigned int  nStreams,
unsigned int  nConcurrentLumis 
)

Definition at line 39 of file NumberOfConcurrentIOVs.cc.

References maxConcurrentIOVs_, and min().

Referenced by edm::eventsetup::EventSetupsController::setMaxConcurrentIOVs().

39  {
40  maxConcurrentIOVs_ = std::min(nStreams, nConcurrentLumis);
41  }
T min(T a, T b)
Definition: MathUtil.h:58

Member Data Documentation

std::vector<std::pair<EventSetupRecordKey, unsigned int> > edm::eventsetup::NumberOfConcurrentIOVs::forceNumberOfConcurrentIOVs_
private
unsigned int edm::eventsetup::NumberOfConcurrentIOVs::maxConcurrentIOVs_ = 1
private

Definition at line 79 of file NumberOfConcurrentIOVs.h.

Referenced by numberOfConcurrentIOVs(), and setMaxConcurrentIOVs().

unsigned int edm::eventsetup::NumberOfConcurrentIOVs::numberConcurrentIOVs_
private
std::set<EventSetupRecordKey> edm::eventsetup::NumberOfConcurrentIOVs::recordsNotAllowingConcurrentIOVs_
private