CMS 3D CMS Logo

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

Public Types

typedef std::unique_ptr< SiStripLorentzAngleReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 

Public Member Functions

ReturnType produce (const SiStripLorentzAngleRcd &)
 
void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
 
 SiStripLorentzAngleFakeESSource (const edm::ParameterSet &)
 
 ~SiStripLorentzAngleFakeESSource () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
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
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Private Attributes

std::vector< double > m_StdDevs_TIB
 
std::vector< double > m_StdDevs_TOB
 
std::vector< double > m_TIB_EstimatedValuesMax
 
std::vector< double > m_TIB_EstimatedValuesMin
 
std::vector< double > m_TIB_PerCent_Errs
 
double m_TIBmeanPerCentError
 
double m_TIBmeanStdDev
 
double m_TIBmeanValueMax
 
double m_TIBmeanValueMin
 
std::vector< double > m_TOB_EstimatedValuesMax
 
std::vector< double > m_TOB_EstimatedValuesMin
 
std::vector< double > m_TOB_PerCent_Errs
 
double m_TOBmeanPerCentError
 
double m_TOBmeanStdDev
 
double m_TOBmeanValueMax
 
double m_TOBmeanValueMin
 
std::vector< bool > m_uniformTIB
 
std::vector< bool > m_uniformTOB
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *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 >
ESConsumesCollector 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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Detailed Description

Description: Generator of the ideal/fake conditions for the LorentzAngle.

It receives input values with layer granularity and it is able to perform gaussian smearing or use a uniform distribution at the module level. Depending on the parameters passed via cfg, it is able to generate the values per DetId with a gaussian distribution and a uniform distribution. When setting the sigma of the gaussian to 0 and passing a single value the generated values are fixed. For TID and TEC the decision to generate with a uniform distribution comes from the setting for the first layers of TIB and TOB.

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

Definition at line 34 of file SiStripLorentzAngleFakeESSource.cc.

Member Typedef Documentation

Definition at line 41 of file SiStripLorentzAngleFakeESSource.cc.

Constructor & Destructor Documentation

SiStripLorentzAngleFakeESSource::SiStripLorentzAngleFakeESSource ( const edm::ParameterSet iConfig)

Definition at line 109 of file SiStripLorentzAngleFakeESSource.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), m_StdDevs_TIB, m_StdDevs_TOB, m_TIB_EstimatedValuesMax, m_TIB_EstimatedValuesMin, m_TIB_PerCent_Errs, m_TIBmeanPerCentError, m_TIBmeanStdDev, m_TIBmeanValueMax, m_TIBmeanValueMin, m_TOB_EstimatedValuesMax, m_TOB_EstimatedValuesMin, m_TOB_PerCent_Errs, m_TOBmeanPerCentError, m_TOBmeanStdDev, m_TOBmeanValueMax, m_TOBmeanValueMin, m_uniformTIB, m_uniformTOB, edm::ESProducer::setWhatProduced(), and create_public_lumi_plots::transform.

110 {
111  setWhatProduced(this);
112  findingRecord<SiStripLorentzAngleRcd>();
113 
114  m_TIB_EstimatedValuesMin = iConfig.getParameter<std::vector<double>>("TIB_EstimatedValuesMin");
115  m_TIB_EstimatedValuesMax = iConfig.getParameter<std::vector<double>>("TIB_EstimatedValuesMax");
116  m_TOB_EstimatedValuesMin = iConfig.getParameter<std::vector<double>>("TOB_EstimatedValuesMin");
117  m_TOB_EstimatedValuesMax = iConfig.getParameter<std::vector<double>>("TOB_EstimatedValuesMax");
118  m_TIB_PerCent_Errs = iConfig.getParameter<std::vector<double>>("TIB_PerCent_Errs");
119  m_TOB_PerCent_Errs = iConfig.getParameter<std::vector<double>>("TOB_PerCent_Errs");
120 
121  // If max values are passed they must be equal in number to the min values.
122  if ( ( ( ! m_TIB_EstimatedValuesMax.empty() ) && ( m_TIB_EstimatedValuesMin.size() != m_TIB_EstimatedValuesMax.size() ) )
123  || ( ( ! m_TOB_EstimatedValuesMax.empty() ) && ( m_TOB_EstimatedValuesMin.size() != m_TOB_EstimatedValuesMax.size() ) ) )
124  {
125  std::cout << "ERROR: size of min and max values is different" << std::endl;
126  std::cout << "TIB_EstimatedValuesMin.size() = " << m_TIB_EstimatedValuesMin.size() << ", TIB_EstimatedValuesMax.size() " << m_TIB_EstimatedValuesMax.size() << std::endl;
127  std::cout << "TOB_EstimatedValuesMin.size() = " << m_TOB_EstimatedValuesMin.size() << ", TOB_EstimatedValuesMax.size() " << m_TOB_EstimatedValuesMax.size() << std::endl;
128  }
129 
130  m_uniformTIB = std::vector<bool>(m_TIB_EstimatedValuesMin.size(), false);
131  m_uniformTOB = std::vector<bool>(m_TOB_EstimatedValuesMin.size(), false);
132  setUniform(m_TIB_EstimatedValuesMin, m_TIB_EstimatedValuesMax, m_uniformTIB);
133  setUniform(m_TOB_EstimatedValuesMin, m_TOB_EstimatedValuesMax, m_uniformTOB);
134 
135  // Compute standard deviations
136  m_StdDevs_TIB = std::vector<double>(m_TIB_EstimatedValuesMin.size(), 0);
137  m_StdDevs_TOB = std::vector<double>(m_TOB_EstimatedValuesMin.size(), 0);
138  transform(m_TIB_EstimatedValuesMin.begin(), m_TIB_EstimatedValuesMin.end(), m_TIB_PerCent_Errs.begin(), m_StdDevs_TIB.begin(), computeSigma);
139  transform(m_TOB_EstimatedValuesMin.begin(), m_TOB_EstimatedValuesMin.end(), m_TOB_PerCent_Errs.begin(), m_StdDevs_TOB.begin(), computeSigma);
140 
141  // Compute mean values to be used with TID and TEC
142  m_TIBmeanValueMin = std::accumulate(m_TIB_EstimatedValuesMin.begin(), m_TIB_EstimatedValuesMin.end(), 0.)/double(m_TIB_EstimatedValuesMin.size());
143  m_TIBmeanValueMax = std::accumulate(m_TIB_EstimatedValuesMax.begin(), m_TIB_EstimatedValuesMax.end(), 0.)/double(m_TIB_EstimatedValuesMax.size());
144  m_TOBmeanValueMin = std::accumulate(m_TOB_EstimatedValuesMin.begin(), m_TOB_EstimatedValuesMin.end(), 0.)/double(m_TOB_EstimatedValuesMin.size());
145  m_TOBmeanValueMax = std::accumulate(m_TOB_EstimatedValuesMax.begin(), m_TOB_EstimatedValuesMax.end(), 0.)/double(m_TOB_EstimatedValuesMax.size());
146  m_TIBmeanPerCentError = std::accumulate(m_TIB_PerCent_Errs.begin(), m_TIB_PerCent_Errs.end(), 0.)/double(m_TIB_PerCent_Errs.size());
147  m_TOBmeanPerCentError = std::accumulate(m_TOB_PerCent_Errs.begin(), m_TOB_PerCent_Errs.end(), 0.)/double(m_TOB_PerCent_Errs.size());
148  m_TIBmeanStdDev = (m_TIBmeanPerCentError/100)*m_TIBmeanValueMin;
149  m_TOBmeanStdDev = (m_TOBmeanPerCentError/100)*m_TOBmeanValueMin;
150 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
SiStripLorentzAngleFakeESSource::~SiStripLorentzAngleFakeESSource ( )
override

Definition at line 152 of file SiStripLorentzAngleFakeESSource.cc.

152 {}

Member Function Documentation

SiStripLorentzAngleFakeESSource::ReturnType SiStripLorentzAngleFakeESSource::produce ( const SiStripLorentzAngleRcd iRecord)

Definition at line 161 of file SiStripLorentzAngleFakeESSource.cc.

References DEFINE_FWK_EVENTSETUP_SOURCE, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_StdDevs_TIB, m_StdDevs_TOB, m_TIB_EstimatedValuesMax, m_TIB_EstimatedValuesMin, m_TIBmeanStdDev, m_TIBmeanValueMax, m_TIBmeanValueMin, m_TOB_EstimatedValuesMax, m_TOB_EstimatedValuesMin, m_TOBmeanStdDev, m_TOBmeanValueMax, m_TOBmeanValueMin, m_uniformTIB, m_uniformTOB, matplotRender::reader, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecRing(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, StripSubdetector::TOB, and TrackerTopology::tobLayer().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

162 {
163  using namespace edm::es;
164 
166  iRecord.getRecord<TrackerTopologyRcd>().get(tTopo);
167 
168  auto lorentzAngle = std::make_unique<SiStripLorentzAngle>();
169 
171  for ( const auto& detId : reader->getAllDetIds() ) {
172  const DetId detectorId = DetId(detId);
173  const int subDet = detectorId.subdetId();
174 
175  float mobi{0.};
176 
177  if ( subDet == int(StripSubdetector::TIB) ) {
178  const int layerId = tTopo->tibLayer(detectorId) -1;
179  mobi = hallMobility(m_TIB_EstimatedValuesMin[layerId], m_TIB_EstimatedValuesMax[layerId], m_StdDevs_TIB[layerId], m_uniformTIB[layerId]);
180  } else if ( subDet == int(StripSubdetector::TOB) ) {
181  const int layerId = tTopo->tobLayer(detectorId) -1;
182  mobi = hallMobility(m_TOB_EstimatedValuesMin[layerId], m_TOB_EstimatedValuesMax[layerId], m_StdDevs_TOB[layerId], m_uniformTOB[layerId]);
183  } else if ( subDet == int (StripSubdetector::TID) ) {
184  // ATTENTION: as of now the uniform generation for TID is decided by the setting for layer 0 of TIB
186  }
187  if ( subDet == int(StripSubdetector::TEC) ) {
188  if ( tTopo->tecRing(detectorId) < 5 ) {
189  // ATTENTION: as of now the uniform generation for TEC is decided by the setting for layer 0 of TIB
191  } else {
192  // ATTENTION: as of now the uniform generation for TEC is decided by the setting for layer 0 of TOB
194  }
195  }
196 
197  if ( ! lorentzAngle->putLorentzAngle(detId, mobi) ) {
198  edm::LogError("SiStripLorentzAngleFakeESSource::produce ") << " detid already exists";
199  }
200  }
201 
202  return lorentzAngle;
203 }
unsigned int tibLayer(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
Definition: DetId.h:18
unsigned int tobLayer(const DetId &id) const
void SiStripLorentzAngleFakeESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iov,
edm::ValidityInterval iValidity 
)
overridevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 154 of file SiStripLorentzAngleFakeESSource.cc.

References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().

155 {
156  iValidity = edm::ValidityInterval{iov.beginOfTime(), iov.endOfTime()};
157 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
static const IOVSyncValue & beginOfTime()

Member Data Documentation

std::vector<double> SiStripLorentzAngleFakeESSource::m_StdDevs_TIB
private

Definition at line 51 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<double> SiStripLorentzAngleFakeESSource::m_StdDevs_TOB
private

Definition at line 52 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<double> SiStripLorentzAngleFakeESSource::m_TIB_EstimatedValuesMax
private

Definition at line 46 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<double> SiStripLorentzAngleFakeESSource::m_TIB_EstimatedValuesMin
private

Definition at line 45 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<double> SiStripLorentzAngleFakeESSource::m_TIB_PerCent_Errs
private

Definition at line 49 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by SiStripLorentzAngleFakeESSource().

double SiStripLorentzAngleFakeESSource::m_TIBmeanPerCentError
private

Definition at line 59 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by SiStripLorentzAngleFakeESSource().

double SiStripLorentzAngleFakeESSource::m_TIBmeanStdDev
private

Definition at line 61 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

double SiStripLorentzAngleFakeESSource::m_TIBmeanValueMax
private

Definition at line 56 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

double SiStripLorentzAngleFakeESSource::m_TIBmeanValueMin
private

Definition at line 55 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<double> SiStripLorentzAngleFakeESSource::m_TOB_EstimatedValuesMax
private

Definition at line 48 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<double> SiStripLorentzAngleFakeESSource::m_TOB_EstimatedValuesMin
private

Definition at line 47 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<double> SiStripLorentzAngleFakeESSource::m_TOB_PerCent_Errs
private

Definition at line 50 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by SiStripLorentzAngleFakeESSource().

double SiStripLorentzAngleFakeESSource::m_TOBmeanPerCentError
private

Definition at line 60 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by SiStripLorentzAngleFakeESSource().

double SiStripLorentzAngleFakeESSource::m_TOBmeanStdDev
private

Definition at line 62 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

double SiStripLorentzAngleFakeESSource::m_TOBmeanValueMax
private

Definition at line 58 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

double SiStripLorentzAngleFakeESSource::m_TOBmeanValueMin
private

Definition at line 57 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<bool> SiStripLorentzAngleFakeESSource::m_uniformTIB
private

Definition at line 53 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().

std::vector<bool> SiStripLorentzAngleFakeESSource::m_uniformTOB
private

Definition at line 54 of file SiStripLorentzAngleFakeESSource.cc.

Referenced by produce(), and SiStripLorentzAngleFakeESSource().