File indexing completed on 2024-04-06 11:57:57
0001
0002
0003
0004
0005
0006 #ifndef EcalLaserDbService_h
0007 #define EcalLaserDbService_h
0008
0009 #include <memory>
0010 #include <oneapi/tbb/concurrent_unordered_set.h>
0011
0012 #include "DataFormats/DetId/interface/DetId.h"
0013 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0014 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0015 #include "DataFormats/Provenance/interface/Timestamp.h"
0016
0017 #include "FWCore/Framework/interface/ModuleFactory.h"
0018 #include "FWCore/Framework/interface/ESProducer.h"
0019
0020 #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h"
0021 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h"
0022 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h"
0023 #include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h"
0024
0025 class EcalLaserDbService {
0026 public:
0027 EcalLaserDbService();
0028
0029 const EcalLaserAlphas* getAlphas() const;
0030 const EcalLaserAPDPNRatiosRef* getAPDPNRatiosRef() const;
0031 const EcalLaserAPDPNRatios* getAPDPNRatios() const;
0032 const EcalLinearCorrections* getLinearCorrections() const;
0033 float getLaserCorrection(DetId const& xid, edm::Timestamp const& iTime) const;
0034
0035 void setAlphaData(const EcalLaserAlphas* fItem) { mAlphas_ = fItem; }
0036 void setAPDPNRefData(const EcalLaserAPDPNRatiosRef* fItem) { mAPDPNRatiosRef_ = fItem; }
0037 void setAPDPNData(const EcalLaserAPDPNRatios* fItem) { mAPDPNRatios_ = fItem; }
0038 void setLinearCorrectionsData(const EcalLinearCorrections* fItem) { mLinearCorrections_ = fItem; }
0039
0040 void setMaxExtrapolationTimeInSec(int deltaT) { maxExtrapolationTime_ = ((unsigned long long)deltaT) << 32; }
0041
0042 private:
0043 const EcalLaserAlphas* mAlphas_;
0044 const EcalLaserAPDPNRatiosRef* mAPDPNRatiosRef_;
0045 const EcalLaserAPDPNRatios* mAPDPNRatios_;
0046 const EcalLinearCorrections* mLinearCorrections_;
0047 unsigned long long maxExtrapolationTime_;
0048
0049 typedef tbb::concurrent_unordered_set<uint32_t> ErrorMapT;
0050 mutable ErrorMapT channelsWithInvalidCorrection_;
0051 };
0052
0053 #endif