13 #include <toolbox/string.h> 61 uint32_t _status_word_to_mask)
66 status_word_to_mask = _status_word_to_mask;
71 uint32_t _status_word_to_mask)
74 conditions=_conditions;
77 status_word_to_mask = _status_word_to_mask;
84 lut_checksums_xml =
nullptr;
90 status_word_to_mask = 0x0000;
98 delete lut_checksums_xml;
114 if (lut_xml)
delete lut_xml;
120 lut_xml -> addLut( _config );
121 lut_xml -> addLut( _config );
122 lut_xml -> addLut( _config );
125 return lut_xml->getCurrentBrick();
133 sscanf(number.c_str(),
"%d", &
result);
140 if ( _det.find(
"HB") != std::string::npos ) result =
HcalBarrel;
141 else if ( _det.find(
"HE") != std::string::npos ) result =
HcalEndcap;
142 else if ( _det.find(
"HF") != std::string::npos ) result =
HcalForward;
143 else if ( _det.find(
"HO") != std::string::npos ) result =
HcalOuter;
153 HcalLutSet _set = _manager . getLutSetFromFile( _filename );
155 s <<
"===> Test of HcalLutSet HcalLutManager::getLutSetFromFile( std::string _filename )" << std::endl << std::endl;
156 s << _set .
label << std::endl;
157 for (
unsigned int i = 0;
i != _set.
subdet.size();
i++) s << _set.
subdet[
i] <<
" ";
171 for (
unsigned int j = 0; j != _set.
lut[0].size(); j++){
172 for (
unsigned int i = 0;
i != _set.
lut.size();
i++){
173 s << _set.
lut[
i][j] <<
" ";
175 s <<
"---> " << j << std::endl;
186 ifstream infile( _filename . c_str() );
189 if ( infile . is_open() ){
190 edm::LogInfo(
"HcalLutManager") <<
"File " << _filename <<
" is open..." << std::endl
191 <<
"Reading LUTs and their eta/phi/depth/subdet ranges...";
194 getline( infile, _lutset .
label );
198 getline( infile, buf );
203 std::vector<std::string> buf_vec;
204 getline( infile, buf );
206 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
211 getline( infile, buf );
213 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
218 getline( infile, buf );
220 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
225 getline( infile, buf );
227 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
233 getline( infile, buf );
235 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
240 getline( infile, buf );
242 for (std::vector<std::string>::const_iterator iter = buf_vec.begin(); iter != buf_vec.end(); iter++){
247 bool first_lut_entry =
true;
248 while (getline( infile, buf )) {
250 for (
unsigned int i = 0;
i < buf_vec.size();
i++){
251 if (first_lut_entry){
252 std::vector<unsigned int> _l;
253 _lutset.
lut.push_back(_l);
257 first_lut_entry =
false;
270 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
271 std::map<int, std::shared_ptr<LutXml> > _xml;
274 _lmap . read(
"./backup/HCALmapHBEF.txt",
"HBEF" );
275 _lmap . read(
"./backup/HCALmapHO.txt",
"HO" );
276 std::map<int,LMapRow> & _map = _lmap.
get_map();
277 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << _map .
size() <<
" channels";
280 HcalLutSet _set = getLutSetFromFile( _filename );
281 int lut_set_size = _set.
lut.size();
285 for( std::map<int,LMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
291 for (
int i=0;
i<lut_set_size;
i++ ){
292 if ( (row->second.crate == _crate || _crate == -1) &&
293 _set.
eta_min[
i] <= row->second.side*row->second.eta &&
294 _set.
eta_max[
i] >= row->second.side*row->second.eta &&
295 _set.
phi_min[
i] <= row->second.phi &&
296 _set.
phi_max[
i] >= row->second.phi &&
299 get_subdetector(_set.
subdet[
i]) == row->second.det ){
303 if ( lut_index >= 0 ){
304 if ( _xml.count(row->second.crate) == 0 && split_by_crate ){
305 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->second.crate,std::make_shared<LutXml>()) );
307 else if ( _xml.count(0) == 0 && !split_by_crate ){
308 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
310 _cfg.
ieta = row->second.side*row->second.eta;
311 _cfg.
iphi = row->second.phi;
312 _cfg.
depth = row->second.depth;
313 _cfg.
crate = row->second.crate;
314 _cfg.
slot = row->second.htr;
315 if (row->second.fpga .
find(
"top") != std::string::npos) _cfg.
topbottom = 1;
316 else if (row->second.fpga .
find(
"bot") != std::string::npos) _cfg.
topbottom = 0;
320 _cfg.
fiber = row->second.htr_fi;
322 if (_set.
lut[lut_index].size() == 128) _cfg.
lut_type = 1;
333 (row->second.side>0)*100 + row->second.eta +
334 ((row->second.det==
HcalForward && row->second.eta==29)?(4*10000):(0));
335 _cfg.
lut = _set.
lut[lut_index];
336 if (split_by_crate ){
337 _xml[row->second.crate]->addLut( _cfg, lut_checksums_xml );
341 _xml[0]->addLut( _cfg, lut_checksums_xml );
347 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
356 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
357 std::map<int, std::shared_ptr<LutXml> > _xml;
360 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
361 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" entries";
364 HcalLutSet _set = getLutSetFromFile( _filename );
365 int lut_set_size = _set.
lut.size();
366 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
369 std::vector<unsigned int> zeroLut;
370 for (
size_t adc = 0;
adc < 128;
adc++) zeroLut.push_back(0);
374 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
375 if( (row->subdet.find(
"HB")!=string::npos ||
376 row->subdet.find(
"HE")!=string::npos ||
377 row->subdet.find(
"HO")!=string::npos ||
378 row->subdet.find(
"HF")!=string::npos ) &&
379 row->subdet.size()==2
386 for (
int i=0;
i<lut_set_size;
i++ ){
387 if ( (row->crate == _crate || _crate == -1) &&
394 _set.
subdet[
i].find(row->subdet)!=string::npos ){
398 if ( lut_index >= 0 ){
399 if ( _xml.count(row->crate) == 0 && split_by_crate ){
400 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->crate,std::make_shared<LutXml>()) );
402 else if ( _xml.count(0) == 0 && !split_by_crate ){
403 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
405 _cfg.
ieta = row->ieta;
406 _cfg.
iphi = row->iphi;
407 _cfg.
depth = row->idepth;
408 _cfg.
crate = row->crate;
409 _cfg.
slot = row->slot;
410 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
411 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
412 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
414 _cfg.
fiber = row->fiber;
426 (row->ieta>0)*100 +
abs(row->ieta) +
427 (((row->subdet.find(
"HF")!=string::npos) &&
abs(row->ieta)==29)?(4*10000):(0));
430 DetId _detId(row->rawId);
431 uint32_t status_word = cq->getValues(_detId)->getValue();
432 if ((status_word & status_word_to_mask) > 0){
436 _cfg.
lut = _set.
lut[lut_index];
438 if (split_by_crate ){
439 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
443 _xml[0]->addLut( _cfg, lut_checksums_xml );
450 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
457 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
458 std::map<int, std::shared_ptr<LutXml> > _xml;
461 HcalLutSet _set = getLutSetFromFile( _filename );
462 int lut_set_size = _set.
lut.size();
463 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
467 for( _iter.begin(); !_iter.end(); _iter.next() ){
474 int _ieta = _iter.getIeta();
475 int _iphi = _iter.getIphi();
476 int _depth = _iter.getDepth();
480 int aCrate = _eId . readoutVMECrateId();
481 int aSlot = _eId . htrSlot();
482 int aTopBottom = _eId . htrTopBottom();
483 int aFiber = _eId . fiberIndex();
484 int aFiberChan = _eId . fiberChanId();
491 for (
int i=0;
i<lut_set_size;
i++ ){
492 if ( (aCrate == _crate || _crate == -1) &&
499 _set.
subdet[
i].find(_ass.getSubdetectorString(_subdet))!=string::npos ){
503 if ( lut_index >= 0 ){
504 if ( _xml.count(aCrate) == 0 && split_by_crate ){
505 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(aCrate,std::make_shared<LutXml>()) );
507 else if ( _xml.count(0) == 0 && !split_by_crate ){
508 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
528 (_ieta>0)*100 +
abs(_ieta) +
530 _cfg.
lut = _set.
lut[lut_index];
531 if (split_by_crate ){
532 _xml[aCrate]->addLut( _cfg, lut_checksums_xml );
536 _xml[0]->addLut( _cfg, lut_checksums_xml );
543 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
550 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from ascii master file...";
551 std::map<int, std::shared_ptr<LutXml> > _xml;
553 edm::LogInfo(
"HcalLutManager") <<
"instantiating CaloTPGTranscoderULUT in order to check the validity of (ieta,iphi)...";
559 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
560 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" channels";
563 HcalLutSet _set = getLutSetFromFile( _filename, 2 );
564 int lut_set_size = _set.
lut.size();
565 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
569 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
575 for (
int i=0;
i<lut_set_size;
i++ ){
576 if ( row->subdet .
find(
"HT") != std::string::npos &&
577 (row->crate == _crate || _crate == -1) &&
582 _coder.
HTvalid(row->ieta, row->iphi, row->idepth / 10) ){
586 if ( lut_index >= 0 ){
587 if ( _xml.count(row->crate) == 0 && split_by_crate ){
588 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->crate,std::make_shared<LutXml>()) );
590 else if ( _xml.count(0) == 0 && !split_by_crate ){
591 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
593 _cfg.
ieta = row->ieta;
594 _cfg.
iphi = row->iphi;
595 _cfg.
depth = row->idepth;
596 _cfg.
crate = row->crate;
597 _cfg.
slot = row->slot;
598 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
599 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
600 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
602 _cfg.
fiber = row->fiber;
604 if (_set.
lut[lut_index].size() == 128) _cfg.
lut_type = 1;
615 (row->ieta>0)*100+
abs(row->ieta);
616 _cfg.
lut = _set.
lut[lut_index];
617 if (split_by_crate ){
618 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
622 _xml[0]->addLut( _cfg, lut_checksums_xml );
628 <<
"Generating compression (output) LUTs from ascii master file...DONE" << std::endl;
635 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...";
636 std::map<int, std::shared_ptr<LutXml> > _xml;
643 _lmap . read(
"backup/HCALmapHBEF.txt",
"HBEF" );
646 std::map<int,LMapRow> & _map = _lmap.
get_map();
647 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << _map .
size() <<
" channels";
655 for( std::map<int,LMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
658 if ( _xml.count(row->second.crate) == 0 && split_by_crate ){
659 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->second.crate,std::make_shared<LutXml>()) );
661 else if ( _xml.count(0) == 0 && !split_by_crate ){
662 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
664 _cfg.
ieta = row->second.side*row->second.eta;
665 _cfg.
iphi = row->second.phi;
666 _cfg.
depth = row->second.depth;
667 _cfg.
crate = row->second.crate;
668 _cfg.
slot = row->second.htr;
669 if (row->second.fpga .
find(
"top") != std::string::npos) _cfg.
topbottom = 1;
670 else if (row->second.fpga .
find(
"bot") != std::string::npos) _cfg.
topbottom = 0;
674 _cfg.
fiber = row->second.htr_fi;
686 (row->second.side>0)*100 + row->second.eta +
687 ((row->second.det==
HcalForward && row->second.eta==29)?(4*10000):(0));
690 HcalDetId _detid(row->second.det, row->second.side*row->second.eta, row->second.phi, row->second.depth);
694 std::vector<unsigned short> coder_lut = _coder . getLinearizationLUT(_detid);
695 for (std::vector<unsigned short>::const_iterator _i=coder_lut.begin(); _i!=coder_lut.end();_i++){
696 unsigned int _temp = (
unsigned int)(*_i);
699 _cfg.
lut.push_back(_temp);
701 if (split_by_crate ){
702 _xml[row->second.crate]->addLut( _cfg, lut_checksums_xml );
706 _xml[0]->addLut( _cfg, lut_checksums_xml );
711 <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
717 edm::LogInfo(
"HcalLutManager") <<
"Generating TDC masks...";
720 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
721 edm::LogInfo(
"HcalLutManager") <<
"EMap contains new" << _map.size() <<
" entries";
723 std::map<int, std::vector<uint64_t>> masks;
725 for(
const auto& row : _map){
727 if(subdet !=
"HF")
continue;
730 int crot=100*crate+slot;
732 int channel=row.fiberchan;
733 unsigned int finel=4*fiber+channel;
734 if(masks.count(crot)==0) masks[crot]={};
735 if(finel>=masks[crot].
size()) masks[crot].resize(finel+1);
739 if ( row.subdet.find(
"HB")!=string::npos ) _subdet =
HcalBarrel;
740 else if ( row.subdet.find(
"HE")!=string::npos ) _subdet =
HcalEndcap;
741 else if ( row.subdet.find(
"HO")!=string::npos ) _subdet =
HcalOuter;
742 else if ( row.subdet.find(
"HF")!=string::npos ) _subdet =
HcalForward;
744 HcalDetId _detid(_subdet, row.ieta, row.iphi, row.idepth);
745 masks[crot][finel]= conditions->getHcalTPChannelParameter(_detid)->getMask();
748 auto parameters = conditions->getHcalTPParameters();
753 std::map<int, std::shared_ptr<LutXml> > _xml;
756 for(
const auto &
i: masks){
763 _cfg.
slot = crot%100;
765 _cfg.
mask =
i.second;
770 int c= split_by_crate ? crate : 0;
771 if ( _xml.count(c) == 0 ) _xml[c]=std::make_shared<LutXml>();
773 _xml[
c]->addLut(_cfg);
778 <<
"Generating Masks...DONE" << std::endl;
787 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...";
788 std::map<int, std::shared_ptr<LutXml> > _xml;
791 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
792 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" entries";
796 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
797 if( (row->subdet.find(
"HB")!=string::npos ||
798 row->subdet.find(
"HE")!=string::npos ||
799 row->subdet.find(
"HF")!=string::npos ) &&
800 row->subdet.size()==2
804 if ( _xml.count(row->crate) == 0 && split_by_crate ){
805 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->crate,std::make_shared<LutXml>()) );
807 else if ( _xml.count(0) == 0 && !split_by_crate ){
808 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
810 _cfg.
ieta = row->ieta;
811 _cfg.
iphi = row->iphi;
812 _cfg.
depth = row->idepth;
813 _cfg.
crate = row->crate;
814 _cfg.
slot = row->slot;
815 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
816 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
817 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
819 _cfg.
fiber = row->fiber;
831 (row->ieta>0)*100 +
abs(row->ieta) +
832 (((row->subdet.find(
"HF")!=string::npos) &&
abs(row->ieta)==29)?(4*10000):(0));
834 if ( row->subdet.find(
"HB")!=string::npos ) _subdet =
HcalBarrel;
835 else if ( row->subdet.find(
"HE")!=string::npos ) _subdet =
HcalEndcap;
836 else if ( row->subdet.find(
"HO")!=string::npos ) _subdet =
HcalOuter;
837 else if ( row->subdet.find(
"HF")!=string::npos ) _subdet =
HcalForward;
839 HcalDetId _detid(_subdet, row->ieta, row->iphi, row->idepth);
843 if (split_by_crate ){
844 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
848 _xml[0]->addLut( _cfg, lut_checksums_xml );
854 <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
860 edm::LogInfo(
"HcalLutManager") <<
"Generating HE fine grain LUTs";
861 std::map<int, std::shared_ptr<LutXml> > _xml;
864 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
865 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" entries";
869 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
870 if( row->subdet.find(
"HT")!=string::npos && row->subdet.size()==2 ){
871 int abseta =
abs(row->ieta);
873 if(abseta<=topo->lastHBRing()
or abseta>topo->
lastHERing())
continue;
877 if ( _xml.count(row->crate) == 0 && split_by_crate ){
878 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->crate,std::make_shared<LutXml>()) );
880 else if ( _xml.count(0) == 0 && !split_by_crate ){
881 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
883 _cfg.
ieta = row->ieta;
884 _cfg.
iphi = row->iphi;
885 _cfg.
depth = row->idepth;
886 _cfg.
crate = row->crate;
887 _cfg.
slot = row->slot;
888 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
889 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
890 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
892 _cfg.
fiber = row->fiber;
901 (row->ieta>0)*100 +
abs(row->ieta) +
902 (((row->subdet.find(
"HF")!=string::npos) &&
abs(row->ieta)==29)?(4*10000):(0));
905 HcalDetId _detid(_subdet, row->ieta, row->iphi, row->idepth);
907 HcalFinegrainBit fg_algo(conditions->getHcalTPParameters()->getFGVersionHBHE());
911 const int n_fgab_bits = 2048;
912 for (
int i=0;
i < 2*n_fgab_bits;
i++) {
914 for(
int k = 0;
k < 6;
k++) {
915 tow[0][
k] = (1 <<
k) &
i;
916 tow[1][
k] = (1 << (
k + 6)) &
i;
918 _cfg.
lut.push_back(fg_algo.compute(tow).to_ulong());
921 if (split_by_crate ){
922 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
926 _xml[0]->addLut( _cfg, lut_checksums_xml );
932 <<
"Generating HE fine grain LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
940 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT," << std::endl
941 <<
"initialized from Event Setup" << std::endl;
942 std::map<int, std::shared_ptr<LutXml> > _xml;
946 std::map<int,unsigned int> maxsize;
948 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
949 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" channels";
952 for(
const auto& row : _map){
953 if ( row.subdet.find(
"HT") == std::string::npos)
continue;
955 if(!cq->topo()->validHT(_detid))
continue;
956 int crot=100*row.crate+row.slot;
958 if(maxsize.count(crot)==0 || size>maxsize[crot]) maxsize[crot]=size;
963 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
966 if ( row->subdet.find(
"HT") == std::string::npos)
continue;
970 if(!cq->topo()->validHT(_detid))
continue;
973 if ( _xml.count(row->crate) == 0 && split_by_crate ){
974 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->crate,std::make_shared<LutXml>()) );
976 else if ( _xml.count(0) == 0 && !split_by_crate ){
977 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
980 _cfg.
ieta = row->ieta;
981 _cfg.
iphi = row->iphi;
982 _cfg.
depth = row->idepth;
983 _cfg.
crate = row->crate;
984 _cfg.
slot = row->slot;
985 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
986 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
987 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
989 _cfg.
fiber = row->fiber;
1000 int crot=100*row->crate+row->slot;
1001 unsigned int size=_cfg.
lut.size();
1002 if(size<maxsize[crot]){
1005 <<
"], using value=" << _cfg.
lut[size-1] << std::endl;
1006 for(
unsigned int i=size;
i<maxsize[crot]; ++
i) _cfg.
lut.push_back(_cfg.
lut[size-1]);
1009 if (split_by_crate ){
1010 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
1014 _xml[0]->addLut( _cfg, lut_checksums_xml );
1019 <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT...DONE" << std::endl;
1028 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT";
1029 std::map<int, std::shared_ptr<LutXml> > _xml;
1036 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
1037 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" channels";
1047 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
1052 const int tp_version = row->idepth / 10;
1053 if ( row->subdet .
find(
"HT") != std::string::npos && _coder.
HTvalid(row->ieta, row->iphi, tp_version) ){
1054 if ( _xml.count(row->crate) == 0 && split_by_crate ){
1055 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->crate,std::make_shared<LutXml>()) );
1057 else if ( _xml.count(0) == 0 && !split_by_crate ){
1058 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
1060 _cfg.
ieta = row->ieta;
1061 _cfg.
iphi = row->iphi;
1062 _cfg.
depth = row->idepth;
1063 _cfg.
crate = row->crate;
1064 _cfg.
slot = row->slot;
1065 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
1066 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
1067 else if (row->topbottom .
find(
"u") != std::string::npos) _cfg.
topbottom = 2;
1069 _cfg.
fiber = row->fiber;
1081 (row->ieta>0)*100+
abs(row->ieta);
1089 if (split_by_crate ){
1090 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
1094 _xml[0]->addLut( _cfg, lut_checksums_xml );
1100 <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT...DONE" << std::endl;
1108 for (
std::map<
int,std::shared_ptr<LutXml> >::const_iterator cr = _xml.begin(); cr != _xml.end(); cr++){
1109 std::stringstream output_file_name;
1110 if ( split_by_crate ){
1111 output_file_name << _tag <<
"_" << cr->first <<
".xml";
1114 output_file_name << _tag <<
".xml";
1116 cr->second->write( output_file_name.str() );
1124 std::map<int, std::shared_ptr<LutXml> > xml;
1125 if ( !lut_checksums_xml ){
1126 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1129 if ( !_lin_file.empty() ){
1130 addLutMap( xml, getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate ) );
1132 writeLutXmlFiles( xml, _tag, split_by_crate );
1134 std::string checksums_file = _tag +
"_checksums.xml";
1135 lut_checksums_xml ->
write( checksums_file );
1143 std::map<int, std::shared_ptr<LutXml> > xml;
1144 if ( !lut_checksums_xml ){
1145 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1148 if ( !_lin_file.empty() ){
1150 addLutMap( xml, getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate ) );
1152 if ( !_comp_file.empty() ){
1154 addLutMap( xml, getCompressionLutXmlFromAsciiMaster( _comp_file, _tag, -1, split_by_crate ) );
1157 writeLutXmlFiles( xml, _tag, split_by_crate );
1159 std::string checksums_file = _tag +
"_checksums.xml";
1160 lut_checksums_xml ->
write( checksums_file );
1168 std::map<int, std::shared_ptr<LutXml> > xml;
1169 if ( !lut_checksums_xml ){
1170 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1173 addLutMap( xml, getCompressionLutXmlFromCoder( _tag, split_by_crate ) );
1175 writeLutXmlFiles( xml, _tag, split_by_crate );
1177 std::string checksums_file = _tag +
"_checksums.xml";
1178 lut_checksums_xml ->
write( checksums_file );
1186 std::map<int, std::shared_ptr<LutXml> > xml;
1187 if ( !lut_checksums_xml ){
1188 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1192 addLutMap( xml, getLinearizationLutXmlFromCoderEmap( _coder, _tag, split_by_crate ) );
1193 addLutMap( xml, getCompressionLutXmlFromCoder( _tag, split_by_crate ) );
1195 writeLutXmlFiles( xml, _tag, split_by_crate );
1197 std::string checksums_file = _tag +
"_checksums.xml";
1198 lut_checksums_xml ->
write( checksums_file );
1208 std::map<int, std::shared_ptr<LutXml> > xml;
1209 if ( !lut_checksums_xml ){
1210 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1213 if ( !_lin_file.empty() ){
1214 const std::map<int, std::shared_ptr<LutXml> > _lin_lut_ascii_xml = getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate );
1215 addLutMap( xml, _lin_lut_ascii_xml );
1217 const std::map<int, std::shared_ptr<LutXml> > _lin_lut_xml = getLinearizationLutXmlFromCoderEmap( _coder, _tag, split_by_crate );
1218 addLutMap( xml, _lin_lut_xml );
1220 const std::map<int, std::shared_ptr<LutXml> > _comp_lut_xml = getCompressionLutXmlFromCoder( _transcoder, _tag, split_by_crate );
1221 addLutMap( xml, _comp_lut_xml );
1223 const std::map<int, std::shared_ptr<LutXml> > _HE_FG_lut_xml = getHEFineGrainLUTs(_tag, split_by_crate );
1224 addLutMap( xml, _HE_FG_lut_xml );
1226 writeLutXmlFiles( xml, _tag, split_by_crate );
1228 std::string checksums_file = _tag +
"_checksums.xml";
1229 lut_checksums_xml ->
write( checksums_file );
1237 std::map<int, std::shared_ptr<LutXml> > xml;
1238 if ( !lut_checksums_xml ){
1239 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1242 if ( !_lin_file.empty() ){
1243 const std::map<int, std::shared_ptr<LutXml> > _lin_lut_ascii_xml = getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate );
1244 addLutMap( xml, _lin_lut_ascii_xml );
1246 const std::map<int, std::shared_ptr<LutXml> > _lin_lut_xml = getLinearizationLutXmlFromCoderEmap( _coder, _tag, split_by_crate );
1247 addLutMap( xml, _lin_lut_xml );
1249 const std::map<int, std::shared_ptr<LutXml> > _comp_lut_xml = getCompressionLutXmlFromCoder( _tag, split_by_crate );
1250 addLutMap( xml, _comp_lut_xml );
1252 writeLutXmlFiles( xml, _tag, split_by_crate );
1254 std::string checksums_file = _tag +
"_checksums.xml";
1255 lut_checksums_xml ->
write( checksums_file );
1265 std::map<int, std::shared_ptr<LutXml> > xml;
1266 if ( !lut_checksums_xml ){
1267 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1270 if ( !_lin_file.empty() ){
1271 addLutMap( xml, getLutXmlFromAsciiMaster( _lin_file, _tag, -1, split_by_crate ) );
1273 addLutMap( xml, getCompressionLutXmlFromCoder( _tag, split_by_crate ) );
1274 writeLutXmlFiles( xml, _tag, split_by_crate );
1276 std::string checksums_file = _tag +
"_checksums.xml";
1277 lut_checksums_xml ->
write( checksums_file );
1287 edm::LogInfo(
"HcalLutManager") <<
"Added LUTs for crate " <<
lut->first;
1304 strftime( timebuf, 50,
"%Y-%m-%d %H:%M:%S", gmtime( &_time ) );
1307 return creationstamp;
1315 local_connect( _filename,
"backup/HCALmapHBEF.txt",
"backup/HCALmapHO.txt" );
1319 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
1320 int map_size = _map .
size();
1321 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << map_size <<
" channels";
1324 std::vector<unsigned int> _lut;
1325 _lut = getLutFromXml( _tag, 1107313727, hcal::ConfigurationDatabase::LinearizerLUT );
1328 edm::LogInfo(
"HcalLutManager") <<
"Testing direct parsing of the LUT XML";
1330 gettimeofday( &_t,
nullptr );
1331 double _time =(double)(_t . tv_sec) + (double)(_t . tv_usec)/1000000.0;
1332 test_direct_xml_parsing(_filename);
1333 gettimeofday( &_t,
nullptr );
1334 edm::LogInfo(
"HcalLutManager") <<
"parsing took that much time: " << (double)(_t . tv_sec) + (double)(_t . tv_usec)/1000000.0 - _time;
1337 gettimeofday( &_t,
nullptr );
1338 _time =(double)(_t . tv_sec) + (double)(_t . tv_usec)/1000000.0;
1339 edm::LogInfo(
"HcalLutManager") <<
"before loop over random LUTs: " << _time;
1343 for (
int _iter=0; _iter<100; _iter++){
1344 gettimeofday( &_t,
nullptr );
1349 int _key = (
rand() % map_size);
1351 if( (_map[_key].subdet.find(
"HB")!=string::npos ||
1352 _map[_key].subdet.find(
"HE")!=string::npos ||
1353 _map[_key].subdet.find(
"HO")!=string::npos ||
1354 _map[_key].subdet.find(
"HF")!=string::npos ) &&
1355 _map[_key].subdet.size()==2
1358 if ( _map[_key].subdet.find(
"HB")!=string::npos ) _subdet =
HcalBarrel;
1359 else if ( _map[_key].subdet.find(
"HE")!=string::npos ) _subdet =
HcalEndcap;
1360 else if ( _map[_key].subdet.find(
"HO")!=string::npos ) _subdet =
HcalOuter;
1361 else if ( _map[_key].subdet.find(
"HF")!=string::npos ) _subdet =
HcalForward;
1363 HcalDetId _detid(_subdet, _map[_key].ieta, _map[_key].iphi, _map[_key].idepth);
1364 _raw_id = _detid.
rawId();
1368 _lut = getLutFromXml( _tag, _raw_id, hcal::ConfigurationDatabase::LinearizerLUT );
1370 gettimeofday( &_t,
nullptr );
1372 double d_time = _t.tv_sec+_t.tv_usec/1000000.0 - _time;
1373 edm::LogInfo(
"HcalLutManager") <<
"after the loop over random LUTs: " << _time+d_time << std::endl
1374 <<
"total time: " << d_time << std::endl;
1377 for ( std::vector<unsigned int>::const_iterator
i = _lut .
end() - 1;
i != _lut .
begin()-1;
i-- )
1379 edm::LogInfo(
"HcalLutManager") << (
i-_lut.begin()) <<
" " << _lut[(
i-_lut.begin())];
1397 lmap -> read( lmap_hbef_file,
"HBEF" );
1398 lmap -> read( lmap_ho_file,
"HO" );
1399 edm::LogInfo(
"HcalLutManager") <<
"LMap contains " << lmap -> get_map() .
size() <<
" channels (compare to 9072 of all HCAL channels)";
1409 db ->
connect( lut_xml_file );
1419 read_lmap( lmap_hbef_file, lmap_ho_file );
1420 read_luts( lut_xml_file );
1429 edm::LogInfo(
"HcalLutManager") <<
"getLutFromXml (new version) is not implemented. Use getLutFromXml_old() for now";
1431 std::vector<unsigned int>
result;
1443 edm::LogError(
"HcalLutManager") <<
"Cannot find LUT without LMAP, exiting...";
1447 edm::LogError(
"HcalLutManager") <<
"Cannot find LUT, no source (local XML file), exiting...";
1451 std::vector<unsigned int>
result;
1453 std::map<int,LMapRow> & _map = lmap -> get_map();
1458 unsigned int _crate, _slot, _fiber, _channel;
1460 int topbottom, luttype;
1463 if ( _map .
find(_rawid) != _map.end() ){
1464 _crate = _map[_rawid] . crate;
1465 _slot = _map[_rawid] . htr;
1466 _fiber = _map[_rawid] . htr_fi;
1467 _channel = _map[_rawid] . fi_ch;
1468 _fpga = _map[_rawid] . fpga;
1470 if ( _fpga .
find(
"top") != std::string::npos ) topbottom = 1;
1471 else if ( _fpga .
find(
"bot") != std::string::npos ) topbottom = 0;
1473 edm::LogError(
"HcalLutManager") <<
"Irregular LMAP fpga value... do not know what to do - exiting";
1476 if ( _lt == hcal::ConfigurationDatabase::LinearizerLUT ) luttype = 1;
1479 result = db -> getOnlineLUT( tag, _crate, _slot, topbottom, _fiber, _channel, luttype );
1489 std::map<int, std::shared_ptr<LutXml> > lut_map = get_brickSet_from_oracle( tag, db_accessor );
1490 if (split_by_crate){
1491 writeLutXmlFiles( lut_map, tag, split_by_crate );
1495 for(
std::map<
int, std::shared_ptr<LutXml> >::const_iterator xml = lut_map.begin(); xml != lut_map.end(); xml++ ){
1496 result += *(xml->second);
1498 std::stringstream out_file;
1499 out_file << tag <<
".xml";
1500 result .
write(out_file.str());
1512 oracle::occi::Connection * _connection = db -> getConnection();
1514 edm::LogInfo(
"HcalLutManager") <<
"Preparing to request the LUT CLOBs from the database...";
1522 std::string query = (
"SELECT TRIG_PRIM_LOOKUPTBL_DATA_CLOB, CRATE FROM CMS_HCL_HCAL_COND.V_HCAL_TRIG_LOOKUP_TABLES");
1528 std::map<int, std::shared_ptr<LutXml> > lut_map;
1532 edm::LogInfo(
"HcalLutManager") <<
"Executing the query...";
1533 Statement* stmt = _connection -> createStatement();
1534 ResultSet *rs = stmt->executeQuery(query);
1535 edm::LogInfo(
"HcalLutManager") <<
"Executing the query... done";
1537 edm::LogInfo(
"HcalLutManager") <<
"Processing the query results...";
1539 while (rs->next()) {
1541 oracle::occi::Clob clob = rs->getClob (1);
1542 int crate = rs->getInt(2);
1544 edm::LogInfo(
"HcalLutManager") <<
"Getting LUTs for crate #" << crate <<
" out of the database...";
1545 brick_set = db -> clobToString(clob);
1555 const char * bs = brick_set . c_str();
1556 MemBufInputSource * lut_clob =
new MemBufInputSource( (
const XMLByte *)bs, strlen( bs ),
"lut_clob",
false );
1557 std::shared_ptr<LutXml> lut_xml = std::make_shared<LutXml>( *lut_clob );
1558 lut_map[crate] = lut_xml;
1563 _connection -> terminateStatement(stmt);
1565 }
catch (SQLException&
e) {
1566 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,::
toolbox::toString(
"Oracle exception : %s",e.getMessage().c_str()));
1579 edm::LogInfo(
"HcalLutManager") <<
"Generating XML loader for LUTs...";
1586 baseConf . tag_name = tag_name;
1588 baseConf . comment_description =
comment;
1589 baseConf . iov_begin =
"1";
1590 baseConf . iov_end =
"-1";
1594 std::stringstream _subversion;
1595 _subversion << subversion;
1596 conf . subversion = _subversion.str();
1598 CSconf . version = conf .
version;
1599 CSconf . subversion = conf . subversion;
1600 CSconf . trig_prim_lookuptbl_data_file = _prefix +
"_checksums.xml.dat";
1601 CSconf . comment_description = tag_name;
1605 std::vector<int> crate_number;
1607 for (std::vector<std::string>::const_iterator _f = file_name.begin(); _f != file_name.end(); _f++){
1608 int crate_begin = _f->rfind(
"_");
1609 int crate_end = _f->rfind(
".xml.dat");
1610 crate_number . push_back(
getInt(_f->substr(crate_begin+1,crate_end-crate_begin-1)));
1616 time_t _offset =
time(
nullptr);
1617 sprintf( _buf,
"%d", (uint32_t)_offset );
1622 for ( std::vector<std::string>::const_iterator _file = file_name .
begin(); _file != file_name .
end(); _file++ )
1624 conf . trig_prim_lookuptbl_data_file = *_file;
1626 conf . crate = crate_number[ _file - file_name .
begin() ];
1630 sprintf( _buf,
"%.2d", conf.
crate );
1633 sprintf( _buf,
"CRATE%.2d", conf . crate );
1635 _namelabel .
append( _buf );
1636 conf . name_label = _namelabel;
1637 doc . addLUT( &conf );
1640 doc . addChecksums( &CSconf );
1642 doc .
write( tag_name +
"_Loader.xml" );
1644 edm::LogInfo(
"HcalLutManager") <<
"Generating XML loader for LUTs... done.";
1654 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
1655 std::stringstream
s;
1656 s <<
"EMap contains " << _map .
size() <<
" channels" << std::endl;
1660 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
1663 if ( row->subdet .
find(
"HT") != std::string::npos ){
1664 s <<
" -----> Subdet = " << row->subdet << std::endl;
1666 if (
abs(row->ieta)>28){
1668 s <<
" ==> (ieta,iphi) = " << row->ieta <<
", " << row->iphi << std::endl;
1714 std::map<int, std::shared_ptr<LutXml> > xml;
1715 if ( !lut_checksums_xml ){
1716 lut_checksums_xml =
new XMLDOMBlock(
"CFGBrick", 1 );
1719 if ( !_lin_file.empty() ){
1720 const std::map<int, std::shared_ptr<LutXml> > _lin_lut_ascii_xml = getLinearizationLutXmlFromAsciiMasterEmap( _lin_file, _tag, -1, split_by_crate );
1721 addLutMap( xml, _lin_lut_ascii_xml );
1723 const std::map<int, std::shared_ptr<LutXml> > _lin_lut_xml = getLinearizationLutXmlFromCoderEmap( _coder, _tag, split_by_crate );
1724 addLutMap( xml, _lin_lut_xml );
1726 const std::map<int, std::shared_ptr<LutXml> > _comp_lut_xml = getCompressionLutXmlFromCoder( _transcoder, _tag, split_by_crate );
1727 addLutMap( xml, _comp_lut_xml );
1729 const std::map<int, std::shared_ptr<LutXml> > _HE_FG_lut_xml = getHEFineGrainLUTs(_tag, split_by_crate );
1730 addLutMap( xml, _HE_FG_lut_xml );
1732 for(
auto masktype: {0,1,2}){
1733 const auto masks=getMasks(masktype, _tag, split_by_crate);
1734 addLutMap(xml, masks);
1737 const std::map<int, std::shared_ptr<LutXml> > _zdc_lut_xml = getZdcLutXml( _tag, split_by_crate );
1738 addLutMap( xml, _zdc_lut_xml );
1740 writeLutXmlFiles( xml, _tag, split_by_crate );
1742 std::string checksums_file = _tag +
"_checksums.xml";
1743 lut_checksums_xml ->
write( checksums_file );
1750 bool split_by_crate )
1752 edm::LogInfo(
"HcalLutManager") <<
"Generating ZDC LUTs ...may the Force be with us...";
1753 std::map<int, std::shared_ptr<LutXml> > _xml;
1759 std::vector<EMap::EMapRow> & _map = _emap.
get_map();
1760 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map .
size() <<
" channels";
1764 for( std::vector<EMap::EMapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++ ){
1768 if ( row->zdc_section .
find(
"ZDC") != std::string::npos ){
1769 if ( _xml.count(row->crate) == 0 && split_by_crate ){
1770 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(row->crate,std::make_shared<LutXml>()) );
1772 else if ( _xml.count(0) == 0 && !split_by_crate ){
1773 _xml.insert( std::pair<
int,std::shared_ptr<LutXml> >(0,std::make_shared<LutXml>()) );
1776 _cfg.
ieta = row->zdc_channel;
1779 _cfg.
depth = row->idepth;
1780 _cfg.
crate = row->crate;
1781 _cfg.
slot = row->slot;
1782 if (row->topbottom .
find(
"t") != std::string::npos) _cfg.
topbottom = 1;
1783 else if (row->topbottom .
find(
"b") != std::string::npos) _cfg.
topbottom = 0;
1785 _cfg.
fiber = row->fiber;
1796 std::vector<int> coder_lut = zdc.
get_lut(row->zdc_section,
1799 edm::LogInfo(
"HcalLutManager") <<
"***DEBUG: ZDC lut size: " << coder_lut.size();
1800 if (!coder_lut.empty()){
1801 for (std::vector<int>::const_iterator _i=coder_lut.begin(); _i!=coder_lut.end();_i++){
1802 unsigned int _temp = (
unsigned int)(*_i);
1805 _cfg.
lut.push_back(_temp);
1809 if (split_by_crate ){
1810 _xml[row->crate]->addLut( _cfg, lut_checksums_xml );
1814 _xml[0]->addLut( _cfg, lut_checksums_xml );
1821 <<
"Generating ZDC LUTs...DONE" << std::endl;
std::array< std::bitset< 6 >, 2 > Tower
int initChannelIterator(std::vector< HcalGenericDetId > &map)
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)
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
std::vector< std::string > subdet
Various manipulations with trigger Lookup Tables.
std::string & getLutXml(std::vector< unsigned int > &_lut)
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)
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)
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, std::shared_ptr< LutXml > > getZdcLutXml(std::string _tag, bool split_by_crate=true)
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)
std::map< int, LMapRow > & get_map(void)
int test_direct_xml_parsing(std::string _filename)
std::vector< unsigned int > lut
int writeLutXmlFiles(std::map< int, std::shared_ptr< LutXml > > &_xml, std::string _tag="default_tag", bool split_by_crate=true)
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)
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
int firstHEDoublePhiRing() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
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...
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.
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, 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)
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, 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)
int read_lmap(std::string lmap_hbef_file, std::string lmap_ho_file)
std::map< int, std::shared_ptr< LutXml > > getMasks(int var, std::string _tag, bool split_by_crate=true)
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")
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