CMS 3D CMS Logo

SiStripPedestalsFakeESSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/SiStripESProducers
4 // Class: SiStripPedestalsFakeESSource
5 //
14 // system include files
15 #include <memory>
16 
17 // user include files
20 
25 
27 
29 public:
32 
34  const edm::IOVSyncValue& iov,
35  edm::ValidityInterval& iValidity) override;
36 
37  typedef std::unique_ptr<SiStripPedestals> ReturnType;
39 
40 private:
41  uint32_t m_pedestalValue;
42  uint32_t m_printDebug;
44 };
45 
47  setWhatProduced(this);
48  findingRecord<SiStripPedestalsRcd>();
49 
50  m_pedestalValue = iConfig.getParameter<uint32_t>("PedestalValue");
51  m_printDebug = iConfig.getUntrackedParameter<uint32_t>("printDebug", 5);
53  SiStripDetInfoFileReader{iConfig.getParameter<edm::FileInPath>("SiStripDetInfoFile").fullPath()};
54 }
55 
57 
59  const edm::IOVSyncValue& iov,
60  edm::ValidityInterval& iValidity) {
61  iValidity = edm::ValidityInterval{iov.beginOfTime(), iov.endOfTime()};
62 }
63 
64 // ------------ method called to produce the data ------------
66  using namespace edm::es;
67 
68  auto pedestals = std::make_unique<SiStripPedestals>();
69 
70  uint32_t count{0};
71  for (const auto& elm : m_detInfoFileReader.getAllData()) {
72  //Generate Noises for det detid
73  SiStripPedestals::InputVector theSiStripVector;
74  for (unsigned short j{0}; j < 128 * elm.second.nApvs; ++j) {
75  if (count < m_printDebug) {
76  edm::LogInfo("SiStripPedestalsFakeESSource::makePedestals(): ")
77  << "detid: " << elm.first << " strip: " << j << " ped: " << m_pedestalValue;
78  }
79  pedestals->setData(m_pedestalValue, theSiStripVector);
80  }
81  ++count;
82  if (!pedestals->put(elm.first, theSiStripVector)) {
83  edm::LogError("SiStripPedestalsFakeESSource::produce ") << " detid already exists";
84  }
85  }
86 
87  return pedestals;
88 }
89 
90 //define this as a plug-in
SiStripPedestalsFakeESSource
Definition: SiStripPedestalsFakeESSource.cc:28
MessageLogger.h
SiStripPedestalsFakeESSource::m_printDebug
uint32_t m_printDebug
Definition: SiStripPedestalsFakeESSource.cc:42
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ValidityInterval
Definition: ValidityInterval.h:28
SiStripPedestalsFakeESSource::m_detInfoFileReader
SiStripDetInfoFileReader m_detInfoFileReader
Definition: SiStripPedestalsFakeESSource.cc:43
ESProducer.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
SiStripPedestalsRcd
Definition: SiStripCondDataRecords.h:43
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
edm::FileInPath
Definition: FileInPath.h:64
SiStripPedestalsFakeESSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
Definition: SiStripPedestalsFakeESSource.cc:58
SiStripPedestalsRcd.h
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
SiStripDetInfoFileReader.h
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
DEFINE_FWK_EVENTSETUP_SOURCE
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:91
EventSetupRecordIntervalFinder.h
SiStripPedestalsFakeESSource::~SiStripPedestalsFakeESSource
~SiStripPedestalsFakeESSource() override
Definition: SiStripPedestalsFakeESSource.cc:56
SourceFactory.h
edm::ParameterSet
Definition: ParameterSet.h:47
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
SiStripPedestalsFakeESSource::SiStripPedestalsFakeESSource
SiStripPedestalsFakeESSource(const edm::ParameterSet &)
Definition: SiStripPedestalsFakeESSource.cc:46
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiStripPedestalsFakeESSource::ReturnType
std::unique_ptr< SiStripPedestals > ReturnType
Definition: SiStripPedestalsFakeESSource.cc:37
SiStripDetInfoFileReader::getAllData
const std::map< uint32_t, DetInfo > & getAllData() const
Definition: SiStripDetInfoFileReader.h:58
SiStripPedestals.h
edm::es
Definition: es_Label.h:33
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripPedestalsFakeESSource::produce
ReturnType produce(const SiStripPedestalsRcd &)
Definition: SiStripPedestalsFakeESSource.cc:65
edm::ESProducer
Definition: ESProducer.h:104
SiStripPedestals::InputVector
std::vector< uint16_t > InputVector
Definition: SiStripPedestals.h:54
ParameterSet.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiStripPedestalsFakeESSource::m_pedestalValue
uint32_t m_pedestalValue
Definition: SiStripPedestalsFakeESSource.cc:41