50 using namespace edm::es;
51 unsigned int nmodules = 0;
54 const std::vector<uint32_t>& DetIds =
reader.getAllDetIds();
59 for (
const auto& detit : DetIds) {
61 const DetId detid(detit);
62 auto rawId = detid.rawId();
64 int side = tTopo.side(detid);
68 int layer = tTopo.pxbLayer(detid);
70 int ladder = tTopo.pxbLadder(detid);
72 int module = tTopo.pxbModule(detid);
79 LogDebug(
"SiPixelFakeLorentzAngleESSource") <<
" pixel barrel:"
80 <<
" layer=" << layer <<
" ladder=" << ladder <<
" module=" << module
81 <<
" rawId=" << rawId <<
" side " << side;
89 <<
"ERROR!: detid " << rawId <<
" already exists" << std::endl;
93 if (it.getParameter<
unsigned int>(
"rawid") == detid.rawId()) {
94 float lorentzangle = (float)it.getParameter<
double>(
"angle");
96 obj->putLorentzAngle(detid.rawId(), lorentzangle);
98 <<
" LA= " << lorentzangle <<
" individual value " << detid.rawId() << std::endl;
101 edm::LogError(
"SiPixelFakeLorentzAngleESSource") <<
"ERROR!: detid already exists" << std::endl;
107 if (it.exists(
"layer"))
108 if (it.getParameter<
int>(
"layer") !=
layer)
110 if (it.exists(
"ladder"))
111 if (it.getParameter<
int>(
"ladder") !=
ladder)
113 if (it.exists(
"module"))
114 if (it.getParameter<
int>(
"module") !=
module)
116 if (it.exists(
"side"))
117 if (it.getParameter<
int>(
"side") != side)
120 float lorentzangle = (float)it.getParameter<
double>(
"angle");
121 obj->putLorentzAngle(detid.rawId(), lorentzangle);
122 edm::LogInfo(
"SiPixelFakeLorentzAngleESSource") <<
" LA= " << lorentzangle << std::endl;
124 }
else if (found == 1) {
126 <<
"detid already given in ModuleParameters, skipping ..." << std::endl;
129 <<
" ERROR!: detid " << rawId <<
" already exists" << std::endl;
142 int disk = pen.diskName();
143 int blade = pen.bladeName();
144 int panel = pen.pannelName();
145 int ring = pen.ringName();
147 LogDebug(
"SiPixelFakeLorentzAngleESSource") <<
" pixel endcap:"
148 <<
" side=" << side <<
" disk=" << disk <<
" blade =" << blade
149 <<
" pannel=" << panel <<
" ring=" << ring <<
" rawId=" << rawId;
156 edm::LogError(
"SiPixelFakeLorentzAngleESSource") <<
" ERROR! detid already exists" << std::endl;
159 for (
const auto& it : ModuleParameters_) {
160 if (it.getParameter<
unsigned int>(
"rawid") == detid.rawId()) {
161 float lorentzangle = (float)it.getParameter<
double>(
"angle");
163 obj->putLorentzAngle(detid.rawId(), lorentzangle);
165 <<
" LA= " << lorentzangle <<
" individual value " << detid.rawId() << std::endl;
169 <<
"ERROR!: detid " << rawId <<
" already exists" << std::endl;
175 if (it.exists(
"side"))
176 if (it.getParameter<
int>(
"side") != side)
178 if (it.exists(
"disk"))
179 if (it.getParameter<
int>(
"disk") != disk)
181 if (it.exists(
"ring"))
182 if (it.getParameter<
int>(
"ring") !=
ring)
184 if (it.exists(
"blade"))
185 if (it.getParameter<
int>(
"blade") != blade)
187 if (it.exists(
"panel"))
188 if (it.getParameter<
int>(
"panel") != panel)
190 if (it.exists(
"HVgroup"))
191 if (it.getParameter<
int>(
"HVgroup") !=
HVgroup(panel, ring))
194 float lorentzangle = (float)it.getParameter<
double>(
"angle");
195 obj->putLorentzAngle(detid.rawId(), lorentzangle);
196 edm::LogInfo(
"SiPixelFakeLorentzAngleESSource") <<
" LA= " << lorentzangle << std::endl;
198 }
else if (found == 1) {
200 <<
" detid " << rawId <<
" already given in ModuleParameters, skipping ..." << std::endl;
203 <<
"ERROR!: detid" << rawId <<
"already exists" << std::endl;
209 edm::LogInfo(
"SiPixelFakeLorentzAngleESSource") <<
"Modules = " << nmodules << std::endl;
211 return std::unique_ptr<SiPixelLorentzAngle>(
obj);
Parameters FPixParameters_
const edm::FileInPath fp_
Log< level::Error, false > LogError
constexpr std::array< uint8_t, layerIndexSize > layer
float bPixLorentzAnglePerTesla_
int HVgroup(int panel, int module)
const edm::FileInPath t_topo_fp_
Log< level::Info, false > LogInfo
float fPixLorentzAnglePerTesla_
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
std::string fullPath() const
Log< level::Warning, false > LogWarning
Parameters ModuleParameters_
Parameters BPixParameters_