31 fp_(conf_.getParameter<edm::
FileInPath>(
"file"))
33 edm::LogInfo(
"SiPixelFakeGainForHLTESSource::SiPixelFakeGainForHLTESSource");
37 findingRecord<SiPixelGainCalibrationForHLTRcd>();
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> theSiPixelGainCalibration;
62 const std::pair<int, int> & detUnitDimensions =
reader.getDetUnitDimensions(*detit);
66 for(
int i=0;
i<detUnitDimensions.first;
i++) {
67 float totalGain = 0.0;
69 float totalEntries=0.0;
70 for(
int j=0;
j<detUnitDimensions.second;
j++) {
76 float gain = totalGain/totalEntries;
77 float ped = totalPed/totalEntries;
79 obj->setData(ped,gain, theSiPixelGainCalibration);
90 int nCols = detUnitDimensions.first;
91 if( !
obj->put(*detit,range,nCols) )
92 edm::LogError(
"SiPixelFakeGainForHLTESSource")<<
"[SiPixelFakeGainForHLTESSource::produce] detid already exists"<<std::endl;
99 return std::auto_ptr<SiPixelGainCalibrationForHLT>(
obj);
static const IOVSyncValue & endOfTime()
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
std::pair< ContainerIterator, ContainerIterator > Range
static const IOVSyncValue & beginOfTime()
virtual std::auto_ptr< SiPixelGainCalibrationForHLT > produce(const SiPixelGainCalibrationForHLTRcd &)
~SiPixelFakeGainForHLTESSource()
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
std::string fullPath() const
SiPixelFakeGainForHLTESSource(const edm::ParameterSet &)