48 std::vector<std::pair<uint32_t, float> >
detid_la;
58 recordName_(conf.getUntrackedParameter<
std::
string>(
"record",
"SiPixelLorentzAngleRcd")),
59 useFile_(conf.getParameter<
bool>(
"useFile")),
60 fileName_(conf.getParameter<
string>(
"fileName")),
61 BPixParameters_(conf.getUntrackedParameter<
Parameters>(
"BPixParameters")),
62 FPixParameters_(conf.getUntrackedParameter<
Parameters>(
"FPixParameters")),
63 ModuleParameters_(conf.getUntrackedParameter<
Parameters>(
"ModuleParameters")) {
81 if (
auto pixelUnit = dynamic_cast<PixelGeomDetUnit const*>(
unit)) {
82 const DetId detid = pixelUnit->geographicalId();
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";
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";
253 }
else if (1 == panel && (3 ==
module || 4 ==
module)) {
255 }
else if (2 == panel && 1 ==
module) {
257 }
else if (2 == panel && (2 ==
module || 3 ==
module)) {
260 LogError(
"SiPixelLorentzAngleDBLoader")
261 <<
" *** error *** in SiPixelLorentzAngleDBLoader::HVgroup(...), panel = " << panel <<
", module = " <<
module
unsigned int pxbLayer(const DetId &id) const
Base exception class for the object to relational access.
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
int ringName() const
ring Id
int bladeName() const
blade id
const Parameters ModuleParameters_
cond::Time_t beginOfTime() const
float fPixLorentzAnglePerTesla_
ALPAKA_FN_ACC int side(int ieta, int iphi)
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 analyze(const edm::Event &e, const edm::EventSetup &c) override
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
T getUntrackedParameter(std::string const &, T const &) const
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
const std::string fileName_
const Parameters BPixParameters_
bool isNewTagRequest(const std::string &recordName)
cond::Time_t currentTime() const
int diskName() const
disk id
std::vector< std::pair< uint32_t, float > > detid_la
~SiPixelLorentzAngleDBLoader() override=default
SiPixelLorentzAngleDBLoader(const edm::ParameterSet &conf)
#define DEFINE_FWK_MODULE(type)
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
std::vector< edm::ParameterSet > Parameters
static const std::string kSharedResource
unsigned int pxbModule(const DetId &id) const
char const * what() const noexcept override
int pannelName() const
pannel id
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkTopoToken_
const Parameters FPixParameters_