CMS 3D CMS Logo

SiStripThresholdFakeESSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/SiStripESProducers
4 // Class: SiStripThresholdFakeESSource
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<SiStripThreshold> ReturnType;
39 
40 private:
41  float m_lTh;
42  float m_hTh;
43  float m_cTh;
45 };
46 
48  setWhatProduced(this);
49  findingRecord<SiStripThresholdRcd>();
50 
51  m_lTh = iConfig.getParameter<double>("LowTh");
52  m_hTh = iConfig.getParameter<double>("HighTh");
53  m_cTh = iConfig.getParameter<double>("ClusTh");
55  SiStripDetInfoFileReader{iConfig.getParameter<edm::FileInPath>("SiStripDetInfoFile").fullPath()};
56 }
57 
59 
61  const edm::IOVSyncValue& iov,
62  edm::ValidityInterval& iValidity) {
63  iValidity = edm::ValidityInterval{iov.beginOfTime(), iov.endOfTime()};
64 }
65 
66 // ------------ method called to produce the data ------------
68  using namespace edm::es;
69 
70  auto threshold = std::make_unique<SiStripThreshold>();
71 
72  for (const auto& elm : m_detInfoFileReader.getAllData()) {
73  //Generate Thresholds for det detid
74  SiStripThreshold::Container theSiStripVector;
75  uint16_t strip = 0;
76 
77  threshold->setData(strip, m_lTh, m_hTh, m_cTh, theSiStripVector);
78  LogDebug("SiStripThresholdFakeESSource::produce")
79  << "detid: " << elm.first << " \t"
80  << "firstStrip: " << strip << " \t" << theSiStripVector.back().getFirstStrip() << " \t"
81  << "lTh: " << m_lTh << " \t" << theSiStripVector.back().getLth() << " \t"
82  << "hTh: " << m_hTh << " \t" << theSiStripVector.back().getHth() << " \t"
83  << "FirstStrip_and_Hth: " << theSiStripVector.back().FirstStrip_and_Hth << " \t";
84 
85  if (!threshold->put(elm.first, theSiStripVector)) {
86  edm::LogError("SiStripThresholdFakeESSource::produce ") << " detid already exists";
87  }
88  }
89 
90  return threshold;
91 }
92 
93 //define this as a plug-in
MessageLogger.h
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
SiStripThresholdFakeESSource::m_hTh
float m_hTh
Definition: SiStripThresholdFakeESSource.cc:42
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ValidityInterval
Definition: ValidityInterval.h:28
ESProducer.h
SiStripThresholdFakeESSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
Definition: SiStripThresholdFakeESSource.cc:60
SiStripThreshold::Container
std::vector< Data > Container
Definition: SiStripThreshold.h:104
SiStripThresholdFakeESSource::m_detInfoFileReader
SiStripDetInfoFileReader m_detInfoFileReader
Definition: SiStripThresholdFakeESSource.cc:44
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
SiStripThresholdFakeESSource::m_lTh
float m_lTh
Definition: SiStripThresholdFakeESSource.cc:41
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
edm::FileInPath
Definition: FileInPath.h:64
SiStripThresholdFakeESSource::~SiStripThresholdFakeESSource
~SiStripThresholdFakeESSource() override
Definition: SiStripThresholdFakeESSource.cc:58
SiStripDetInfoFileReader.h
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
SiStripThreshold.h
DEFINE_FWK_EVENTSETUP_SOURCE
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:91
EventSetupRecordIntervalFinder.h
SiStripThresholdRcd
Definition: SiStripCondDataRecords.h:51
SourceFactory.h
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
SiStripThresholdRcd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SiStripThresholdFakeESSource::produce
ReturnType produce(const SiStripThresholdRcd &)
Definition: SiStripThresholdFakeESSource.cc:67
SiStripDetInfoFileReader::getAllData
const std::map< uint32_t, DetInfo > & getAllData() const
Definition: SiStripDetInfoFileReader.h:58
edm::es
Definition: es_Label.h:33
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
edm::ESProducer
Definition: ESProducer.h:101
ParameterSet.h
SiStripThresholdFakeESSource
Definition: SiStripThresholdFakeESSource.cc:28
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
SiStripThresholdFakeESSource::ReturnType
std::unique_ptr< SiStripThreshold > ReturnType
Definition: SiStripThresholdFakeESSource.cc:37
SiStripThresholdFakeESSource::m_cTh
float m_cTh
Definition: SiStripThresholdFakeESSource.cc:43
SiStripThresholdFakeESSource::SiStripThresholdFakeESSource
SiStripThresholdFakeESSource(const edm::ParameterSet &)
Definition: SiStripThresholdFakeESSource.cc:47