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++)
74 cout <<
" version_ = " << ptr->version_ << endl;
75 cout <<
" bxmask_default_ = " << ptr->bxmask_default_ << endl;
77 size_t len_prescale_table_ = 0;
78 for (
size_t col = 0;
col < ptr->prescale_table_.size();
col++) {
79 size_t nRows = (ptr->prescale_table_)[
col].
size();
80 len_prescale_table_ += nRows;
81 if (prescale_table_verbosity > 0) {
83 for (
size_t row = 0; row < nRows; row++)
84 column[row] = (ptr->prescale_table_)[
col][row];
85 cout <<
" prescale_table_[" <<
col <<
"][" << nRows <<
"] = ";
87 cout <<
hash(column,
sizeof(
int) * nRows) << endl;
92 int prescale_table_[len_prescale_table_];
93 for (
size_t col = 0,
pos = 0;
col < ptr->prescale_table_.size();
col++) {
94 size_t nRows = (ptr->prescale_table_)[
col].
size();
95 for (
size_t row = 0; row < nRows; row++,
pos++)
96 prescale_table_[
pos] = (ptr->prescale_table_)[
col][row];
98 cout <<
" prescale_table_[[" << len_prescale_table_ <<
"]] = ";
99 if (len_prescale_table_)
100 cout <<
hash(prescale_table_,
sizeof(
int) * len_prescale_table_) << endl;
104 if (prescale_table_verbosity > 1) {
105 cout << endl <<
" Detailed view on the prescales * masks: " << endl;
106 for (
size_t col = 0;
col < ptr->prescale_table_.size();
col++)
107 cout << setw(8) <<
" Index " <<
col;
109 size_t nRows = (ptr->prescale_table_)[0].
size();
110 for (
size_t row = 0; row < nRows; row++) {
111 for (
size_t col = 0;
col < ptr->prescale_table_.size();
col++)
112 cout << setw(8) << (ptr->prescale_table_)[
col][row];
118 size_t len_bxmask_map_ = 0;
119 for (
std::map<
int, std::vector<int> >::const_iterator it = (ptr->bxmask_map_).begin(); it != (ptr->bxmask_map_).
end();
121 len_bxmask_map_ += it->second.size();
122 if (bxmask_map_verbosity == 1) {
123 int masks[it->second.size()];
124 for (
size_t i = 0;
i < it->second.size();
i++)
125 masks[
i] = it->second[
i];
126 cout <<
" bxmask_map_[" << it->first <<
"][" << it->second.size() <<
"] = ";
127 if (!it->second.empty())
128 cout <<
hash(masks,
sizeof(
int) * it->second.size()) << endl;
132 if (bxmask_map_verbosity > 1) {
133 cout <<
" bxmask_map_[" << it->first <<
"][" << it->second.size() <<
"] = ";
139 int bxmask_map_[len_bxmask_map_];
141 for (
std::map<
int, std::vector<int> >::const_iterator it = (ptr->bxmask_map_).begin(); it != (ptr->bxmask_map_).
end();
143 for (
size_t i = 0;
i < it->second.size();
i++,
pos++)
144 bxmask_map_[
pos] = it->second[
i];
146 cout <<
" bxmask_map_[[" << len_bxmask_map_ <<
"]] = ";
148 cout <<
hash(bxmask_map_,
sizeof(
int) * len_bxmask_map_) << endl;
152 int veto_[(ptr->veto_).
size()];
153 bool veto_allZeros =
true;
154 for (
size_t i = 0;
i < (ptr->veto_).
size();
i++) {
155 veto_[
i] = (ptr->veto_)[
i];
157 veto_allZeros =
false;
159 cout <<
" veto_[" << (ptr->veto_).
size() <<
"] = ";
160 if (veto_verbosity == 0) {
161 if (!(ptr->veto_).empty()) {
162 cout <<
hash(veto_,
sizeof(
int) * (ptr->veto_).size());
164 cout <<
" (all zeros)" << endl;
170 for (
size_t i = 0;
i < (ptr->veto_).
size();
i++)
171 cout << veto_[
i] << endl;
173 int exp_ints_[(ptr->exp_ints_).
size()];
174 for (
size_t i = 0;
i < (ptr->exp_ints_).
size();
i++)
175 exp_ints_[
i] = (ptr->exp_ints_)[
i];
176 cout <<
" exp_ints_[" << (ptr->exp_ints_).
size() <<
"] = ";
177 if (!(ptr->exp_ints_).empty())
178 cout <<
hash(exp_ints_,
sizeof(
int) * (ptr->exp_ints_).
size()) << endl;
182 int exp_doubles_[(ptr->exp_doubles_).
size()];
183 for (
size_t i = 0;
i < (ptr->exp_doubles_).
size();
i++)
184 exp_ints_[
i] = (ptr->exp_doubles_)[
i];
185 cout <<
" exp_doubles_[" << (ptr->exp_doubles_).
size() <<
"] = ";
186 if (!(ptr->exp_doubles_).empty())
187 cout <<
hash(exp_doubles_,
sizeof(
int) * (ptr->exp_doubles_).
size()) << endl;
~L1TGlobalPrescalesVetosViewer(void) override
#define DEFINE_FWK_MODULE(type)
L1TGlobalPrescalesVetosViewer(const edm::ParameterSet &pset)
int32_t prescale_table_verbosity
std::string hash(void *buf, size_t len) const
void analyze(const edm::Event &, const edm::EventSetup &) override
T const * product() const
int32_t bxmask_map_verbosity
Log< level::Info, false > LogInfo