CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1TMuonBarrelKalmanParamsViewer.cc
Go to the documentation of this file.
1 #include <iomanip>
2 #include <iostream>
3 
5 
8 
11 
17 
18 #include <iostream>
19 using namespace std;
20 
22 private:
23  std::string hash(void *buf, size_t len) const;
24 
25 public:
26  void analyze(const edm::Event &, const edm::EventSetup &) override;
27 
30 };
31 
32 #include <openssl/sha.h>
33 #include <cmath>
34 #include <iostream>
35 using namespace std;
36 
38  char tmp[SHA_DIGEST_LENGTH * 2 + 1];
39  bzero(tmp, sizeof(tmp));
40  SHA_CTX ctx;
41  if (!SHA1_Init(&ctx))
42  throw cms::Exception("L1TMuonBarrelKalmanParamsViewer::hash") << "SHA1 initialization error";
43 
44  if (!SHA1_Update(&ctx, buf, len))
45  throw cms::Exception("L1TMuonBarrelKalmanParamsViewer::hash") << "SHA1 processing error";
46 
47  unsigned char hash[SHA_DIGEST_LENGTH];
48  if (!SHA1_Final(hash, &ctx))
49  throw cms::Exception("L1TMuonBarrelKalmanParamsViewer::hash") << "SHA1 finalization error";
50 
51  // re-write bytes in hex
52  for (unsigned int i = 0; i < 20; i++)
53  ::sprintf(&tmp[i * 2], "%02x", hash[i]);
54 
55  tmp[20 * 2] = 0;
56  return std::string(tmp);
57 }
58 
61  evSetup.get<L1TMuonBarrelKalmanParamsRcd>().get(handle1);
62  std::shared_ptr<L1TMuonBarrelKalmanParams> ptr(new L1TMuonBarrelKalmanParams(*(handle1.product())));
63 
64  // Get the nodes and print out
65  auto pnodes = ptr->pnodes_[ptr->CONFIG];
66  cout << "version : " << ptr->version_ << endl;
67  cout << "fwVersion : " << hex << pnodes.fwVersion_ << dec << endl;
68  cout << "LUTsPath : " << pnodes.kalmanLUTsPath_ << endl;
69 
70  // typedef std::map<short, short, std::less<short> > LUT;
71 }
72 
76 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::string hash(void *buf, size_t len) const
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:224
void analyze(const edm::Event &, const edm::EventSetup &) override
T const * product() const
Definition: ESHandle.h:86
L1TMuonBarrelKalmanParamsViewer(const edm::ParameterSet &)
T get() const
Definition: EventSetup.h:82
tuple cout
Definition: gather_cfg.py:144
tmp
align.sh
Definition: createJobs.py:716