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  unsigned int maxConcurrentIOVs,
41  bool dumpOptions);
42 
43  // This depends on bool's hard coded in the EventSetupRecord C++ classes
45 
46  unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const&, bool printInfoMsg = false) const;
47 
48  void clear();
49 
50  private:
51  // This is the single value configured in the top level options
52  // parameter set that determines the number of concurrent IOVs
53  // allowed for each record. This value can be overridden by
54  // either of the values of the next two data members. The default
55  // for this is one.
56  unsigned int numberConcurrentIOVs_;
57 
58  // This is derived from a boolean value that can be hard coded
59  // into the C++ definition of a class deriving from EventSetupRecord.
60  // The data member is a static constexpr member of the class and
61  // this data member is named allowConcurrentIOVs_.
62  // If the value is defined as false, then the key to the record
63  // will get stored in the set defined below. This will be used to
64  // to limit the number of concurrent IOVs for a particular record
65  // to be one even if the overall "numberOfConcurrentIOVs" parameter
66  // is configured to be greater than one.
67  std::set<EventSetupRecordKey> recordsNotAllowingConcurrentIOVs_;
68 
69  // It is possible to individually configure the number of concurrent
70  // IOVs allowed for each record. This is done by adding parameters
71  // to a nested parameter set in the top level options parameter set.
72  // Setting these parameters is optional. This container can hold an
73  // entry for all records, it can be empty, or hold an entry for
74  // any subset of records. Values in this container override both of the
75  // above data members.
76  std::vector<std::pair<EventSetupRecordKey, unsigned int>> forceNumberOfConcurrentIOVs_;
77 
78  unsigned int maxConcurrentIOVs_ = 1;
79  };
80 
81  } // namespace eventsetup
82 } // namespace edm
83 #endif
void fillRecordsNotAllowingConcurrentIOVs(EventSetupProvider const &)
std::set< EventSetupRecordKey > recordsNotAllowingConcurrentIOVs_
std::vector< std::pair< EventSetupRecordKey, unsigned int > > forceNumberOfConcurrentIOVs_
void readConfigurationParameters(ParameterSet const *eventSetupPset, unsigned int maxConcurrentIOVs, bool dumpOptions)
HLT enums.
unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const &, bool printInfoMsg=false) const