File indexing completed on 2024-04-06 12:21:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <memory>
0012
0013
0014 #include "FWCore/Framework/interface/ModuleFactory.h"
0015 #include "FWCore/Framework/interface/ESProducer.h"
0016
0017
0018
0019 #include "CondFormats/L1TObjects/interface/L1TTwinMuxParams.h"
0020 #include "CondFormats/DataRecord/interface/L1TTwinMuxParamsRcd.h"
0021
0022
0023
0024 typedef std::map<short, short, std::less<short> > LUT;
0025
0026 class L1TTwinMuxParamsESProducer : public edm::ESProducer {
0027 public:
0028 L1TTwinMuxParamsESProducer(const edm::ParameterSet&);
0029 ~L1TTwinMuxParamsESProducer() override;
0030
0031 using ReturnType = std::unique_ptr<L1TTwinMuxParams>;
0032
0033 ReturnType produce(const L1TTwinMuxParamsRcd&);
0034
0035 private:
0036 L1TTwinMuxParams m_params;
0037 };
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 L1TTwinMuxParamsESProducer::L1TTwinMuxParamsESProducer(const edm::ParameterSet& iConfig) {
0051
0052
0053 setWhatProduced(this);
0054
0055 unsigned fwVersion = iConfig.getParameter<unsigned>("fwVersion");
0056 unsigned useRpcBxForDtBelowQuality = iConfig.getParameter<unsigned>("useRpcBxForDtBelowQuality");
0057 bool useOnlyRPC = iConfig.getParameter<bool>("useOnlyRPC");
0058 bool useOnlyDT = iConfig.getParameter<bool>("useOnlyDT");
0059 bool useLowQDT = iConfig.getParameter<bool>("useLowQDT");
0060 bool CorrectDTBxwRPC = iConfig.getParameter<bool>("CorrectDTBxwRPC");
0061 bool Verbose = iConfig.getParameter<bool>("verbose");
0062 unsigned dphiWindowBxShift = iConfig.getParameter<unsigned>("dphiWindowBxShift");
0063
0064 m_params.setFwVersion(fwVersion);
0065 m_params.set_USERPCBXFORDTBELOWQUALITY(useRpcBxForDtBelowQuality);
0066 m_params.set_UseOnlyRPC(useOnlyRPC);
0067 m_params.set_UseOnlyDT(useOnlyDT);
0068 m_params.set_UseLowQDT(useLowQDT);
0069 m_params.set_CorrectDTBxwRPC(CorrectDTBxwRPC);
0070 m_params.set_Verbose(Verbose);
0071 m_params.set_DphiWindowBxShift(dphiWindowBxShift);
0072 }
0073
0074 L1TTwinMuxParamsESProducer::~L1TTwinMuxParamsESProducer() {}
0075
0076
0077
0078
0079
0080
0081 L1TTwinMuxParamsESProducer::ReturnType L1TTwinMuxParamsESProducer::produce(const L1TTwinMuxParamsRcd& iRecord) {
0082 return std::make_unique<L1TTwinMuxParams>(m_params);
0083 }
0084
0085
0086 DEFINE_FWK_EVENTSETUP_MODULE(L1TTwinMuxParamsESProducer);