SimG4CMS
Calo
src
HcalTestNS.cc
Go to the documentation of this file.
1
#include "
DataFormats/HcalDetId/interface/HcalDetId.h
"
2
#include "
FWCore/Framework/interface/ESHandle.h
"
3
#include "
Geometry/HcalCommonData/interface/HcalHitRelabeller.h
"
4
#include "
Geometry/Records/interface/HcalRecNumberingRecord.h
"
5
#include "
SimG4CMS/Calo/interface/HcalNumberingScheme.h
"
6
#include "
SimG4CMS/Calo/interface/HcalTestNumberingScheme.h
"
7
#include "
SimG4CMS/Calo/interface/HcalTestNS.h
"
8
9
//#define EDM_ML_DEBUG
10
11
HcalTestNS::HcalTestNS
(
const
edm::EventSetup
* iSetup) {
12
edm::ESHandle<HcalDDDRecConstants>
hdc;
13
iSetup->
get
<
HcalRecNumberingRecord
>().
get
(hdc);
14
if
(hdc.
isValid
()) {
15
hcons_
= hdc.
product
();
16
}
else
{
17
edm::LogError
(
"HcalSim"
) <<
"HcalTestNS : Cannot find HcalDDDRecConstant"
;
18
hcons_
=
nullptr
;
19
}
20
}
21
22
HcalTestNS::~HcalTestNS
() {}
23
24
bool
HcalTestNS::compare
(
HcalNumberingFromDDD::HcalID
const
&
tmp
, uint32_t
const
&
id
) {
25
HcalNumberingScheme
*
scheme
= dynamic_cast<HcalNumberingScheme*>(
new
HcalTestNumberingScheme
(
false
));
26
uint32_t id0 =
scheme
->getUnitID(
tmp
);
27
DetId
hid =
HcalHitRelabeller::relabel
(id0,
hcons_
);
28
bool
ok
= (
id
== hid.
rawId
());
29
#ifdef EDM_ML_DEBUG
30
std::string
ck = (
ok
?
" OK "
:
" **** ERROR ****"
);
31
edm::LogVerbatim
(
"HcalSim"
) <<
"HcalTestNS:: Det ID from HCalSD "
<<
HcalDetId
(
id
) <<
" "
<< std::hex <<
id
32
<<
std::dec
<<
" from relabller "
<<
HcalDetId
(hid) <<
" "
<< std::hex << hid.
rawId
()
33
<<
std::dec
<< ck;
34
#endif
35
return
ok
;
36
}
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
HcalNumberingFromDDD::HcalID
Definition:
HcalNumberingFromDDD.h:21
ESHandle.h
HcalTestNS.h
HcalRecNumberingRecord.h
createJobs.tmp
tmp
align.sh
Definition:
createJobs.py:716
convertSQLiteXML.ok
bool ok
Definition:
convertSQLiteXML.py:98
DetId
Definition:
DetId.h:17
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:87
HcalTestNS::~HcalTestNS
virtual ~HcalTestNS()
Definition:
HcalTestNS.cc:22
edm::ESHandle
Definition:
DTSurvey.h:22
HcalNumberingScheme.h
HcalRecNumberingRecord
Definition:
HcalRecNumberingRecord.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HcalTestNumberingScheme
Definition:
HcalTestNumberingScheme.h:11
HcalDetId.h
HcalHitRelabeller.h
HcalDetId
Definition:
HcalDetId.h:12
edm::EventSetup
Definition:
EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition:
ESHandle.h:44
HcalNumberingScheme
Definition:
HcalNumberingScheme.h:13
generator_cfi.scheme
scheme
Definition:
generator_cfi.py:22
HcalHitRelabeller::relabel
DetId relabel(const uint32_t testId) const
Definition:
HcalHitRelabeller.cc:49
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition:
DetId.h:57
HcalTestNS::compare
bool compare(HcalNumberingFromDDD::HcalID const &, uint32_t const &)
Definition:
HcalTestNS.cc:24
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition:
MessageLogger.h:128
HcalTestNS::HcalTestNS
HcalTestNS(const edm::EventSetup *)
Definition:
HcalTestNS.cc:11
HcalTestNumberingScheme.h
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:143
HcalTestNS::hcons_
const HcalDDDRecConstants * hcons_
Definition:
HcalTestNS.h:16
Generated for CMSSW Reference Manual by
1.8.16