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 }
54 
56 
58  const edm::IOVSyncValue& iov,
59  edm::ValidityInterval& iValidity) {
60  iValidity = edm::ValidityInterval{iov.beginOfTime(), iov.endOfTime()};
61 }
62 
63 // ------------ method called to produce the data ------------
65  using namespace edm::es;
66 
67  auto pedestals = std::make_unique<SiStripPedestals>();
68 
69  uint32_t count{0};
70  for (const auto& elm : m_detInfo.getAllData()) {
71  //Generate Noises for det detid
72  SiStripPedestals::InputVector theSiStripVector;
73  for (unsigned short j{0}; j < 128 * elm.second.nApvs; ++j) {
74  if (count < m_printDebug) {
75  edm::LogInfo("SiStripPedestalsFakeESSource::makePedestals(): ")
76  << "detid: " << elm.first << " strip: " << j << " ped: " << m_pedestalValue;
77  }
78  pedestals->setData(m_pedestalValue, theSiStripVector);
79  }
80  ++count;
81  if (!pedestals->put(elm.first, theSiStripVector)) {
82  edm::LogError("SiStripPedestalsFakeESSource::produce ") << " detid already exists";
83  }
84  }
85 
86  return pedestals;
87 }
88 
89 //define this as a plug-in
SiStripPedestalsFakeESSource
Definition: SiStripPedestalsFakeESSource.cc:28
MessageLogger.h
SiStripPedestalsFakeESSource::m_printDebug
uint32_t m_printDebug
Definition: SiStripPedestalsFakeESSource.cc:42
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ValidityInterval
Definition: ValidityInterval.h:28
ESProducer.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
SiStripPedestalsRcd
Definition: SiStripCondDataRecords.h:43
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
SiStripDetInfoFileReader::read
SiStripDetInfo read(std::string filePath)
Definition: SiStripDetInfoFileReader.cc:11
edm::FileInPath
Definition: FileInPath.h:61
SiStripPedestalsFakeESSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
Definition: SiStripPedestalsFakeESSource.cc:57
SiStripPedestalsRcd.h
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
SiStripDetInfo::getAllData
const std::map< uint32_t, DetInfo > & getAllData() const noexcept
Definition: SiStripDetInfo.h:59
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:55
SourceFactory.h
edm::ParameterSet
Definition: ParameterSet.h:47
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
SiStripPedestalsFakeESSource::m_detInfo
SiStripDetInfo m_detInfo
Definition: SiStripPedestalsFakeESSource.cc:43
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
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:64
edm::ESProducer
Definition: ESProducer.h:104
SiStripDetInfo
Definition: SiStripDetInfo.h:29
SiStripPedestals::InputVector
std::vector< uint16_t > InputVector
Definition: SiStripPedestals.h:54
ParameterSet.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161
SiStripPedestalsFakeESSource::m_pedestalValue
uint32_t m_pedestalValue
Definition: SiStripPedestalsFakeESSource.cc:41