#include <iostream>
#include <stdexcept>
#include <sstream>
#include "TString.h"
#include "PhysicsTools/FWLite/interface/CommandLineParser.h"
#include "CaloOnlineTools/HcalOnlineDb/interface/HcalLutManager.h"
Go to the source code of this file.
◆ dumpLutDiff()
void dumpLutDiff |
( |
LutXml & |
xmls1, |
|
|
LutXml & |
xmls2, |
|
|
bool |
testFormat = true , |
|
|
int |
detail = 0 |
|
) |
| |
Definition at line 21 of file hcalLUT.cc.
23 const char *DET[ndet] = {
"HB",
"HE",
"HO",
"HF",
"HT"};
24 const int dtype[ndet] = {0, 1, 2, 3, 4};
29 std::array<int, nvar>
n[ndet];
37 for (
auto &
x1 : xmls1) {
39 auto x2 = xmls2.
find(
id.rawId());
40 auto subdet =
id.genericSubdet();
41 if (subdet == 0
or subdet == 6)
44 auto &
m =
n[subdet - 1];
47 if (
x2 == xmls2.
end()) {
50 cout <<
"Extra detId: " <<
id << endl;
55 const auto &lut1 =
x1.second;
56 size_t size = lut1.size();
59 for (
auto &
i : lut1) {
67 if (detail == 1 and testFormat) {
68 cout <<
"Zero LUT: " <<
id << endl;
75 const auto &lut2 =
x2->second;
76 bool good =
size == lut2.size();
77 for (
size_t i = 0;
i <
size and good; ++
i) {
78 if (lut1[
i] != lut2[
i]) {
81 cout << Form(
"Mismatach in index=%3d, %4d!=%4d, ",
int(
i), lut1[
i], lut2[
i]) <<
id << endl;
90 cout << Form(
"%3s: %8s %8s %8s",
"Det",
"total",
"zeroes",
"extra") << endl;
92 cout << Form(
"%3s: %8d %8d %8d", DET[
i],
n[
i][
total],
n[
i][zeros],
n[
i][extra]) << endl;
93 cout <<
"--------------------------------------------" << endl;
101 cout << Form(
"%3s: %8s %8s %8s",
"Det",
"total",
"match",
"mismatch") << endl;
104 cout <<
"--------------------------------------------" << endl;
105 cout << (good ?
"PASS!" :
"FAIL!") << endl;
References gather_cfg::cout, ztail::d, runTauDisplay::dtype, LutXml::end(), LutXml::find(), mps_fire::i, triggerObjects_cff::id, visualization-live-secondInstance_cfg::m, match(), dqmiodumpmetadata::n, or, std::size(), dqmMemoryStats::total, findQualityFiles::v, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.
Referenced by main().
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 109 of file hcalLUT.cc.
113 std::cerr <<
"runTest: missing input command" << std::endl;
114 }
else if (strcmp(
argv[1],
"merge") == 0) {
118 }
else if (strcmp(
argv[1],
"diff") == 0) {
120 auto detail =
parser.integerValue(
"section");
125 xmls1.create_lut_map();
126 xmls2.create_lut_map();
134 cout <<
"Comparison" << endl;
136 }
else if (strcmp(
argv[1],
"create-lut-loader") == 0) {
144 manager.
create_lut_loader(_file_list, _prefix, _tag, _comment, _tag, _subversion);
146 throw std::invalid_argument(Form(
"Unknown command: %s",
argv[1]));
References dir2webdir::argc, cmsBatch::argv, beam_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, HcalLutManager::create_lut_loader(), LutXml::create_lut_map(), dumpLutDiff(), MainPageGenerator::files, contentValuesFiles::fullPath, mergeLUTs(), writedatasetfile::parser, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ mergeLUTs()
void mergeLUTs |
( |
const char * |
flist, |
|
|
const char * |
out |
|
) |
| |
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)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
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