26 string hash(
void *buf,
size_t len)
const ;
35 #include <openssl/sha.h> 41 char tmp[SHA_DIGEST_LENGTH*2+1];
42 bzero(tmp,
sizeof(tmp));
44 if( !SHA1_Init( &ctx ) )
45 throw cms::Exception(
"L1TCaloParamsViewer::hash")<<
"SHA1 initialization error";
47 if( !SHA1_Update( &ctx, buf, len ) )
48 throw cms::Exception(
"L1TCaloParamsViewer::hash")<<
"SHA1 processing error";
50 unsigned char hash[SHA_DIGEST_LENGTH];
51 if( !SHA1_Final(hash, &ctx) )
52 throw cms::Exception(
"L1TCaloParamsViewer::hash")<<
"SHA1 finalization error";
55 for(
unsigned int i=0;
i<20;
i++)
56 ::sprintf(&tmp[
i*2],
"%02x", hash[i]);
69 cout<<
"Some fields in L1TMuonOverlapParamsParams: "<<endl;
71 cout<<
" fwVersion() = "<<ptr1->fwVersion()<<endl;
72 cout<<
" nPdfAddrBits() = "<<ptr1->nPdfAddrBits()<<endl;
73 cout<<
" nPdfValBits() = "<<ptr1->nPdfValBits()<<endl;
74 cout<<
" nHitsPerLayer() = "<<ptr1->nHitsPerLayer()<<endl;
75 cout<<
" nPhiBits() = "<<ptr1->nPhiBits()<<endl;
76 cout<<
" nPhiBins() = "<<ptr1->nPhiBins()<<endl;
77 cout<<
" nRefHits() = "<<ptr1->nRefHits()<<endl;
78 cout<<
" nTestRefHits() = "<<ptr1->nTestRefHits()<<endl;
79 cout<<
" nProcessors() = "<<ptr1->nProcessors()<<endl;
80 cout<<
" nLogicRegions() = "<<ptr1->nLogicRegions()<<endl;
81 cout<<
" nInputs() = "<<ptr1->nInputs()<<endl;
82 cout<<
" nLayers() = "<<ptr1->nLayers()<<endl;
83 cout<<
" nRefLayers() = "<<ptr1->nRefLayers()<<endl;
84 cout<<
" nGoldenPatterns() = "<<ptr1->nGoldenPatterns()<<endl;
86 const std::vector<int>*
gp = ptr1->generalParams();
87 cout<<
" number of general parameters: = "<<gp->size()<<endl;
89 for(
auto a : *gp)
cout<<
a<<
", ";
92 const std::vector<L1TMuonOverlapParams::LayerMapNode> *lm = ptr1->layerMap();
94 cout<<
" layerMap() = ["<<lm->size()<<
"] ";
96 for(
unsigned int i=0;
i<lm->size();
i++) lm_[
i] = (*lm)[
i];
100 for(
unsigned int i=0;
i<lm->size();
i++){
102 char *
n = (
char*)(&(lm_[
i]));
110 cout<<
" layerMap() = [0] "<<endl;
113 const std::vector<L1TMuonOverlapParams::RefLayerMapNode> *rlm = ptr1->refLayerMap();
115 cout<<
" refLayerMap() = ["<<rlm->size()<<
"] ";
117 for(
unsigned int i=0;
i<rlm->size();
i++) rlm_[
i] = (*rlm)[
i];
121 cout<<
" refLayerMap() = [0] "<<endl;
124 const std::vector<L1TMuonOverlapParams::RefHitNode> *rhn = ptr1->refHitMap();
126 cout<<
" refHitMap() = ["<<rhn->size()<<
"] ";
128 for(
unsigned int i=0;
i<rhn->size();
i++) rhn_[
i] = (*rhn)[
i];
132 cout<<
" refHitMap() = [0] "<<endl;
135 const std::vector<int> *gpsm = ptr1->globalPhiStartMap();
136 if( !gpsm->empty() ){
137 cout<<
" globalPhiStartMap() = ["<<gpsm->size()<<
"] ";
138 int gpsm_[gpsm->size()];
139 for(
unsigned int i=0;
i<gpsm->size();
i++) gpsm_[
i] = (*gpsm)[
i];
140 cout <<
hash( gpsm_,
sizeof(
int)*(gpsm->size()) ) << endl;
142 cout<<
" globalPhiStartMap() = [0] "<<endl;
145 const std::vector<L1TMuonOverlapParams::LayerInputNode> *lim = ptr1->layerInputMap();
147 cout<<
" layerInputMap() = ["<<lim->size()<<
"] ";
149 for(
unsigned int i=0;
i<lim->size();
i++) lim_[
i] = (*lim)[
i];
153 cout<<
" layerInputMap() = [0] "<<endl;
156 const std::vector<int> *css = ptr1->connectedSectorsStart();
158 cout<<
" connectedSectorsStart() = ["<<css->size()<<
"] ";
159 int css_[css->size()];
160 for(
unsigned int i=0;
i<css->size();
i++) css_[
i] = (*css)[
i];
161 cout <<
hash( css_,
sizeof(
int)*(css->size()) ) << endl;
163 cout<<
" connectedSectorsStart() = [0] "<<endl;
166 const std::vector<int> *cse = ptr1->connectedSectorsEnd();
168 cout<<
" connectedSectorsEnd() = ["<<cse->size()<<
"] ";
169 int cse_[cse->size()];
170 for(
unsigned int i=0;
i<cse->size();
i++) cse_[
i] = (*cse)[
i];
171 cout <<
hash( cse_,
sizeof(
int)*(cse->size()) ) << endl;
173 cout<<
" connectedSectorsEnd() = [0] "<<endl;
177 const l1t::LUT *clut = ptr1->chargeLUT();
184 cout<<
" chargeLUT = [0] "<<endl;
187 const l1t::LUT *elut = ptr1->etaLUT();
194 cout<<
" chargeLUT = [0] "<<endl;
197 const l1t::LUT *ptlut = ptr1->ptLUT();
204 cout<<
" ptLUT = [0] "<<endl;
207 const l1t::LUT *plut = ptr1->pdfLUT();
214 cout<<
" pdfLUT = [0] "<<endl;
217 const l1t::LUT *mlut = ptr1->meanDistPhiLUT();
219 cout<<
" meanDistPhiLUT = ["<<mlut->
maxSize()<<
"] "<<flush;
224 cout<<
" meanDistPhiLUT = [0] "<<endl;
T getUntrackedParameter(std::string const &, T const &) const
string hash(void *buf, size_t len) const
void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned int hwNumber
short layer number used within OMTF emulator
unsigned int maxSize() const
unsigned int logicNumber
logic numer of the layer
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
L1TMuonOverlapParamsViewer(const edm::ParameterSet &pset)
bool bendingLayer
Is this a bending layers?
std::vector< std::vector< double > > tmp
~L1TMuonOverlapParamsViewer(void) override
unsigned int connectedToLayer
int data(unsigned int address) const
T const * product() const