#include <CalibTracker/SiPixelESProducer/src/SiPixelFakeGainESSource.cc>
Public Member Functions | |
virtual std::auto_ptr < SiPixelGainCalibration > | produce (const SiPixelGainCalibrationRcd &) |
SiPixelFakeGainESSource (const edm::ParameterSet &) | |
~SiPixelFakeGainESSource () | |
Protected Member Functions | |
virtual void | setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) |
Private Attributes | |
edm::FileInPath | fp_ |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 37 of file SiPixelFakeGainESSource.h.
SiPixelFakeGainESSource::SiPixelFakeGainESSource | ( | const edm::ParameterSet & | conf_ | ) |
Definition at line 30 of file SiPixelFakeGainESSource.cc.
References edm::ESProducer::setWhatProduced().
: fp_(conf_.getParameter<edm::FileInPath>("file")) { edm::LogInfo("SiPixelFakeGainESSource::SiPixelFakeGainESSource"); //the following line is needed to tell the framework what // data is being produced setWhatProduced(this); findingRecord<SiPixelGainCalibrationRcd>(); }
SiPixelFakeGainESSource::~SiPixelFakeGainESSource | ( | ) |
Definition at line 40 of file SiPixelFakeGainESSource.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
std::auto_ptr< SiPixelGainCalibration > SiPixelFakeGainESSource::produce | ( | const SiPixelGainCalibrationRcd & | ) | [virtual] |
Definition at line 48 of file SiPixelFakeGainESSource.cc.
References fp_, edm::FileInPath::fullPath(), i, j, VarParsing::obj, and matplotRender::reader.
{ using namespace edm::es; unsigned int nmodules = 0; uint32_t nchannels = 0; SiPixelGainCalibration * obj = new SiPixelGainCalibration(25.,30., 2.,3.); SiPixelDetInfoFileReader reader(fp_.fullPath()); const std::vector<uint32_t> DetIds = reader.getAllDetIds(); // Loop over detectors for(std::vector<uint32_t>::const_iterator detit=DetIds.begin(); detit!=DetIds.end(); detit++) { nmodules++; std::vector<char> theSiPixelGainCalibration; const std::pair<int, int> & detUnitDimensions = reader.getDetUnitDimensions(*detit); // Loop over columns and rows for(int i=0; i<detUnitDimensions.first; i++) { for(int j=0; j<detUnitDimensions.second; j++) { nchannels++; float gain = 2.8; float ped = 28.2; obj->setData(ped, gain , theSiPixelGainCalibration); } } //std::cout << "detid " << (*detit) << std::endl; SiPixelGainCalibration::Range range(theSiPixelGainCalibration.begin(),theSiPixelGainCalibration.end()); if( !obj->put(*detit,range,detUnitDimensions.first) ) edm::LogError("SiPixelFakeGainESSource")<<"[SiPixelFakeGainESSource::produce] detid already exists"<<std::endl; } //std::cout << "Modules = " << nmodules << " Channels " << nchannels << std::endl; // return std::auto_ptr<SiPixelGainCalibration>(obj); }
void SiPixelFakeGainESSource::setIntervalFor | ( | const edm::eventsetup::EventSetupRecordKey & | , |
const edm::IOVSyncValue & | iosv, | ||
edm::ValidityInterval & | oValidity | ||
) | [protected, virtual] |
Implements edm::EventSetupRecordIntervalFinder.
Definition at line 90 of file SiPixelFakeGainESSource.cc.
References edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime(), and infinity.
{ edm::ValidityInterval infinity( iosv.beginOfTime(), iosv.endOfTime() ); oValidity = infinity; }
edm::FileInPath SiPixelFakeGainESSource::fp_ [private] |
Definition at line 56 of file SiPixelFakeGainESSource.h.
Referenced by produce().