CMS 3D CMS Logo

NumberOfConcurrentIOVs.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_NumberOfConcurrentIOVs_h
2 #define FWCore_Framework_NumberOfConcurrentIOVs_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : NumberOfConcurrentIOVs
7 //
17 //
18 // Original Authors: W. David Dagenhart
19 // Created: 1 February 2019
20 
22 
23 #include <set>
24 #include <utility>
25 #include <vector>
26 
27 namespace edm {
28 
29  class ParameterSet;
30 
31  namespace eventsetup {
32 
33  class EventSetupProvider;
34 
36  public:
38 
39  void readConfigurationParameters(ParameterSet const* eventSetupPset);
40 
41  // Can't have more concurrent IOVs than streams or concurrent lumis
42  void setMaxConcurrentIOVs(unsigned int nStreams, unsigned int nConcurrentLumis);
43 
44  // This depends on bool's hard coded in the EventSetupRecord C++ classes
46 
47  unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const&, bool printInfoMsg = false) const;
48 
49  void clear();
50 
51  private:
52  // This is the single value configured in the top level options
53  // parameter set that determines the number of concurrent IOVs
54  // allowed for each record. This value can be overridden by
55  // either of the values of the next two data members. The default
56  // for this is one.
57  unsigned int numberConcurrentIOVs_;
58 
59  // This is derived from a boolean value that can be hard coded
60  // into the C++ definition of a class deriving from EventSetupRecord.
61  // The data member is a static constexpr member of the class and
62  // this data member is named allowConcurrentIOVs_.
63  // If the value is defined as false, then the key to the record
64  // will get stored in the set defined below. This will be used to
65  // to limit the number of concurrent IOVs for a particular record
66  // to be one even if the overall "numberOfConcurrentIOVs" parameter
67  // is configured to be greater than one.
68  std::set<EventSetupRecordKey> recordsNotAllowingConcurrentIOVs_;
69 
70  // It is possible to individually configure the number of concurrent
71  // IOVs allowed for each record. This is done by adding parameters
72  // to a nested parameter set in the top level options parameter set.
73  // Setting these parameters is optional. This container can hold an
74  // entry for all records, it can be empty, or hold an entry for
75  // any subset of records. Values in this container override both of the
76  // above data members.
77  std::vector<std::pair<EventSetupRecordKey, unsigned int>> forceNumberOfConcurrentIOVs_;
78 
79  unsigned int maxConcurrentIOVs_ = 1;
80  };
81 
82  } // namespace eventsetup
83 } // namespace edm
84 #endif
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
runTheMatrix.nStreams
nStreams
Definition: runTheMatrix.py:371
edm::eventsetup::EventSetupProvider
Definition: EventSetupProvider.h:50
edm::eventsetup::NumberOfConcurrentIOVs
Definition: NumberOfConcurrentIOVs.h:35
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
edm::eventsetup::NumberOfConcurrentIOVs::readConfigurationParameters
void readConfigurationParameters(ParameterSet const *eventSetupPset)
Definition: NumberOfConcurrentIOVs.cc:19
edm::eventsetup::NumberOfConcurrentIOVs::recordsNotAllowingConcurrentIOVs_
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_
Definition: NumberOfConcurrentIOVs.h:68
edm::eventsetup::NumberOfConcurrentIOVs::numberOfConcurrentIOVs
unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const &, bool printInfoMsg=false) const
Definition: NumberOfConcurrentIOVs.cc:47
edm::eventsetup::NumberOfConcurrentIOVs::clear
void clear()
Definition: NumberOfConcurrentIOVs.cc:75
edm::eventsetup::NumberOfConcurrentIOVs::fillRecordsNotAllowingConcurrentIOVs
void fillRecordsNotAllowingConcurrentIOVs(EventSetupProvider const &)
Definition: NumberOfConcurrentIOVs.cc:43
edm::eventsetup::NumberOfConcurrentIOVs::NumberOfConcurrentIOVs
NumberOfConcurrentIOVs()
Definition: NumberOfConcurrentIOVs.cc:17
edm::eventsetup::NumberOfConcurrentIOVs::setMaxConcurrentIOVs
void setMaxConcurrentIOVs(unsigned int nStreams, unsigned int nConcurrentLumis)
Definition: NumberOfConcurrentIOVs.cc:39
EventSetupRecordKey.h
edm::eventsetup::NumberOfConcurrentIOVs::maxConcurrentIOVs_
unsigned int maxConcurrentIOVs_
Definition: NumberOfConcurrentIOVs.h:79
edm::eventsetup::NumberOfConcurrentIOVs::numberConcurrentIOVs_
unsigned int numberConcurrentIOVs_
Definition: NumberOfConcurrentIOVs.h:57
edm::eventsetup::NumberOfConcurrentIOVs::forceNumberOfConcurrentIOVs_
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
Definition: NumberOfConcurrentIOVs.h:77