28 produces<nanoaod::FlatTable, edm::Transition::BeginRun>();
29 produces<nanoaod::FlatTable, edm::Transition::BeginRun>(
"magField");
38 desc.add<
std::string>(
"doc",
"Run info for the Lorentz angle measurement");
39 descriptions.
add(
"siStripLorentzAngleRunInfoTable",
desc);
53 template <
typename VALUES>
65 std::vector<uint32_t> c_rawid;
66 std::vector<float> c_globalZofunitlocalY, c_localB, c_BdotY, c_driftx, c_drifty, c_driftz, c_lorentzAngle;
68 auto dets = tkGeom.detsTIB();
69 dets.insert(dets.end(), tkGeom.detsTID().begin(), tkGeom.detsTID().end());
70 dets.insert(dets.end(), tkGeom.detsTOB().begin(), tkGeom.detsTOB().end());
71 dets.insert(dets.end(), tkGeom.detsTEC().begin(), tkGeom.detsTEC().end());
72 for (
auto det : dets) {
73 auto detid = det->geographicalId().rawId();
76 c_rawid.push_back(detid);
79 c_localB.push_back(locB.mag());
82 c_driftx.push_back(
drift.
x());
83 c_drifty.push_back(
drift.
y());
84 c_driftz.push_back(
drift.
z());
85 c_lorentzAngle.push_back(lorentzAngle.getLorentzAngle(detid));
88 auto out = std::make_unique<nanoaod::FlatTable>(c_rawid.size(),
m_name,
false,
false);
89 addColumn(
out.get(),
"rawid", c_rawid,
"DetId");
90 addColumn(
out.get(),
"globalZofunitlocalY", c_globalZofunitlocalY,
"z component of a local unit vector along y");
91 addColumn(
out.get(),
"localB", c_localB,
"Local magnitude of the magnetic field");
92 addColumn(
out.get(),
"BdotY", c_BdotY,
"Magnetic field projection on the local y axis");
93 addColumn(
out.get(),
"driftx", c_driftx,
"x component of the drift vector");
94 addColumn(
out.get(),
"drifty", c_drifty,
"y component of the drift vector");
95 addColumn(
out.get(),
"driftz", c_driftz,
"z component of the drift vector");
96 addColumn(
out.get(),
"lorentzAngle", c_lorentzAngle,
"Lorentz angle from database");
100 out2->addColumnValue<
float>(
101 "origin", magField.inTesla(
GlobalPoint(0, 0, 0)).z(),
"z-component of the magnetic field at (0,0,0) in Tesla");
const std::string m_magFieldName
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Global3DPoint GlobalPoint
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_tkGeomToken
LocalPoint toLocal(const GlobalPoint &gp) const
void globalBeginRunProduce(edm::Run &iRun, edm::EventSetup const &iSetup) const override
Container::value_type value_type
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
#define DEFINE_FWK_MODULE(type)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
const Plane & surface() const
The nominal surface of the GeomDet.
const PositionType & position() const
void put(std::unique_ptr< PROD > product)
Put a new product.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleDepRcd > m_lorentzAngleToken
SiStripLorentzAngleRunInfoTableProducer(const edm::ParameterSet ¶ms)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_magFieldToken