14 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalTimeCalibHandler")),
15 m_firstRun(static_cast<unsigned
int>(atoi(ps.getParameter<
std::
string>(
"firstRun").c_str()))),
16 m_file_name(ps.getParameter<
std::
string>(
"fileName")),
17 m_file_type(ps.getParameter<
std::
string>(
"type"))
19 edm::LogInfo(
"EcalTimeCalib Source handler constructor\n");
27 if (m_file_type ==
"xml")
40 if (!fxml.is_open()) {
44 for (
int i = 0;
i < 6;
i++) {
45 getline(fxml, dummyLine);
49 std::istringstream iEB(stt);
56 for (
int iChannel = 0; iChannel <
kEBChannels; iChannel++) {
59 std::size_t
found = bid.find(
"</");
60 stt = bid.substr(6,
found - 6);
61 float val = std::stof(stt);
64 for (
int i = 0;
i < 5;
i++) {
65 getline(fxml, dummyLine);
68 stt = bid.substr(7, 5);
69 std::istringstream iEE(stt);
77 for (
int iChannel = 0; iChannel <
kEEChannels; iChannel++) {
80 std::size_t
found = bid.find(
"</");
81 stt = bid.substr(6,
found - 6);
82 float val = std::stof(stt);
90 if (!ftxt.is_open()) {
93 int number_of_lines = 0,
eta,
phi,
x,
y,
z;
96 while (std::getline(ftxt,
line)) {
102 std::sscanf(
line.c_str(),
"%i %i %i %f", &
x, &
y, &
z, &
val);
108 edm::LogInfo(
"Number of lines in text file: ") << number_of_lines;
static EEDetId unhashIndex(int hi)
static const int ETAPHIMODE
void readTXT(const std::string &filename, EcalFloatCondObjectContainer &record)
Log< level::Info, false > LogInfo
EcalTimeCalibHandler(edm::ParameterSet const &)
EcalTimeCalibConstantMap EcalTimeCalibConstants
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
void readXML(const std::string &filename, EcalFloatCondObjectContainer &record)
void getNewObjects() override