CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SiStripNoisesFakeESSource Class Reference
Inheritance diagram for SiStripNoisesFakeESSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::unique_ptr< SiStripNoisesReturnType
 

Public Member Functions

ReturnType produce (const SiStripNoisesRcd &)
 
void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
 
 SiStripNoisesFakeESSource (const edm::ParameterSet &)
 
 ~SiStripNoisesFakeESSource () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Private Attributes

SiStripDetInfoFileReader m_detInfoFileReader
 
double m_noisePar0
 
SiStripFakeAPVParameters m_noisePar1
 
SiStripFakeAPVParameters m_noisePar2
 
uint32_t m_printDebug
 
bool m_stripLengthMode
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdm_tTopoToken
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Detailed Description

Description: "fake" SiStripNoises ESProducer

Implementation: Port of SiStripNoisesGenerator and templated fake ESSource to an edm::ESProducer

Definition at line 31 of file SiStripNoisesFakeESSource.cc.

Member Typedef Documentation

◆ ReturnType

Definition at line 40 of file SiStripNoisesFakeESSource.cc.

Constructor & Destructor Documentation

◆ SiStripNoisesFakeESSource()

SiStripNoisesFakeESSource::SiStripNoisesFakeESSource ( const edm::ParameterSet iConfig)

Definition at line 64 of file SiStripNoisesFakeESSource.cc.

64  {
65  setWhatProduced(this).setConsumes(m_tTopoToken);
66  findingRecord<SiStripNoisesRcd>();
67 
68  m_stripLengthMode = iConfig.getParameter<bool>("StripLengthMode");
69 
70  if (!m_stripLengthMode) {
71  //parameters for random noise generation. not used if Strip length mode is chosen
72  m_noisePar0 = iConfig.getParameter<double>("MinPositiveNoise");
73  m_noisePar1 = SiStripFakeAPVParameters(iConfig, "MeanNoise");
74  m_noisePar2 = SiStripFakeAPVParameters(iConfig, "SigmaNoise");
75  } else {
76  //parameters for strip length proportional noise generation. not used if random mode is chosen
77  m_noisePar0 = iConfig.getParameter<double>("electronPerAdc");
78  m_noisePar1 = SiStripFakeAPVParameters(iConfig, "NoiseStripLengthSlope");
79  m_noisePar2 = SiStripFakeAPVParameters(iConfig, "NoiseStripLengthQuote");
80  }
81 
82  m_printDebug = iConfig.getUntrackedParameter<uint32_t>("printDebug", 5);
83 
85  SiStripDetInfoFileReader{iConfig.getParameter<edm::FileInPath>("SiStripDetInfoFile").fullPath()};
86 }

References contentValuesFiles::fullPath, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_detInfoFileReader, m_noisePar0, m_noisePar1, m_noisePar2, m_printDebug, m_stripLengthMode, m_tTopoToken, and edm::ESProducer::setWhatProduced().

◆ ~SiStripNoisesFakeESSource()

SiStripNoisesFakeESSource::~SiStripNoisesFakeESSource ( )
override

Definition at line 88 of file SiStripNoisesFakeESSource.cc.

88 {}

Member Function Documentation

◆ produce()

SiStripNoisesFakeESSource::ReturnType SiStripNoisesFakeESSource::produce ( const SiStripNoisesRcd iRecord)

Definition at line 97 of file SiStripNoisesFakeESSource.cc.

97  {
98  using namespace edm::es;
99 
100  const auto& tTopo = iRecord.get(m_tTopoToken);
101 
102  auto noises = std::make_unique<SiStripNoises>();
103 
104  uint32_t count{0};
105  for (const auto& elm : m_detInfoFileReader.getAllData()) {
106  //Generate Noises for det detid
107  SiStripNoises::InputVector theSiStripVector;
109 
110  if (m_stripLengthMode) {
111  // Use strip length
112  const double linearSlope{m_noisePar1.get(sl)};
113  const double linearQuote{m_noisePar2.get(sl)};
114  const double stripLength{elm.second.stripLength};
115  for (unsigned short j{0}; j < 128 * elm.second.nApvs; ++j) {
116  const float noise = (linearSlope * stripLength + linearQuote) / m_noisePar0;
117  if (count < m_printDebug)
118  printLog(elm.first, j, noise);
119  noises->setData(noise, theSiStripVector);
120  }
121  } else {
122  // Use random generator
123  const double meanN{m_noisePar1.get(sl)};
124  const double sigmaN{m_noisePar2.get(sl)};
125  for (unsigned short j{0}; j < 128 * elm.second.nApvs; ++j) {
126  const float noise = std::max(CLHEP::RandGauss::shoot(meanN, sigmaN), m_noisePar0);
127  if (count < m_printDebug)
128  printLog(elm.first, j, noise);
129  noises->setData(noise, theSiStripVector);
130  }
131  }
132  ++count;
133 
134  if (!noises->put(elm.first, theSiStripVector)) {
135  edm::LogError("SiStripNoisesFakeESSource::produce ") << " detid already exists";
136  }
137  }
138 
139  return noises;
140 }

References KineDebug3::count(), SiStripFakeAPVParameters::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), SiStripDetInfoFileReader::getAllData(), SiStripFakeAPVParameters::getIndex(), dqmiolumiharvest::j, m_detInfoFileReader, m_noisePar0, m_noisePar1, m_noisePar2, m_printDebug, m_stripLengthMode, m_tTopoToken, SiStripPI::max, hgcalDigitizer_cfi::noise, and hgcalLayerClusters_cff::noises.

◆ setIntervalFor()

void SiStripNoisesFakeESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iov,
edm::ValidityInterval iValidity 
)
overridevirtual

Member Data Documentation

◆ m_detInfoFileReader

SiStripDetInfoFileReader SiStripNoisesFakeESSource::m_detInfoFileReader
private

Definition at line 50 of file SiStripNoisesFakeESSource.cc.

Referenced by produce(), and SiStripNoisesFakeESSource().

◆ m_noisePar0

double SiStripNoisesFakeESSource::m_noisePar0
private

Definition at line 46 of file SiStripNoisesFakeESSource.cc.

Referenced by produce(), and SiStripNoisesFakeESSource().

◆ m_noisePar1

SiStripFakeAPVParameters SiStripNoisesFakeESSource::m_noisePar1
private

Definition at line 47 of file SiStripNoisesFakeESSource.cc.

Referenced by produce(), and SiStripNoisesFakeESSource().

◆ m_noisePar2

SiStripFakeAPVParameters SiStripNoisesFakeESSource::m_noisePar2
private

Definition at line 48 of file SiStripNoisesFakeESSource.cc.

Referenced by produce(), and SiStripNoisesFakeESSource().

◆ m_printDebug

uint32_t SiStripNoisesFakeESSource::m_printDebug
private

Definition at line 49 of file SiStripNoisesFakeESSource.cc.

Referenced by produce(), and SiStripNoisesFakeESSource().

◆ m_stripLengthMode

bool SiStripNoisesFakeESSource::m_stripLengthMode
private

Definition at line 45 of file SiStripNoisesFakeESSource.cc.

Referenced by produce(), and SiStripNoisesFakeESSource().

◆ m_tTopoToken

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripNoisesFakeESSource::m_tTopoToken
private

Definition at line 44 of file SiStripNoisesFakeESSource.cc.

Referenced by produce(), and SiStripNoisesFakeESSource().

SiStripNoisesFakeESSource::m_noisePar0
double m_noisePar0
Definition: SiStripNoisesFakeESSource.cc:46
SiStripFakeAPVParameters::getIndex
static index getIndex(const TrackerTopology *tTopo, DetId id)
Definition: SiStripFakeAPVParameters.h:34
hgcalLayerClusters_cff.noises
noises
Definition: hgcalLayerClusters_cff.py:18
SiStripFakeAPVParameters
Definition: SiStripFakeAPVParameters.h:9
SiStripNoisesFakeESSource::m_stripLengthMode
bool m_stripLengthMode
Definition: SiStripNoisesFakeESSource.cc:45
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ValidityInterval
Definition: ValidityInterval.h:28
SiStripNoisesFakeESSource::m_tTopoToken
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_tTopoToken
Definition: SiStripNoisesFakeESSource.cc:44
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
edm::FileInPath
Definition: FileInPath.h:64
SiStripNoisesFakeESSource::m_noisePar2
SiStripFakeAPVParameters m_noisePar2
Definition: SiStripNoisesFakeESSource.cc:48
SiStripNoisesFakeESSource::m_detInfoFileReader
SiStripDetInfoFileReader m_detInfoFileReader
Definition: SiStripNoisesFakeESSource.cc:50
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
SiStripNoisesFakeESSource::m_noisePar1
SiStripFakeAPVParameters m_noisePar1
Definition: SiStripNoisesFakeESSource.cc:47
SiStripFakeAPVParameters::index
std::pair< int, int > index
Definition: SiStripFakeAPVParameters.h:11
edm::LogError
Definition: MessageLogger.h:183
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
SiStripFakeAPVParameters::get
double get(const index &idx) const
Definition: SiStripFakeAPVParameters.h:32
hgcalDigitizer_cfi.noise
noise
Definition: hgcalDigitizer_cfi.py:150
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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
SiStripNoises::InputVector
std::vector< uint16_t > InputVector
Definition: SiStripNoises.h:50
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiStripNoisesFakeESSource::m_printDebug
uint32_t m_printDebug
Definition: SiStripNoisesFakeESSource.cc:49