44 auto cc = setWhatProduced(
this);
49 const float theMagField = iMagfield->
inTesla(center).
mag();
50 if (theMagField >= -0.1 && theMagField < 1.0)
53 if (theMagField >= 3.9 || theMagField < 3.65)
54 edm::LogWarning(
"UnexpectedMagneticFieldUsingDefaultPixelTemplate") <<
"Magnetic field is " << theMagField;
59 magfieldToken_ =
cc.consumes();
65 const float theMagField = iRecord.
get(magfieldToken_).inTesla(center).mag();
67 const auto& dbobject = iRecord.
get(templateToken_);
69 if (std::fabs(theMagField - dbobject.sVector()[22]) > 0.1)
71 <<
"Magnetic field is " << theMagField <<
" Template Magnetic field is " << dbobject.sVector()[22];
edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectRcd > templateToken_
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
uint32_t cc[maxCellsPerHit]
SiPixelTemplateDBObjectESProducer(const edm::ParameterSet &iConfig)
std::shared_ptr< const SiPixelTemplateDBObject > produce(const SiPixelTemplateDBObjectESProducerRcd &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
Log< level::Warning, false > LogWarning
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const