CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1TGlobalPrescalesVetosViewer Class Reference
Inheritance diagram for L1TGlobalPrescalesVetosViewer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 L1TGlobalPrescalesVetosViewer (const edm::ParameterSet &pset)
 
 ~L1TGlobalPrescalesVetosViewer (void) override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

std::string hash (void *buf, size_t len) const
 

Private Attributes

int32_t bxmask_map_verbosity
 
int32_t prescale_table_verbosity
 
int32_t veto_verbosity
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 13 of file L1TGlobalPrescalesVetosViewer.cc.

Constructor & Destructor Documentation

L1TGlobalPrescalesVetosViewer::L1TGlobalPrescalesVetosViewer ( const edm::ParameterSet pset)
inlineexplicit

Definition at line 24 of file L1TGlobalPrescalesVetosViewer.cc.

References bxmask_map_verbosity, edm::ParameterSet::getUntrackedParameter(), prescale_table_verbosity, and veto_verbosity.

24  : edm::EDAnalyzer() {
25  prescale_table_verbosity = pset.getUntrackedParameter<int32_t>("prescale_table_verbosity", 0);
26  bxmask_map_verbosity = pset.getUntrackedParameter<int32_t>("bxmask_map_verbosity", 0);
27  veto_verbosity = pset.getUntrackedParameter<int32_t>("veto_verbosity", 0);
28  }
T getUntrackedParameter(std::string const &, T const &) const
L1TGlobalPrescalesVetosViewer::~L1TGlobalPrescalesVetosViewer ( void  )
inlineoverride

Definition at line 30 of file L1TGlobalPrescalesVetosViewer.cc.

30 {}

Member Function Documentation

void L1TGlobalPrescalesVetosViewer::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 60 of file L1TGlobalPrescalesVetosViewer.cc.

References cuy::col, gather_cfg::cout, dataset::end, edm::EventSetup::get(), cond::hash, mps_fire::i, PrescalesVetos_cff::L1TGlobalPrescalesVetos, edm::ESHandle< class >::product(), and findQualityFiles::size.

60  {
62  evSetup.get<L1TGlobalPrescalesVetosRcd>().get(handle1);
63  std::shared_ptr<L1TGlobalPrescalesVetos> ptr(new L1TGlobalPrescalesVetos(*(handle1.product())));
64 
65  edm::LogInfo("") << "L1TGlobalPrescalesVetosViewer:";
66 
67  cout << endl;
68  cout << " version_ = " << ptr->version_ << endl;
69  cout << " bxmask_default_ = " << ptr->bxmask_default_ << endl;
70 
71  size_t len_prescale_table_ = 0;
72  for (size_t col = 0; col < ptr->prescale_table_.size(); col++) {
73  size_t nRows = (ptr->prescale_table_)[col].size();
74  len_prescale_table_ += nRows;
75  if (prescale_table_verbosity > 0) {
76  int column[nRows];
77  for (size_t row = 0; row < nRows; row++)
78  column[row] = (ptr->prescale_table_)[col][row];
79  cout << " prescale_table_[" << col << "][" << nRows << "] = ";
80  if (nRows)
81  cout << hash(column, sizeof(int) * nRows) << endl;
82  else
83  cout << 0 << endl;
84  }
85  }
86  int prescale_table_[len_prescale_table_];
87  for (size_t col = 0, pos = 0; col < ptr->prescale_table_.size(); col++) {
88  size_t nRows = (ptr->prescale_table_)[col].size();
89  for (size_t row = 0; row < nRows; row++, pos++)
90  prescale_table_[pos] = (ptr->prescale_table_)[col][row];
91  }
92  cout << " prescale_table_[[" << len_prescale_table_ << "]] = ";
93  if (len_prescale_table_)
94  cout << hash(prescale_table_, sizeof(int) * len_prescale_table_) << endl;
95  else
96  cout << 0 << endl;
97 
98  if (prescale_table_verbosity > 1) {
99  cout << endl << " Detailed view on the prescales * masks: " << endl;
100  for (size_t col = 0; col < ptr->prescale_table_.size(); col++)
101  cout << setw(8) << " Index " << col;
102  cout << endl;
103  size_t nRows = (ptr->prescale_table_)[0].size();
104  for (size_t row = 0; row < nRows; row++) {
105  for (size_t col = 0; col < ptr->prescale_table_.size(); col++)
106  cout << setw(8) << (ptr->prescale_table_)[col][row];
107  cout << endl;
108  }
109  cout << endl;
110  }
111 
112  size_t len_bxmask_map_ = 0;
113  for (std::map<int, std::vector<int> >::const_iterator it = (ptr->bxmask_map_).begin(); it != (ptr->bxmask_map_).end();
114  it++) {
115  len_bxmask_map_ += it->second.size();
116  if (bxmask_map_verbosity == 1) {
117  int masks[it->second.size()];
118  for (size_t i = 0; i < it->second.size(); i++)
119  masks[i] = it->second[i];
120  cout << " bxmask_map_[" << it->first << "][" << it->second.size() << "] = ";
121  if (!it->second.empty())
122  cout << hash(masks, sizeof(int) * it->second.size()) << endl;
123  else
124  cout << 0 << endl;
125  }
126  if (bxmask_map_verbosity > 1) {
127  cout << " bxmask_map_[" << it->first << "][" << it->second.size() << "] = ";
128  for (size_t algo = 0; algo < it->second.size(); algo++)
129  cout << it->second[algo] << ", ";
130  cout << endl;
131  }
132  }
133  int bxmask_map_[len_bxmask_map_];
134  size_t pos = 0;
135  for (std::map<int, std::vector<int> >::const_iterator it = (ptr->bxmask_map_).begin(); it != (ptr->bxmask_map_).end();
136  it++) {
137  for (size_t i = 0; i < it->second.size(); i++, pos++)
138  bxmask_map_[pos] = it->second[i];
139  }
140  cout << " bxmask_map_[[" << len_bxmask_map_ << "]] = ";
141  if (len_bxmask_map_)
142  cout << hash(bxmask_map_, sizeof(int) * len_bxmask_map_) << endl;
143  else
144  cout << 0 << endl;
145 
146  int veto_[(ptr->veto_).size()];
147  bool veto_allZeros = true;
148  for (size_t i = 0; i < (ptr->veto_).size(); i++) {
149  veto_[i] = (ptr->veto_)[i];
150  if (veto_[i])
151  veto_allZeros = false;
152  }
153  cout << " veto_[" << (ptr->veto_).size() << "] = ";
154  if (veto_verbosity == 0) {
155  if (!(ptr->veto_).empty()) {
156  cout << hash(veto_, sizeof(int) * (ptr->veto_).size());
157  if (veto_allZeros)
158  cout << " (all zeros)" << endl;
159  else
160  cout << endl;
161  } else
162  cout << 0 << endl;
163  } else
164  for (size_t i = 0; i < (ptr->veto_).size(); i++)
165  cout << veto_[i] << endl;
166 
167  int exp_ints_[(ptr->exp_ints_).size()];
168  for (size_t i = 0; i < (ptr->exp_ints_).size(); i++)
169  exp_ints_[i] = (ptr->exp_ints_)[i];
170  cout << " exp_ints_[" << (ptr->exp_ints_).size() << "] = ";
171  if (!(ptr->exp_ints_).empty())
172  cout << hash(exp_ints_, sizeof(int) * (ptr->exp_ints_).size()) << endl;
173  else
174  cout << 0 << endl;
175 
176  int exp_doubles_[(ptr->exp_doubles_).size()];
177  for (size_t i = 0; i < (ptr->exp_doubles_).size(); i++)
178  exp_ints_[i] = (ptr->exp_doubles_)[i];
179  cout << " exp_doubles_[" << (ptr->exp_doubles_).size() << "] = ";
180  if (!(ptr->exp_doubles_).empty())
181  cout << hash(exp_doubles_, sizeof(int) * (ptr->exp_doubles_).size()) << endl;
182  else
183  cout << 0 << endl;
184 }
Log< level::Info, false > LogInfo
T const * product() const
Definition: ESHandle.h:86
T get() const
Definition: EventSetup.h:88
string end
Definition: dataset.py:937
tuple cout
Definition: gather_cfg.py:144
int col
Definition: cuy.py:1009
std::string hash(void *buf, size_t len) const
tuple size
Write out results.
std::string L1TGlobalPrescalesVetosViewer::hash ( void *  buf,
size_t  len 
) const
private

Definition at line 38 of file L1TGlobalPrescalesVetosViewer.cc.

References Exception, cond::hash, mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and createJobs::tmp.

38  {
39  char tmp[SHA_DIGEST_LENGTH * 2 + 1];
40  bzero(tmp, sizeof(tmp));
41  SHA_CTX ctx;
42  if (!SHA1_Init(&ctx))
43  throw cms::Exception("L1TGlobalPrescalesVetosViewer::hash") << "SHA1 initialization error";
44 
45  if (!SHA1_Update(&ctx, buf, len))
46  throw cms::Exception("L1TGlobalPrescalesVetosViewer::hash") << "SHA1 processing error";
47 
48  unsigned char hash[SHA_DIGEST_LENGTH];
49  if (!SHA1_Final(hash, &ctx))
50  throw cms::Exception("L1TGlobalPrescalesVetosViewer::hash") << "SHA1 finalization error";
51 
52  // re-write bytes in hex
53  for (unsigned int i = 0; i < 20; i++)
54  ::sprintf(&tmp[i * 2], "%02x", hash[i]);
55 
56  tmp[20 * 2] = 0;
57  return std::string(tmp);
58 }
std::string hash(void *buf, size_t len) const
tmp
align.sh
Definition: createJobs.py:716

Member Data Documentation

int32_t L1TGlobalPrescalesVetosViewer::bxmask_map_verbosity
private

Definition at line 16 of file L1TGlobalPrescalesVetosViewer.cc.

Referenced by L1TGlobalPrescalesVetosViewer().

int32_t L1TGlobalPrescalesVetosViewer::prescale_table_verbosity
private

Definition at line 15 of file L1TGlobalPrescalesVetosViewer.cc.

Referenced by L1TGlobalPrescalesVetosViewer().

int32_t L1TGlobalPrescalesVetosViewer::veto_verbosity
private

Definition at line 17 of file L1TGlobalPrescalesVetosViewer.cc.

Referenced by L1TGlobalPrescalesVetosViewer().