11 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalIntercalibHandler")) {
13 edm::LogInfo(
"EcalIntercalib Source handler constructor\n");
23 std::ostringstream ss;
26 unsigned long long irun;
52 for(
int i=0;
i< 6;
i++) {
53 getline(fxml, dummyLine);
58 std::istringstream iEB(stt);
66 for (
int iChannel = 0; iChannel <
kEBChannels; iChannel++) {
69 std::size_t
found = bid.find(
"</");
70 stt = bid.substr(6, found - 6);
71 float val = std::stof(stt);
72 record[myEBDetId] =
val;
74 for(
int i=0;
i< 5;
i++) {
75 getline(fxml, dummyLine);
79 stt = bid.substr(7,5);
80 std::istringstream iEE(stt);
89 for (
int iChannel = 0; iChannel <
kEEChannels; iChannel++) {
92 std::size_t
found = bid.find(
"</");
93 stt = bid.substr(6, found - 6);
94 float val = std::stof(stt);
95 record[myEEDetId] =
val;
103 if(!ftxt.is_open()) {
107 int number_of_lines = 0,
eta, phi, x, y, z;
110 while (std::getline(ftxt, line)) {
112 sscanf(line.c_str(),
"%i %i %i %f", &
eta, &phi, &z, &
val);
114 record[ebdetid] =
val;
117 sscanf(line.c_str(),
"%i %i %i %f", &x, &y, &z, &
val);
119 record[eedetid] =
val;
123 edm::LogInfo(
"Number of lines in text file: ") << number_of_lines;
125 if(number_of_lines != kChannels)
126 edm::LogInfo(
"wrong number of channels! Please check ");
T getParameter(std::string const &) const
void getNewObjects() override
static EEDetId unhashIndex(int hi)
void readTXT(const std::string &filename, EcalFloatCondObjectContainer &record)
void readXML(const std::string &filename, EcalFloatCondObjectContainer &record)
EcalIntercalibHandler(edm::ParameterSet const &)
static const int ETAPHIMODE
~EcalIntercalibHandler() override
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
EcalIntercalibConstantMap EcalIntercalibConstants