Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-05 00:08:15

0001 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0002 #include "Geometry/HcalCommonData/interface/HcalHitRelabeller.h"
0003 #include "SimG4CMS/Calo/interface/HcalNumberingScheme.h"
0004 #include "SimG4CMS/Calo/interface/HcalTestNumberingScheme.h"
0005 #include "SimG4CMS/Calo/interface/HcalTestNS.h"
0006 
0007 //#define EDM_ML_DEBUG
0008 
0009 HcalTestNS::HcalTestNS(const HcalDDDRecConstants* hcons) : hcons_(hcons) {}
0010 
0011 bool HcalTestNS::compare(HcalNumberingFromDDD::HcalID const& tmp, uint32_t const& id) {
0012   HcalNumberingScheme* scheme = dynamic_cast<HcalNumberingScheme*>(new HcalTestNumberingScheme(false));
0013   uint32_t id0 = scheme->getUnitID(tmp);
0014   DetId hid = HcalHitRelabeller::relabel(id0, hcons_);
0015   bool ok = (id == hid.rawId());
0016 #ifdef EDM_ML_DEBUG
0017   std::string ck = (ok ? " OK " : " **** ERROR ****");
0018   edm::LogVerbatim("HcalSim") << "HcalTestNS:: Det ID from HCalSD " << HcalDetId(id) << " " << std::hex << id
0019                               << std::dec << " from relabller " << HcalDetId(hid) << " " << std::hex << hid.rawId()
0020                               << std::dec << ck;
0021 #endif
0022   return ok;
0023 }