Implements edm::one::EDAnalyzerBase.
Definition at line 71 of file SiPixelLorentzAngleDBLoader.cc.
References cond::service::PoolDBOutputService::appendOneIOV(), cond::service::PoolDBOutputService::beginOfTime(), PixelEndcapName::bladeName(), bPixLorentzAnglePerTesla_, BPixParameters_, cond::service::PoolDBOutputService::createOneIOV(), cond::service::PoolDBOutputService::currentTime(), TrackerGeometry::detUnits(), PixelEndcapName::diskName(), cppFunctionSkipper::exception, newFWLiteAna::found, fPixLorentzAnglePerTesla_, FPixParameters_, edm::EventSetup::getData(), HVgroup(), edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), PVValHelper::ladder, nano_mu_digi_cff::layer, SiStripSimParameters_cfi::LorentzAngle, callgraph::module, ModuleParameters_, PixelEndcapName::pannelName(), pfMETsysShiftCorrections_cfi::parameter, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxbModule(), nano_mu_digi_cff::rawId, DetId::rawId(), recordName_, relativeConstraints::ring, PixelEndcapName::ringName(), TrackerTopology::side(), DetId::subdetId(), tkGeomToken_, tkTopoToken_, unit(), useFile_, and cms::Exception::what().
72 static constexpr
int nModules_ = 4;
81 if (
auto pixelUnit = dynamic_cast<PixelGeomDetUnit const*>(
unit)) {
82 const DetId detid = pixelUnit->geographicalId();
85 int side = tTopo->
side(detid);
94 if (
module < nModules_ + 1) {
100 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
" pixel barrel:" 102 <<
" rawId=" <<
rawId <<
" side=" << side;
106 LogPrint(
"SiPixelLorentzAngleDBLoader")
109 LogError(
"SiPixelLorentzAngleDBLoader") <<
"ERROR!: detid already exists";
113 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
"method for reading file not implemented yet";
118 if (moduleParam.getParameter<
unsigned int>(
"rawid") == detid.
rawId()) {
119 float lorentzangle =
static_cast<float>(moduleParam.getParameter<
double>(
"angle"));
122 LogPrint(
"SiPixelLorentzAngleDBLoader")
123 <<
" >> LA=" << lorentzangle <<
" individual value " << detid.
rawId();
126 LogError(
"SiPixelLorentzAngleDBLoader") <<
"ERROR!: detid already exists";
133 if (bpixParam.exists(
"layer")) {
134 if (bpixParam.getParameter<
int>(
"layer") !=
layer)
136 if (bpixParam.exists(
"ladder"))
137 if (bpixParam.getParameter<
int>(
"ladder") !=
ladder)
139 if (bpixParam.exists(
"module"))
140 if (bpixParam.getParameter<
int>(
"module") !=
module)
142 if (bpixParam.exists(
"side"))
143 if (bpixParam.getParameter<
int>(
"side") != side)
146 float lorentzangle =
static_cast<float>(bpixParam.getParameter<
double>(
"angle"));
148 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
" >> LA=" << lorentzangle;
150 }
else if (
found == 1) {
151 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
"The detid already given in ModuleParameters, skipping ...";
153 LogError(
"SiPixelLorentzAngleDBLoader") <<
"ERROR!: detid already exists";
162 int disk = pen.diskName();
163 int blade = pen.bladeName();
164 int panel = pen.pannelName();
165 int ring = pen.ringName();
167 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
" pixel endcap:" 168 <<
" side=" << side <<
" disk=" << disk <<
" blade=" << blade
169 <<
" pannel=" << panel <<
" ring=" <<
ring <<
" rawId=" <<
rawId;
175 LogError(
"SiPixelLorentzAngleDBLoader") <<
"detid already exists";
179 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
"method for reading file not implemented yet";
184 if (
parameter.getParameter<
unsigned int>(
"rawid") == detid.
rawId()) {
185 float lorentzangle =
static_cast<float>(
parameter.getParameter<
double>(
"angle"));
188 LogPrint(
"SiPixelLorentzAngleDBLoader")
189 <<
" LA=" << lorentzangle <<
" individual value " << detid.
rawId();
192 LogError(
"SiPixelLorentzAngleDBLoader") <<
"ERROR!: detid already exists";
198 if (fpixParam.exists(
"side"))
199 if (fpixParam.getParameter<
int>(
"side") != side)
201 if (fpixParam.exists(
"disk"))
202 if (fpixParam.getParameter<
int>(
"disk") != disk)
204 if (fpixParam.exists(
"ring"))
205 if (fpixParam.getParameter<
int>(
"ring") !=
ring)
207 if (fpixParam.exists(
"blade"))
208 if (fpixParam.getParameter<
int>(
"blade") != blade)
210 if (fpixParam.exists(
"panel"))
211 if (fpixParam.getParameter<
int>(
"panel") != panel)
213 if (fpixParam.exists(
"HVgroup"))
214 if (fpixParam.getParameter<
int>(
"HVgroup") !=
HVgroup(panel,
ring))
217 float lorentzangle =
static_cast<float>(fpixParam.getParameter<
double>(
"angle"));
219 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
" >> LA=" << lorentzangle;
221 }
else if (
found == 1) {
222 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
"The detid already given in ModuleParameters, skipping ...";
224 LogError(
"SiPixelLorentzAngleDBLoader") <<
" ERROR!: detid already exists";
240 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
"SiPixelLorentzAngleDBLoader" << er.
what();
242 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
"SiPixelLorentzAngleDBLoader" 243 <<
"caught std::exception " << er.what();
246 LogPrint(
"SiPixelLorentzAngleDBLoader") <<
"Service is unavailable";
unsigned int pxbLayer(const DetId &id) const
Base exception class for the object to relational access.
const Parameters ModuleParameters_
cond::Time_t beginOfTime() const
float fPixLorentzAnglePerTesla_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
unsigned int pxbLadder(const DetId &id) const
Log< level::Error, false > LogError
unsigned int side(const DetId &id) const
int HVgroup(int panel, int module)
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
const Parameters BPixParameters_
bool isNewTagRequest(const std::string &recordName)
cond::Time_t currentTime() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Log< level::Warning, true > LogPrint
Basic3DVector unit() const
const std::string recordName_
float bPixLorentzAnglePerTesla_
constexpr uint32_t rawId() const
get the raw id
unsigned int pxbModule(const DetId &id) const
char const * what() const noexcept override
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkTopoToken_
const Parameters FPixParameters_