13 #include <toolbox/string.h> 55 uint32_t _status_word_to_mask) {
59 status_word_to_mask = _status_word_to_mask;
64 uint32_t _status_word_to_mask) {
69 status_word_to_mask = _status_word_to_mask;
74 lut_checksums_xml =
nullptr;
80 status_word_to_mask = 0x0000;
85 delete lut_checksums_xml;
103 lut_xml->addLut(_config);
104 lut_xml->addLut(_config);
105 lut_xml->addLut(_config);
108 return lut_xml->getCurrentBrick();
119 if (_det.find(
"HB") != std::string::npos)
121 else if (_det.find(
"HE") != std::string::npos)
123 else if (_det.find(
"HF") != std::string::npos)
125 else if (_det.find(
"HO") != std::string::npos)
137 s <<
"===> Test of HcalLutSet HcalLutManager::getLutSetFromFile( std::string _filename )" << std::endl << std::endl;
138 s << _set.
label << std::endl;
139 for (
unsigned int i = 0;
i != _set.
subdet.size();
i++)
160 for (
unsigned int j = 0;
j != _set.
lut[0].size();
j++) {
161 for (
unsigned int i = 0;
i != _set.
lut.size();
i++) {
162 s << _set.
lut[
i][
j] <<
" ";
164 s <<
"---> " <<
j << std::endl;
173 ifstream
infile(_filename.c_str());
177 edm::LogInfo(
"HcalLutManager") <<
"File " << _filename <<
" is open..." << std::endl
178 <<
"Reading LUTs and their eta/phi/depth/subdet ranges...";
190 std::vector<std::string> buf_vec;
193 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++) {
200 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++) {
207 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++) {
214 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++) {
222 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++) {
229 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++) {
234 bool first_lut_entry =
true;
237 for (
unsigned int i = 0;
i < buf_vec.size();
i++) {
238 if (first_lut_entry) {
239 std::vector<unsigned int> _l;
240 _lutset.
lut.push_back(_l);
244 first_lut_entry =
false;
256 bool split_by_crate) {
257 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
258 std::map<int, std::shared_ptr<LutXml>> _xml;
261 _lmap.
read(
"./backup/HCALmapHBEF.txt",
"HBEF");
262 _lmap.
read(
"./backup/HCALmapHO.txt",
"HO");
263 std::map<int, LMapRow>& _map = _lmap.
get_map();
264 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << _map.size() <<
" channels";
267 HcalLutSet _set = getLutSetFromFile(_filename);
268 int lut_set_size = _set.
lut.size();
272 for (std::map<int, LMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
278 for (
int i = 0;
i < lut_set_size;
i++) {
279 if ((row->second.crate == _crate || _crate == -1) &&
280 _set.
eta_min[
i] <= row->second.side * row->second.eta &&
281 _set.
eta_max[
i] >= row->second.side * row->second.eta && _set.
phi_min[
i] <= row->second.phi &&
283 _set.
depth_max[
i] >= row->second.depth && get_subdetector(_set.
subdet[
i]) == row->second.det) {
287 if (lut_index >= 0) {
288 if (_xml.count(row->second.crate) == 0 && split_by_crate) {
289 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->second.crate, std::make_shared<LutXml>()));
290 }
else if (_xml.count(0) == 0 && !split_by_crate) {
291 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
293 _cfg.
ieta = row->second.side * row->second.eta;
294 _cfg.
iphi = row->second.phi;
295 _cfg.
depth = row->second.depth;
296 _cfg.
crate = row->second.crate;
297 _cfg.
slot = row->second.htr;
298 if (row->second.fpga.find(
"top") != std::string::npos)
300 else if (row->second.fpga.find(
"bot") != std::string::npos)
306 _cfg.
fiber = row->second.htr_fi;
308 if (_set.
lut[lut_index].size() == 128)
320 ((row->second.det ==
HcalForward && row->second.eta == 29) ? (4 * 10000) : (0));
321 _cfg.
lut = _set.
lut[lut_index];
322 if (split_by_crate) {
323 _xml[row->second.crate]->addLut(_cfg, lut_checksums_xml);
326 _xml[0]->addLut(_cfg, lut_checksums_xml);
332 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
342 bool split_by_crate) {
343 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
344 std::map<int, std::shared_ptr<LutXml>> _xml;
347 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
348 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" entries";
351 HcalLutSet _set = getLutSetFromFile(_filename);
352 int lut_set_size = _set.
lut.size();
353 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
356 std::vector<unsigned int> zeroLut;
358 zeroLut.push_back(0);
362 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
363 if ((row->subdet.find(
"HB") != string::npos || row->subdet.find(
"HE") != string::npos ||
364 row->subdet.find(
"HO") != string::npos || row->subdet.find(
"HF") != string::npos) &&
365 row->subdet.size() == 2) {
371 for (
int i = 0;
i < lut_set_size;
i++) {
372 if ((row->crate == _crate || _crate == -1) &&
375 _set.
subdet[
i].find(row->subdet) != string::npos) {
379 if (lut_index >= 0) {
380 if (_xml.count(row->crate) == 0 && split_by_crate) {
381 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
382 }
else if (_xml.count(0) == 0 && !split_by_crate) {
383 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
385 _cfg.
ieta = row->ieta;
386 _cfg.
iphi = row->iphi;
387 _cfg.
depth = row->idepth;
388 _cfg.
crate = row->crate;
389 _cfg.
slot = row->slot;
390 if (row->topbottom.find(
't') != std::string::npos)
392 else if (row->topbottom.find(
'b') != std::string::npos)
394 else if (row->topbottom.find(
'u') != std::string::npos)
398 _cfg.
fiber = row->fiber;
409 _cfg.
iphi * 10000 + _cfg.
depth * 1000 + (row->ieta > 0) * 100 +
abs(row->ieta) +
410 (((row->subdet.find(
"HF") != string::npos) &&
abs(row->ieta) == 29) ? (4 * 10000) : (0));
413 DetId _detId(row->rawId);
414 uint32_t status_word = cq->getValues(_detId)->getValue();
415 if ((status_word & status_word_to_mask) > 0) {
418 _cfg.
lut = _set.
lut[lut_index];
420 if (split_by_crate) {
421 _xml[row->crate]->addLut(_cfg, lut_checksums_xml);
424 _xml[0]->addLut(_cfg, lut_checksums_xml);
431 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
437 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
438 std::map<int, std::shared_ptr<LutXml>> _xml;
441 HcalLutSet _set = getLutSetFromFile(_filename);
442 int lut_set_size = _set.
lut.size();
443 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
447 for (_iter.begin(); !_iter.end(); _iter.next()) {
450 int _ieta = _iter.getIeta();
451 int _iphi = _iter.getIphi();
452 int _depth = _iter.getDepth();
457 int aSlot = _eId.htrSlot();
458 int aTopBottom = _eId.htrTopBottom();
459 int aFiber = _eId.fiberIndex();
460 int aFiberChan = _eId.fiberChanId();
467 for (
int i = 0;
i < lut_set_size;
i++) {
468 if ((aCrate == _crate || _crate == -1) &&
471 _set.
subdet[
i].find(_ass.getSubdetectorString(_subdet)) != string::npos) {
475 if (lut_index >= 0) {
476 if (_xml.count(aCrate) == 0 && split_by_crate) {
477 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(aCrate, std::make_shared<LutXml>()));
478 }
else if (_xml.count(0) == 0 && !split_by_crate) {
479 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
498 (((_subdet ==
HcalForward) &&
abs(_ieta) == 29) ? (4 * 10000) : (0));
499 _cfg.
lut = _set.
lut[lut_index];
500 if (split_by_crate) {
501 _xml[aCrate]->addLut(_cfg, lut_checksums_xml);
504 _xml[0]->addLut(_cfg, lut_checksums_xml);
511 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
518 bool split_by_crate) {
519 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from ascii master file...";
520 std::map<int, std::shared_ptr<LutXml>> _xml;
523 <<
"instantiating CaloTPGTranscoderULUT in order to check the validity of (ieta,iphi)...";
529 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
530 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" channels";
533 HcalLutSet _set = getLutSetFromFile(_filename, 2);
534 int lut_set_size = _set.
lut.size();
535 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
539 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
545 for (
int i = 0;
i < lut_set_size;
i++) {
546 if (row->subdet.find(
"HT") != std::string::npos &&
547 (row->crate == _crate || _crate == -1) &&
549 _set.
phi_max[
i] >= row->iphi && _coder.
HTvalid(row->ieta, row->iphi, row->idepth / 10)) {
553 if (lut_index >= 0) {
554 if (_xml.count(row->crate) == 0 && split_by_crate) {
555 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
556 }
else if (_xml.count(0) == 0 && !split_by_crate) {
557 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
559 _cfg.
ieta = row->ieta;
560 _cfg.
iphi = row->iphi;
561 _cfg.
depth = row->idepth;
562 _cfg.
crate = row->crate;
563 _cfg.
slot = row->slot;
564 if (row->topbottom.find(
't') != std::string::npos)
566 else if (row->topbottom.find(
'b') != std::string::npos)
568 else if (row->topbottom.find(
'u') != std::string::npos)
572 _cfg.
fiber = row->fiber;
574 if (_set.
lut[lut_index].size() == 128)
586 _cfg.
lut = _set.
lut[lut_index];
587 if (split_by_crate) {
588 _xml[row->crate]->addLut(_cfg, lut_checksums_xml);
591 _xml[0]->addLut(_cfg, lut_checksums_xml);
597 <<
"Generating compression (output) LUTs from ascii master file...DONE" << std::endl;
603 bool split_by_crate) {
604 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...";
605 std::map<int, std::shared_ptr<LutXml>> _xml;
612 _lmap.
read(
"backup/HCALmapHBEF.txt",
"HBEF");
615 std::map<int, LMapRow>& _map = _lmap.
get_map();
616 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << _map.size() <<
" channels";
624 for (std::map<int, LMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
627 if (_xml.count(row->second.crate) == 0 && split_by_crate) {
628 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->second.crate, std::make_shared<LutXml>()));
629 }
else if (_xml.count(0) == 0 && !split_by_crate) {
630 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
632 _cfg.
ieta = row->second.side * row->second.eta;
633 _cfg.
iphi = row->second.phi;
634 _cfg.
depth = row->second.depth;
635 _cfg.
crate = row->second.crate;
636 _cfg.
slot = row->second.htr;
637 if (row->second.fpga.find(
"top") != std::string::npos)
639 else if (row->second.fpga.find(
"bot") != std::string::npos)
645 _cfg.
fiber = row->second.htr_fi;
656 ((row->second.det ==
HcalForward && row->second.eta == 29) ? (4 * 10000) : (0));
659 HcalDetId _detid(row->second.det, row->second.side * row->second.eta, row->second.phi, row->second.depth);
664 for (std::vector<unsigned short>::const_iterator _i = coder_lut.begin(); _i != coder_lut.end(); _i++) {
665 unsigned int _temp = (
unsigned int)(*_i);
668 _cfg.
lut.push_back(_temp);
670 if (split_by_crate) {
671 _xml[row->second.crate]->addLut(_cfg, lut_checksums_xml);
674 _xml[0]->addLut(_cfg, lut_checksums_xml);
679 <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
684 edm::LogInfo(
"HcalLutManager") <<
"Generating TDC masks...";
687 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
688 edm::LogInfo(
"HcalLutManager") <<
"EMap contains new" << _map.size() <<
" entries";
690 std::map<int, std::vector<uint64_t>> masks;
692 for (
const auto& row : _map) {
696 int crate = row.crate;
699 int fiber = row.fiber;
700 int channel = row.fiberchan;
701 unsigned int finel = 4 *
fiber + channel;
702 if (masks.count(crot) == 0)
704 if (finel >= masks[crot].
size())
705 masks[crot].resize(finel + 1);
709 if (row.subdet.find(
"HB") != string::npos)
711 else if (row.subdet.find(
"HE") != string::npos)
713 else if (row.subdet.find(
"HO") != string::npos)
715 else if (row.subdet.find(
"HF") != string::npos)
719 HcalDetId _detid(_subdet, row.ieta, row.iphi, row.idepth);
720 masks[crot][finel] =
conditions->getHcalTPChannelParameter(_detid)->getMask();
723 masks[crot][finel] = masktype == 1 ?
parameters->getADCThresholdHF() :
parameters->getTDCMaskHF();
727 std::map<int, std::shared_ptr<LutXml>> _xml;
730 for (
const auto&
i : masks) {
732 int crate = crot / 100;
737 _cfg.
slot = crot % 100;
739 _cfg.
mask =
i.second;
744 int c = split_by_crate ?
crate : 0;
745 if (_xml.count(
c) == 0)
746 _xml[
c] = std::make_shared<LutXml>();
748 _xml[
c]->addLut(_cfg);
753 <<
"Generating Masks...DONE" << std::endl;
759 bool split_by_crate) {
760 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...";
761 std::map<int, std::shared_ptr<LutXml>> _xml;
764 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
765 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" entries";
769 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
770 if ((row->subdet.find(
"HB") != string::npos || row->subdet.find(
"HE") != string::npos ||
771 row->subdet.find(
"HF") != string::npos) &&
772 row->subdet.size() == 2) {
775 if (_xml.count(row->crate) == 0 && split_by_crate) {
776 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
777 }
else if (_xml.count(0) == 0 && !split_by_crate) {
778 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
780 _cfg.
ieta = row->ieta;
781 _cfg.
iphi = row->iphi;
782 _cfg.
depth = row->idepth;
783 _cfg.
crate = row->crate;
784 _cfg.
slot = row->slot;
785 if (row->topbottom.find(
't') != std::string::npos)
787 else if (row->topbottom.find(
'b') != std::string::npos)
789 else if (row->topbottom.find(
'u') != std::string::npos)
793 _cfg.
fiber = row->fiber;
804 (((row->subdet.find(
"HF") != string::npos) &&
abs(row->ieta) == 29) ? (4 * 10000) : (0));
806 if (row->subdet.find(
"HB") != string::npos)
808 else if (row->subdet.find(
"HE") != string::npos)
810 else if (row->subdet.find(
"HO") != string::npos)
812 else if (row->subdet.find(
"HF") != string::npos)
816 HcalDetId _detid(_subdet, row->ieta, row->iphi, row->idepth);
819 _cfg.
lut.push_back(
i);
821 if (split_by_crate) {
822 _xml[row->crate]->addLut(_cfg, lut_checksums_xml);
825 _xml[0]->addLut(_cfg, lut_checksums_xml);
831 <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
836 edm::LogInfo(
"HcalLutManager") <<
"Generating HE fine grain LUTs";
837 std::map<int, std::shared_ptr<LutXml>> _xml;
840 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
841 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" entries";
845 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
846 if (row->subdet.find(
"HT") != string::npos && row->subdet.size() == 2) {
847 int abseta =
abs(row->ieta);
849 if (abseta <= topo->lastHBRing()
or abseta > topo->
lastHERing())
855 if (_xml.count(row->crate) == 0 && split_by_crate) {
856 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
857 }
else if (_xml.count(0) == 0 && !split_by_crate) {
858 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
860 _cfg.
ieta = row->ieta;
861 _cfg.
iphi = row->iphi;
862 _cfg.
depth = row->idepth;
863 _cfg.
crate = row->crate;
864 _cfg.
slot = row->slot;
865 if (row->topbottom.find(
't') != std::string::npos)
867 else if (row->topbottom.find(
'b') != std::string::npos)
869 else if (row->topbottom.find(
'u') != std::string::npos)
873 _cfg.
fiber = row->fiber;
881 (((row->subdet.find(
"HF") != string::npos) &&
abs(row->ieta) == 29) ? (4 * 10000) : (0));
884 HcalDetId _detid(_subdet, row->ieta, row->iphi, row->idepth);
890 const int n_fgab_bits = 2048;
891 for (
int i = 0;
i < 2 * n_fgab_bits;
i++) {
893 for (
int k = 0;
k < 6;
k++) {
894 tow[0][
k] = (1 <<
k) &
i;
895 tow[1][
k] = (1 << (
k + 6)) &
i;
897 _cfg.
lut.push_back(fg_algo.compute(tow).to_ulong());
900 if (split_by_crate) {
901 _xml[row->crate]->addLut(_cfg, lut_checksums_xml);
904 _xml[0]->addLut(_cfg, lut_checksums_xml);
910 <<
"Generating HE fine grain LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
916 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT," << std::endl
917 <<
"initialized from Event Setup" << std::endl;
918 std::map<int, std::shared_ptr<LutXml>> _xml;
922 std::map<int, unsigned int>
maxsize;
924 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
925 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" channels";
928 for (
const auto& row : _map) {
929 if (row.subdet.find(
"HT") == std::string::npos)
932 if (!cq->topo()->validHT(_detid))
934 int crot = 100 * row.crate + row.slot;
941 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
944 if (row->subdet.find(
"HT") == std::string::npos)
949 if (!cq->topo()->validHT(_detid))
952 if (_xml.count(row->crate) == 0 && split_by_crate) {
953 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
954 }
else if (_xml.count(0) == 0 && !split_by_crate) {
955 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
958 _cfg.
ieta = row->ieta;
959 _cfg.
iphi = row->iphi;
960 _cfg.
depth = row->idepth;
961 _cfg.
crate = row->crate;
962 _cfg.
slot = row->slot;
963 if (row->topbottom.find(
't') != std::string::npos)
965 else if (row->topbottom.find(
'b') != std::string::npos)
967 else if (row->topbottom.find(
'u') != std::string::npos)
971 _cfg.
fiber = row->fiber;
981 auto pWeight =
conditions->getHcalTPChannelParameter(_detid,
false);
983 _cfg.
weight = pWeight->getauxi1();
987 int crot = 100 * row->crate + row->slot;
988 unsigned int size = _cfg.
lut.size();
990 edm::LogWarning(
"HcalLutManager") <<
" resizing LUT for " << _detid <<
", channel=[" << _cfg.
crate <<
":" 992 <<
"], using value=" << _cfg.
lut[
size - 1] << std::endl;
997 if (split_by_crate) {
998 _xml[row->crate]->addLut(_cfg, lut_checksums_xml);
1001 _xml[0]->addLut(_cfg, lut_checksums_xml);
1006 <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT...DONE" 1013 bool split_by_crate) {
1014 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT";
1015 std::map<int, std::shared_ptr<LutXml>> _xml;
1022 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
1023 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" channels";
1033 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
1038 const int tp_version = row->idepth / 10;
1039 if (row->subdet.find(
"HT") != std::string::npos && _coder.
HTvalid(row->ieta, row->iphi, tp_version)) {
1040 if (_xml.count(row->crate) == 0 && split_by_crate) {
1041 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
1042 }
else if (_xml.count(0) == 0 && !split_by_crate) {
1043 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
1045 _cfg.
ieta = row->ieta;
1046 _cfg.
iphi = row->iphi;
1047 _cfg.
depth = row->idepth;
1048 _cfg.
crate = row->crate;
1049 _cfg.
slot = row->slot;
1050 if (row->topbottom.find(
't') != std::string::npos)
1052 else if (row->topbottom.find(
'b') != std::string::npos)
1054 else if (row->topbottom.find(
'u') != std::string::npos)
1058 _cfg.
fiber = row->fiber;
1076 if (split_by_crate) {
1077 _xml[row->crate]->addLut(_cfg, lut_checksums_xml);
1080 _xml[0]->addLut(_cfg, lut_checksums_xml);
1086 <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT...DONE" 1093 bool split_by_crate) {
1094 for (
std::map<
int, std::shared_ptr<LutXml>>::const_iterator cr = _xml.begin(); cr != _xml.end(); cr++) {
1095 std::stringstream output_file_name;
1096 if (split_by_crate) {
1097 output_file_name << _tag <<
"_" << cr->first <<
".xml";
1099 output_file_name << _tag <<
".xml";
1101 cr->second->write(output_file_name.str());
1108 std::map<int, std::shared_ptr<LutXml>> xml;
1109 if (!lut_checksums_xml) {
1110 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1);
1113 if (!_lin_file.empty()) {
1114 addLutMap(xml, getLinearizationLutXmlFromAsciiMasterEmap(_lin_file, _tag, -1, split_by_crate));
1116 writeLutXmlFiles(xml, _tag, split_by_crate);
1118 std::string checksums_file = _tag +
"_checksums.xml";
1119 lut_checksums_xml->write(checksums_file);
1127 bool split_by_crate) {
1129 std::map<int, std::shared_ptr<LutXml>> xml;
1130 if (!lut_checksums_xml) {
1131 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1);
1134 if (!_lin_file.empty()) {
1136 addLutMap(xml, getLinearizationLutXmlFromAsciiMasterEmap(_lin_file, _tag, -1, split_by_crate));
1138 if (!_comp_file.empty()) {
1140 addLutMap(xml, getCompressionLutXmlFromAsciiMaster(_comp_file, _tag, -1, split_by_crate));
1143 writeLutXmlFiles(xml, _tag, split_by_crate);
1145 std::string checksums_file = _tag +
"_checksums.xml";
1146 lut_checksums_xml->write(checksums_file);
1153 std::map<int, std::shared_ptr<LutXml>> xml;
1154 if (!lut_checksums_xml) {
1155 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1);
1158 addLutMap(xml, getCompressionLutXmlFromCoder(_tag, split_by_crate));
1160 writeLutXmlFiles(xml, _tag, split_by_crate);
1162 std::string checksums_file = _tag +
"_checksums.xml";
1163 lut_checksums_xml->write(checksums_file);
1170 std::map<int, std::shared_ptr<LutXml>> xml;
1171 if (!lut_checksums_xml) {
1172 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1);
1176 addLutMap(xml, getLinearizationLutXmlFromCoderEmap(_coder, _tag, split_by_crate));
1177 addLutMap(xml, getCompressionLutXmlFromCoder(_tag, split_by_crate));
1179 writeLutXmlFiles(xml, _tag, split_by_crate);
1181 std::string checksums_file = _tag +
"_checksums.xml";
1182 lut_checksums_xml->write(checksums_file);
1194 bool split_by_crate) {
1195 std::map<int, std::shared_ptr<LutXml>> xml;
1196 if (!lut_checksums_xml) {
1197 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1);
1200 if (!_lin_file.empty()) {
1201 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_ascii_xml =
1202 getLinearizationLutXmlFromAsciiMasterEmap(_lin_file, _tag, -1, split_by_crate);
1203 addLutMap(xml, _lin_lut_ascii_xml);
1205 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_xml =
1206 getLinearizationLutXmlFromCoderEmap(_coder, _tag, split_by_crate);
1207 addLutMap(xml, _lin_lut_xml);
1209 const std::map<int, std::shared_ptr<LutXml>> _comp_lut_xml =
1210 getCompressionLutXmlFromCoder(_transcoder, _tag, split_by_crate);
1211 addLutMap(xml, _comp_lut_xml);
1213 const std::map<int, std::shared_ptr<LutXml>> _HE_FG_lut_xml = getHEFineGrainLUTs(_tag, split_by_crate);
1214 addLutMap(xml, _HE_FG_lut_xml);
1216 writeLutXmlFiles(xml, _tag, split_by_crate);
1218 std::string checksums_file = _tag +
"_checksums.xml";
1219 lut_checksums_xml->write(checksums_file);
1227 bool split_by_crate) {
1228 std::map<int, std::shared_ptr<LutXml>> xml;
1229 if (!lut_checksums_xml) {
1230 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1);
1233 if (!_lin_file.empty()) {
1234 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_ascii_xml =
1235 getLinearizationLutXmlFromAsciiMasterEmap(_lin_file, _tag, -1, split_by_crate);
1236 addLutMap(xml, _lin_lut_ascii_xml);
1238 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_xml =
1239 getLinearizationLutXmlFromCoderEmap(_coder, _tag, split_by_crate);
1240 addLutMap(xml, _lin_lut_xml);
1242 const std::map<int, std::shared_ptr<LutXml>> _comp_lut_xml = getCompressionLutXmlFromCoder(_tag, split_by_crate);
1243 addLutMap(xml, _comp_lut_xml);
1245 writeLutXmlFiles(xml, _tag, split_by_crate);
1247 std::string checksums_file = _tag +
"_checksums.xml";
1248 lut_checksums_xml->write(checksums_file);
1256 bool split_by_crate) {
1258 std::map<int, std::shared_ptr<LutXml>> xml;
1259 if (!lut_checksums_xml) {
1260 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1);
1263 if (!_lin_file.empty()) {
1264 addLutMap(xml, getLutXmlFromAsciiMaster(_lin_file, _tag, -1, split_by_crate));
1266 addLutMap(xml, getCompressionLutXmlFromCoder(_tag, split_by_crate));
1267 writeLutXmlFiles(xml, _tag, split_by_crate);
1269 std::string checksums_file = _tag +
"_checksums.xml";
1270 lut_checksums_xml->write(checksums_file);
1277 for (
std::map<
int, std::shared_ptr<LutXml>>::const_iterator lut =
other.begin(); lut !=
other.end(); lut++) {
1278 edm::LogInfo(
"HcalLutManager") <<
"Added LUTs for crate " << lut->first;
1279 if (
result.count(lut->first) == 0) {
1282 *(
result[lut->first]) += *(lut->second);
1290 strftime(timebuf, 50,
"%Y-%m-%d %H:%M:%S", gmtime(&_time));
1293 return creationstamp;
1297 local_connect(_filename,
"backup/HCALmapHBEF.txt",
"backup/HCALmapHO.txt");
1301 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
1302 int map_size = _map.size();
1303 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << map_size <<
" channels";
1306 std::vector<unsigned int> _lut;
1307 _lut = getLutFromXml(_tag, 1107313727, hcal::ConfigurationDatabase::LinearizerLUT);
1309 edm::LogInfo(
"HcalLutManager") <<
"Testing direct parsing of the LUT XML";
1311 gettimeofday(&_t,
nullptr);
1312 double _time = (double)(_t.tv_sec) + (double)(_t.tv_usec) / 1000000.0;
1313 test_direct_xml_parsing(_filename);
1314 gettimeofday(&_t,
nullptr);
1315 edm::LogInfo(
"HcalLutManager") <<
"parsing took that much time: " 1316 << (double)(_t.tv_sec) + (double)(_t.tv_usec) / 1000000.0 - _time;
1318 gettimeofday(&_t,
nullptr);
1319 _time = (double)(_t.tv_sec) + (double)(_t.tv_usec) / 1000000.0;
1320 edm::LogInfo(
"HcalLutManager") <<
"before loop over random LUTs: " << _time;
1324 for (
int _iter = 0; _iter < 100; _iter++) {
1325 gettimeofday(&_t,
nullptr);
1330 int _key = (rand() % map_size);
1332 if ((_map[_key].subdet.find(
"HB") != string::npos || _map[_key].subdet.find(
"HE") != string::npos ||
1333 _map[_key].subdet.find(
"HO") != string::npos || _map[_key].subdet.find(
"HF") != string::npos) &&
1334 _map[_key].subdet.size() == 2) {
1336 if (_map[_key].subdet.find(
"HB") != string::npos)
1338 else if (_map[_key].subdet.find(
"HE") != string::npos)
1340 else if (_map[_key].subdet.find(
"HO") != string::npos)
1342 else if (_map[_key].subdet.find(
"HF") != string::npos)
1347 _raw_id = _detid.
rawId();
1351 _lut = getLutFromXml(_tag, _raw_id, hcal::ConfigurationDatabase::LinearizerLUT);
1353 gettimeofday(&_t,
nullptr);
1355 double d_time = _t.tv_sec + _t.tv_usec / 1000000.0 - _time;
1356 edm::LogInfo(
"HcalLutManager") <<
"after the loop over random LUTs: " << _time + d_time << std::endl
1357 <<
"total time: " << d_time << std::endl;
1359 edm::LogInfo(
"HcalLutManager") <<
"LUT length = " << _lut.size();
1360 for (std::vector<unsigned int>::const_iterator
i = _lut.end() - 1;
i != _lut.begin() - 1;
i--) {
1361 edm::LogInfo(
"HcalLutManager") << (
i - _lut.begin()) <<
" " << _lut[(
i - _lut.begin())];
1376 lmap->read(lmap_hbef_file,
"HBEF");
1377 lmap->read(lmap_ho_file,
"HO");
1378 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << lmap->get_map().size()
1379 <<
" channels (compare to 9072 of all HCAL channels)";
1386 db->connect(lut_xml_file);
1391 read_lmap(lmap_hbef_file, lmap_ho_file);
1392 read_luts(lut_xml_file);
1398 hcal::ConfigurationDatabase::LUTType _lt) {
1399 edm::LogInfo(
"HcalLutManager") <<
"getLutFromXml (new version) is not implemented. Use getLutFromXml_old() for now";
1401 std::vector<unsigned int>
result;
1409 hcal::ConfigurationDatabase::LUTType _lt) {
1411 edm::LogError(
"HcalLutManager") <<
"Cannot find LUT without LMAP, exiting...";
1415 edm::LogError(
"HcalLutManager") <<
"Cannot find LUT, no source (local XML file), exiting...";
1419 std::vector<unsigned int>
result;
1421 std::map<int, LMapRow>& _map = lmap->get_map();
1426 unsigned int _crate, _slot, _fiber, _channel;
1428 int topbottom, luttype;
1431 if (_map.find(_rawid) != _map.end()) {
1432 _crate = _map[_rawid].crate;
1433 _slot = _map[_rawid].htr;
1434 _fiber = _map[_rawid].htr_fi;
1435 _channel = _map[_rawid].fi_ch;
1436 _fpga = _map[_rawid].fpga;
1438 if (_fpga.find(
"top") != std::string::npos)
1440 else if (_fpga.find(
"bot") != std::string::npos)
1443 edm::LogError(
"HcalLutManager") <<
"Irregular LMAP fpga value... do not know what to do - exiting";
1446 if (_lt == hcal::ConfigurationDatabase::LinearizerLUT)
1451 result =
db->getOnlineLUT(
tag, _crate, _slot, topbottom, _fiber, _channel, luttype);
1458 std::map<int, std::shared_ptr<LutXml>> lut_map = get_brickSet_from_oracle(
tag, db_accessor);
1459 if (split_by_crate) {
1460 writeLutXmlFiles(lut_map,
tag, split_by_crate);
1463 for (
std::map<
int, std::shared_ptr<LutXml>>::const_iterator xml = lut_map.begin(); xml != lut_map.end(); xml++) {
1464 result += *(xml->second);
1479 db->connect(_accessor);
1480 oracle::occi::Connection* _connection =
db->getConnection();
1482 edm::LogInfo(
"HcalLutManager") <<
"Preparing to request the LUT CLOBs from the database...";
1490 std::string query = (
"SELECT TRIG_PRIM_LOOKUPTBL_DATA_CLOB, CRATE FROM CMS_HCL_HCAL_COND.V_HCAL_TRIG_LOOKUP_TABLES");
1496 std::map<int, std::shared_ptr<LutXml>> lut_map;
1500 edm::LogInfo(
"HcalLutManager") <<
"Executing the query...";
1501 Statement* stmt = _connection->createStatement();
1502 ResultSet* rs = stmt->executeQuery(
query);
1503 edm::LogInfo(
"HcalLutManager") <<
"Executing the query... done";
1505 edm::LogInfo(
"HcalLutManager") <<
"Processing the query results...";
1507 while (rs->next()) {
1509 oracle::occi::Clob clob = rs->getClob(1);
1510 int crate = rs->getInt(2);
1512 edm::LogInfo(
"HcalLutManager") <<
"Getting LUTs for crate #" <<
crate <<
" out of the database...";
1513 brick_set =
db->clobToString(clob);
1523 const char*
bs = brick_set.c_str();
1524 MemBufInputSource* lut_clob =
new MemBufInputSource((
const XMLByte*)
bs, strlen(
bs),
"lut_clob",
false);
1525 std::shared_ptr<LutXml> lut_xml = std::make_shared<LutXml>(*lut_clob);
1526 lut_map[
crate] = lut_xml;
1531 _connection->terminateStatement(stmt);
1533 }
catch (SQLException&
e) {
1534 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,
1551 edm::LogInfo(
"HcalLutManager") <<
"Generating XML loader for LUTs...";
1566 std::stringstream _subversion;
1567 _subversion << subversion;
1577 std::vector<int> crate_number;
1579 for (std::vector<std::string>::const_iterator _f =
file_name.begin(); _f !=
file_name.end(); _f++) {
1580 int crate_begin = _f->rfind(
"_");
1581 int crate_end = _f->rfind(
".xml.dat");
1582 crate_number.push_back(
getInt(_f->substr(crate_begin + 1, crate_end - crate_begin - 1)));
1588 time_t _offset =
time(
nullptr);
1589 sprintf(_buf,
"%d", (uint32_t)_offset);
1601 sprintf(_buf,
"%.2d", conf.
crate);
1604 sprintf(_buf,
"CRATE%.2d", conf.
crate);
1606 _namelabel.append(_buf);
1611 doc.addChecksums(&CSconf);
1613 doc.write(tag_name +
"_Loader.xml");
1615 edm::LogInfo(
"HcalLutManager") <<
"Generating XML loader for LUTs... done.";
1625 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
1626 std::stringstream
s;
1627 s <<
"EMap contains " << _map.size() <<
" channels" << std::endl;
1631 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
1633 if (row->subdet.find(
"HT") != std::string::npos) {
1634 s <<
" -----> Subdet = " << row->subdet << std::endl;
1636 if (
abs(row->ieta) > 28) {
1638 s <<
" ==> (ieta,iphi) = " << row->ieta <<
", " << row->iphi << std::endl;
1681 bool split_by_crate) {
1682 std::map<int, std::shared_ptr<LutXml>> xml;
1683 if (!lut_checksums_xml) {
1684 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1);
1687 if (!_lin_file.empty()) {
1688 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_ascii_xml =
1689 getLinearizationLutXmlFromAsciiMasterEmap(_lin_file, _tag, -1, split_by_crate);
1690 addLutMap(xml, _lin_lut_ascii_xml);
1692 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_xml =
1693 getLinearizationLutXmlFromCoderEmap(_coder, _tag, split_by_crate);
1694 addLutMap(xml, _lin_lut_xml);
1696 const std::map<int, std::shared_ptr<LutXml>> _comp_lut_xml =
1697 getCompressionLutXmlFromCoder(_transcoder, _tag, split_by_crate);
1698 addLutMap(xml, _comp_lut_xml);
1700 const std::map<int, std::shared_ptr<LutXml>> _HE_FG_lut_xml = getHEFineGrainLUTs(_tag, split_by_crate);
1701 addLutMap(xml, _HE_FG_lut_xml);
1703 for (
auto masktype : {0, 1, 2}) {
1704 const auto masks = getMasks(masktype, _tag, split_by_crate);
1705 addLutMap(xml, masks);
1708 const auto _zdc_lut_xml = getZdcLutXml(_coder, _tag, split_by_crate,
false);
1709 addLutMap(xml, _zdc_lut_xml);
1711 const auto _zdc_ootpu_lut_xml = getZdcLutXml(_coder, _tag, split_by_crate,
true);
1712 addLutMap(xml, _zdc_ootpu_lut_xml);
1714 writeLutXmlFiles(xml, _tag, split_by_crate);
1716 std::string checksums_file = _tag +
"_checksums.xml";
1717 lut_checksums_xml->write(checksums_file);
1724 bool split_by_crate,
1726 edm::LogInfo(
"HcalLutManager") <<
"Generating ZDC LUTs ...may the Force be with us...";
1727 std::map<int, std::shared_ptr<LutXml>> _xml;
1731 std::vector<EMap::EMapRow>& _map = _emap.
get_map();
1732 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" channels";
1736 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
1740 if (row->zdc_section.find(
"ZDC") != std::string::npos) {
1741 if (_xml.count(row->crate) == 0 && split_by_crate) {
1742 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
1743 }
else if (_xml.count(0) == 0 && !split_by_crate) {
1744 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
1747 _cfg.
ieta = row->zdc_channel;
1750 _cfg.
depth = row->zdc_zside;
1751 _cfg.
crate = row->crate;
1752 _cfg.
slot = row->slot;
1753 if (row->topbottom.find(
't') != std::string::npos)
1755 else if (row->topbottom.find(
'b') != std::string::npos)
1761 _cfg.
fiber = row->fiber + 6;
1763 _cfg.
fiber = row->fiber;
1774 if (row->zdc_section ==
"ZDC EM") {
1777 }
else if (row->zdc_section ==
"ZDC HAD") {
1780 }
else if (row->zdc_section ==
"ZDC LUM") {
1782 }
else if (row->zdc_section ==
"ZDC RPD") {
1788 _cfg.
lut.push_back(
i);
1791 if (split_by_crate) {
1792 _xml[row->crate]->addLut(_cfg, lut_checksums_xml);
1795 _xml[0]->addLut(_cfg, lut_checksums_xml);
1803 <<
"Generating ZDC LUTs...DONE" << std::endl;
std::array< std::bitset< 6 >, 2 > Tower
int initChannelIterator(std::vector< HcalGenericDetId > &map)
std::string trig_prim_lookuptbl_data_file
std::vector< std::vector< unsigned int > > lut
std::string targetfirmware
static int getLutSetFromFile_test(std::string _filename)
std::vector< int > phi_max
int createLutXmlFiles_HBEFFromCoder_HOFromAscii_ZDC(std::string _tag, const HcalTPGCoder &_coder, const CaloTPGTranscoderULUT &_transcoder, std::string _lin_file, bool split_by_crate=true)
std::map< int, std::shared_ptr< LutXml > > getZdcLutXml(const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true, bool ootpu_lut=false)
std::map< int, std::shared_ptr< LutXml > > getLinearizationLutXmlFromCoderEmap(const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true)
virtual bool HTvalid(const int ieta, const int iphi, const int version) const
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
std::string comment_description
std::vector< std::string > subdet
Various manipulations with trigger Lookup Tables.
std::string & getLutXml(std::vector< unsigned int > &_lut)
std::vector< int > phi_min
std::vector< int > depth_max
int get_xml_files_from_db(std::string tag, const std::string db_accessor="occi://CMS_HCL_PRTTYPE_HCAL_READER@anyhost/int2r?PASSWORD=HCAL_Reader_88,LHWM_VERSION=22", bool split_by_crate=true)
std::map< int, std::shared_ptr< LutXml > > getCompressionLutXmlFromCoder(std::string _tag, bool split_by_crate=true)
unsigned long int getCount(void)
int getInt(ResultSet *rset, int ipar)
Log< level::Error, false > LogError
static HcalSubdetector get_subdetector(std::string _subdet)
void addLutMap(std::map< int, std::shared_ptr< LutXml > > &result, const std::map< int, std::shared_ptr< LutXml > > &other)
int createCompLutXmlFilesFromCoder(std::string _tag, bool split_by_crate=true)
int createLinLutXmlFiles(std::string _tag, std::string _lin_file, bool split_by_crate=true)
std::map< int, std::shared_ptr< LutXml > > getCompressionLutXmlFromAsciiMaster(std::string _filename, std::string _tag, int _crate=-1, bool split_by_crate=true)
virtual std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
std::map< int, LMapRow > & get_map(void)
int test_direct_xml_parsing(std::string _filename)
constexpr int32_t readoutVMECrateId() const
get the readout VME crate number
virtual const std::vector< unsigned int > getCompressionLUT(const HcalTrigTowerDetId &id) const
std::vector< unsigned int > lut
std::string comment_description
int writeLutXmlFiles(std::map< int, std::shared_ptr< LutXml > > &_xml, std::string _tag="default_tag", bool split_by_crate=true)
int read(std::string accessor, std::string type="HBEF")
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
static std::vector< std::string > splitString(const std::string &fLine)
int read_luts(std::string lut_xml_file)
std::vector< int > depth_min
Abs< T >::type abs(const T &t)
HcalLutSet getLutSetFromFile(std::string _filename, int _type=1)
std::string formatrevision
std::map< int, std::shared_ptr< LutXml > > getLutXmlFromAsciiMaster(std::string _filename, std::string _tag, int _crate=-1, bool split_by_crate=true)
Gather config data from online DB.
Log< level::Info, false > LogInfo
int test_xml_access(std::string _tag, std::string _filename)
int create_lut_loader(std::string file_list, std::string _prefix, std::string tag_name, std::string comment="default comment", std::string version="V00-01-01", int subversion=1)
int createAllLutXmlFiles(std::string _tag, std::string _lin_file, std::string _comp_file, bool split_by_crate=true)
constexpr uint32_t rawId() const
get the raw id
int firstHEDoublePhiRing() const
std::map< int, std::shared_ptr< LutXml > > getHEFineGrainLUTs(std::string _tag, bool split_by_crate=true)
std::map< int, std::shared_ptr< LutXml > > getLinearizationLutXmlFromAsciiMasterEmap_new(std::string _filename, std::string _tag, int _crate, bool split_by_crate=true)
static int getInt(std::string number)
static std::string get_time_stamp(time_t _time)
int local_connect(std::string lut_xml_file, std::string lmap_hbef_file, std::string lmap_ho_file)
std::vector< unsigned int > getLutFromXml(std::string tag, uint32_t _rawid, hcal::ConfigurationDatabase::LUTType _lt)
std::map< int, std::shared_ptr< LutXml > > getLinearizationLutXmlFromAsciiMasterEmap(std::string _filename, std::string _tag, int _crate, bool split_by_crate=true)
int createAllLutXmlFilesLinAsciiCompCoder(std::string _tag, std::string _lin_file, bool split_by_crate=true)
std::vector< int > eta_max
std::vector< EMap::EMapRow > & get_map(void)
std::string trig_prim_lookuptbl_data_file
int read_lmap(std::string lmap_hbef_file, std::string lmap_ho_file)
Log< level::Warning, false > LogWarning
std::map< int, std::shared_ptr< LutXml > > getMasks(int var, std::string _tag, bool split_by_crate=true)
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
std::map< int, std::shared_ptr< LutXml > > getLinearizationLutXmlFromCoder(const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true)
std::string creationstamp
Readout chain identification for Hcal.
int createLutXmlFiles_HBEFFromCoder_HOFromAscii(std::string _tag, const HcalTPGCoder &_coder, std::string _lin_file, bool split_by_crate=true)
std::vector< int > eta_min
static XMLProcessor * getInstance()
std::map< int, std::shared_ptr< LutXml > > get_brickSet_from_oracle(std::string tag, const std::string _accessor="occi://CMS_HCL_PRTTYPE_HCAL_READER@anyhost/int2r?PASSWORD=HCAL_Reader_88,LHWM_VERSION=22")
uint16_t *__restrict__ uint16_t const *__restrict__ adc
int createAllLutXmlFilesFromCoder(const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true)
std::vector< unsigned int > getLutFromXml_old(std::string tag, uint32_t _rawid, hcal::ConfigurationDatabase::LUTType _lt)
std::vector< uint64_t > mask