90 for (
m = 0;
m <
obj.numOfTempl(); ++
m) {
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];
118 obj.setMaxIndex(
obj.maxIndex() + 1);
124 obj.setMaxIndex(
obj.maxIndex() + 1);
125 obj.push_back(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));
196 if (thisID == 10000 || (!
obj.putTemplateID(detid.
rawId(), thisID)))
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)
241 if (thisID == 10000 || (!
obj.putTemplateID(detid.
rawId(), thisID)))
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;
254 mapnum =
obj.getTemplateID(detid.
rawId());
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_
unsigned int pxbLayer(const DetId &id) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
unsigned int pxfBlade(const DetId &id) const
cond::Time_t beginOfTime() const
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
unsigned int pxbLadder(const DetId &id) const
Log< level::Error, false > LogError
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
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)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Log< level::Warning, true > LogPrint
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
std::vector< uint32_t > theEndcapTemplateIds
unsigned int pxfPanel(const DetId &id) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Log< level::Info, false > LogInfo
unsigned int pxfSide(const DetId &id) const
vstring theBarrelLocations
std::vector< uint32_t > theBarrelTemplateIds
constexpr uint32_t rawId() const
get the raw id
vstring theTemplateCalibrations
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
unsigned int pxbModule(const DetId &id) const
vstring theEndcapLocations