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
void fillRecordsNotAllowingConcurrentIOVs(EventSetupProvider const &)
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_
unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const &, bool printInfoMsg=false) const
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
HLT enums.
void readConfigurationParameters(ParameterSet const *eventSetupPset)
void setMaxConcurrentIOVs(unsigned int nStreams, unsigned int nConcurrentLumis)