61 : theTemplateCalibrations(iConfig.getParameter<
vstring>(
"siPixelTemplateCalibrations")),
62 theTemplateBaseString(iConfig.getParameter<std::
string>(
"theTemplateBaseString")),
63 theVersion(iConfig.getParameter<double>(
"Version")),
64 theMagField(iConfig.getParameter<double>(
"MagField")),
65 theBarrelLocations(iConfig.getParameter<std::
vector<std::
string> >(
"barrelLocations")),
66 theEndcapLocations(iConfig.getParameter<std::
vector<std::
string> >(
"endcapLocations")),
67 theBarrelTemplateIds(iConfig.getParameter<std::
vector<uint32_t> >(
"barrelTemplateIds")),
68 theEndcapTemplateIds(iConfig.getParameter<std::
vector<uint32_t> >(
"endcapTemplateIds")),
69 useVectorIndices(iConfig.getUntrackedParameter<bool>(
"useVectorIndices",
false)),
93 if (in_file.is_open()) {
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";
SiPixel2DTemplateDBObjectUploader(const edm::ParameterSet &)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
std::string theTemplateBaseString
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
const edm::EventSetup & c
#define DEFINE_FWK_MODULE(type)
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)
~SiPixel2DTemplateDBObjectUploader() override
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
Log< level::Info, false > LogInfo
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
void setNumOfTempl(int numOfTempl)
std::vector< std::string > vstring
void setVersion(float version)
vstring theBarrelLocations
short getTemplateID(const uint32_t &detid) const
std::vector< uint32_t > theBarrelTemplateIds
void analyze(const edm::Event &, const edm::EventSetup &) override
trackerTopologyToken_(iC.esConsumes())
vstring theTemplateCalibrations
cond::Time_t currentTime() const
unsigned int pxfSide(const DetId &id) const
std::string fullPath() const
trackerGeometryToken_(iC.esConsumes())
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
bool putTemplateID(const uint32_t &detid, short &value)
std::vector< uint32_t > theDetIds
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
vstring theEndcapLocations