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

Constructor & Destructor Documentation

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

Definition at line 29 of file L1TMuonOverlapParamsViewer.cc.

References edm::ParameterSet::getUntrackedParameter().

29  : edm::EDAnalyzer() {
30  printLayerMap = pset.getUntrackedParameter<bool>("printLayerMap", false);
31  }
T getUntrackedParameter(std::string const &, T const &) const
L1TMuonOverlapParamsViewer::~L1TMuonOverlapParamsViewer ( void  )
inlineoverride

Definition at line 32 of file L1TMuonOverlapParamsViewer.cc.

32 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 62 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< class >::product().

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

Definition at line 40 of file L1TMuonOverlapParamsViewer.cc.

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

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

Member Data Documentation

bool L1TMuonOverlapParamsViewer::printLayerMap
private

Definition at line 23 of file L1TMuonOverlapParamsViewer.cc.