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()) {
114 const DetId detid = det_u->geographicalId();
115 uint32_t rawId = detid.
rawId();
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)
#define DEFINE_FWK_MODULE(type)
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.
constexpr Detector det() const
get the detector field from this detid
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)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getData(T &iHolder) const
static constexpr auto TOB
Log< level::Info, false > LogInfo
constexpr uint32_t rawId() const
get the raw id
SiPhase2OuterTrackerLorentzAngleWriter(const edm::ParameterSet &)
Log< level::Warning, false > LogWarning
static constexpr auto TID
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~SiPhase2OuterTrackerLorentzAngleWriter() override