24 #include <unordered_map> 70 m_record(iConfig.getParameter<
std::
string>(
"record")),
71 m_tag(iConfig.getParameter<
std::
string>(
"tag")),
72 m_value(iConfig.getParameter<double>(
"value")) {}
76 <<
"SiPhase2OuterTrackerLorentzAngleWriter::~SiPhase2OuterTrackerLorentzAngleWriter" << std::endl;
88 <<
"SiPhase2OuterTrackerLorentzAngleWriter::analyze " << std::endl;
93 edm::LogWarning(
"SiPhase2OuterTrackerLorentzAngleWriter") <<
"Service is unavailable" << std::endl;
98 unsigned int irun =
iEvent.id().run();
99 edm::LogVerbatim(
"SiPhase2OuterTrackerLorentzAngleWriter") <<
"Writing on tag : " <<
tag << std::endl;
100 edm::LogVerbatim(
"SiPhase2OuterTrackerLorentzAngleWriter") <<
"Usinng as IOV run : " << irun << std::endl;
103 std::unordered_map<unsigned int, float> detsLAtoDB;
111 <<
" There are " << pDD->
detUnits().size() <<
" modules in this geometry." << std::endl;
113 for (
auto const& det_u : pDD->
detUnits()) {
116 int subid =
detid.subdetId();
120 LogDebug(
"SiPhase2OuterTrackerLorentzAngleWriter") <<
rawId <<
" is a " << subid <<
" det" << std::endl;
122 LogDebug(
"SiPhase2OuterTrackerLorentzAngleWriter")
123 <<
"subdetector ID:" << subid <<
" layer:" << tTopo->
layer(
detid) << std::endl;
130 <<
" There are " << detsLAtoDB.size() <<
" OT Lorentz Angle values assigned" << std::endl;
133 auto lorentzAngle = std::make_unique<SiPhase2OuterTrackerLorentzAngle>();
134 lorentzAngle->putLorentzAngles(detsLAtoDB);
135 edm::LogInfo(
"SiPhase2OuterTrackerLorentzAngleWriter") <<
"currentTime " << mydbservice->
currentTime() << std::endl;
142 desc.setComment(
"Module to write SiPhase2OuterTrackerLorentzAngle Payloads");
143 desc.add<
std::string>(
"record",
"SiPhase2OuterTrackerLorentzAngleRcd")->setComment(
"record to write");
144 desc.add<
std::string>(
"tag",
"SiPhase2OuterTrackerLorentzAngle")->setComment(
"tag to write");
145 desc.add<
double>(
"value", 0.07)->setComment(
"value to be put in the payload");
Log< level::Info, true > LogVerbatim
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
void analyze(const edm::Event &, const edm::EventSetup &) override
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
unsigned int layer(const DetId &id) const
std::string tag(const std::string &recordName)
cond::Time_t currentTime() const
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
#define DEFINE_FWK_MODULE(type)
static constexpr auto TOB
Log< level::Info, false > LogInfo
SiPhase2OuterTrackerLorentzAngleWriter(const edm::ParameterSet &)
Log< level::Warning, false > LogWarning
static constexpr auto TID
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~SiPhase2OuterTrackerLorentzAngleWriter() override