11 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalPFRecHitThresholdsHandler")) {
12 edm::LogInfo(
"EcalPFRecHitThresholds Source handler constructor\n");
22 std::ostringstream
ss;
25 unsigned long long irun;
31 if (m_file_type ==
"xml")
45 if (!fxml.is_open()) {
50 for (
int i = 0;
i < 6;
i++) {
51 getline(fxml, dummyLine);
56 std::istringstream iEB(stt);
64 for (
int iChannel = 0; iChannel <
kEBChannels; iChannel++) {
67 std::size_t
found = bid.find(
"</");
68 stt = bid.substr(6,
found - 6);
69 float val = std::stof(stt);
72 for (
int i = 0;
i < 5;
i++) {
73 getline(fxml, dummyLine);
77 stt = bid.substr(7, 5);
78 std::istringstream iEE(stt);
87 for (
int iChannel = 0; iChannel <
kEEChannels; iChannel++) {
90 std::size_t
found = bid.find(
"</");
91 stt = bid.substr(6,
found - 6);
92 float val = std::stof(stt);
100 if (!ftxt.is_open()) {
104 int number_of_lines = 0,
eta,
phi,
x,
y,
z;
107 while (std::getline(ftxt,
line)) {
113 sscanf(
line.c_str(),
"%i %i %i %f", &
x, &
y, &
z, &
val);
119 edm::LogInfo(
"Number of lines in text file: ") << number_of_lines;
122 edm::LogInfo(
"wrong number of channels! Please check ");
T getParameter(std::string const &) const
EcalPFRecHitThresholdsMap EcalPFRecHitThresholds
~EcalPFRecHitThresholdsHandler() override
static EEDetId unhashIndex(int hi)
void readTXT(const std::string &filename, EcalFloatCondObjectContainer &record)
EcalPFRecHitThresholdsHandler(edm::ParameterSet const &)
void getNewObjects() override
static const int ETAPHIMODE
Log< level::Info, false > LogInfo
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
void readXML(const std::string &filename, EcalFloatCondObjectContainer &record)