CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalTestNS Class Reference

#include <HcalTestNS.h>

Public Member Functions

bool compare (HcalNumberingFromDDD::HcalID const &, uint32_t const &)
 
 HcalTestNS (const edm::EventSetup *)
 
virtual ~HcalTestNS ()
 

Private Attributes

HcalDDDRecConstantshcons_
 

Detailed Description

Definition at line 8 of file HcalTestNS.h.

Constructor & Destructor Documentation

HcalTestNS::HcalTestNS ( const edm::EventSetup iSetup)

Definition at line 11 of file HcalTestNS.cc.

References edm::EventSetup::get(), hcons_, and edm::ESHandleBase::isValid().

11  {
12 
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_ = nullptr;
20  }
21 }
HcalDDDRecConstants * hcons_
Definition: HcalTestNS.h:19
const T & get() const
Definition: EventSetup.h:55
bool isValid() const
Definition: ESHandle.h:47
HcalTestNS::~HcalTestNS ( )
virtual

Definition at line 23 of file HcalTestNS.cc.

23 {}

Member Function Documentation

bool HcalTestNS::compare ( HcalNumberingFromDDD::HcalID const &  tmp,
uint32_t const &  id 
)

Definition at line 25 of file HcalTestNS.cc.

References gather_cfg::cout, TauDecayModes::dec, HcalNumberingScheme::getUnitID(), hcons_, convertSQLiteXML::ok, DetId::rawId(), and HcalHitRelabeller::relabel().

Referenced by HCalSD::setDetUnitId().

26  {
27 
28  HcalNumberingScheme* scheme = dynamic_cast<HcalNumberingScheme*>(new HcalTestNumberingScheme(false));
29  uint32_t id0 = scheme->getUnitID(tmp);
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 }
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HcalDDDRecConstants * hcons_
Definition: HcalTestNS.h:19
Definition: DetId.h:18
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
DetId relabel(const uint32_t testId) const

Member Data Documentation

HcalDDDRecConstants* HcalTestNS::hcons_
private

Definition at line 19 of file HcalTestNS.h.

Referenced by compare(), and HcalTestNS().