Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:02:04

0001 #ifndef FWCore_Framework_NumberOfConcurrentIOVs_h
0002 #define FWCore_Framework_NumberOfConcurrentIOVs_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Framework
0006 // Class  :     NumberOfConcurrentIOVs
0007 //
0008 /** \class edm::eventsetup::NumberOfConcurrentIOVs
0009 
0010  Description: Calculates and holds the number of concurrent
0011               intervals of validity allowed for each record
0012               in the EventSetup.
0013 
0014  Usage: Used internally by the Framework
0015 
0016 */
0017 //
0018 // Original Authors:  W. David Dagenhart
0019 //          Created:  1 February 2019
0020 
0021 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0022 
0023 #include <set>
0024 #include <utility>
0025 #include <vector>
0026 
0027 namespace edm {
0028 
0029   class ParameterSet;
0030 
0031   namespace eventsetup {
0032 
0033     class EventSetupProvider;
0034 
0035     class NumberOfConcurrentIOVs {
0036     public:
0037       NumberOfConcurrentIOVs();
0038 
0039       void readConfigurationParameters(ParameterSet const* eventSetupPset,
0040                                        unsigned int maxConcurrentIOVs,
0041                                        bool dumpOptions);
0042 
0043       // This depends on bool's hard coded in the EventSetupRecord C++ classes
0044       void fillRecordsNotAllowingConcurrentIOVs(EventSetupProvider const&);
0045 
0046       unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const&, bool printInfoMsg = false) const;
0047 
0048       void clear();
0049 
0050     private:
0051       // This is the single value configured in the top level options
0052       // parameter set that determines the number of concurrent IOVs
0053       // allowed for each record. This value can be overridden by
0054       // either of the values of the next two data members. The default
0055       // for this is one.
0056       unsigned int numberConcurrentIOVs_;
0057 
0058       // This is derived from a boolean value that can be hard coded
0059       // into the C++ definition of a class deriving from EventSetupRecord.
0060       // The data member is a static constexpr member of the class and
0061       // this data member is named allowConcurrentIOVs_.
0062       // If the value is defined as false, then the key to the record
0063       // will get stored in the set defined below. This will be used to
0064       // to limit the number of concurrent IOVs for a particular record
0065       // to be one even if the overall "numberOfConcurrentIOVs" parameter
0066       // is configured to be greater than one.
0067       std::set<EventSetupRecordKey> recordsNotAllowingConcurrentIOVs_;
0068 
0069       // It is possible to individually configure the number of concurrent
0070       // IOVs allowed for each record. This is done by adding parameters
0071       // to a nested parameter set in the top level options parameter set.
0072       // Setting these parameters is optional. This container can hold an
0073       // entry for all records, it can be empty, or hold an entry for
0074       // any subset of records. Values in this container override both of the
0075       // above data members.
0076       std::vector<std::pair<EventSetupRecordKey, unsigned int>> forceNumberOfConcurrentIOVs_;
0077 
0078       unsigned int maxConcurrentIOVs_ = 1;
0079     };
0080 
0081   }  // namespace eventsetup
0082 }  // namespace edm
0083 #endif