64 : fp_(conf_.getParameter<
edm::FileInPath>(
"file")) {
65 edm::LogInfo(
"SiPixelFakeGainForHLTESSource::SiPixelFakeGainForHLTESSource");
69 findingRecord<SiPixelGainCalibrationForHLTRcd>();
77 const std::vector<uint32_t>& DetIds =
reader.getAllDetIds();
80 for (std::vector<uint32_t>::const_iterator detit = DetIds.begin(); detit != DetIds.end(); detit++) {
81 std::vector<char> theSiPixelGainCalibration;
82 const std::pair<int, int>& detUnitDimensions =
reader.getDetUnitDimensions(*detit);
86 for (
int i = 0;
i < detUnitDimensions.first;
i++) {
87 float totalGain = 0.0;
89 float totalEntries = 0.0;
90 for (
int j = 0;
j < detUnitDimensions.second;
j++) {
94 if ((
j + 1) % 80 == 0) {
95 float gain = totalGain / totalEntries;
96 float ped = totalPed / totalEntries;
98 obj->setData(
ped,
gain, theSiPixelGainCalibration);
109 int nCols = detUnitDimensions.first;
110 if (!
obj->put(*detit,
range, nCols))
112 <<
"[SiPixelFakeGainForHLTESSource::produce] detid already exists" << std::endl;
116 return std::unique_ptr<SiPixelGainCalibrationForHLT>(
obj);
~SiPixelFakeGainForHLTESSource() override=default
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static const IOVSyncValue & endOfTime()
std::pair< ContainerIterator, ContainerIterator > Range
static const IOVSyncValue & beginOfTime()
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Log< level::Info, false > LogInfo
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
virtual std::unique_ptr< SiPixelGainCalibrationForHLT > produce(const SiPixelGainCalibrationForHLTRcd &)
const std::string & fullPath() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
SiPixelFakeGainForHLTESSource(const edm::ParameterSet &)