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();
74 const StripGeomDetUnit* stripDet = dynamic_cast<const StripGeomDetUnit*>(tkGeom.idToDet(det->geographicalId()));
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");