CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1TMuonBarrelParamsViewer Class Reference
Inheritance diagram for L1TMuonBarrelParamsViewer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 L1TMuonBarrelParamsViewer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

bool printPtaThreshold
 
edm::ESGetToken< L1TMuonBarrelParams, L1TMuonBarrelParamsRcdtoken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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< Bconsumes (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 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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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 22 of file L1TMuonBarrelParamsViewer.cc.

Constructor & Destructor Documentation

◆ L1TMuonBarrelParamsViewer()

L1TMuonBarrelParamsViewer::L1TMuonBarrelParamsViewer ( const edm::ParameterSet )
inlineexplicit

Definition at line 31 of file L1TMuonBarrelParamsViewer.cc.

References deDxTools::esConsumes().

31 : token_{esConsumes()} { printPtaThreshold = false; }
edm::ESGetToken< L1TMuonBarrelParams, L1TMuonBarrelParamsRcd > token_

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 67 of file L1TMuonBarrelParamsViewer.cc.

References L1TMuonBarrelParamsHelper::AssLUTPath(), gather_cfg::cout, L1TMuonBarrelParamsHelper::eta_lut(), L1TMuonBarrelParamsHelper::ext_lut(), L1TMuonBarrelParamsHelper::fwVersion(), L1TMuonBarrelParamsHelper::get_BX_max(), L1TMuonBarrelParamsHelper::get_BX_min(), L1TMuonBarrelParamsHelper::get_DisableNewAlgo(), L1TMuonBarrelParamsHelper::get_EtaTrackFinder(), L1TMuonBarrelParamsHelper::get_Extrapolation_21(), L1TMuonBarrelParamsHelper::get_Extrapolation_Filter(), L1TMuonBarrelParamsHelper::get_Extrapolation_nbits_Phi(), L1TMuonBarrelParamsHelper::get_Extrapolation_nbits_PhiB(), L1TMuonBarrelParamsHelper::get_Open_LUTs(), L1TMuonBarrelParamsHelper::get_OutOfTime_Filter(), L1TMuonBarrelParamsHelper::get_OutOfTime_Filter_Window(), L1TMuonBarrelParamsHelper::get_PHI_Assignment_nbits_Phi(), L1TMuonBarrelParamsHelper::get_PHI_Assignment_nbits_PhiB(), L1TMuonBarrelParamsHelper::get_PT_Assignment_nbits_Phi(), L1TMuonBarrelParamsHelper::get_PT_Assignment_nbits_PhiB(), edm::EventSetup::getData(), cond::hash, mps_fire::i, B2GTnPMonitor_cfi::item, isotrackApplyRegressor::k, AlCaHLTBitMon_ParallelJobs::p, L1TMuonBarrelParamsHelper::pta_lut(), L1TMuonBarrelParamsHelper::pta_threshold(), L1TMuonBarrelParamsHelper::qp_lut(), and L1TMuonBarrelParams::version_.

67  {
68  L1TMuonBarrelParams const &ptr = evSetup.getData(token_);
69 
71 
72  cout << "AssLUTPath: " << ptr1->AssLUTPath() << endl;
73 
74  // typedef std::map<short, short, std::less<short> > LUT;
75 
76  size_t k = 0; // avoid using l
77  for (const auto &lut : ptr1->pta_lut()) {
78  if (!lut.empty()) {
79  cout << " pta_lut[" << setw(2) << k << "]= [" << lut.size() << "] " << flush;
80  int lut_[lut.size()], i = 0;
81  for (const pair<const short, short> &p : lut)
82  lut_[i++] = p.first * 0xFFFF + p.second;
83  cout << hash(lut_, sizeof(int) * lut.size()) << endl;
84  } else {
85  cout << " pta_lut[" << setw(2) << k << "]= [0] " << endl;
86  }
87  k++;
88  }
89 
90  cout << " pta_threshold= [" << ptr1->pta_threshold().size() << "] " << flush;
91  int pta_threshold[ptr1->pta_threshold().size()];
92  for (unsigned int i = 0; i < ptr1->pta_threshold().size(); i++) {
93  pta_threshold[i] = ptr1->pta_threshold()[i];
95  cout << " " << pta_threshold[i] << endl;
96  }
97  if (!ptr1->pta_threshold().empty())
98  cout << hash(pta_threshold, sizeof(int) * ptr1->pta_threshold().size()) << endl;
99  else
100  cout << endl;
101 
102  k = 0;
103  for (const auto &lut : ptr1->pta_lut()) {
104  if (!lut.empty()) {
105  cout << " phi_lut[" << k << "]= [" << lut.size() << "] " << flush;
106  int lut_[lut.size()], i = 0;
107  for (const pair<const short, short> &p : lut)
108  lut_[i++] = p.first * 0xFFFF + p.second;
109  cout << hash(lut_, sizeof(int) * lut.size()) << endl;
110  } else {
111  cout << " phi_lut[" << k << "]= [0] " << endl;
112  }
113  k++;
114  }
115 
116  k = 0;
117  for (const auto &lu : ptr1->ext_lut()) {
118  const auto &lut = lu.low;
119  if (!lut.empty()) {
120  cout << " ext_lut_low[" << setw(2) << k << "]= [" << lut.size() << "] " << flush;
121  int lut_[lut.size()], i = 0;
122  for (const pair<const short, short> &p : lut)
123  lut_[i++] = p.first * 0xFFFF + p.second;
124  cout << hash(lut_, sizeof(int) * lut.size()) << endl;
125  } else {
126  cout << " ext_lut_low[" << setw(2) << k << "]= [0] " << endl;
127  }
128  k++;
129  }
130 
131  k = 0;
132  for (const auto &lu : ptr1->ext_lut()) {
133  const auto &lut = lu.high;
134  if (!lut.empty()) {
135  cout << " ext_lut_high[" << setw(2) << k << "]= [" << lut.size() << "] " << flush;
136  int lut_[lut.size()], i = 0;
137  for (const pair<const short, short> &p : lut)
138  lut_[i++] = p.first * 0xFFFF + p.second;
139  cout << hash(lut_, sizeof(int) * lut.size()) << endl;
140  } else {
141  cout << " ext_lut_high[" << setw(2) << k << "]= [0] " << endl;
142  }
143  k++;
144  }
145 
146  // typedef std::map< LUTID, LUTCONT > qpLUT;
147  for (const auto &item : ptr1->qp_lut()) {
148  cout << " qp_lut[" << item.first.first << "," << item.first.second << "]= " << item.second.first << ", ["
149  << item.second.second.size() << "] " << flush;
150  if (!item.second.second.empty()) {
151  int lut_[item.second.second.size()];
152  for (size_t i = 0; i < item.second.second.size(); i++)
153  lut_[i] = item.second.second[i];
154  cout << hash(lut_, sizeof(int) * item.second.second.size()) << endl;
155  } else {
156  cout << endl;
157  }
158  }
159 
160  // typedef std::map<short, L1MuDTEtaPattern, std::less<short> > etaLUT;
161  for (const pair<const short, L1MuDTEtaPattern> &item : ptr1->eta_lut())
162  cout << " eta_lut[" << item.first << "]= " << endl << item.second << endl;
163 
164  cout << "PT_Assignment_nbits_Phi= " << ptr1->get_PT_Assignment_nbits_Phi() << endl;
165  cout << "PT_Assignment_nbits_PhiB= " << ptr1->get_PT_Assignment_nbits_PhiB() << endl;
166  cout << "PHI_Assignment_nbits_Phi= " << ptr1->get_PHI_Assignment_nbits_Phi() << endl;
167  cout << "PHI_Assignment_nbits_PhiB= " << ptr1->get_PHI_Assignment_nbits_PhiB() << endl;
168  cout << "Extrapolation_nbits_Phi= " << ptr1->get_Extrapolation_nbits_Phi() << endl;
169  cout << "Extrapolation_nbits_PhiB= " << ptr1->get_Extrapolation_nbits_PhiB() << endl;
170  cout << "BX_min= " << ptr1->get_BX_min() << endl;
171  cout << "BX_max= " << ptr1->get_BX_max() << endl;
172  cout << "Extrapolation_Filter= " << ptr1->get_Extrapolation_Filter() << endl;
173  cout << "OutOfTime_Filter_Window= " << ptr1->get_OutOfTime_Filter_Window() << endl;
174 
175  cout << boolalpha;
176  cout << "OutOfTime_Filter= " << ptr1->get_OutOfTime_Filter() << endl;
177  cout << "Open_LUTs= " << ptr1->get_Open_LUTs() << endl;
178  cout << "EtaTrackFinder= " << ptr1->get_EtaTrackFinder() << endl;
179  cout << "Extrapolation_21= " << ptr1->get_Extrapolation_21() << endl;
180  cout << "DisableNewAlgo= " << ptr1->get_DisableNewAlgo() << endl;
181  cout << noboolalpha;
182 
183  // FW version
184  cout << "fwVersion= " << ptr1->fwVersion() << endl;
185  cout << "version= " << ptr1->version_ << endl;
186 }
edm::ESGetToken< L1TMuonBarrelParams, L1TMuonBarrelParamsRcd > token_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::string hash(void *buf, size_t len) const
std::vector< int > pta_threshold() const
std::vector< LUT > pta_lut() const
std::vector< LUTParams::extLUT > ext_lut() const

◆ hash()

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

Definition at line 39 of file L1TMuonBarrelParamsViewer.cc.

References visDQMUpload::buf, EVP_MD_CTX_free, EVP_MD_CTX_new, Exception, cond::hash, mps_fire::i, cms::openssl_init(), AlCaHLTBitMon_QueryRunRegistry::string, and createJobs::tmp.

39  {
41  EVP_MD_CTX *mdctx = EVP_MD_CTX_new();
42  const EVP_MD *md = EVP_get_digestbyname("SHA1");
43  if (!EVP_DigestInit_ex(mdctx, md, nullptr))
44  throw cms::Exception("L1TMuonBarrelParamsViewer::hash") << "SHA1 initialization error";
45 
46  if (!EVP_DigestUpdate(mdctx, buf, len))
47  throw cms::Exception("L1TMuonBarrelParamsViewer::hash") << "SHA1 processing error";
48 
49  unsigned char hash[EVP_MAX_MD_SIZE];
50  unsigned int md_len = 0;
51  if (!EVP_DigestFinal_ex(mdctx, hash, &md_len))
52  throw cms::Exception("L1TMuonBarrelParamsViewer::hash") << "SHA1 finalization error";
53 
54  EVP_MD_CTX_free(mdctx);
55 
56  // re-write bytes in hex
57  char tmp[EVP_MAX_MD_SIZE * 2 + 1];
58  if (md_len > 20)
59  md_len = 20;
60  for (unsigned int i = 0; i < md_len; i++)
61  ::sprintf(&tmp[i * 2], "%02x", hash[i]);
62 
63  tmp[md_len * 2] = 0;
64  return std::string(tmp);
65 }
void openssl_init()
Definition: openssl_init.cc:5
#define EVP_MD_CTX_free
Definition: openssl_init.h:7
std::string hash(void *buf, size_t len) const
#define EVP_MD_CTX_new
Definition: openssl_init.h:6
tmp
align.sh
Definition: createJobs.py:716

Member Data Documentation

◆ printPtaThreshold

bool L1TMuonBarrelParamsViewer::printPtaThreshold
private

Definition at line 26 of file L1TMuonBarrelParamsViewer.cc.

◆ token_

edm::ESGetToken<L1TMuonBarrelParams, L1TMuonBarrelParamsRcd> L1TMuonBarrelParamsViewer::token_
private

Definition at line 25 of file L1TMuonBarrelParamsViewer.cc.