52 unsigned int nmodules = 0;
55 const std::vector<uint32_t>& DetIds =
reader.getAllDetIds();
60 for (
const auto& detit : DetIds) {
62 const DetId detid(detit);
63 auto rawId = detid.rawId();
65 int side = tTopo.
side(detid);
80 LogDebug(
"SiPixelFakeLorentzAngleESSource") <<
" pixel barrel:" 82 <<
" rawId=" << rawId <<
" side " << side;
90 <<
"ERROR!: detid " << rawId <<
" already exists" << std::endl;
94 if (it.getParameter<
unsigned int>(
"rawid") == detid.rawId()) {
95 float lorentzangle = (
float)it.getParameter<
double>(
"angle");
97 obj->putLorentzAngle(detid.rawId(), lorentzangle);
99 <<
" LA= " << lorentzangle <<
" individual value " << detid.rawId() << std::endl;
102 edm::LogError(
"SiPixelFakeLorentzAngleESSource") <<
"ERROR!: detid already exists" << std::endl;
108 if (it.exists(
"layer"))
109 if (it.getParameter<
int>(
"layer") !=
layer)
111 if (it.exists(
"ladder"))
112 if (it.getParameter<
int>(
"ladder") !=
ladder)
114 if (it.exists(
"module"))
115 if (it.getParameter<
int>(
"module") !=
module)
117 if (it.exists(
"side"))
118 if (it.getParameter<
int>(
"side") != side)
121 float lorentzangle = (
float)it.getParameter<
double>(
"angle");
122 obj->putLorentzAngle(detid.rawId(), lorentzangle);
123 edm::LogInfo(
"SiPixelFakeLorentzAngleESSource") <<
" LA= " << lorentzangle << std::endl;
125 }
else if (
found == 1) {
127 <<
"detid already given in ModuleParameters, skipping ..." << std::endl;
130 <<
" ERROR!: detid " << rawId <<
" already exists" << std::endl;
143 int disk = pen.diskName();
144 int blade = pen.bladeName();
145 int panel = pen.pannelName();
146 int ring = pen.ringName();
148 LogDebug(
"SiPixelFakeLorentzAngleESSource") <<
" pixel endcap:" 149 <<
" side=" << side <<
" disk=" << disk <<
" blade =" << blade
150 <<
" pannel=" << panel <<
" ring=" <<
ring <<
" rawId=" << rawId;
157 edm::LogError(
"SiPixelFakeLorentzAngleESSource") <<
" ERROR! detid already exists" << std::endl;
161 if (it.getParameter<
unsigned int>(
"rawid") == detid.rawId()) {
162 float lorentzangle = (
float)it.getParameter<
double>(
"angle");
164 obj->putLorentzAngle(detid.rawId(), lorentzangle);
166 <<
" LA= " << lorentzangle <<
" individual value " << detid.rawId() << std::endl;
170 <<
"ERROR!: detid " << rawId <<
" already exists" << std::endl;
176 if (it.exists(
"side"))
177 if (it.getParameter<
int>(
"side") != side)
179 if (it.exists(
"disk"))
180 if (it.getParameter<
int>(
"disk") != disk)
182 if (it.exists(
"ring"))
183 if (it.getParameter<
int>(
"ring") !=
ring)
185 if (it.exists(
"blade"))
186 if (it.getParameter<
int>(
"blade") != blade)
188 if (it.exists(
"panel"))
189 if (it.getParameter<
int>(
"panel") != panel)
191 if (it.exists(
"HVgroup"))
192 if (it.getParameter<
int>(
"HVgroup") !=
HVgroup(panel,
ring))
195 float lorentzangle = (
float)it.getParameter<
double>(
"angle");
196 obj->putLorentzAngle(detid.rawId(), lorentzangle);
197 edm::LogInfo(
"SiPixelFakeLorentzAngleESSource") <<
" LA= " << lorentzangle << std::endl;
199 }
else if (
found == 1) {
201 <<
" detid " << rawId <<
" already given in ModuleParameters, skipping ..." << std::endl;
204 <<
"ERROR!: detid" << rawId <<
"already exists" << std::endl;
210 edm::LogInfo(
"SiPixelFakeLorentzAngleESSource") <<
"Modules = " << nmodules << std::endl;
212 return std::unique_ptr<SiPixelLorentzAngle>(
obj);
unsigned int pxbLayer(const DetId &id) const
Parameters FPixParameters_
std::string fullPath() const
const edm::FileInPath fp_
unsigned int pxbLadder(const DetId &id) const
Log< level::Error, false > LogError
unsigned int side(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > 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)
unsigned int pxbModule(const DetId &id) const
Log< level::Warning, false > LogWarning
Parameters ModuleParameters_
Parameters BPixParameters_