32 edm::LogInfo(
"SiPixelFakeGainOfflineESSource::SiPixelFakeGainOfflineESSource");
36 findingRecord<SiPixelGainCalibrationOfflineRcd>();
51 unsigned int nmodules = 0;
52 uint32_t nchannels = 0;
55 const std::vector<uint32_t> DetIds =
reader.getAllDetIds();
58 for(std::vector<uint32_t>::const_iterator detit=DetIds.begin(); detit!=DetIds.end(); detit++) {
60 std::vector<char> theSiPixelGainCalibrationOffline;
61 const std::pair<int, int> & detUnitDimensions =
reader.getDetUnitDimensions(*detit);
64 for(
int i=0;
i<detUnitDimensions.first;
i++) {
65 float totalGain = 0.0;
66 float totalEntries = 0.0;
67 for(
int j=0; j<detUnitDimensions.second; j++) {
73 if ((j + 1) % 80 == 0)
75 float gain = totalGain/totalEntries;
76 obj->
setDataGain(gain, 80, theSiPixelGainCalibrationOffline);
87 if( !obj->
put(*detit,range,detUnitDimensions.first) )
88 edm::LogError(
"SiPixelFakeGainOfflineESSource")<<
"[SiPixelFakeGainOfflineESSource::produce] detid already exists"<<std::endl;
95 return std::unique_ptr<SiPixelGainCalibrationOffline>(
obj);
static const IOVSyncValue & endOfTime()
void setDataPedestal(float pedestal, std::vector< char > &vped, bool thisPixelIsDead=false, bool thisPixelIsNoisy=false)
std::pair< ContainerIterator, ContainerIterator > Range
void setDataGain(float gain, const int &nRows, std::vector< char > &vped, bool thisColumnIsDead=false, bool thisColumnIsNoisy=false)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
~SiPixelFakeGainOfflineESSource()
static const IOVSyncValue & beginOfTime()
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
SiPixelFakeGainOfflineESSource(const edm::ParameterSet &)
virtual std::unique_ptr< SiPixelGainCalibrationOffline > produce(const SiPixelGainCalibrationOfflineRcd &)
std::string fullPath() const
bool put(const uint32_t &detID, Range input, const int &nCols)