CMS 3D CMS Logo

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 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
mps_fire.i
i
Definition: mps_fire.py:428
ESHandle.h
cond::hash
Definition: Time.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EDAnalyzer.h
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
L1TMuonBarrelKalmanParams
Definition: L1TMuonBarrelKalmanParams.h:21
MakerMacros.h
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
edm::ESHandle
Definition: DTSurvey.h:22
L1TMuonBarrelKalmanParams.h
L1TMuonBarrelKalmanParamsViewer::L1TMuonBarrelKalmanParamsViewer
L1TMuonBarrelKalmanParamsViewer(const edm::ParameterSet &)
Definition: L1TMuonBarrelKalmanParamsViewer.cc:28
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
L1TMuonBarrelKalmanParamsViewer::~L1TMuonBarrelKalmanParamsViewer
~L1TMuonBarrelKalmanParamsViewer(void) override
Definition: L1TMuonBarrelKalmanParamsViewer.cc:29
ModuleDef.h
iEvent
int iEvent
Definition: GenABIO.cc:224
L1TMuonBarrelKalmanParamsRcd
Definition: L1TMuonBarrelKalmanParamsRcd.h:13
L1TMuonBarrelKalmanParamsViewer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: L1TMuonBarrelKalmanParamsViewer.cc:59
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
L1TMuonBarrelKalmanParamsViewer::hash
std::string hash(void *buf, size_t len) const
Definition: L1TMuonBarrelKalmanParamsViewer.cc:37
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ModuleFactory.h
std
Definition: JetResolutionObject.h:76
L1TMuonBarrelKalmanParamsRcd.h
Exception
Definition: hltDiff.cc:245
L1TMuonBarrelKalmanParamsViewer
Definition: L1TMuonBarrelKalmanParamsViewer.cc:21
EventSetup.h
ParameterSet.h
edm::Event
Definition: Event.h:73
Session.h
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142