CMS 3D CMS Logo

SiPixelFakeGainESSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelFakeGainESSource
4 // Class: SiPixelFakeGainESSource
5 //
13 //
14 // Original Author: Vincenzo Chiochia
15 // Created: Fri Apr 27 12:31:25 CEST 2007
16 //
17 //
18 
19 // user include files
20 
26 //
27 // constructors and destructor
28 //
30  : fp_(conf_.getParameter<edm::FileInPath>("file")) {
31  edm::LogInfo("SiPixelFakeGainESSource::SiPixelFakeGainESSource");
32  //the following line is needed to tell the framework what
33  // data is being produced
34  setWhatProduced(this);
35  findingRecord<SiPixelGainCalibrationRcd>();
36 }
37 
39  // do anything here that needs to be done at desctruction time
40  // (e.g. close files, deallocate resources etc.)
41 }
42 
43 std::unique_ptr<SiPixelGainCalibration> SiPixelFakeGainESSource::produce(const SiPixelGainCalibrationRcd&) {
44  using namespace edm::es;
45  unsigned int nmodules = 0;
46  uint32_t nchannels = 0;
47  SiPixelGainCalibration* obj = new SiPixelGainCalibration(25., 30., 2., 3.);
49  const std::vector<uint32_t>& DetIds = reader.getAllDetIds();
50 
51  // Loop over detectors
52  for (std::vector<uint32_t>::const_iterator detit = DetIds.begin(); detit != DetIds.end(); detit++) {
53  nmodules++;
54  std::vector<char> theSiPixelGainCalibration;
55  const std::pair<int, int>& detUnitDimensions = reader.getDetUnitDimensions(*detit);
56 
57  // Loop over columns and rows
58  for (int i = 0; i < detUnitDimensions.first; i++) {
59  for (int j = 0; j < detUnitDimensions.second; j++) {
60  nchannels++;
61  float gain = 2.8;
62  float ped = 28.2;
63  obj->setData(ped, gain, theSiPixelGainCalibration);
64  }
65  }
66 
67  //std::cout << "detid " << (*detit) << std::endl;
68 
69  SiPixelGainCalibration::Range range(theSiPixelGainCalibration.begin(), theSiPixelGainCalibration.end());
70  if (!obj->put(*detit, range, detUnitDimensions.first))
71  edm::LogError("SiPixelFakeGainESSource")
72  << "[SiPixelFakeGainESSource::produce] detid already exists" << std::endl;
73  }
74 
75  //std::cout << "Modules = " << nmodules << " Channels " << nchannels << std::endl;
76 
77  //
78  return std::unique_ptr<SiPixelGainCalibration>(obj);
79 }
80 
82  const edm::IOVSyncValue& iosv,
83  edm::ValidityInterval& oValidity) {
85  oValidity = infinity;
86 }
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
TrackerGeometry.h
SiPixelFakeGainESSource::SiPixelFakeGainESSource
SiPixelFakeGainESSource(const edm::ParameterSet &)
Definition: SiPixelFakeGainESSource.cc:29
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ValidityInterval
Definition: ValidityInterval.h:28
SiPixelGainCalibrationRcd
Definition: SiPixelGainCalibrationRcd.h:24
SiPixelFakeGainESSource.h
infinity
const double infinity
Definition: CSCChamberFitter.cc:10
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
SiPixelGainCalibration::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiPixelGainCalibration.h:51
SiPixelDetInfoFileReader
Definition: SiPixelDetInfoFileReader.h:28
SiPixelFakeGainESSource::~SiPixelFakeGainESSource
~SiPixelFakeGainESSource() override
Definition: SiPixelFakeGainESSource.cc:38
DQM.reader
reader
Definition: DQM.py:105
SiPixelFakeGainESSource::fp_
edm::FileInPath fp_
Definition: SiPixelFakeGainESSource.h:49
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
SiPixelFakeGainESSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition: SiPixelFakeGainESSource.cc:81
SiPixelDetInfoFileReader.h
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
SiPixelFakeGainESSource::produce
virtual std::unique_ptr< SiPixelGainCalibration > produce(const SiPixelGainCalibrationRcd &)
Definition: SiPixelFakeGainESSource.cc:43
edm::es
Definition: es_Label.h:33
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
SiPixelGainCalibration
Definition: SiPixelGainCalibration.h:29
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163