93 if (in_file.is_open()) {
94 edm::LogInfo(
"Template Info") <<
"Opened Template 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';
112 for (j = 0; j < 80; j += 4) {
113 temp.
c[0] = title_char[
j];
114 temp.
c[1] = title_char[j + 1];
115 temp.
c[2] = title_char[j + 2];
116 temp.
c[3] = title_char[j + 3];
122 in_file >> tempstore;
123 while (!in_file.eof()) {
126 in_file >> tempstore;
132 edm::LogError(
"SiPixel2DTemplateDBObjectUploader") <<
"Error opening File " << (
file.fullPath()).c_str();
150 edm::LogPrint(
"SiPixel2DTemplateDBObjectUploader") <<
"Phase-" << phase <<
" geometry is used" << std::endl;
153 for (
const auto& it : pDD->detUnits()) {
156 DetId detid = it->geographicalId();
157 unsigned int layer = 0,
ladder = 0, disk = 0, side = 0, blade = 0, panel = 0,
module = 0;
159 short thisID = 10000;
183 unsigned int first_delim_pos = loc_string.find(
'_');
184 unsigned int second_delim_pos = loc_string.find(
'_', first_delim_pos + 1);
186 unsigned int checklayer = (
unsigned int)stoi(loc_string.substr(0, first_delim_pos));
187 unsigned int checkladder =
188 (
unsigned int)stoi(loc_string.substr(first_delim_pos + 1, second_delim_pos - first_delim_pos - 1));
189 unsigned int checkmodule = (
unsigned int)stoi(loc_string.substr(second_delim_pos + 1, 5));
191 if (
ladder == checkladder && layer == checklayer &&
module == checkmodule)
198 <<
" Could not fill barrel layer " << layer <<
", module " <<
module <<
"\n";
200 <<
"This is a barrel element with: layer " << layer <<
", ladder " <<
ladder <<
" and module " <<
module;
225 unsigned int first_delim_pos = loc_string.find(
'_');
226 unsigned int second_delim_pos = loc_string.find(
'_', first_delim_pos + 1);
227 unsigned int third_delim_pos = loc_string.find(
'_', second_delim_pos + 1);
229 unsigned int checkdisk = (
unsigned int)stoi(loc_string.substr(0, first_delim_pos));
230 unsigned int checkblade =
231 (
unsigned int)stoi(loc_string.substr(first_delim_pos + 1, second_delim_pos - first_delim_pos - 1));
232 unsigned int checkside =
233 (
unsigned int)stoi(loc_string.substr(second_delim_pos + 1, third_delim_pos - second_delim_pos - 1));
234 unsigned int checkpanel = (
unsigned int)stoi(loc_string.substr(third_delim_pos + 1, 5));
236 if (disk == checkdisk && blade == checkblade && side == checkside && panel == checkpanel)
243 <<
" Could not fill endcap det unit" << side <<
", disk " << disk <<
", blade " << blade <<
", and panel "
246 <<
"This is an endcap element with: side " << side <<
", disk " << disk <<
", blade " << blade
247 <<
", and panel " << panel;
256 <<
"The DetID: " << detid.
rawId() <<
" is mapped to the template: " << mapnum <<
"\n";
263 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
const edm::EventSetup & c
unsigned int pxfDisk(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
unsigned int pxbModule(const DetId &id) const
Log< level::Error, false > LogError
constexpr std::array< uint8_t, layerIndexSize > layer
bool getData(T &iHolder) const
void push_back(float entry)
bool isNewTagRequest(const std::string &recordName)
cond::Time_t beginOfTime() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
Log< level::Warning, true > LogPrint
std::vector< uint32_t > theEndcapTemplateIds
void setMaxIndex(int maxIndex)
unsigned int pxbLayer(const DetId &id) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Log< level::Info, false > LogInfo
void setNumOfTempl(int numOfTempl)
void setVersion(float version)
vstring theBarrelLocations
short getTemplateID(const uint32_t &detid) const
std::vector< uint32_t > theBarrelTemplateIds
vstring theTemplateCalibrations
cond::Time_t currentTime() const
unsigned int pxfSide(const DetId &id) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
bool putTemplateID(const uint32_t &detid, short &value)
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
vstring theEndcapLocations