91 if (in_file.is_open()) {
92 edm::LogInfo(
"SiPixelTemplateDBObjectUploader") <<
"Opened Template File: " <<
file.fullPath().c_str();
95 char title_char[80],
c;
101 for (iter = 0; (c = in_file.get()) !=
'\n'; ++iter) {
103 title_char[iter] =
c;
109 title_char[iter + 1] =
'\n';
110 for (j = 0; j < 80; j += 4) {
111 temp.
c[0] = title_char[
j];
112 temp.
c[1] = title_char[j + 1];
113 temp.
c[2] = title_char[j + 2];
114 temp.
c[3] = title_char[j + 3];
120 for (k = 0; k < 80; k++) {
121 if ((title_char[k] ==
'@') && (title_char[k - 1] ==
'T')) {
122 double localMagField = (((int)title_char[k - 4]) - 48) * 10 + ((
int)title_char[k - 2]) - 48;
125 <<
"\n -------- WARNING -------- \n Magnetic field in the cfg is " <<
theMagField <<
"T while it is "
126 << title_char[k - 4] << title_char[k - 2] << title_char[k - 1]
127 <<
" in the header \n ------------------------- \n " << std::endl;
133 in_file >> tempstore;
134 while (!in_file.eof()) {
137 in_file >> tempstore;
143 edm::LogError(
"SiPixelTemplateDBObjectUploader") <<
"Error opening File: " <<
file.fullPath().c_str();
161 edm::LogPrint(
"SiPixelTemplateDBObjectUploader") <<
"Phase-" << phase <<
" geometry is used \n" << std::endl;
164 for (
const auto& it : pDD->detUnits()) {
167 DetId detid = it->geographicalId();
168 unsigned int layer = 0,
ladder = 0, disk = 0, side = 0, blade = 0, panel = 0,
module = 0;
169 short thisID = 10000;
193 unsigned int first_delim_pos = loc_string.find(
'_');
194 unsigned int second_delim_pos = loc_string.find(
'_', first_delim_pos + 1);
196 unsigned int checklayer = (
unsigned int)stoi(loc_string.substr(0, first_delim_pos));
197 unsigned int checkladder =
198 (
unsigned int)stoi(loc_string.substr(first_delim_pos + 1, second_delim_pos - first_delim_pos - 1));
199 unsigned int checkmodule = (
unsigned int)stoi(loc_string.substr(second_delim_pos + 1, 5));
201 if (
ladder == checkladder && layer == checklayer &&
module == checkmodule)
208 <<
" Could not fill barrel layer " << layer <<
", module " <<
module <<
"\n";
210 <<
"This is a barrel element with: layer " << layer <<
", ladder " <<
ladder <<
" and module " <<
module;
234 unsigned int first_delim_pos = loc_string.find(
'_');
235 unsigned int second_delim_pos = loc_string.find(
'_', first_delim_pos + 1);
236 unsigned int third_delim_pos = loc_string.find(
'_', second_delim_pos + 1);
238 unsigned int checkdisk = (
unsigned int)stoi(loc_string.substr(0, first_delim_pos));
239 unsigned int checkblade =
240 (
unsigned int)stoi(loc_string.substr(first_delim_pos + 1, second_delim_pos - first_delim_pos - 1));
241 unsigned int checkside =
242 (
unsigned int)stoi(loc_string.substr(second_delim_pos + 1, third_delim_pos - second_delim_pos - 1));
243 unsigned int checkpanel = (
unsigned int)stoi(loc_string.substr(third_delim_pos + 1, 5));
245 if (disk == checkdisk && blade == checkblade && side == checkside && panel == checkpanel)
252 <<
" Could not fill endcap det unit" << side <<
", disk " << disk <<
", blade " << blade <<
", and panel "
254 edm::LogPrint(
"SiPixelTemplateDBObjectUploader") <<
"This is an endcap element with: side " << side <<
", disk "
255 << disk <<
", blade " << blade <<
", and panel " << panel;
264 <<
"The DetID: " << detid.
rawId() <<
" is mapped to the template: " << mapnum <<
"\n";
271 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
vstring theTemplateCalibrations
std::vector< uint32_t > theBarrelTemplateIds
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
const edm::EventSetup & c
bool putTemplateID(const uint32_t &detid, short &value)
short getTemplateID(const uint32_t &detid) const
unsigned int pxfDisk(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
void push_back(float entry)
unsigned int pxbModule(const DetId &id) const
Log< level::Error, false > LogError
void setMaxIndex(int maxIndex)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< uint32_t > theEndcapTemplateIds
bool getData(T &iHolder) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
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
unsigned int pxbLayer(const DetId &id) const
vstring theBarrelLocations
Log< level::Info, false > LogInfo
vstring theEndcapLocations
void setVersion(float version)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
void setNumOfTempl(int numOfTempl)
cond::Time_t currentTime() const
unsigned int pxfSide(const DetId &id) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const