CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1TMuonOverlapParamsViewer Class Reference
Inheritance diagram for L1TMuonOverlapParamsViewer:
edm::EDAnalyzer 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)
 
 ~L1TMuonOverlapParamsViewer (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 Attributes

bool printLayerMap
 

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< 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 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 ()
 
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 29 of file L1TMuonOverlapParamsViewer.cc.

References muonDTDigis_cfi::pset.

29  : edm::EDAnalyzer() {
30  printLayerMap = pset.getUntrackedParameter<bool>("printLayerMap", false);
31  }

◆ ~L1TMuonOverlapParamsViewer()

L1TMuonOverlapParamsViewer::~L1TMuonOverlapParamsViewer ( void  )
inlineoverride

Definition at line 32 of file L1TMuonOverlapParamsViewer.cc.

32 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 68 of file L1TMuonOverlapParamsViewer.cc.

References a, L1TMuonOverlapParams::LayerMapNode::bendingLayer, L1TMuonOverlapParams::LayerMapNode::connectedToLayer, gather_cfg::cout, l1t::LUT::data(), TauDecayModes::dec, edm::EventSetup::get(), runTauDisplay::gp, cond::hash, L1TMuonOverlapParams::LayerMapNode::hwNumber, mps_fire::i, dqmiolumiharvest::j, L1TMuonOverlapParams::LayerMapNode::logicNumber, l1t::LUT::maxSize(), dqmiodumpmetadata::n, and edm::ESHandle< T >::product().

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

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