60 : theGenErrorCalibrations(iConfig.getParameter<
vstring>(
"siPixelGenErrorCalibrations")),
61 theGenErrorBaseString(iConfig.getParameter<
std::
string>(
"theGenErrorBaseString")),
62 theVersion(iConfig.getParameter<double>(
"Version")),
63 theMagField(iConfig.getParameter<double>(
"MagField")),
64 theBarrelLocations(iConfig.getParameter<
std::
vector<
std::
string> >(
"barrelLocations")),
65 theEndcapLocations(iConfig.getParameter<
std::
vector<
std::
string> >(
"endcapLocations")),
66 theBarrelGenErrIds(iConfig.getParameter<
std::
vector<uint32_t> >(
"barrelGenErrIds")),
67 theEndcapGenErrIds(iConfig.getParameter<
std::
vector<uint32_t> >(
"endcapGenErrIds")),
68 useVectorIndices(iConfig.getUntrackedParameter<
bool>(
"useVectorIndices",
false)),
90 for (
m = 0;
m <
obj.numOfTempl(); ++
m) {
94 edm::LogInfo(
"GenError Info") <<
"Opened GenError File: " <<
file.fullPath().c_str();
97 char title_char[80],
c;
103 for (iter = 0; (
c =
in_file.get()) !=
'\n'; ++iter) {
105 title_char[iter] =
c;
111 title_char[iter + 1] =
'\n';
113 for (
j = 0;
j < 80;
j += 4) {
114 temp.c[0] = title_char[
j];
115 temp.c[1] = title_char[
j + 1];
116 temp.c[2] = title_char[
j + 2];
117 temp.c[3] = title_char[
j + 3];
119 obj.setMaxIndex(
obj.maxIndex() + 1);
123 for (
k = 0;
k < 80;
k++) {
124 if ((title_char[
k] ==
'@') && (title_char[
k - 1] ==
'T')) {
125 double localMagField = (((
int)title_char[
k - 4]) - 48) * 10 + ((
int)title_char[
k - 2]) - 48;
128 <<
"\n -------- WARNING -------- \n Magnetic field in the cfg is " <<
theMagField <<
"T while it is " 129 << title_char[
k - 4] << title_char[
k - 2] << title_char[
k - 1]
130 <<
" in the header \n ------------------------- \n " << std::endl;
138 obj.setMaxIndex(
obj.maxIndex() + 1);
139 obj.push_back(tempstore);
146 edm::LogError(
"SiPixelGenErrorDBObjectUploader") <<
"Error opening File " <<
file.fullPath().c_str();
164 edm::LogPrint(
"SiPixelGenErrorDBObjectUploader") <<
"Phase-" <<
phase <<
" geometry is used" << std::endl;
167 for (
const auto& it : pDD->
detUnits()) {
170 DetId detid = it->geographicalId();
171 unsigned int layer = 0,
ladder = 0, disk = 0, side = 0, blade = 0, panel = 0,
module = 0;
174 short thisID = 10000;
198 unsigned int first_delim_pos = loc_string.find(
'_');
199 unsigned int second_delim_pos = loc_string.find(
'_', first_delim_pos + 1);
201 unsigned int checklayer = (
unsigned int)stoi(loc_string.substr(0, first_delim_pos));
202 unsigned int checkladder =
203 (
unsigned int)stoi(loc_string.substr(first_delim_pos + 1, second_delim_pos - first_delim_pos - 1));
204 unsigned int checkmodule = (
unsigned int)stoi(loc_string.substr(second_delim_pos + 1, 5));
211 if (thisID == 10000 || (!
obj.putGenErrorID(detid.
rawId(), thisID)))
213 <<
" Could not fill barrel layer " <<
layer <<
", module " <<
module <<
"\n";
215 <<
"This is a barrel element with: layer " <<
layer <<
", ladder " <<
ladder <<
" and module " <<
module;
239 unsigned int first_delim_pos = loc_string.find(
'_');
240 unsigned int second_delim_pos = loc_string.find(
'_', first_delim_pos + 1);
241 unsigned int third_delim_pos = loc_string.find(
'_', second_delim_pos + 1);
243 unsigned int checkdisk = (
unsigned int)stoi(loc_string.substr(0, first_delim_pos));
244 unsigned int checkblade =
245 (
unsigned int)stoi(loc_string.substr(first_delim_pos + 1, second_delim_pos - first_delim_pos - 1));
246 unsigned int checkside =
247 (
unsigned int)stoi(loc_string.substr(second_delim_pos + 1, third_delim_pos - second_delim_pos - 1));
248 unsigned int checkpanel = (
unsigned int)stoi(loc_string.substr(third_delim_pos + 1, 5));
250 if (disk == checkdisk && blade == checkblade && side == checkside && panel == checkpanel)
255 if (thisID == 10000 || (!
obj.putGenErrorID(detid.
rawId(), thisID)))
257 <<
" Could not fill endcap det unit" << side <<
", disk " << disk <<
", blade " << blade <<
", panel " 259 edm::LogPrint(
"SiPixelGenErrorDBObjectUploader") <<
"This is an endcap element with: side " << side <<
", disk " 260 << disk <<
", blade " << blade <<
", panel " << panel;
267 mapnum =
obj.getGenErrorID(detid.
rawId());
269 <<
"The DetID: " << detid.
rawId() <<
" is mapped to the template: " << mapnum <<
"\n";
276 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
unsigned int pxbLayer(const DetId &id) const
vstring theEndcapLocations
void analyze(const edm::Event &, const edm::EventSetup &) override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
unsigned int pxfBlade(const DetId &id) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
cond::Time_t beginOfTime() const
std::vector< uint32_t > theEndcapGenErrIds
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
unsigned int pxbLadder(const DetId &id) const
Log< level::Error, false > LogError
std::vector< uint32_t > theDetIds
vstring theGenErrorCalibrations
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
SiPixelGenErrorDBObjectUploader(const edm::ParameterSet &)
bool isNewTagRequest(const std::string &recordName)
cond::Time_t currentTime() const
bool isThere(GeomDetEnumerators::SubDetector subdet) const
unsigned int pxfDisk(const DetId &id) const
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
#define DEFINE_FWK_MODULE(type)
vstring theBarrelLocations
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
~SiPixelGenErrorDBObjectUploader() override
Log< level::Warning, true > LogPrint
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
unsigned int pxfPanel(const DetId &id) const
Log< level::Info, false > LogInfo
unsigned int pxfSide(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
std::vector< std::string > vstring
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
std::string theGenErrorBaseString
unsigned int pxbModule(const DetId &id) const
std::vector< uint32_t > theBarrelGenErrIds