File indexing completed on 2023-10-25 09:47:56
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include <memory>
0025
0026
0027 #include "FWCore/Framework/interface/ModuleFactory.h"
0028 #include "FWCore/Framework/interface/ESProducer.h"
0029
0030 #include "FWCore/Framework/interface/ESHandle.h"
0031
0032 #python_begin
0033 if len(__datatypes__) > 1:
0034 print('#include "FWCore/Framework/interface/ESProducts.h"')
0035 #python_end
0036
0037
0038
0039
0040
0041
0042
0043
0044 class __class__ : public edm::ESProducer {
0045 public:
0046 __class__(const edm::ParameterSet&);
0047 ~__class__() override;
0048
0049 #python_begin
0050 if len(__datatypes__) > 1:
0051 datatypes = []
0052 for dtype in __datatypes__:
0053 datatypes.append("std::unique_ptr<%s>" % dtype)
0054 print(" using ReturnType = edm::ESProducts<%s>;" % ', '.join(datatypes))
0055 elif len(__datatypes__) == 1:
0056 print(" using ReturnType = std::unique_ptr<%s>;" % __datatypes__[0])
0057 #python_end
0058
0059 ReturnType produce(const __record__&);
0060
0061 private:
0062
0063 };
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076 __class__::__class__(const edm::ParameterSet& iConfig) {
0077
0078
0079 setWhatProduced(this);
0080
0081
0082 }
0083
0084 __class__::~__class__() {
0085
0086
0087 }
0088
0089
0090
0091
0092
0093
0094 __class__::ReturnType __class__::produce(const __record__& iRecord) {
0095
0096
0097
0098
0099
0100
0101 #python_begin
0102 if len(__datatypes__) > 1:
0103 out1 = []
0104 out2 = []
0105 i = 1
0106 for dtype in __datatypes__:
0107 out1.append(" auto p%s = std::make_unique<%s>();" % (i, dtype))
0108 out2.append("std::move(p%s)" % i)
0109 i = i + 1
0110 output = '\n'.join(out1)
0111 output += "\n return edm::es::products(%s);" % ', '.join(out2)
0112 print(output)
0113 elif len(__datatypes__) == 1:
0114 print(" auto product = std::make_unique<%s>();" % __datatypes__[0])
0115 print(" return product;")
0116 #python_end
0117 }
0118
0119
0120 DEFINE_FWK_EVENTSETUP_MODULE(__class__);