30 fp_(conf_.getParameter<edm::
FileInPath>(
"file"))
32 edm::LogInfo(
"SiPixelFakeGainOfflineESSource::SiPixelFakeGainOfflineESSource");
36 findingRecord<SiPixelGainCalibrationOfflineRcd>();
50 using namespace edm::es;
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++) {
72 obj->setDataPedestal(ped, theSiPixelGainCalibrationOffline);
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::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