12 #include <toolbox/string.h> 60 uint32_t _status_word_to_mask)
65 status_word_to_mask = _status_word_to_mask;
70 uint32_t _status_word_to_mask)
73 conditions=_conditions;
76 status_word_to_mask = _status_word_to_mask;
83 lut_checksums_xml =
nullptr;
89 status_word_to_mask = 0x0000;
97 delete lut_checksums_xml;
113 if (lut_xml)
delete lut_xml;
119 lut_xml -> addLut( _config );
120 lut_xml -> addLut( _config );
121 lut_xml -> addLut( _config );
124 return lut_xml->getCurrentBrick();
132 sscanf(number.c_str(),
"%d", &
result);
139 if ( _det.find(
"HB") != std::string::npos ) result =
HcalBarrel;
140 else if ( _det.find(
"HE") != std::string::npos ) result =
HcalEndcap;
141 else if ( _det.find(
"HF") != std::string::npos ) result =
HcalForward;
142 else if ( _det.find(
"HO") != std::string::npos ) result =
HcalOuter;
152 HcalLutSet _set = _manager . getLutSetFromFile( _filename );
154 s <<
"===> Test of HcalLutSet HcalLutManager::getLutSetFromFile( std::string _filename )" << std::endl << std::endl;
155 s << _set .
label << std::endl;
156 for (
unsigned int i = 0;
i != _set.
subdet.size();
i++) s << _set.
subdet[
i] <<
" ";
170 for (
unsigned int j = 0; j != _set.
lut[0].size(); j++){
171 for (
unsigned int i = 0;
i != _set.
lut.size();
i++){
172 s << _set.
lut[
i][j] <<
" ";
174 s <<
"---> " << j << std::endl;
185 ifstream infile( _filename . c_str() );
188 if ( infile . is_open() ){
189 edm::LogInfo(
"HcalLutManager") <<
"File " << _filename <<
" is open..." << std::endl
190 <<
"Reading LUTs and their eta/phi/depth/subdet ranges...";
193 getline( infile, _lutset .
label );
197 getline( infile, buf );
202 std::vector<std::string> buf_vec;
203 getline( infile, buf );
205 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
210 getline( infile, buf );
212 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
217 getline( infile, buf );
219 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
224 getline( infile, buf );
226 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
232 getline( infile, buf );
234 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
239 getline( infile, buf );
241 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
246 bool first_lut_entry =
true;
247 while (getline( infile, buf )) {
249 for (
unsigned int i = 0;
i < buf_vec.size();
i++){
250 if (first_lut_entry){
251 std::vector<unsigned int> _l;
252 _lutset.
lut.push_back(_l);
256 first_lut_entry =
false;
269 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
270 std::map<int, boost::shared_ptr<LutXml> > _xml;
273 _lmap . read(
"./backup/HCALmapHBEF.txt",
"HBEF" );
274 _lmap . read(
"./backup/HCALmapHO.txt",
"HO" );
275 std::map<int,LMapRow> & _map = _lmap.
get_map();
276 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << _map .
size() <<
" channels";
279 HcalLutSet _set = getLutSetFromFile( _filename );
280 int lut_set_size = _set.
lut.size();
284 for( std::map<int,LMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
290 for (
int i=0;
i<lut_set_size;
i++ ){
291 if ( (row->second.crate == _crate || _crate == -1) &&
292 _set.
eta_min[
i] <= row->second.side*row->second.eta &&
293 _set.
eta_max[
i] >= row->second.side*row->second.eta &&
294 _set.
phi_min[
i] <= row->second.phi &&
295 _set.
phi_max[
i] >= row->second.phi &&
298 get_subdetector(_set.
subdet[
i]) == row->second.det ){
302 if ( lut_index >= 0 ){
303 if ( _xml.count(row->second.crate) == 0 && split_by_crate ){
304 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(row->second.crate,boost::shared_ptr<LutXml>(
new LutXml())) );
306 else if ( _xml.count(0) == 0 && !split_by_crate ){
307 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
309 _cfg.
ieta = row->second.side*row->second.eta;
310 _cfg.
iphi = row->second.phi;
311 _cfg.
depth = row->second.depth;
312 _cfg.
crate = row->second.crate;
313 _cfg.
slot = row->second.htr;
314 if (row->second.fpga .
find(
"top") != std::string::npos) _cfg.
topbottom = 1;
315 else if (row->second.fpga .
find(
"bot") != std::string::npos) _cfg.
topbottom = 0;
319 _cfg.
fiber = row->second.htr_fi;
321 if (_set.
lut[lut_index].size() == 128) _cfg.
lut_type = 1;
332 (row->second.side>0)*100 + row->second.eta +
333 ((row->second.det==
HcalForward && row->second.eta==29)?(4*10000):(0));
334 _cfg.
lut = _set.
lut[lut_index];
335 if (split_by_crate ){
336 _xml[row->second.crate]->addLut( _cfg, lut_checksums_xml );
340 _xml[0]->addLut( _cfg, lut_checksums_xml );
346 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
355 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
356 std::map<int, boost::shared_ptr<LutXml> > _xml;
359 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
360 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" entries";
363 HcalLutSet _set = getLutSetFromFile( _filename );
364 int lut_set_size = _set.
lut.size();
365 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
368 std::vector<unsigned int> zeroLut;
369 for (
size_t adc = 0;
adc < 128;
adc++) zeroLut.push_back(0);
373 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
374 if( (row->subdet.find(
"HB")!=string::npos ||
375 row->subdet.find(
"HE")!=string::npos ||
376 row->subdet.find(
"HO")!=string::npos ||
377 row->subdet.find(
"HF")!=string::npos ) &&
378 row->subdet.size()==2
385 for (
int i=0;
i<lut_set_size;
i++ ){
386 if ( (row->crate == _crate || _crate == -1) &&
393 _set.
subdet[
i].find(row->subdet)!=string::npos ){
397 if ( lut_index >= 0 ){
398 if ( _xml.count(row->crate) == 0 && split_by_crate ){
399 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(row->crate,boost::shared_ptr<LutXml>(
new LutXml())) );
401 else if ( _xml.count(0) == 0 && !split_by_crate ){
402 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
404 _cfg.
ieta = row->ieta;
405 _cfg.
iphi = row->iphi;
406 _cfg.
depth = row->idepth;
407 _cfg.
crate = row->crate;
408 _cfg.
slot = row->slot;
409 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
410 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
411 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
413 _cfg.
fiber = row->fiber;
425 (row->ieta>0)*100 +
abs(row->ieta) +
426 (((row->subdet.find(
"HF")!=string::npos) &&
abs(row->ieta)==29)?(4*10000):(0));
429 DetId _detId(row->rawId);
430 uint32_t status_word = cq->getValues(_detId)->getValue();
431 if ((status_word & status_word_to_mask) > 0){
435 _cfg.
lut = _set.
lut[lut_index];
437 if (split_by_crate ){
438 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
442 _xml[0]->addLut( _cfg, lut_checksums_xml );
449 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
456 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
457 std::map<int, boost::shared_ptr<LutXml> > _xml;
460 HcalLutSet _set = getLutSetFromFile( _filename );
461 int lut_set_size = _set.
lut.size();
462 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
466 for( _iter.begin(); !_iter.end(); _iter.next() ){
473 int _ieta = _iter.getIeta();
474 int _iphi = _iter.getIphi();
475 int _depth = _iter.getDepth();
479 int aCrate = _eId . readoutVMECrateId();
480 int aSlot = _eId . htrSlot();
481 int aTopBottom = _eId . htrTopBottom();
482 int aFiber = _eId . fiberIndex();
483 int aFiberChan = _eId . fiberChanId();
490 for (
int i=0;
i<lut_set_size;
i++ ){
491 if ( (aCrate == _crate || _crate == -1) &&
498 _set.
subdet[
i].find(_ass.getSubdetectorString(_subdet))!=string::npos ){
502 if ( lut_index >= 0 ){
503 if ( _xml.count(aCrate) == 0 && split_by_crate ){
504 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(aCrate,boost::shared_ptr<LutXml>(
new LutXml())) );
506 else if ( _xml.count(0) == 0 && !split_by_crate ){
507 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
527 (_ieta>0)*100 +
abs(_ieta) +
529 _cfg.
lut = _set.
lut[lut_index];
530 if (split_by_crate ){
531 _xml[aCrate]->addLut( _cfg, lut_checksums_xml );
535 _xml[0]->addLut( _cfg, lut_checksums_xml );
542 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
549 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from ascii master file...";
550 std::map<int, boost::shared_ptr<LutXml> > _xml;
552 edm::LogInfo(
"HcalLutManager") <<
"instantiating CaloTPGTranscoderULUT in order to check the validity of (ieta,iphi)...";
558 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
559 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" channels";
562 HcalLutSet _set = getLutSetFromFile( _filename, 2 );
563 int lut_set_size = _set.
lut.size();
564 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
568 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
574 for (
int i=0;
i<lut_set_size;
i++ ){
575 if ( row->subdet .
find(
"HT") != std::string::npos &&
576 (row->crate == _crate || _crate == -1) &&
581 _coder.
HTvalid(row->ieta, row->iphi, row->idepth / 10) ){
585 if ( lut_index >= 0 ){
586 if ( _xml.count(row->crate) == 0 && split_by_crate ){
587 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(row->crate,boost::shared_ptr<LutXml>(
new LutXml())) );
589 else if ( _xml.count(0) == 0 && !split_by_crate ){
590 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
592 _cfg.
ieta = row->ieta;
593 _cfg.
iphi = row->iphi;
594 _cfg.
depth = row->idepth;
595 _cfg.
crate = row->crate;
596 _cfg.
slot = row->slot;
597 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
598 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
599 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
601 _cfg.
fiber = row->fiber;
603 if (_set.
lut[lut_index].size() == 128) _cfg.
lut_type = 1;
614 (row->ieta>0)*100+
abs(row->ieta);
615 _cfg.
lut = _set.
lut[lut_index];
616 if (split_by_crate ){
617 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
621 _xml[0]->addLut( _cfg, lut_checksums_xml );
627 <<
"Generating compression (output) LUTs from ascii master file...DONE" << std::endl;
634 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...";
635 std::map<int, boost::shared_ptr<LutXml> > _xml;
642 _lmap . read(
"backup/HCALmapHBEF.txt",
"HBEF" );
645 std::map<int,LMapRow> & _map = _lmap.
get_map();
646 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << _map .
size() <<
" channels";
654 for( std::map<int,LMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
657 if ( _xml.count(row->second.crate) == 0 && split_by_crate ){
658 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(row->second.crate,boost::shared_ptr<LutXml>(
new LutXml())) );
660 else if ( _xml.count(0) == 0 && !split_by_crate ){
661 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
663 _cfg.
ieta = row->second.side*row->second.eta;
664 _cfg.
iphi = row->second.phi;
665 _cfg.
depth = row->second.depth;
666 _cfg.
crate = row->second.crate;
667 _cfg.
slot = row->second.htr;
668 if (row->second.fpga .
find(
"top") != std::string::npos) _cfg.
topbottom = 1;
669 else if (row->second.fpga .
find(
"bot") != std::string::npos) _cfg.
topbottom = 0;
673 _cfg.
fiber = row->second.htr_fi;
685 (row->second.side>0)*100 + row->second.eta +
686 ((row->second.det==
HcalForward && row->second.eta==29)?(4*10000):(0));
689 HcalDetId _detid(row->second.det, row->second.side*row->second.eta, row->second.phi, row->second.depth);
693 std::vector<unsigned short> coder_lut = _coder . getLinearizationLUT(_detid);
694 for (std::vector<unsigned short>::const_iterator _i=coder_lut.begin(); _i!=coder_lut.end();_i++){
695 unsigned int _temp = (
unsigned int)(*_i);
698 _cfg.
lut.push_back(_temp);
700 if (split_by_crate ){
701 _xml[row->second.crate]->addLut( _cfg, lut_checksums_xml );
705 _xml[0]->addLut( _cfg, lut_checksums_xml );
710 <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
716 edm::LogInfo(
"HcalLutManager") <<
"Generating TDC masks...";
719 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
720 edm::LogInfo(
"HcalLutManager") <<
"EMap contains new" << _map.size() <<
" entries";
722 std::map<int, std::vector<uint64_t>> masks;
724 for(
const auto& row : _map){
726 if(subdet !=
"HF")
continue;
729 int crot=100*crate+slot;
731 int channel=row.fiberchan;
732 unsigned int finel=4*fiber+channel;
733 if(masks.count(crot)==0) masks[crot]={};
734 if(finel>=masks[crot].
size()) masks[crot].resize(finel+1);
738 if ( row.subdet.find(
"HB")!=string::npos ) _subdet =
HcalBarrel;
739 else if ( row.subdet.find(
"HE")!=string::npos ) _subdet =
HcalEndcap;
740 else if ( row.subdet.find(
"HO")!=string::npos ) _subdet =
HcalOuter;
741 else if ( row.subdet.find(
"HF")!=string::npos ) _subdet =
HcalForward;
743 HcalDetId _detid(_subdet, row.ieta, row.iphi, row.idepth);
744 masks[crot][finel]= conditions->getHcalTPChannelParameter(_detid)->getMask();
747 auto parameters = conditions->getHcalTPParameters();
752 std::map<int, boost::shared_ptr<LutXml> > _xml;
755 for(
const auto &
i: masks){
762 _cfg.
slot = crot%100;
764 _cfg.
mask =
i.second;
769 int c= split_by_crate ? crate : 0;
770 if ( _xml.count(c) == 0 ) _xml[c]=boost::shared_ptr<LutXml>(
new LutXml());
772 _xml[
c]->addLut(_cfg);
777 <<
"Generating Masks...DONE" << std::endl;
786 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...";
787 std::map<int, boost::shared_ptr<LutXml> > _xml;
790 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
791 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" entries";
795 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
796 if( (row->subdet.find(
"HB")!=string::npos ||
797 row->subdet.find(
"HE")!=string::npos ||
798 row->subdet.find(
"HF")!=string::npos ) &&
799 row->subdet.size()==2
803 if ( _xml.count(row->crate) == 0 && split_by_crate ){
804 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(row->crate,boost::shared_ptr<LutXml>(
new LutXml())) );
806 else if ( _xml.count(0) == 0 && !split_by_crate ){
807 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
809 _cfg.
ieta = row->ieta;
810 _cfg.
iphi = row->iphi;
811 _cfg.
depth = row->idepth;
812 _cfg.
crate = row->crate;
813 _cfg.
slot = row->slot;
814 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
815 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
816 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
818 _cfg.
fiber = row->fiber;
830 (row->ieta>0)*100 +
abs(row->ieta) +
831 (((row->subdet.find(
"HF")!=string::npos) &&
abs(row->ieta)==29)?(4*10000):(0));
833 if ( row->subdet.find(
"HB")!=string::npos ) _subdet =
HcalBarrel;
834 else if ( row->subdet.find(
"HE")!=string::npos ) _subdet =
HcalEndcap;
835 else if ( row->subdet.find(
"HO")!=string::npos ) _subdet =
HcalOuter;
836 else if ( row->subdet.find(
"HF")!=string::npos ) _subdet =
HcalForward;
838 HcalDetId _detid(_subdet, row->ieta, row->iphi, row->idepth);
842 if (split_by_crate ){
843 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
847 _xml[0]->addLut( _cfg, lut_checksums_xml );
853 <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
861 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT," << std::endl
862 <<
"initialized from Event Setup" << std::endl;
863 std::map<int, boost::shared_ptr<LutXml> > _xml;
867 std::map<int,unsigned int> maxsize;
869 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
870 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" channels";
873 for(
const auto& row : _map){
874 if ( row.subdet.find(
"HT") == std::string::npos)
continue;
876 if(!cq->topo()->validHT(_detid))
continue;
877 int crot=100*row.crate+row.slot;
879 if(maxsize.count(crot)==0 || size>maxsize[crot]) maxsize[crot]=size;
884 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
887 if ( row->subdet.find(
"HT") == std::string::npos)
continue;
891 if(!cq->topo()->validHT(_detid))
continue;
894 if ( _xml.count(row->crate) == 0 && split_by_crate ){
895 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(row->crate,boost::shared_ptr<LutXml>(
new LutXml())) );
897 else if ( _xml.count(0) == 0 && !split_by_crate ){
898 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
901 _cfg.
ieta = row->ieta;
902 _cfg.
iphi = row->iphi;
903 _cfg.
depth = row->idepth;
904 _cfg.
crate = row->crate;
905 _cfg.
slot = row->slot;
906 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
907 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
908 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
910 _cfg.
fiber = row->fiber;
921 int crot=100*row->crate+row->slot;
922 unsigned int size=_cfg.
lut.size();
923 if(size<maxsize[crot]){
926 <<
"], using value=" << _cfg.
lut[size-1] << std::endl;
927 for(
unsigned int i=size;
i<maxsize[crot]; ++
i) _cfg.
lut.push_back(_cfg.
lut[size-1]);
930 if (split_by_crate ){
931 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
935 _xml[0]->addLut( _cfg, lut_checksums_xml );
940 <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT...DONE" << std::endl;
949 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT";
950 std::map<int, boost::shared_ptr<LutXml> > _xml;
957 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
958 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" channels";
968 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
973 const int tp_version = row->idepth / 10;
974 if ( row->subdet .
find(
"HT") != std::string::npos && _coder.
HTvalid(row->ieta, row->iphi, tp_version) ){
975 if ( _xml.count(row->crate) == 0 && split_by_crate ){
976 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(row->crate,boost::shared_ptr<LutXml>(
new LutXml())) );
978 else if ( _xml.count(0) == 0 && !split_by_crate ){
979 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
981 _cfg.
ieta = row->ieta;
982 _cfg.
iphi = row->iphi;
983 _cfg.
depth = row->idepth;
984 _cfg.
crate = row->crate;
985 _cfg.
slot = row->slot;
986 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
987 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
988 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
990 _cfg.
fiber = row->fiber;
1002 (row->ieta>0)*100+
abs(row->ieta);
1010 if (split_by_crate ){
1011 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
1015 _xml[0]->addLut( _cfg, lut_checksums_xml );
1021 <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT...DONE" << std::endl;
1029 for (
std::map<
int,boost::shared_ptr<LutXml> >::const_iterator cr = _xml.begin(); cr != _xml.end(); cr++){
1030 std::stringstream output_file_name;
1031 if ( split_by_crate ){
1032 output_file_name << _tag <<
"_" << cr->first <<
".xml";
1035 output_file_name << _tag <<
".xml";
1037 cr->second->write( output_file_name.str() );
1045 std::map<int, boost::shared_ptr<LutXml> > xml;
1046 if ( !lut_checksums_xml ){
1047 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1050 if ( !_lin_file.empty() ){
1051 addLutMap( xml, getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate ) );
1053 writeLutXmlFiles( xml, _tag, split_by_crate );
1055 std::string checksums_file = _tag +
"_checksums.xml";
1056 lut_checksums_xml ->
write( checksums_file );
1064 std::map<int, boost::shared_ptr<LutXml> > xml;
1065 if ( !lut_checksums_xml ){
1066 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1069 if ( !_lin_file.empty() ){
1071 addLutMap( xml, getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate ) );
1073 if ( !_comp_file.empty() ){
1075 addLutMap( xml, getCompressionLutXmlFromAsciiMaster( _comp_file, _tag, -1, split_by_crate ) );
1078 writeLutXmlFiles( xml, _tag, split_by_crate );
1080 std::string checksums_file = _tag +
"_checksums.xml";
1081 lut_checksums_xml ->
write( checksums_file );
1089 std::map<int, boost::shared_ptr<LutXml> > xml;
1090 if ( !lut_checksums_xml ){
1091 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1094 addLutMap( xml, getCompressionLutXmlFromCoder( _tag, split_by_crate ) );
1096 writeLutXmlFiles( xml, _tag, split_by_crate );
1098 std::string checksums_file = _tag +
"_checksums.xml";
1099 lut_checksums_xml ->
write( checksums_file );
1107 std::map<int, boost::shared_ptr<LutXml> > xml;
1108 if ( !lut_checksums_xml ){
1109 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1113 addLutMap( xml, getLinearizationLutXmlFromCoderEmap( _coder, _tag, split_by_crate ) );
1114 addLutMap( xml, getCompressionLutXmlFromCoder( _tag, 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 );
1129 std::map<int, boost::shared_ptr<LutXml> > xml;
1130 if ( !lut_checksums_xml ){
1131 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1134 if ( !_lin_file.empty() ){
1135 const std::map<int, boost::shared_ptr<LutXml> > _lin_lut_ascii_xml = getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate );
1136 addLutMap( xml, _lin_lut_ascii_xml );
1138 const std::map<int, boost::shared_ptr<LutXml> > _lin_lut_xml = getLinearizationLutXmlFromCoderEmap( _coder, _tag, split_by_crate );
1139 addLutMap( xml, _lin_lut_xml );
1141 const std::map<int, boost::shared_ptr<LutXml> > _comp_lut_xml = getCompressionLutXmlFromCoder( _transcoder, _tag, split_by_crate );
1142 addLutMap( xml, _comp_lut_xml );
1144 writeLutXmlFiles( xml, _tag, split_by_crate );
1146 std::string checksums_file = _tag +
"_checksums.xml";
1147 lut_checksums_xml ->
write( checksums_file );
1155 std::map<int, boost::shared_ptr<LutXml> > xml;
1156 if ( !lut_checksums_xml ){
1157 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1160 if ( !_lin_file.empty() ){
1161 const std::map<int, boost::shared_ptr<LutXml> > _lin_lut_ascii_xml = getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate );
1162 addLutMap( xml, _lin_lut_ascii_xml );
1164 const std::map<int, boost::shared_ptr<LutXml> > _lin_lut_xml = getLinearizationLutXmlFromCoderEmap( _coder, _tag, split_by_crate );
1165 addLutMap( xml, _lin_lut_xml );
1167 const std::map<int, boost::shared_ptr<LutXml> > _comp_lut_xml = getCompressionLutXmlFromCoder( _tag, split_by_crate );
1168 addLutMap( xml, _comp_lut_xml );
1170 writeLutXmlFiles( xml, _tag, split_by_crate );
1172 std::string checksums_file = _tag +
"_checksums.xml";
1173 lut_checksums_xml ->
write( checksums_file );
1183 std::map<int, boost::shared_ptr<LutXml> > xml;
1184 if ( !lut_checksums_xml ){
1185 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1188 if ( !_lin_file.empty() ){
1189 addLutMap( xml, getLutXmlFromAsciiMaster( _lin_file, _tag, -1, split_by_crate ) );
1191 addLutMap( xml, getCompressionLutXmlFromCoder( _tag, split_by_crate ) );
1192 writeLutXmlFiles( xml, _tag, split_by_crate );
1194 std::string checksums_file = _tag +
"_checksums.xml";
1195 lut_checksums_xml ->
write( checksums_file );
1205 edm::LogInfo(
"HcalLutManager") <<
"Added LUTs for crate " <<
lut->first;
1222 strftime( timebuf, 50,
"%Y-%m-%d %H:%M:%S", gmtime( &_time ) );
1225 return creationstamp;
1233 local_connect( _filename,
"backup/HCALmapHBEF.txt",
"backup/HCALmapHO.txt" );
1237 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
1238 int map_size = _map .
size();
1239 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << map_size <<
" channels";
1242 std::vector<unsigned int> _lut;
1243 _lut = getLutFromXml( _tag, 1107313727, hcal::ConfigurationDatabase::LinearizerLUT );
1246 edm::LogInfo(
"HcalLutManager") <<
"Testing direct parsing of the LUT XML";
1248 gettimeofday( &_t,
nullptr );
1249 double _time =(double)(_t . tv_sec) + (double)(_t . tv_usec)/1000000.0;
1250 test_direct_xml_parsing(_filename);
1251 gettimeofday( &_t,
nullptr );
1252 edm::LogInfo(
"HcalLutManager") <<
"parsing took that much time: " << (double)(_t . tv_sec) + (double)(_t . tv_usec)/1000000.0 - _time;
1255 gettimeofday( &_t,
nullptr );
1256 _time =(double)(_t . tv_sec) + (double)(_t . tv_usec)/1000000.0;
1257 edm::LogInfo(
"HcalLutManager") <<
"before loop over random LUTs: " << _time;
1261 for (
int _iter=0; _iter<100; _iter++){
1262 gettimeofday( &_t,
nullptr );
1267 int _key = (
rand() % map_size);
1269 if( (_map[_key].subdet.find(
"HB")!=string::npos ||
1270 _map[_key].subdet.find(
"HE")!=string::npos ||
1271 _map[_key].subdet.find(
"HO")!=string::npos ||
1272 _map[_key].subdet.find(
"HF")!=string::npos ) &&
1273 _map[_key].subdet.size()==2
1276 if ( _map[_key].subdet.find(
"HB")!=string::npos ) _subdet =
HcalBarrel;
1277 else if ( _map[_key].subdet.find(
"HE")!=string::npos ) _subdet =
HcalEndcap;
1278 else if ( _map[_key].subdet.find(
"HO")!=string::npos ) _subdet =
HcalOuter;
1279 else if ( _map[_key].subdet.find(
"HF")!=string::npos ) _subdet =
HcalForward;
1281 HcalDetId _detid(_subdet, _map[_key].ieta, _map[_key].iphi, _map[_key].idepth);
1282 _raw_id = _detid.
rawId();
1286 _lut = getLutFromXml( _tag, _raw_id, hcal::ConfigurationDatabase::LinearizerLUT );
1288 gettimeofday( &_t,
nullptr );
1290 double d_time = _t.tv_sec+_t.tv_usec/1000000.0 - _time;
1291 edm::LogInfo(
"HcalLutManager") <<
"after the loop over random LUTs: " << _time+d_time << std::endl
1292 <<
"total time: " << d_time << std::endl;
1295 for ( std::vector<unsigned int>::const_iterator
i = _lut .
end() - 1;
i != _lut .
begin()-1;
i-- )
1297 edm::LogInfo(
"HcalLutManager") << (
i-_lut.begin()) <<
" " << _lut[(
i-_lut.begin())];
1315 lmap -> read( lmap_hbef_file,
"HBEF" );
1316 lmap -> read( lmap_ho_file,
"HO" );
1317 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << lmap -> get_map() .
size() <<
" channels (compare to 9072 of all HCAL channels)";
1327 db ->
connect( lut_xml_file );
1337 read_lmap( lmap_hbef_file, lmap_ho_file );
1338 read_luts( lut_xml_file );
1347 edm::LogInfo(
"HcalLutManager") <<
"getLutFromXml (new version) is not implemented. Use getLutFromXml_old() for now";
1349 std::vector<unsigned int>
result;
1361 edm::LogError(
"HcalLutManager") <<
"Cannot find LUT without LMAP, exiting...";
1365 edm::LogError(
"HcalLutManager") <<
"Cannot find LUT, no source (local XML file), exiting...";
1369 std::vector<unsigned int>
result;
1371 std::map<int,LMapRow> & _map = lmap -> get_map();
1376 unsigned int _crate, _slot, _fiber, _channel;
1378 int topbottom, luttype;
1381 if ( _map .
find(_rawid) != _map.end() ){
1382 _crate = _map[_rawid] . crate;
1383 _slot = _map[_rawid] . htr;
1384 _fiber = _map[_rawid] . htr_fi;
1385 _channel = _map[_rawid] . fi_ch;
1386 _fpga = _map[_rawid] . fpga;
1388 if ( _fpga .
find(
"top") != std::string::npos ) topbottom = 1;
1389 else if ( _fpga .
find(
"bot") != std::string::npos ) topbottom = 0;
1391 edm::LogError(
"HcalLutManager") <<
"Irregular LMAP fpga value... do not know what to do - exiting";
1394 if ( _lt == hcal::ConfigurationDatabase::LinearizerLUT ) luttype = 1;
1397 result = db -> getOnlineLUT( tag, _crate, _slot, topbottom, _fiber, _channel, luttype );
1407 std::map<int, boost::shared_ptr<LutXml> > lut_map = get_brickSet_from_oracle( tag, db_accessor );
1408 if (split_by_crate){
1409 writeLutXmlFiles( lut_map, tag, split_by_crate );
1413 for(
std::map<
int, boost::shared_ptr<LutXml> >::const_iterator xml = lut_map.begin(); xml != lut_map.end(); xml++ ){
1414 result += *(xml->second);
1416 std::stringstream out_file;
1417 out_file << tag <<
".xml";
1418 result .
write(out_file.str());
1430 oracle::occi::Connection * _connection = db -> getConnection();
1432 edm::LogInfo(
"HcalLutManager") <<
"Preparing to request the LUT CLOBs from the database...";
1440 std::string query = (
"SELECT TRIG_PRIM_LOOKUPTBL_DATA_CLOB, CRATE FROM CMS_HCL_HCAL_COND.V_HCAL_TRIG_LOOKUP_TABLES");
1446 std::map<int, boost::shared_ptr<LutXml> > lut_map;
1450 edm::LogInfo(
"HcalLutManager") <<
"Executing the query...";
1451 Statement* stmt = _connection -> createStatement();
1452 ResultSet *rs = stmt->executeQuery(query);
1453 edm::LogInfo(
"HcalLutManager") <<
"Executing the query... done";
1455 edm::LogInfo(
"HcalLutManager") <<
"Processing the query results...";
1457 while (rs->next()) {
1459 oracle::occi::Clob clob = rs->getClob (1);
1460 int crate = rs->getInt(2);
1462 edm::LogInfo(
"HcalLutManager") <<
"Getting LUTs for crate #" << crate <<
" out of the database...";
1463 brick_set = db -> clobToString(clob);
1473 const char * bs = brick_set . c_str();
1474 MemBufInputSource * lut_clob =
new MemBufInputSource( (
const XMLByte *)bs, strlen( bs ),
"lut_clob",
false );
1475 boost::shared_ptr<LutXml> lut_xml = boost::shared_ptr<LutXml>(
new LutXml( *lut_clob ) );
1476 lut_map[crate] = lut_xml;
1481 _connection -> terminateStatement(stmt);
1483 }
catch (SQLException&
e) {
1484 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,::
toolbox::toString(
"Oracle exception : %s",getOraMessage(&e)));
1497 edm::LogInfo(
"HcalLutManager") <<
"Generating XML loader for LUTs...";
1504 baseConf . tag_name = tag_name;
1506 baseConf . comment_description =
comment;
1507 baseConf . iov_begin =
"1";
1508 baseConf . iov_end =
"-1";
1512 std::stringstream _subversion;
1513 _subversion << subversion;
1514 conf . subversion = _subversion.str();
1516 CSconf . version = conf .
version;
1517 CSconf . subversion = conf . subversion;
1518 CSconf . trig_prim_lookuptbl_data_file = _prefix +
"_checksums.xml.dat";
1519 CSconf . comment_description = tag_name;
1523 std::vector<int> crate_number;
1525 for (std::vector<std::string>::const_iterator _f = file_name.begin(); _f != file_name.end(); _f++){
1526 int crate_begin = _f->rfind(
"_");
1527 int crate_end = _f->rfind(
".xml.dat");
1528 crate_number . push_back(
getInt(_f->substr(crate_begin+1,crate_end-crate_begin-1)));
1534 time_t _offset =
time(
nullptr);
1535 sprintf( _buf,
"%d", (uint32_t)_offset );
1540 for ( std::vector<std::string>::const_iterator _file = file_name .
begin(); _file != file_name .
end(); _file++ )
1542 conf . trig_prim_lookuptbl_data_file = *_file;
1544 conf . crate = crate_number[ _file - file_name .
begin() ];
1548 sprintf( _buf,
"%.2d", conf.
crate );
1551 sprintf( _buf,
"CRATE%.2d", conf . crate );
1553 _namelabel .
append( _buf );
1554 conf . name_label = _namelabel;
1555 doc . addLUT( &conf );
1558 doc . addChecksums( &CSconf );
1560 doc .
write( tag_name +
"_Loader.xml" );
1562 edm::LogInfo(
"HcalLutManager") <<
"Generating XML loader for LUTs... done.";
1572 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
1573 std::stringstream
s;
1574 s <<
"EMap contains " << _map .
size() <<
" channels" << std::endl;
1578 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
1581 if ( row->subdet .
find(
"HT") != std::string::npos ){
1582 s <<
" -----> Subdet = " << row->subdet << std::endl;
1584 if (
abs(row->ieta)>28){
1586 s <<
" ==> (ieta,iphi) = " << row->ieta <<
", " << row->iphi << std::endl;
1632 std::map<int, boost::shared_ptr<LutXml> > xml;
1633 if ( !lut_checksums_xml ){
1634 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1637 if ( !_lin_file.empty() ){
1638 const std::map<int, boost::shared_ptr<LutXml> > _lin_lut_ascii_xml = getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate );
1639 addLutMap( xml, _lin_lut_ascii_xml );
1641 const std::map<int, boost::shared_ptr<LutXml> > _lin_lut_xml = getLinearizationLutXmlFromCoderEmap( _coder, _tag, split_by_crate );
1642 addLutMap( xml, _lin_lut_xml );
1644 const std::map<int, boost::shared_ptr<LutXml> > _comp_lut_xml = getCompressionLutXmlFromCoder( _transcoder, _tag, split_by_crate );
1645 addLutMap( xml, _comp_lut_xml );
1647 for(
auto masktype: {0,1,2}){
1648 const auto masks=getMasks(masktype, _tag, split_by_crate);
1649 addLutMap(xml, masks);
1652 const std::map<int, boost::shared_ptr<LutXml> > _zdc_lut_xml = getZdcLutXml( _tag, split_by_crate );
1653 addLutMap( xml, _zdc_lut_xml );
1655 writeLutXmlFiles( xml, _tag, split_by_crate );
1657 std::string checksums_file = _tag +
"_checksums.xml";
1658 lut_checksums_xml ->
write( checksums_file );
1665 bool split_by_crate )
1667 edm::LogInfo(
"HcalLutManager") <<
"Generating ZDC LUTs ...may the Force be with us...";
1668 std::map<int, boost::shared_ptr<LutXml> > _xml;
1674 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
1675 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" channels";
1679 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
1683 if ( row->zdc_section .
find(
"ZDC") != std::string::npos ){
1684 if ( _xml.count(row->crate) == 0 && split_by_crate ){
1685 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(row->crate,boost::shared_ptr<LutXml>(
new LutXml())) );
1687 else if ( _xml.count(0) == 0 && !split_by_crate ){
1688 _xml.insert( std::pair<
int,boost::shared_ptr<LutXml> >(0,boost::shared_ptr<LutXml>(
new LutXml())) );
1691 _cfg.
ieta = row->zdc_channel;
1694 _cfg.
depth = row->idepth;
1695 _cfg.
crate = row->crate;
1696 _cfg.
slot = row->slot;
1697 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
1698 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
1700 _cfg.
fiber = row->fiber;
1711 std::vector<int> coder_lut = zdc.
get_lut(row->zdc_section,
1714 edm::LogInfo(
"HcalLutManager") <<
"***DEBUG: ZDC lut size: " << coder_lut.size();
1715 if (!coder_lut.empty()){
1716 for (std::vector<int>::const_iterator _i=coder_lut.begin(); _i!=coder_lut.end();_i++){
1717 unsigned int _temp = (
unsigned int)(*_i);
1720 _cfg.
lut.push_back(_temp);
1724 if (split_by_crate ){
1725 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
1729 _xml[0]->addLut( _cfg, lut_checksums_xml );
1736 <<
"Generating ZDC LUTs...DONE" << std::endl;
int adc(sample_type sample)
get the ADC sample (12 bits)
int initChannelIterator(std::vector< HcalGenericDetId > &map)
std::map< int, boost::shared_ptr< LutXml > > getLutXmlFromAsciiMaster(std::string _filename, std::string _tag, int _crate=-1, bool split_by_crate=true)
std::vector< std::vector< unsigned int > > lut
std::vector< int > get_lut(int emap_side, int emap_htr_fiber, int emap_fi_ch)
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)
virtual bool HTvalid(const int ieta, const int iphi, const int version) const
std::map< int, boost::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")
std::vector< std::string > subdet
Various manipulations with trigger Lookup Tables.
std::string & getLutXml(std::vector< unsigned int > &_lut)
std::map< int, boost::shared_ptr< LutXml > > getCompressionLutXmlFromAsciiMaster(std::string _filename, std::string _tag, int _crate=-1, bool split_by_crate=true)
virtual const std::vector< unsigned int > getCompressionLUT(const HcalTrigTowerDetId &id) const
constexpr uint32_t rawId() const
get the raw id
Generation of ZDC Lookup tables and associate helper methods.
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)
unsigned long int getCount(void)
int getInt(ResultSet *rset, int ipar)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static HcalSubdetector get_subdetector(std::string _subdet)
std::map< int, boost::shared_ptr< LutXml > > getCompressionLutXmlFromCoder(std::string _tag, bool split_by_crate=true)
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, boost::shared_ptr< LutXml > > getLinearizationLutXmlFromCoder(const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true)
std::map< int, LMapRow > & get_map(void)
int test_direct_xml_parsing(std::string _filename)
std::vector< unsigned int > lut
void addLutMap(std::map< int, boost::shared_ptr< LutXml > > &result, const std::map< int, boost::shared_ptr< LutXml > > &other)
static std::vector< std::string > splitString(const std::string &fLine)
std::map< int, boost::shared_ptr< LutXml > > getZdcLutXml(std::string _tag, bool split_by_crate=true)
int read_luts(std::string lut_xml_file)
std::vector< int > depth_min
Abs< T >::type abs(const T &t)
std::map< int, boost::shared_ptr< LutXml > > getLinearizationLutXmlFromAsciiMasterEmap_new(std::string _filename, std::string _tag, int _crate, bool split_by_crate=true)
int writeLutXmlFiles(std::map< int, boost::shared_ptr< LutXml > > &_xml, std::string _tag="default_tag", bool split_by_crate=true)
HcalLutSet getLutSetFromFile(std::string _filename, int _type=1)
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
std::string formatrevision
virtual std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
Gather config data from online DB.
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)
std::map< int, boost::shared_ptr< LutXml > > getLinearizationLutXmlFromCoderEmap(const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true)
std::map< int, boost::shared_ptr< LutXml > > getMasks(int var, std::string _tag, bool split_by_crate=true)
static int getInt(std::string number)
static std::string get_time_stamp(time_t _time)
const HcalElectronicsMap * getHcalMapping() const
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, boost::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)
int read_lmap(std::string lmap_hbef_file, std::string lmap_ho_file)
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()
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