|
|
Various manipulations with trigger Lookup Tables.
More...
#include <HcalLutManager.h>
|
void | addLutMap (std::map< int, std::shared_ptr< LutXml > > &result, const std::map< int, std::shared_ptr< LutXml > > &other) |
|
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) |
|
int | createAllLutXmlFilesFromCoder (const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true) |
|
int | createAllLutXmlFilesLinAsciiCompCoder (std::string _tag, std::string _lin_file, 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) |
|
int | createLutXmlFiles_HBEFFromCoder_HOFromAscii (std::string _tag, const HcalTPGCoder &_coder, const CaloTPGTranscoderULUT &_transcoder, std::string _lin_file, bool split_by_crate=true) |
|
int | createLutXmlFiles_HBEFFromCoder_HOFromAscii (std::string _tag, const HcalTPGCoder &_coder, std::string _lin_file, bool split_by_crate=true) |
|
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 > > | 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::string | get_checksum (std::vector< unsigned int > &lut) |
|
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 > > | getCompressionLutXmlFromAsciiMaster (std::string _filename, std::string _tag, int _crate=-1, bool split_by_crate=true) |
|
std::map< int, std::shared_ptr< LutXml > > | getCompressionLutXmlFromCoder (const CaloTPGTranscoderULUT &_coder, std::string _tag, bool split_by_crate=true) |
|
std::map< int, std::shared_ptr< LutXml > > | getCompressionLutXmlFromCoder (std::string _tag, 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 (std::string _filename, std::string _tag, int _crate, 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) |
|
std::map< int, std::shared_ptr< LutXml > > | getLinearizationLutXmlFromCoder (const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true) |
|
std::map< int, std::shared_ptr< LutXml > > | getLinearizationLutXmlFromCoderEmap (const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true) |
|
std::vector< unsigned int > | getLutFromXml (std::string tag, uint32_t _rawid, hcal::ConfigurationDatabase::LUTType _lt) |
|
std::vector< unsigned int > | getLutFromXml_old (std::string tag, uint32_t _rawid, hcal::ConfigurationDatabase::LUTType _lt) |
|
HcalLutSet | getLutSetFromFile (std::string _filename, int _type=1) |
|
std::string & | getLutXml (std::vector< unsigned int > &_lut) |
|
std::map< int, std::shared_ptr< LutXml > > | getLutXmlFromAsciiMaster (std::string _filename, std::string _tag, int _crate=-1, bool split_by_crate=true) |
|
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 > > | getZdcLutXml (std::string _tag, bool split_by_crate=true) |
|
| HcalLutManager () |
|
| HcalLutManager (const HcalDbService *conditions, const HcalChannelQuality *_cq=nullptr, uint32_t _status_word_to_mask=0x0000) |
|
| HcalLutManager (const HcalElectronicsMap *_emap, const HcalChannelQuality *_cq=nullptr, uint32_t _status_word_to_mask=0x0000) |
|
| HcalLutManager (std::vector< HcalGenericDetId > &map) |
|
void | init (void) |
|
int | initChannelIterator (std::vector< HcalGenericDetId > &map) |
|
int | local_connect (std::string lut_xml_file, std::string lmap_hbef_file, std::string lmap_ho_file) |
|
int | read_lmap (std::string lmap_hbef_file, std::string lmap_ho_file) |
|
int | read_luts (std::string lut_xml_file) |
|
int | test_direct_xml_parsing (std::string _filename) |
|
void | test_emap (void) |
|
int | test_xml_access (std::string _tag, std::string _filename) |
|
int | writeLutXmlFiles (std::map< int, std::shared_ptr< LutXml > > &_xml, std::string _tag="default_tag", bool split_by_crate=true) |
|
| ~HcalLutManager () |
|
Various manipulations with trigger Lookup Tables.
- Author
- Gena Kukartsev, Brown University, March 14, 2008
Definition at line 39 of file HcalLutManager.h.
◆ HcalLutManager() [1/4]
HcalLutManager::HcalLutManager |
( |
void |
| ) |
|
◆ HcalLutManager() [2/4]
◆ HcalLutManager() [3/4]
◆ HcalLutManager() [4/4]
◆ ~HcalLutManager()
HcalLutManager::~HcalLutManager |
( |
void |
| ) |
|
◆ addLutMap()
void HcalLutManager::addLutMap |
( |
std::map< int, std::shared_ptr< LutXml > > & |
result, |
|
|
const std::map< int, std::shared_ptr< LutXml > > & |
other |
|
) |
| |
◆ create_lut_loader()
int HcalLutManager::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 |
|
) |
| |
Definition at line 1540 of file HcalLutManager.cc.
1546 edm::LogInfo(
"HcalLutManager") <<
"Generating XML loader for LUTs...";
1561 std::stringstream _subversion;
1562 _subversion << subversion;
1572 std::vector<int> crate_number;
1574 for (std::vector<std::string>::const_iterator _f =
file_name.begin(); _f !=
file_name.end(); _f++) {
1575 int crate_begin = _f->rfind(
"_");
1576 int crate_end = _f->rfind(
".xml.dat");
1577 crate_number.push_back(
getInt(_f->substr(crate_begin + 1, crate_end - crate_begin - 1)));
1583 time_t _offset =
time(
nullptr);
1584 sprintf(_buf,
"%d", (uint32_t)_offset);
1589 for (std::vector<std::string>::const_iterator _file =
file_name.begin(); _file !=
file_name.end(); _file++) {
1596 sprintf(_buf,
"%.2d", conf.
crate);
1599 sprintf(_buf,
"CRATE%.2d", conf.
crate);
1601 _namelabel.append(_buf);
1606 doc.addChecksums(&CSconf);
1608 doc.write(tag_name +
"_Loader.xml");
1610 edm::LogInfo(
"HcalLutManager") <<
"Generating XML loader for LUTs... done.";
References XMLLUTLoader::_checksumsDBConfig::comment_description, XMLProcessor::_loaderBaseConfig::comment_description, XMLLUTLoader::_lutDBConfig::crate, common_cff::doc, contentValuesCheck::file_name, getInt(), XMLProcessor::_loaderBaseConfig::iov_begin, XMLProcessor::_loaderBaseConfig::iov_end, XMLLUTLoader::_lutDBConfig::name_label, HcalQIEManager::splitString(), AlCaHLTBitMon_QueryRunRegistry::string, XMLProcessor::_DBConfig::subversion, XMLProcessor::_loaderBaseConfig::tag_name, ntuplemaker::time, XMLLUTLoader::_lutDBConfig::trig_prim_lookuptbl_data_file, XMLLUTLoader::_checksumsDBConfig::trig_prim_lookuptbl_data_file, BeamSplash_cfg::version, and XMLProcessor::_DBConfig::version.
Referenced by main().
◆ createAllLutXmlFiles()
int HcalLutManager::createAllLutXmlFiles |
( |
std::string |
_tag, |
|
|
std::string |
_lin_file, |
|
|
std::string |
_comp_file, |
|
|
bool |
split_by_crate = true |
|
) |
| |
◆ createAllLutXmlFilesFromCoder()
int HcalLutManager::createAllLutXmlFilesFromCoder |
( |
const HcalTPGCoder & |
_coder, |
|
|
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
◆ createAllLutXmlFilesLinAsciiCompCoder()
int HcalLutManager::createAllLutXmlFilesLinAsciiCompCoder |
( |
std::string |
_tag, |
|
|
std::string |
_lin_file, |
|
|
bool |
split_by_crate = true |
|
) |
| |
◆ createCompLutXmlFilesFromCoder()
int HcalLutManager::createCompLutXmlFilesFromCoder |
( |
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
◆ createLinLutXmlFiles()
int HcalLutManager::createLinLutXmlFiles |
( |
std::string |
_tag, |
|
|
std::string |
_lin_file, |
|
|
bool |
split_by_crate = true |
|
) |
| |
◆ createLutXmlFiles_HBEFFromCoder_HOFromAscii() [1/2]
int HcalLutManager::createLutXmlFiles_HBEFFromCoder_HOFromAscii |
( |
std::string |
_tag, |
|
|
const HcalTPGCoder & |
_coder, |
|
|
const CaloTPGTranscoderULUT & |
_transcoder, |
|
|
std::string |
_lin_file, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 1185 of file HcalLutManager.cc.
1190 std::map<int, std::shared_ptr<LutXml>> xml;
1195 if (!_lin_file.empty()) {
1196 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_ascii_xml =
1200 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_xml =
1204 const std::map<int, std::shared_ptr<LutXml>> _comp_lut_xml =
1208 const std::map<int, std::shared_ptr<LutXml>> _HE_FG_lut_xml =
getHEFineGrainLUTs(_tag, split_by_crate);
1213 std::string checksums_file = _tag +
"_checksums.xml";
References AlCaHLTBitMon_QueryRunRegistry::string.
◆ createLutXmlFiles_HBEFFromCoder_HOFromAscii() [2/2]
int HcalLutManager::createLutXmlFiles_HBEFFromCoder_HOFromAscii |
( |
std::string |
_tag, |
|
|
const HcalTPGCoder & |
_coder, |
|
|
std::string |
_lin_file, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 1219 of file HcalLutManager.cc.
1223 std::map<int, std::shared_ptr<LutXml>> xml;
1228 if (!_lin_file.empty()) {
1229 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_ascii_xml =
1233 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_xml =
1242 std::string checksums_file = _tag +
"_checksums.xml";
References AlCaHLTBitMon_QueryRunRegistry::string.
◆ createLutXmlFiles_HBEFFromCoder_HOFromAscii_ZDC()
int HcalLutManager::createLutXmlFiles_HBEFFromCoder_HOFromAscii_ZDC |
( |
std::string |
_tag, |
|
|
const HcalTPGCoder & |
_coder, |
|
|
const CaloTPGTranscoderULUT & |
_transcoder, |
|
|
std::string |
_lin_file, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 1672 of file HcalLutManager.cc.
1677 std::map<int, std::shared_ptr<LutXml>> xml;
1682 if (!_lin_file.empty()) {
1683 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_ascii_xml =
1687 const std::map<int, std::shared_ptr<LutXml>> _lin_lut_xml =
1691 const std::map<int, std::shared_ptr<LutXml>> _comp_lut_xml =
1695 const std::map<int, std::shared_ptr<LutXml>> _HE_FG_lut_xml =
getHEFineGrainLUTs(_tag, split_by_crate);
1698 for (
auto masktype : {0, 1, 2}) {
1699 const auto masks =
getMasks(masktype, _tag, split_by_crate);
1703 const std::map<int, std::shared_ptr<LutXml>> _zdc_lut_xml =
getZdcLutXml(_tag, split_by_crate);
1708 std::string checksums_file = _tag +
"_checksums.xml";
References AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalLutGenerator::analyze().
◆ get_brickSet_from_oracle()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::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" |
|
) |
| |
Definition at line 1469 of file HcalLutManager.cc.
1477 edm::LogInfo(
"HcalLutManager") <<
"Preparing to request the LUT CLOBs from the database...";
1485 std::string query = (
"SELECT TRIG_PRIM_LOOKUPTBL_DATA_CLOB, CRATE FROM CMS_HCL_HCAL_COND.V_HCAL_TRIG_LOOKUP_TABLES");
1491 std::map<int, std::shared_ptr<LutXml>> lut_map;
1495 edm::LogInfo(
"HcalLutManager") <<
"Executing the query...";
1496 Statement* stmt = _connection->createStatement();
1497 ResultSet* rs = stmt->executeQuery(
query);
1498 edm::LogInfo(
"HcalLutManager") <<
"Executing the query... done";
1500 edm::LogInfo(
"HcalLutManager") <<
"Processing the query results...";
1502 while (rs->next()) {
1504 oracle::occi::Clob clob = rs->getClob(1);
1505 int crate = rs->getInt(2);
1507 edm::LogInfo(
"HcalLutManager") <<
"Getting LUTs for crate #" << crate <<
" out of the database...";
1518 const char*
bs = brick_set.c_str();
1519 MemBufInputSource* lut_clob =
new MemBufInputSource((
const XMLByte*)
bs, strlen(
bs),
"lut_clob",
false);
1520 std::shared_ptr<LutXml>
lut_xml = std::make_shared<LutXml>(*lut_clob);
1526 _connection->terminateStatement(stmt);
1528 }
catch (SQLException&
e) {
1529 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,
References cms::cuda::bs, dqmiodatasetharvest::db, MillePedeFileConverter_cfg::e, XMLProcessor::getInstance(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, and toolbox::toString().
◆ get_checksum()
std::string HcalLutManager::get_checksum |
( |
std::vector< unsigned int > & |
lut | ) |
|
◆ get_subdetector()
◆ get_time_stamp()
string HcalLutManager::get_time_stamp |
( |
time_t |
_time | ) |
|
|
static |
◆ get_xml_files_from_db()
int HcalLutManager::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 |
|
) |
| |
◆ getCompressionLutXmlFromAsciiMaster()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getCompressionLutXmlFromAsciiMaster |
( |
std::string |
_filename, |
|
|
std::string |
_tag, |
|
|
int |
_crate = -1 , |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 515 of file HcalLutManager.cc.
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";
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) {
597 <<
"Generating compression (output) LUTs from ascii master file...DONE" << std::endl;
References funct::abs(), RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, HcalLutSet::eta_max, HcalLutSet::eta_min, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, EMap::get_map(), RooGKCounter::getCount(), CaloTPGTranscoderULUT::HTvalid(), mps_fire::i, LutXml::_Config::ieta, LutXml::_Config::iphi, HcalLutSet::lut, LutXml::_Config::lut, LutXml::_Config::lut_type, HcalLutSet::phi_max, HcalLutSet::phi_min, LutXml::_Config::slot, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getCompressionLutXmlFromCoder() [1/2]
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getCompressionLutXmlFromCoder |
( |
const CaloTPGTranscoderULUT & |
_coder, |
|
|
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 914 of file HcalLutManager.cc.
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)
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)
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;
982 int crot = 100 * row->crate + row->slot;
983 unsigned int size = _cfg.
lut.size();
985 edm::LogWarning(
"HcalLutManager") <<
" resizing LUT for " << _detid <<
", channel=[" << _cfg.
crate <<
":"
987 <<
"], using value=" << _cfg.
lut[
size - 1] << std::endl;
992 if (split_by_crate) {
1001 <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT...DONE"
References funct::abs(), RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, EMap::get_map(), CaloTPGTranscoderULUT::getCompressionLUT(), RooGKCounter::getCount(), mps_fire::i, LutXml::_Config::ieta, LutXml::_Config::iphi, LutXml::_Config::lut, LutXml::_Config::lut_type, cmsswSequenceInfo::maxsize, findQualityFiles::size, LutXml::_Config::slot, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getCompressionLutXmlFromCoder() [2/2]
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getCompressionLutXmlFromCoder |
( |
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 1007 of file HcalLutManager.cc.
1009 edm::LogInfo(
"HcalLutManager") <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT";
1010 std::map<int, std::shared_ptr<LutXml>> _xml;
1017 std::vector<EMap::EMapRow>& _map = _emap.get_map();
1018 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" channels";
1028 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
1033 const int tp_version = row->idepth / 10;
1034 if (row->subdet.find(
"HT") != std::string::npos && _coder.
HTvalid(row->ieta, row->iphi, tp_version)) {
1035 if (_xml.count(row->crate) == 0 && split_by_crate) {
1036 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
1037 }
else if (_xml.count(0) == 0 && !split_by_crate) {
1038 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
1040 _cfg.
ieta = row->ieta;
1041 _cfg.
iphi = row->iphi;
1042 _cfg.
depth = row->idepth;
1043 _cfg.
crate = row->crate;
1044 _cfg.
slot = row->slot;
1045 if (row->topbottom.find(
't') != std::string::npos)
1047 else if (row->topbottom.find(
'b') != std::string::npos)
1049 else if (row->topbottom.find(
'u') != std::string::npos)
1053 _cfg.
fiber = row->fiber;
1071 if (split_by_crate) {
1081 <<
"Generating compression (output) LUTs from CaloTPGTranscoderULUT...DONE"
References funct::abs(), RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, EMap::get_map(), CaloTPGTranscoderULUT::getCompressionLUT(), RooGKCounter::getCount(), CaloTPGTranscoderULUT::HTvalid(), LutXml::_Config::ieta, LutXml::_Config::iphi, LutXml::_Config::lut, LutXml::_Config::lut_type, LutXml::_Config::slot, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getHEFineGrainLUTs()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getHEFineGrainLUTs |
( |
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 835 of file HcalLutManager.cc.
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) {
910 <<
"Generating HE fine grain LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
References funct::abs(), submitPVValidationJobs::conditions, RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, LutXml::_Config::fiber, LutXml::_Config::fiberchan, HcalTopology::firstHEDoublePhiRing(), LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, EMap::get_map(), RooGKCounter::getCount(), HcalEndcap, mps_fire::i, LutXml::_Config::ieta, LutXml::_Config::iphi, dqmdumpme::k, HcalTopology::lastHERing(), LutXml::_Config::lut, LutXml::_Config::lut_type, or, LutXml::_Config::slot, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getInt()
int HcalLutManager::getInt |
( |
std::string |
number | ) |
|
|
static |
◆ getLinearizationLutXmlFromAsciiMasterEmap()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getLinearizationLutXmlFromAsciiMasterEmap |
( |
std::string |
_filename, |
|
|
std::string |
_tag, |
|
|
int |
_crate, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 339 of file HcalLutManager.cc.
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";
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);
418 _cfg.
lut = _set.
lut[lut_index];
420 if (split_by_crate) {
431 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
References funct::abs(), ecalLiteDTU::adc(), RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, HcalLutSet::depth_max, HcalLutSet::depth_min, HcalLutSet::eta_max, HcalLutSet::eta_min, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, EMap::get_map(), RooGKCounter::getCount(), mps_fire::i, LutXml::_Config::ieta, LutXml::_Config::iphi, HcalLutSet::lut, LutXml::_Config::lut, LutXml::_Config::lut_type, HcalLutSet::phi_max, HcalLutSet::phi_min, LutXml::_Config::slot, HcalLutSet::subdet, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getLinearizationLutXmlFromAsciiMasterEmap_new()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getLinearizationLutXmlFromAsciiMasterEmap_new |
( |
std::string |
_filename, |
|
|
std::string |
_tag, |
|
|
int |
_crate, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 435 of file HcalLutManager.cc.
437 edm::LogInfo(
"HcalLutManager") <<
"Generating linearization (input) LUTs from ascii master file...";
438 std::map<int, std::shared_ptr<LutXml>> _xml;
442 int lut_set_size = _set.
lut.size();
443 edm::LogInfo(
"HcalLutManager") <<
" ==> " << lut_set_size <<
" sets of different LUTs read from the master file";
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) &&
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) {
511 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
References funct::abs(), RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, HcalLutSet::depth_max, HcalLutSet::depth_min, HcalLutSet::eta_max, HcalLutSet::eta_min, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, RooGKCounter::getCount(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, mps_fire::i, LutXml::_Config::ieta, LutXml::_Config::iphi, HcalLutSet::lut, LutXml::_Config::lut, LutXml::_Config::lut_type, HcalLutSet::phi_max, HcalLutSet::phi_min, HcalElectronicsId::readoutVMECrateId(), LutXml::_Config::slot, HcalLutSet::subdet, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getLinearizationLutXmlFromCoder()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getLinearizationLutXmlFromCoder |
( |
const HcalTPGCoder & |
_coder, |
|
|
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 601 of file HcalLutManager.cc.
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) {
679 <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
References RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, LMap::get_map(), RooGKCounter::getCount(), HcalTPGCoder::getLinearizationLUT(), HcalForward, LutXml::_Config::ieta, createfilelist::int, LutXml::_Config::iphi, LutXml::_Config::lut, LutXml::_Config::lut_type, LMap::read(), LutXml::_Config::slot, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getLinearizationLutXmlFromCoderEmap()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getLinearizationLutXmlFromCoderEmap |
( |
const HcalTPGCoder & |
_coder, |
|
|
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 757 of file HcalLutManager.cc.
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) {
831 <<
"Generating linearization (input) LUTs from HcaluLUTTPGCoder...DONE" << std::endl;
References funct::abs(), RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, EMap::get_map(), RooGKCounter::getCount(), HcalTPGCoder::getLinearizationLUT(), HcalBarrel, HcalEndcap, HcalForward, HcalOther, HcalOuter, mps_fire::i, LutXml::_Config::ieta, LutXml::_Config::iphi, LutXml::_Config::lut, LutXml::_Config::lut_type, LutXml::_Config::slot, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getLutFromXml()
std::vector< unsigned int > HcalLutManager::getLutFromXml |
( |
std::string |
tag, |
|
|
uint32_t |
_rawid, |
|
|
hcal::ConfigurationDatabase::LUTType |
_lt |
|
) |
| |
◆ getLutFromXml_old()
std::vector< unsigned int > HcalLutManager::getLutFromXml_old |
( |
std::string |
tag, |
|
|
uint32_t |
_rawid, |
|
|
hcal::ConfigurationDatabase::LUTType |
_lt |
|
) |
| |
Definition at line 1402 of file HcalLutManager.cc.
1406 edm::LogError(
"HcalLutManager") <<
"Cannot find LUT without LMAP, exiting...";
1410 edm::LogError(
"HcalLutManager") <<
"Cannot find LUT, no source (local XML file), exiting...";
1414 std::vector<unsigned int>
result;
1421 unsigned int _crate, _slot, _fiber, _channel;
1423 int topbottom, luttype;
1426 if (_map.find(_rawid) != _map.end()) {
1427 _crate = _map[_rawid].crate;
1428 _slot = _map[_rawid].htr;
1429 _fiber = _map[_rawid].htr_fi;
1430 _channel = _map[_rawid].fi_ch;
1431 _fpga = _map[_rawid].fpga;
1433 if (_fpga.find(
"top") != std::string::npos)
1435 else if (_fpga.find(
"bot") != std::string::npos)
1438 edm::LogError(
"HcalLutManager") <<
"Irregular LMAP fpga value... do not know what to do - exiting";
1441 if (_lt == hcal::ConfigurationDatabase::LinearizerLUT)
References dqmiodatasetharvest::db, beamvalidation::exit(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.
◆ getLutSetFromFile()
HcalLutSet HcalLutManager::getLutSetFromFile |
( |
std::string |
_filename, |
|
|
int |
_type = 1 |
|
) |
| |
Definition at line 170 of file HcalLutManager.cc.
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;
References visDQMUpload::buf, HcalLutSet::depth_max, HcalLutSet::depth_min, HcalLutSet::eta_max, HcalLutSet::eta_min, getInt(), mps_fire::i, timingPdfMaker::infile, HcalLutSet::label, HcalLutSet::lut, HcalLutSet::phi_max, HcalLutSet::phi_min, HcalQIEManager::splitString(), AlCaHLTBitMon_QueryRunRegistry::string, and HcalLutSet::subdet.
Referenced by HcalLutManager_test::getLutSetFromFile_test().
◆ getLutXml()
std::string & HcalLutManager::getLutXml |
( |
std::vector< unsigned int > & |
_lut | ) |
|
◆ getLutXmlFromAsciiMaster()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getLutXmlFromAsciiMaster |
( |
std::string |
_filename, |
|
|
std::string |
_tag, |
|
|
int |
_crate = -1 , |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 253 of file HcalLutManager.cc.
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";
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 &&
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) {
332 <<
"Generating linearization (input) LUTs from ascii master file...DONE" << std::endl;
References RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, HcalLutSet::depth_max, HcalLutSet::depth_min, HcalLutSet::eta_max, HcalLutSet::eta_min, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, LMap::get_map(), RooGKCounter::getCount(), HcalForward, mps_fire::i, LutXml::_Config::ieta, LutXml::_Config::iphi, HcalLutSet::lut, LutXml::_Config::lut, LutXml::_Config::lut_type, HcalLutSet::phi_max, HcalLutSet::phi_min, LMap::read(), LutXml::_Config::slot, HcalLutSet::subdet, LutXml::_Config::targetfirmware, ntuplemaker::time, and LutXml::_Config::topbottom.
◆ getMasks()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getMasks |
( |
int |
var, |
|
|
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 683 of file HcalLutManager.cc.
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;
698 int crot = 100 * crate + slot;
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);
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;
References HltBtagPostValidation_cff::c, submitPVValidationJobs::conditions, RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationtag, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, EMap::get_map(), RooGKCounter::getCount(), HcalBarrel, HcalEndcap, HcalForward, HcalOther, HcalOuter, mps_fire::i, LutXml::_Config::lut_type, LutXml::_Config::mask, findQualityFiles::size, LutXml::_Config::slot, AlCaHLTBitMon_QueryRunRegistry::string, and LutXml::_Config::targetfirmware.
◆ getZdcLutXml()
std::map< int, std::shared_ptr< LutXml > > HcalLutManager::getZdcLutXml |
( |
std::string |
_tag, |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 1714 of file HcalLutManager.cc.
1715 edm::LogInfo(
"HcalLutManager") <<
"Generating ZDC LUTs ...may the Force be with us...";
1716 std::map<int, std::shared_ptr<LutXml>> _xml;
1722 std::vector<EMap::EMapRow>& _map = _emap.get_map();
1723 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << _map.size() <<
" channels";
1727 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
1731 if (row->zdc_section.find(
"ZDC") != std::string::npos) {
1732 if (_xml.count(row->crate) == 0 && split_by_crate) {
1733 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(row->crate, std::make_shared<LutXml>()));
1734 }
else if (_xml.count(0) == 0 && !split_by_crate) {
1735 _xml.insert(std::pair<
int, std::shared_ptr<LutXml>>(0, std::make_shared<LutXml>()));
1738 _cfg.
ieta = row->zdc_channel;
1741 _cfg.
depth = row->idepth;
1742 _cfg.
crate = row->crate;
1743 _cfg.
slot = row->slot;
1744 if (row->topbottom.find(
't') != std::string::npos)
1746 else if (row->topbottom.find(
'b') != std::string::npos)
1750 _cfg.
fiber = row->fiber;
1761 std::vector<int> coder_lut =
zdc.get_lut(row->zdc_section, row->zdc_zside, row->zdc_channel);
1762 edm::LogInfo(
"HcalLutManager") <<
"***DEBUG: ZDC lut size: " << coder_lut.size();
1763 if (!coder_lut.empty()) {
1764 for (std::vector<int>::const_iterator _i = coder_lut.begin(); _i != coder_lut.end(); _i++) {
1765 unsigned int _temp = (
unsigned int)(*_i);
1768 _cfg.
lut.push_back(_temp);
1772 if (split_by_crate) {
1783 <<
"Generating ZDC LUTs...DONE" << std::endl;
References RooGKCounter::count(), LutXml::_Config::crate, LutXml::_Config::creationstamp, LutXml::_Config::creationtag, LutXml::_Config::depth, LutXml::_Config::fiber, LutXml::_Config::fiberchan, LutXml::_Config::formatrevision, LutXml::_Config::generalizedindex, EMap::get_map(), RooGKCounter::getCount(), LutXml::_Config::ieta, createfilelist::int, LutXml::_Config::lut, LutXml::_Config::lut_type, LutXml::_Config::slot, LutXml::_Config::targetfirmware, ntuplemaker::time, LutXml::_Config::topbottom, and hcalSimParameters_cfi::zdc.
◆ init()
void HcalLutManager::init |
( |
void |
| ) |
|
◆ initChannelIterator()
int HcalLutManager::initChannelIterator |
( |
std::vector< HcalGenericDetId > & |
map | ) |
|
◆ local_connect()
int HcalLutManager::local_connect |
( |
std::string |
lut_xml_file, |
|
|
std::string |
lmap_hbef_file, |
|
|
std::string |
lmap_ho_file |
|
) |
| |
◆ read_lmap()
int HcalLutManager::read_lmap |
( |
std::string |
lmap_hbef_file, |
|
|
std::string |
lmap_ho_file |
|
) |
| |
Definition at line 1368 of file HcalLutManager.cc.
1371 lmap->
read(lmap_hbef_file,
"HBEF");
1374 <<
" channels (compare to 9072 of all HCAL channels)";
◆ read_luts()
int HcalLutManager::read_luts |
( |
std::string |
lut_xml_file | ) |
|
◆ test_direct_xml_parsing()
int HcalLutManager::test_direct_xml_parsing |
( |
std::string |
_filename | ) |
|
◆ test_emap()
void HcalLutManager::test_emap |
( |
void |
| ) |
|
Definition at line 1615 of file HcalLutManager.cc.
1620 std::vector<EMap::EMapRow>& _map = _emap.get_map();
1621 std::stringstream
s;
1622 s <<
"EMap contains " << _map.size() <<
" channels" << std::endl;
1626 for (std::vector<EMap::EMapRow>::const_iterator row = _map.begin(); row != _map.end(); row++) {
1628 if (row->subdet.find(
"HT") != std::string::npos) {
1629 s <<
" -----> Subdet = " << row->subdet << std::endl;
1631 if (
abs(row->ieta) > 28) {
1633 s <<
" ==> (ieta,iphi) = " << row->ieta <<
", " << row->iphi << std::endl;
References funct::abs(), EMap::get_map(), and alignCSCRings::s.
◆ test_xml_access()
int HcalLutManager::test_xml_access |
( |
std::string |
_tag, |
|
|
std::string |
_filename |
|
) |
| |
Definition at line 1291 of file HcalLutManager.cc.
1292 local_connect(_filename,
"backup/HCALmapHBEF.txt",
"backup/HCALmapHO.txt");
1296 std::vector<EMap::EMapRow>& _map = _emap.get_map();
1297 int map_size = _map.size();
1298 edm::LogInfo(
"HcalLutManager") <<
"EMap contains " << map_size <<
" channels";
1301 std::vector<unsigned int> _lut;
1302 _lut =
getLutFromXml(_tag, 1107313727, hcal::ConfigurationDatabase::LinearizerLUT);
1304 edm::LogInfo(
"HcalLutManager") <<
"Testing direct parsing of the LUT XML";
1306 gettimeofday(&_t,
nullptr);
1307 double _time = (double)(_t.tv_sec) + (double)(_t.tv_usec) / 1000000.0;
1309 gettimeofday(&_t,
nullptr);
1310 edm::LogInfo(
"HcalLutManager") <<
"parsing took that much time: "
1311 << (double)(_t.tv_sec) + (double)(_t.tv_usec) / 1000000.0 - _time;
1313 gettimeofday(&_t,
nullptr);
1314 _time = (double)(_t.tv_sec) + (double)(_t.tv_usec) / 1000000.0;
1315 edm::LogInfo(
"HcalLutManager") <<
"before loop over random LUTs: " << _time;
1320 gettimeofday(&_t,
nullptr);
1325 int _key = (rand() % map_size);
1327 if ((_map[_key].subdet.find(
"HB") != string::npos || _map[_key].subdet.find(
"HE") != string::npos ||
1328 _map[_key].subdet.find(
"HO") != string::npos || _map[_key].subdet.find(
"HF") != string::npos) &&
1329 _map[_key].subdet.size() == 2) {
1331 if (_map[_key].subdet.find(
"HB") != string::npos)
1333 else if (_map[_key].subdet.find(
"HE") != string::npos)
1335 else if (_map[_key].subdet.find(
"HO") != string::npos)
1337 else if (_map[_key].subdet.find(
"HF") != string::npos)
1342 _raw_id = _detid.rawId();
1346 _lut =
getLutFromXml(_tag, _raw_id, hcal::ConfigurationDatabase::LinearizerLUT);
1348 gettimeofday(&_t,
nullptr);
1350 double d_time = _t.tv_sec + _t.tv_usec / 1000000.0 - _time;
1351 edm::LogInfo(
"HcalLutManager") <<
"after the loop over random LUTs: " << _time + d_time << std::endl
1352 <<
"total time: " << d_time << std::endl;
1354 edm::LogInfo(
"HcalLutManager") <<
"LUT length = " << _lut.size();
1355 for (std::vector<unsigned int>::const_iterator
i = _lut.end() - 1;
i != _lut.begin() - 1;
i--) {
1356 edm::LogInfo(
"HcalLutManager") << (
i - _lut.begin()) <<
" " << _lut[(
i - _lut.begin())];
References dqmiodatasetharvest::db, EMap::get_map(), HcalBarrel, HcalEndcap, HcalForward, HcalOther, HcalOuter, mps_fire::i, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, and DetId::rawId().
◆ writeLutXmlFiles()
int HcalLutManager::writeLutXmlFiles |
( |
std::map< int, std::shared_ptr< LutXml > > & |
_xml, |
|
|
std::string |
_tag = "default_tag" , |
|
|
bool |
split_by_crate = true |
|
) |
| |
Definition at line 1086 of file HcalLutManager.cc.
1089 for (
std::map<
int, std::shared_ptr<LutXml>>::const_iterator cr = _xml.begin(); cr != _xml.end(); cr++) {
1090 std::stringstream output_file_name;
1091 if (split_by_crate) {
1092 output_file_name << _tag <<
"_" << cr->first <<
".xml";
1094 output_file_name << _tag <<
".xml";
1096 cr->second->write(output_file_name.str());
References genParticles_cff::map.
◆ _ass
◆ _iter
◆ conditions
◆ cq
◆ db
Definition at line 180 of file HcalLutManager.h.
Referenced by conddb_version_mgr.conddb_tool::connect(), conddbCopyTest.CopyTest::execute(), conddb_version_mgr.version_db::fetch_boost_run_map(), conddb_version_mgr.version_db::fetch_cmssw_boost_map(), conddb_version_mgr.conddb_tool::insert_boost_run(), conddb_version_mgr.version_db::insert_boost_run_range(), conddb_version_mgr.version_db::insert_cmssw_boost(), conddb_version_mgr.conddb_tool::list_boost_run(), conddb_version_mgr.version_db::populate_for_gts(), conddb_version_mgr.conddb_tool::process_tag_boost_version(), conddb_version_mgr.conddb_tool::show_tag_boost_version(), conddb_version_mgr.conddb_tool::update_tag_boost_version_in_db(), conddb_version_mgr.conddb_tool::update_tags(), conditionUploadTest.UploadTest::upload(), and conddb_version_mgr.conddb_tool::validate_boost_version().
◆ emap
◆ lmap
LMap* HcalLutManager::lmap |
|
protected |
◆ lut_checksums_xml
◆ lut_xml
LutXml* HcalLutManager::lut_xml |
|
protected |
◆ status_word_to_mask
uint32_t HcalLutManager::status_word_to_mask |
|
protected |
int local_connect(std::string lut_xml_file, std::string lmap_hbef_file, std::string lmap_ho_file)
static XMLProcessor * getInstance()
int test_direct_xml_parsing(std::string _filename)
constexpr int readoutVMECrateId() const
get the readout VME crate number
std::map< int, std::shared_ptr< LutXml > > getLinearizationLutXmlFromCoderEmap(const HcalTPGCoder &_coder, std::string _tag, bool split_by_crate=true)
int write(std::string target="stdout")
virtual const std::vector< unsigned int > getCompressionLUT(const HcalTrigTowerDetId &id) const
std::vector< uint64_t > mask
virtual std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
void connect(std::string _accessor)
std::map< int, std::shared_ptr< LutXml > > getCompressionLutXmlFromAsciiMaster(std::string _filename, std::string _tag, int _crate=-1, bool split_by_crate=true)
std::vector< int > eta_min
oracle::occi::Connection * getConnection(void)
uint32_t getMask() const
get mask for channel validity and self trigger information
std::map< int, std::shared_ptr< LutXml > > getMasks(int var, std::string _tag, bool split_by_crate=true)
Log< level::Info, false > LogInfo
const HcalChannelQuality * cq
uint32_t status_word_to_mask
HcalGenericDetId getHcalGenericDetId(void)
std::string comment_description
Log< level::Warning, false > LogWarning
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::string targetfirmware
const HcalElectronicsMap * getHcalMapping() const
std::vector< int > eta_max
std::string clobToString(const oracle::occi::Clob &)
void addLutMap(std::map< int, std::shared_ptr< LutXml > > &result, const std::map< int, std::shared_ptr< LutXml > > &other)
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< std::vector< unsigned int > > lut
int firstHEDoublePhiRing() const
std::map< int, std::shared_ptr< LutXml > > getLinearizationLutXmlFromAsciiMasterEmap(std::string _filename, std::string _tag, int _crate, bool split_by_crate=true)
std::vector< int > phi_max
std::vector< int > depth_min
int getFGVersionHBHE() const
get FineGrain Algorithm Version for HBHE
Generation of ZDC Lookup tables and associate helper methods.
virtual bool HTvalid(const int ieta, const int iphi, const int version) const
Readout chain identification for Hcal.
const HcalElectronicsMap * emap
static std::string get_time_stamp(time_t _time)
std::string creationstamp
bool validHT(const HcalTrigTowerDetId &id) const
int writeLutXmlFiles(std::map< int, std::shared_ptr< LutXml > > &_xml, std::string _tag="default_tag", bool split_by_crate=true)
std::vector< unsigned int > getOnlineLUT(std::string tag, int crate, int slot, int topbottom, int fiber, int channel, int luttype)
const HcalTPParameters * getHcalTPParameters() const
static std::vector< std::string > splitString(const std::string &fLine)
HcalChannelIterator _iter
int read(std::string accessor, std::string type="HBEF")
Gather config data from online DB.
uint32_t getValue() const
std::vector< unsigned int > lut
int read_luts(std::string lut_xml_file)
std::string & getCurrentBrick(void)
const HcalTopology * topo() const
void addLut(Config &_config, XMLDOMBlock *checksums_xml=nullptr)
std::map< int, LMapRow > & get_map(void)
HcalLutSet getLutSetFromFile(std::string _filename, int _type=1)
std::map< int, std::shared_ptr< LutXml > > getZdcLutXml(std::string _tag, bool split_by_crate=true)
const HcalDbService * conditions
std::array< std::bitset< 6 >, 2 > Tower
Log< level::Error, false > LogError
std::vector< int > phi_min
std::string getSubdetectorString(HcalSubdetector _det)
std::string formatrevision
static HcalSubdetector get_subdetector(std::string _subdet)
constexpr uint32_t rawId() const
get the raw id
std::string comment_description
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")
static int getInt(std::string number)
unsigned long int getCount(void)
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
XMLDOMBlock * lut_checksums_xml
std::vector< int > depth_max
int init(const std::vector< HcalGenericDetId > &map)
std::string trig_prim_lookuptbl_data_file
int read_lmap(std::string lmap_hbef_file, std::string lmap_ho_file)
Abs< T >::type abs(const T &t)
std::map< int, std::shared_ptr< LutXml > > getLutXmlFromAsciiMaster(std::string _filename, std::string _tag, int _crate=-1, bool split_by_crate=true)
std::vector< std::string > subdet
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId) const
std::string trig_prim_lookuptbl_data_file
HcalSubdetector getHcalSubdetector(void)
std::map< int, std::shared_ptr< LutXml > > getHEFineGrainLUTs(std::string _tag, bool split_by_crate=true)
std::vector< unsigned int > getLutFromXml(std::string tag, uint32_t _rawid, hcal::ConfigurationDatabase::LUTType _lt)
std::map< int, std::shared_ptr< LutXml > > getCompressionLutXmlFromCoder(std::string _tag, bool split_by_crate=true)