64 : fp_(conf_.getParameter<
edm::FileInPath>(
"file")) {
65 edm::LogInfo(
"SiPixelFakeGainOfflineESSource::SiPixelFakeGainOfflineESSource");
69 findingRecord<SiPixelGainCalibrationOfflineRcd>();
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> theSiPixelGainCalibrationOffline;
82 const std::pair<int, int>& detUnitDimensions =
reader.getDetUnitDimensions(*detit);
85 for (
int i = 0;
i < detUnitDimensions.first;
i++) {
86 float totalGain = 0.0;
87 float totalEntries = 0.0;
88 for (
int j = 0;
j < detUnitDimensions.second;
j++) {
92 obj->setDataPedestal(
ped, theSiPixelGainCalibrationOffline);
93 if ((
j + 1) % 80 == 0)
95 float gain = totalGain / totalEntries;
96 obj->setDataGain(
gain, 80, theSiPixelGainCalibrationOffline);
106 theSiPixelGainCalibrationOffline.end());
108 if (!
obj->put(*detit,
range, detUnitDimensions.first))
110 <<
"[SiPixelFakeGainOfflineESSource::produce] detid already exists" << std::endl;
114 return std::unique_ptr<SiPixelGainCalibrationOffline>(
obj);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static const IOVSyncValue & endOfTime()
~SiPixelFakeGainOfflineESSource() override=default
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
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
SiPixelFakeGainOfflineESSource(const edm::ParameterSet &)
virtual std::unique_ptr< SiPixelGainCalibrationOffline > produce(const SiPixelGainCalibrationOfflineRcd &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string & fullPath() const