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)),
88 for (
int m = 0;
m <
obj.numOfTempl(); ++
m) {
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];
116 obj.setMaxIndex(
obj.maxIndex() + 1);
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;
135 obj.setMaxIndex(
obj.maxIndex() + 1);
136 obj.push_back(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));
206 if (thisID == 10000 || (!
obj.putTemplateID(detid.
rawId(), thisID)))
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)
250 if (thisID == 10000 || (!
obj.putTemplateID(detid.
rawId(), thisID)))
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;
262 mapnum =
obj.getTemplateID(detid.
rawId());
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
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
std::string theTemplateBaseString
SiPixelTemplateDBObjectUploader(const edm::ParameterSet &)
cond::Time_t beginOfTime() const
std::vector< std::string > vstring
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 > theEndcapTemplateIds
~SiPixelTemplateDBObjectUploader() override
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
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)
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
vstring theBarrelLocations
unsigned int pxfPanel(const DetId &id) const
Log< level::Info, false > LogInfo
vstring theEndcapLocations
unsigned int pxfSide(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
std::vector< uint32_t > theDetIds
void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned int pxbModule(const DetId &id) const