30 : fp_(conf_.getParameter<
edm::FileInPath>(
"file")) {
31 edm::LogInfo(
"SiPixelFakeGainOfflineESSource::SiPixelFakeGainOfflineESSource");
35 findingRecord<SiPixelGainCalibrationOfflineRcd>();
46 unsigned int nmodules = 0;
47 uint32_t nchannels = 0;
50 const std::vector<uint32_t>& DetIds =
reader.getAllDetIds();
53 for (std::vector<uint32_t>::const_iterator detit = DetIds.begin(); detit != DetIds.end(); detit++) {
55 std::vector<char> theSiPixelGainCalibrationOffline;
56 const std::pair<int, int>& detUnitDimensions =
reader.getDetUnitDimensions(*detit);
59 for (
int i = 0;
i < detUnitDimensions.first;
i++) {
60 float totalGain = 0.0;
61 float totalEntries = 0.0;
62 for (
int j = 0;
j < detUnitDimensions.second;
j++) {
67 obj->setDataPedestal(ped, theSiPixelGainCalibrationOffline);
68 if ((
j + 1) % 80 == 0)
70 float gain = totalGain / totalEntries;
71 obj->setDataGain(
gain, 80, theSiPixelGainCalibrationOffline);
81 theSiPixelGainCalibrationOffline.end());
83 if (!
obj->put(*detit,
range, detUnitDimensions.first))
85 <<
"[SiPixelFakeGainOfflineESSource::produce] detid already exists" << std::endl;
91 return std::unique_ptr<SiPixelGainCalibrationOffline>(
obj);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
std::string fullPath() const
~SiPixelFakeGainOfflineESSource() override
static const IOVSyncValue & endOfTime()
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
std::pair< ContainerIterator, ContainerIterator > Range
static const IOVSyncValue & beginOfTime()
Log< level::Info, false > LogInfo
SiPixelFakeGainOfflineESSource(const edm::ParameterSet &)
virtual std::unique_ptr< SiPixelGainCalibrationOffline > produce(const SiPixelGainCalibrationOfflineRcd &)