30 : fp_(conf_.getParameter<
edm::FileInPath>(
"file")) {
31 edm::LogInfo(
"SiPixelFakeGainOfflineESSource::SiPixelFakeGainOfflineESSource");
35 findingRecord<SiPixelGainCalibrationOfflineRcd>();
48 const std::vector<uint32_t>& DetIds =
reader.getAllDetIds();
51 for (std::vector<uint32_t>::const_iterator detit = DetIds.begin(); detit != DetIds.end(); detit++) {
52 std::vector<char> theSiPixelGainCalibrationOffline;
53 const std::pair<int, int>& detUnitDimensions =
reader.getDetUnitDimensions(*detit);
56 for (
int i = 0;
i < detUnitDimensions.first;
i++) {
57 float totalGain = 0.0;
58 float totalEntries = 0.0;
59 for (
int j = 0;
j < detUnitDimensions.second;
j++) {
63 obj->setDataPedestal(
ped, theSiPixelGainCalibrationOffline);
64 if ((
j + 1) % 80 == 0)
66 float gain = totalGain / totalEntries;
67 obj->setDataGain(
gain, 80, theSiPixelGainCalibrationOffline);
77 theSiPixelGainCalibrationOffline.end());
79 if (!
obj->put(*detit,
range, detUnitDimensions.first))
81 <<
"[SiPixelFakeGainOfflineESSource::produce] detid already exists" << std::endl;
85 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 &)