31 fp_(conf_.getParameter<edm::
FileInPath>(
"file"))
33 edm::LogInfo(
"SiPixelFakeGainOfflineESSource::SiPixelFakeGainOfflineESSource");
37 findingRecord<SiPixelGainCalibrationOfflineRcd>();
51 using namespace edm::es;
52 unsigned int nmodules = 0;
53 uint32_t nchannels = 0;
56 const std::vector<uint32_t> DetIds =
reader.getAllDetIds();
59 for(std::vector<uint32_t>::const_iterator detit=DetIds.begin(); detit!=DetIds.end(); detit++) {
61 std::vector<char> theSiPixelGainCalibrationOffline;
62 const std::pair<int, int> & detUnitDimensions =
reader.getDetUnitDimensions(*detit);
65 for(
int i=0;
i<detUnitDimensions.first;
i++) {
66 float totalGain = 0.0;
67 float totalEntries = 0.0;
68 for(
int j=0;
j<detUnitDimensions.second;
j++) {
73 obj->setDataPedestal(ped, theSiPixelGainCalibrationOffline);
74 if ((
j + 1) % 80 == 0)
76 float gain = totalGain/totalEntries;
77 obj->setDataGain(gain, 80, theSiPixelGainCalibrationOffline);
88 if( !
obj->put(*detit,range,detUnitDimensions.first) )
89 edm::LogError(
"SiPixelFakeGainOfflineESSource")<<
"[SiPixelFakeGainOfflineESSource::produce] detid already exists"<<std::endl;
96 return std::auto_ptr<SiPixelGainCalibrationOffline>(
obj);
virtual std::auto_ptr< SiPixelGainCalibrationOffline > produce(const SiPixelGainCalibrationOfflineRcd &)
static const IOVSyncValue & endOfTime()
std::pair< ContainerIterator, ContainerIterator > Range
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 &)
std::string fullPath() const