CMS 3D CMS Logo

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
string hash (void *buf, size_t len) const
 
 L1TMuonOverlapParamsViewer (const edm::ParameterSet &pset)
 
- 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 Attributes

bool printLayerMap
 
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcdtoken_
 

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 21 of file L1TMuonOverlapParamsViewer.cc.

Constructor & Destructor Documentation

◆ L1TMuonOverlapParamsViewer()

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

Definition at line 30 of file L1TMuonOverlapParamsViewer.cc.

References deDxTools::esConsumes().

30  : token_{esConsumes()} {
31  printLayerMap = pset.getUntrackedParameter<bool>("printLayerMap", false);
32  }
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > token_

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 68 of file L1TMuonOverlapParamsViewer.cc.

References a, L1TMuonOverlapParams::LayerMapNode::bendingLayer, L1TMuonOverlapParams::chargeLUT(), L1TMuonOverlapParams::connectedSectorsEnd(), L1TMuonOverlapParams::connectedSectorsStart(), L1TMuonOverlapParams::LayerMapNode::connectedToLayer, gather_cfg::cout, l1t::LUT::data(), TauDecayModes::dec, L1TMuonOverlapParams::etaLUT(), L1TMuonOverlapParams::fwVersion(), L1TMuonOverlapParams::generalParams(), edm::EventSetup::getData(), L1TMuonOverlapParams::globalPhiStartMap(), cond::hash, L1TMuonOverlapParams::LayerMapNode::hwNumber, mps_fire::i, dqmiolumiharvest::j, L1TMuonOverlapParams::layerInputMap(), L1TMuonOverlapParams::layerMap(), L1TMuonOverlapParams::LayerMapNode::logicNumber, l1t::LUT::maxSize(), L1TMuonOverlapParams::meanDistPhiLUT(), create_idmaps::n, L1TMuonOverlapParams::nGoldenPatterns(), L1TMuonOverlapParams::nHitsPerLayer(), L1TMuonOverlapParams::nInputs(), L1TMuonOverlapParams::nLayers(), L1TMuonOverlapParams::nLogicRegions(), L1TMuonOverlapParams::nPdfAddrBits(), L1TMuonOverlapParams::nPdfValBits(), L1TMuonOverlapParams::nPhiBins(), L1TMuonOverlapParams::nPhiBits(), L1TMuonOverlapParams::nProcessors(), L1TMuonOverlapParams::nRefHits(), L1TMuonOverlapParams::nRefLayers(), L1TMuonOverlapParams::nTestRefHits(), L1TMuonOverlapParams::pdfLUT(), L1TMuonOverlapParams::ptLUT(), L1TMuonOverlapParams::refHitMap(), and L1TMuonOverlapParams::refLayerMap().

68  {
69  // Pull the config from the ES
70  L1TMuonOverlapParams const &ptr1 = evSetup.getData(token_);
71 
72  cout << "Some fields in L1TMuonOverlapParamsParams: " << endl;
73 
74  cout << " fwVersion() = " << ptr1.fwVersion() << endl;
75  cout << " nPdfAddrBits() = " << ptr1.nPdfAddrBits() << endl;
76  cout << " nPdfValBits() = " << ptr1.nPdfValBits() << endl;
77  cout << " nHitsPerLayer() = " << ptr1.nHitsPerLayer() << endl;
78  cout << " nPhiBits() = " << ptr1.nPhiBits() << endl;
79  cout << " nPhiBins() = " << ptr1.nPhiBins() << endl;
80  cout << " nRefHits() = " << ptr1.nRefHits() << endl;
81  cout << " nTestRefHits() = " << ptr1.nTestRefHits() << endl;
82  cout << " nProcessors() = " << ptr1.nProcessors() << endl;
83  cout << " nLogicRegions() = " << ptr1.nLogicRegions() << endl;
84  cout << " nInputs() = " << ptr1.nInputs() << endl;
85  cout << " nLayers() = " << ptr1.nLayers() << endl;
86  cout << " nRefLayers() = " << ptr1.nRefLayers() << endl;
87  cout << " nGoldenPatterns() = " << ptr1.nGoldenPatterns() << endl;
88 
89  const std::vector<int> *gp = ptr1.generalParams();
90  cout << " number of general parameters: = " << gp->size() << endl;
91  cout << " ";
92  for (auto a : *gp)
93  cout << a << ", ";
94  cout << endl;
95 
96  const std::vector<L1TMuonOverlapParams::LayerMapNode> *lm = ptr1.layerMap();
97  if (!lm->empty()) {
98  cout << " layerMap() = [" << lm->size() << "] ";
100  for (unsigned int i = 0; i < lm->size(); i++)
101  lm_[i] = (*lm)[i];
102  cout << hash(lm_, sizeof(L1TMuonOverlapParams::LayerMapNode) * (lm->size())) << endl;
103  if (printLayerMap) {
104  cout << sizeof(L1TMuonOverlapParams::LayerMapNode) << endl;
105  for (unsigned int i = 0; i < lm->size(); i++) {
106  cout << " [" << i << "]: hwNumber = " << lm_[i].hwNumber << " logicNumber = " << lm_[i].logicNumber
107  << " bendingLayer = " << lm_[i].bendingLayer << " connectedToLayer = " << lm_[i].connectedToLayer << " ("
108  << flush;
109  char *n = (char *)(&(lm_[i]));
110  for (unsigned int j = 0; j < sizeof(L1TMuonOverlapParams::LayerMapNode); j++)
111  cout << "0x" << hex << int(*(n + j)) << dec << ", ";
112  cout << endl;
113  }
114  // hash( (void*)(&(lm_[i])), sizeof(L1TMuonOverlapParams::LayerMapNode) ) <<endl;
115  }
116  delete[] lm_;
117  } else {
118  cout << " layerMap() = [0] " << endl;
119  }
120 
121  const std::vector<L1TMuonOverlapParams::RefLayerMapNode> *rlm = ptr1.refLayerMap();
122  if (!rlm->empty()) {
123  cout << " refLayerMap() = [" << rlm->size() << "] ";
125  for (unsigned int i = 0; i < rlm->size(); i++)
126  rlm_[i] = (*rlm)[i];
127  cout << hash(rlm_, sizeof(L1TMuonOverlapParams::RefLayerMapNode) * (rlm->size())) << endl;
128  delete[] rlm_;
129  } else {
130  cout << " refLayerMap() = [0] " << endl;
131  }
132 
133  const std::vector<L1TMuonOverlapParams::RefHitNode> *rhn = ptr1.refHitMap();
134  if (!rhn->empty()) {
135  cout << " refHitMap() = [" << rhn->size() << "] ";
137  for (unsigned int i = 0; i < rhn->size(); i++)
138  rhn_[i] = (*rhn)[i];
139  cout << hash(rhn_, sizeof(L1TMuonOverlapParams::RefHitNode) * (rhn->size())) << endl;
140  delete[] rhn_;
141  } else {
142  cout << " refHitMap() = [0] " << endl;
143  }
144 
145  const std::vector<int> *gpsm = ptr1.globalPhiStartMap();
146  if (!gpsm->empty()) {
147  cout << " globalPhiStartMap() = [" << gpsm->size() << "] ";
148  int gpsm_[gpsm->size()];
149  for (unsigned int i = 0; i < gpsm->size(); i++)
150  gpsm_[i] = (*gpsm)[i];
151  cout << hash(gpsm_, sizeof(int) * (gpsm->size())) << endl;
152  } else {
153  cout << " globalPhiStartMap() = [0] " << endl;
154  }
155 
156  const std::vector<L1TMuonOverlapParams::LayerInputNode> *lim = ptr1.layerInputMap();
157  if (!lim->empty()) {
158  cout << " layerInputMap() = [" << lim->size() << "] ";
160  for (unsigned int i = 0; i < lim->size(); i++)
161  lim_[i] = (*lim)[i];
162  cout << hash(lim_, sizeof(L1TMuonOverlapParams::LayerInputNode) * (lim->size())) << endl;
163  delete[] lim_;
164  } else {
165  cout << " layerInputMap() = [0] " << endl;
166  }
167 
168  const std::vector<int> *css = ptr1.connectedSectorsStart();
169  if (!css->empty()) {
170  cout << " connectedSectorsStart() = [" << css->size() << "] ";
171  int css_[css->size()];
172  for (unsigned int i = 0; i < css->size(); i++)
173  css_[i] = (*css)[i];
174  cout << hash(css_, sizeof(int) * (css->size())) << endl;
175  } else {
176  cout << " connectedSectorsStart() = [0] " << endl;
177  }
178 
179  const std::vector<int> *cse = ptr1.connectedSectorsEnd();
180  if (!cse->empty()) {
181  cout << " connectedSectorsEnd() = [" << cse->size() << "] ";
182  int cse_[cse->size()];
183  for (unsigned int i = 0; i < cse->size(); i++)
184  cse_[i] = (*cse)[i];
185  cout << hash(cse_, sizeof(int) * (cse->size())) << endl;
186  } else {
187  cout << " connectedSectorsEnd() = [0] " << endl;
188  }
189 
190  const l1t::LUT *clut = ptr1.chargeLUT();
191  if (clut->maxSize()) {
192  cout << " chargeLUT = [" << clut->maxSize() << "] ";
193  int clut_[clut->maxSize()];
194  for (unsigned int i = 0; i < clut->maxSize(); i++)
195  clut_[i] = clut->data(i);
196  cout << hash(clut_, sizeof(int) * (clut->maxSize())) << endl;
197  } else {
198  cout << " chargeLUT = [0] " << endl;
199  }
200 
201  const l1t::LUT *elut = ptr1.etaLUT();
202  if (elut->maxSize()) {
203  cout << " etaLUT = [" << elut->maxSize() << "] ";
204  int elut_[elut->maxSize()];
205  for (unsigned int i = 0; i < elut->maxSize(); i++)
206  elut_[i] = elut->data(i);
207  cout << hash(elut_, sizeof(int) * (elut->maxSize())) << endl;
208  } else {
209  cout << " chargeLUT = [0] " << endl;
210  }
211 
212  const l1t::LUT *ptlut = ptr1.ptLUT();
213  if (ptlut->maxSize()) {
214  cout << " ptLUT = [" << ptlut->maxSize() << "] " << flush;
215  int ptlut_[ptlut->maxSize()];
216  for (unsigned int i = 0; i < ptlut->maxSize(); i++)
217  ptlut_[i] = ptlut->data(i);
218  cout << hash(ptlut_, sizeof(int) * (ptlut->maxSize())) << endl;
219  } else {
220  cout << " ptLUT = [0] " << endl;
221  }
222 
223  const l1t::LUT *plut = ptr1.pdfLUT();
224  if (plut->maxSize()) {
225  cout << " pdfLUT = [" << plut->maxSize() << "] " << flush;
226  int plut_[plut->maxSize()];
227  for (unsigned int i = 0; i < plut->maxSize(); i++)
228  plut_[i] = plut->data(i);
229  cout << hash(plut_, sizeof(int) * (plut->maxSize())) << endl;
230  } else {
231  cout << " pdfLUT = [0] " << endl;
232  }
233 
234  const l1t::LUT *mlut = ptr1.meanDistPhiLUT();
235  if (mlut->maxSize()) {
236  cout << " meanDistPhiLUT = [" << mlut->maxSize() << "] " << flush;
237  int mlut_[mlut->maxSize()];
238  for (unsigned int i = 0; i < mlut->maxSize(); i++)
239  mlut_[i] = mlut->data(i);
240  cout << hash(mlut_, sizeof(int) * (mlut->maxSize())) << endl;
241  } else {
242  cout << " meanDistPhiLUT = [0] " << endl;
243  }
244 }
const std::vector< int > * generalParams() const
General definitions.
unsigned int maxSize() const
Definition: LUT.h:55
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
unsigned int hwNumber
short layer number used within OMTF emulator
unsigned int logicNumber
logic numer of the layer
const std::vector< LayerMapNode > * layerMap() const
const std::vector< LayerInputNode > * layerInputMap() const
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > token_
int nPdfAddrBits() const
Access to specific general settings.
int data(unsigned int address) const
Definition: LUT.h:46
const l1t::LUT * pdfLUT() const
unsigned fwVersion() const
bool bendingLayer
Is this a bending layers?
Definition: LUT.h:29
string hash(void *buf, size_t len) const
const std::vector< int > * connectedSectorsEnd() const
double a
Definition: hdecay.h:121
const l1t::LUT * meanDistPhiLUT() const
const std::vector< RefLayerMapNode > * refLayerMap() const
const std::vector< int > * connectedSectorsStart() const
const l1t::LUT * ptLUT() const
const std::vector< RefHitNode > * refHitMap() const
const std::vector< int > * globalPhiStartMap() const
const l1t::LUT * etaLUT() const

◆ hash()

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

Definition at line 40 of file L1TMuonOverlapParamsViewer.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.

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

Member Data Documentation

◆ printLayerMap

bool L1TMuonOverlapParamsViewer::printLayerMap
private

Definition at line 24 of file L1TMuonOverlapParamsViewer.cc.

◆ token_

edm::ESGetToken<L1TMuonOverlapParams, L1TMuonOverlapParamsRcd> L1TMuonOverlapParamsViewer::token_
private

Definition at line 23 of file L1TMuonOverlapParamsViewer.cc.