76 #include "CLHEP/Random/RandFlat.h" 77 #include "CLHEP/Random/RandGauss.h" 81 void setUniform(
const std::vector<double>& estimatedValuesMin,
82 const std::vector<double>& estimatedValuesMax,
83 std::vector<bool>& uniform) {
84 if (!estimatedValuesMax.empty()) {
85 std::vector<double>::const_iterator
min = estimatedValuesMin.begin();
86 std::vector<double>::const_iterator
max = estimatedValuesMax.begin();
87 std::vector<bool>::iterator uniformIt = uniform.begin();
88 for (;
min != estimatedValuesMin.end(); ++
min, ++
max, ++uniformIt) {
95 double computeSigma(
const double&
value,
const double& perCentError) {
return (perCentError / 100) *
value; }
103 float hallMobility(
const double& meanMin,
const double& meanMax,
const double& sigma,
const bool uniform) {
105 return CLHEP::RandFlat::shoot(meanMin, meanMax);
106 }
else if (sigma > 0) {
107 return CLHEP::RandGauss::shoot(meanMin, sigma);
118 findingRecord<SiStripLorentzAngleRcd>();
130 std::cout <<
"ERROR: size of min and max values is different" << std::endl;
189 auto lorentzAngle = std::make_unique<SiStripLorentzAngle>();
193 const int subDet = detectorId.
subdetId();
198 const int layerId = tTopo.tibLayer(detectorId) - 1;
204 const int layerId = tTopo.tobLayer(detectorId) - 1;
214 if (tTopo.tecRing(detectorId) < 5) {
223 if (!lorentzAngle->putLorentzAngle(detId, mobi)) {
224 edm::LogError(
"SiStripLorentzAngleFakeESSource::produce ") <<
" detid already exists";
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
static constexpr auto TEC
T getParameter(std::string const &) const
SiStripLorentzAngleFakeESSource(const edm::ParameterSet &)
std::vector< double > m_TIB_EstimatedValuesMin
std::vector< double > m_StdDevs_TOB
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
uint32_t cc[maxCellsPerHit]
edm::ESGetToken< GeometricDet, IdealGeometryRecord > m_geomDetToken
static const IOVSyncValue & endOfTime()
std::vector< double > m_TOB_EstimatedValuesMin
Log< level::Error, false > LogError
std::vector< bool > m_uniformTIB
double m_TOBmeanPerCentError
std::vector< bool > m_uniformTOB
std::vector< double > m_TOB_PerCent_Errs
static const IOVSyncValue & beginOfTime()
double m_TIBmeanPerCentError
std::vector< uint32_t > getSiStripDetIds(const GeometricDet &geomDet)
std::vector< double > m_TOB_EstimatedValuesMax
std::vector< double > m_StdDevs_TIB
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto TOB
ReturnType produce(const SiStripLorentzAngleRcd &)
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
static constexpr auto TIB
std::vector< double > m_TIB_EstimatedValuesMax
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_tTopoToken
std::unique_ptr< SiStripLorentzAngle > ReturnType
~SiStripLorentzAngleFakeESSource() override
const DepRecordT getRecord() const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
static constexpr auto TID
std::vector< double > m_TIB_PerCent_Errs