41 const EVP_MD* md = EVP_get_digestbyname(
"SHA1");
42 if (!EVP_DigestInit_ex(mdctx, md,
nullptr))
43 throw cms::Exception(
"L1TGlobalPrescalesVetosViewer::hash") <<
"SHA1 initialization error";
45 if (!EVP_DigestUpdate(mdctx,
buf, len))
46 throw cms::Exception(
"L1TGlobalPrescalesVetosViewer::hash") <<
"SHA1 processing error";
48 unsigned char hash[EVP_MAX_MD_SIZE];
49 unsigned int md_len = 0;
50 if (!EVP_DigestFinal_ex(mdctx,
hash, &md_len))
51 throw cms::Exception(
"L1TGlobalPrescalesVetosViewer::hash") <<
"SHA1 finalization error";
56 char tmp[EVP_MAX_MD_SIZE * 2 + 1];
59 for (
unsigned int i = 0;
i < md_len;
i++)
75 size_t len_prescale_table_ = 0;
78 len_prescale_table_ += nRows;
79 if (prescale_table_verbosity > 0) {
81 for (
size_t row = 0; row < nRows; row++)
83 cout <<
" prescale_table_[" <<
col <<
"][" << nRows <<
"] = ";
85 cout <<
hash(column,
sizeof(
int) * nRows) << endl;
90 int prescale_table_[len_prescale_table_];
93 for (
size_t row = 0; row < nRows; row++,
pos++)
96 cout <<
" prescale_table_[[" << len_prescale_table_ <<
"]] = ";
97 if (len_prescale_table_)
98 cout <<
hash(prescale_table_,
sizeof(
int) * len_prescale_table_) << endl;
102 if (prescale_table_verbosity > 1) {
103 cout << endl <<
" Detailed view on the prescales * masks: " << endl;
105 cout << setw(8) <<
" Index " <<
col;
108 for (
size_t row = 0; row < nRows; row++) {
116 size_t len_bxmask_map_ = 0;
119 len_bxmask_map_ +=
it->second.size();
120 if (bxmask_map_verbosity == 1) {
121 int masks[
it->second.size()];
122 for (
size_t i = 0;
i <
it->second.size();
i++)
123 masks[
i] =
it->second[
i];
124 cout <<
" bxmask_map_[" <<
it->first <<
"][" <<
it->second.size() <<
"] = ";
125 if (!
it->second.empty())
126 cout <<
hash(masks,
sizeof(
int) *
it->second.size()) << endl;
130 if (bxmask_map_verbosity > 1) {
131 cout <<
" bxmask_map_[" <<
it->first <<
"][" <<
it->second.size() <<
"] = ";
137 int bxmask_map_[len_bxmask_map_];
141 for (
size_t i = 0;
i <
it->second.size();
i++,
pos++)
142 bxmask_map_[
pos] =
it->second[
i];
144 cout <<
" bxmask_map_[[" << len_bxmask_map_ <<
"]] = ";
146 cout <<
hash(bxmask_map_,
sizeof(
int) * len_bxmask_map_) << endl;
150 int veto_[(ptr.
veto_).size()];
151 bool veto_allZeros =
true;
152 for (
size_t i = 0;
i < (ptr.
veto_).size();
i++) {
155 veto_allZeros =
false;
157 cout <<
" veto_[" << (ptr.
veto_).size() <<
"] = ";
158 if (veto_verbosity == 0) {
159 if (!(ptr.
veto_).empty()) {
162 cout <<
" (all zeros)" << endl;
168 for (
size_t i = 0;
i < (ptr.
veto_).size();
i++)
169 cout << veto_[
i] << endl;
edm::ESGetToken< L1TGlobalPrescalesVetos, L1TGlobalPrescalesVetosRcd > token_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
L1TGlobalPrescalesVetosViewer(const edm::ParameterSet &pset)
int32_t prescale_table_verbosity
std::string hash(void *buf, size_t len) const
std::map< int, std::vector< int > > bxmask_map_
std::vector< double > exp_doubles_
void analyze(const edm::Event &, const edm::EventSetup &) override
int32_t bxmask_map_verbosity
#define DEFINE_FWK_MODULE(type)
Log< level::Info, false > LogInfo
std::vector< std::vector< int > > prescale_table_
std::vector< int > exp_ints_