Main Page
Namespaces
Classes
Package Documentation
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
13
edm::ESHandle<HcalDDDRecConstants>
hdc;
14
iSetup->
get
<
HcalRecNumberingRecord
>().
get
(hdc);
15
if
(hdc.
isValid
()) {
16
hcons_
= (
HcalDDDRecConstants
*)(&(*hdc));
17
}
else
{
18
edm::LogError
(
"HcalSim"
) <<
"HcalTestNS : Cannot find HcalDDDRecConstant"
;
19
hcons_
= 0;
20
}
21
}
22
23
HcalTestNS::~HcalTestNS
() {}
24
25
bool
HcalTestNS::compare
(
HcalNumberingFromDDD::HcalID
const
&
tmp
,
26
uint32_t
const
&
id
) {
27
28
HcalNumberingScheme
* scheme =
dynamic_cast<
HcalNumberingScheme
*
>
(
new
HcalTestNumberingScheme
(
false
));
29
uint32_t id0 = scheme->
getUnitID
(tmp);
30
DetId
hid =
HcalHitRelabeller::relabel
(id0,
hcons_
);
31
bool
ok
= (
id
== hid.
rawId
());
32
#ifdef EDM_ML_DEBUG
33
std::cout
<<
"Det ID from HCalSD "
<<
HcalDetId
(
id
) <<
" "
<< std::hex <<
id
34
<<
std::dec
<<
" from relabller "
<<
HcalDetId
(hid) <<
" "
35
<< std::hex << hid.
rawId
() <<
std::dec
;
36
if
(!ok)
std::cout
<<
" **** ERROR ****"
<< std::endl;
37
else
std::cout
<<
" OK "
<< std::endl;
38
#endif
39
return
ok
;
40
}
convertSQLiteXML.ok
bool ok
Definition:
convertSQLiteXML.py:97
HcalNumberingScheme::getUnitID
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
Definition:
HcalNumberingScheme.cc:22
HcalTestNS::compare
bool compare(HcalNumberingFromDDD::HcalID const &, uint32_t const &)
Definition:
HcalTestNS.cc:25
DetId::rawId
uint32_t rawId() const
get the raw id
Definition:
DetId.h:43
HcalNumberingScheme
Definition:
HcalNumberingScheme.h:13
edm::LogError
Definition:
MessageLogger.h:166
HcalHitRelabeller.h
HcalTestNumberingScheme
Definition:
HcalTestNumberingScheme.h:11
HcalTestNS::HcalTestNS
HcalTestNS(const edm::EventSetup *)
Definition:
HcalTestNS.cc:11
HcalDetId
Definition:
HcalDetId.h:12
HcalDetId.h
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
edm::EventSetup
Definition:
EventSetup.h:44
HcalNumberingScheme.h
HcalTestNS::hcons_
HcalDDDRecConstants * hcons_
Definition:
HcalTestNS.h:19
DetId
Definition:
DetId.h:18
HcalTestNS.h
HcalRecNumberingRecord.h
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
HcalTestNumberingScheme.h
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:141
tmp
std::vector< std::vector< double > > tmp
Definition:
MVATrainer.cc:100
HcalDDDRecConstants
Definition:
HcalDDDRecConstants.h:23
HcalRecNumberingRecord
Definition:
HcalRecNumberingRecord.h:23
HcalTestNS::~HcalTestNS
virtual ~HcalTestNS()
Definition:
HcalTestNS.cc:23
gather_cfg.cout
cout
Definition:
gather_cfg.py:145
HcalHitRelabeller::relabel
DetId relabel(const uint32_t testId) const
Definition:
HcalHitRelabeller.cc:48
HcalNumberingFromDDD::HcalID
Definition:
HcalNumberingFromDDD.h:23
edm::ESHandleBase::isValid
bool isValid() const
Definition:
ESHandle.h:47
Generated for CMSSW Reference Manual by
1.8.11