CMS 3D CMS Logo

HcalTestNumberingTest.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalTestNumberingTester
4 // Class: HcalTestNumberingTester
5 //
13 //
14 // Original Author: Sunanda Banerjee
15 // Created: Mon 2013/12/26
16 //
17 
18 // system include files
19 #include <memory>
20 #include <iostream>
21 #include <fstream>
22 
23 // user include files
28 
34 
44 
46 public:
48  ~HcalTestNumberingTester() override;
49 
50  void beginJob() override {}
51  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
52  void endJob() override {}
53 
54 private:
57 };
58 
62 
64 
65 // ------------ method called to produce the data ------------
67  const HcalDDDSimConstants* hcs = &iSetup.getData(tokSim_);
68  const HcalDDDRecConstants* hcr = &iSetup.getData(tokReco_);
70  HcalNumberingScheme* schme2 = dynamic_cast<HcalNumberingScheme*>(new HcalTestNumberingScheme(false));
71 
72  for (int type = 0; type < 2; ++type) {
73  HcalSubdetector sub = (type == 0) ? HcalBarrel : HcalEndcap;
74  for (int zs = 0; zs < 2; ++zs) {
75  int zside = 2 * zs - 1;
76  std::pair<int, int> etas = hcr->getEtaRange(type);
77  for (int eta = etas.first; eta <= etas.second; ++eta) {
78  std::vector<std::pair<int, double> > phis = hcr->getPhis(sub, eta);
79  for (unsigned int k = 0; k < phis.size(); ++k) {
80  int phi = phis[k].first;
81  int lmin = (type == 1 && eta == 16) ? 8 : 1;
82  int lmax = (type == 1) ? 19 : ((eta == 16) ? 7 : 17);
83  for (int lay = lmin; lay <= lmax; ++lay) {
84  std::pair<int, int> etd = hcs->getEtaDepth(sub, eta, phi, zside, 0, lay);
85  HcalNumberingFromDDD::HcalID tmp(sub, zs, etd.second, etd.first, phi, phi, lay);
86  uint32_t id1 = schme1->getUnitID(tmp);
87  uint32_t id2 = schme2->getUnitID(tmp);
89  std::string ok = (id1 != id0.rawId()) ? " *** ERROR ***" : " ";
90  edm::LogVerbatim("HcalSim") << "I/P " << sub << ":" << zside * eta << ":" << phi << ":" << lay << " Normal "
91  << std::hex << id1 << std::dec << " " << HcalDetId(id1) << " Test " << std::hex
92  << id2 << std::dec << " " << HcalDetId(id0) << ok;
93  }
94  }
95  }
96  }
97  }
98 }
99 
100 //define this as a plug-in
EDAnalyzer.h
HcalNumberingScheme::getUnitID
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
Definition: HcalNumberingScheme.cc:19
MessageLogger.h
HcalDDDRecConstants::getPhis
std::vector< std::pair< int, double > > getPhis(const int &subdet, const int &ieta) const
Definition: HcalDDDRecConstants.cc:373
HcalNumberingFromDDD::HcalID
Definition: HcalNumberingFromDDD.h:21
HcalSimNumberingRecord.h
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
globals_cff.id1
id1
Definition: globals_cff.py:33
HcalRecNumberingRecord.h
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
HcalTestNumberingTester::~HcalTestNumberingTester
~HcalTestNumberingTester() override
Definition: HcalTestNumberingTest.cc:63
HcalBarrel
Definition: HcalAssistant.h:33
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
HcalNumberingFromDDD.h
HcalDDDSimConstants
Definition: HcalDDDSimConstants.h:24
DetId
Definition: DetId.h:17
HcalTestNumberingTester::analyze
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
Definition: HcalTestNumberingTest.cc:66
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
EnergyCorrector.etas
etas
Definition: EnergyCorrector.py:45
PVValHelper::eta
Definition: PVValidationHelpers.h:70
HcalNumberingScheme.h
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
HcalDDDSimConstants::getEtaDepth
std::pair< int, int > getEtaDepth(const int &det, int etaR, const int &phi, const int &zside, int depth, const int &lay) const
Definition: HcalDDDSimConstants.cc:252
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
HcalTestNumberingScheme
Definition: HcalTestNumberingScheme.h:11
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
HcalDetId.h
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
HcalHitRelabeller.h
HcalDetId
Definition: HcalDetId.h:12
iEvent
int iEvent
Definition: GenABIO.cc:224
HcalTestNumberingTester
Definition: HcalTestNumberingTest.cc:45
IdealGeometryRecord.h
HcalTestNumberingTester::endJob
void endJob() override
Definition: HcalTestNumberingTest.cc:52
edm::EventSetup
Definition: EventSetup.h:58
HcalSubdetector.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord >
HcalNumberingScheme
Definition: HcalNumberingScheme.h:13
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
DDAxes::phi
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
HcalDDDRecConstants::getEtaRange
std::pair< int, int > getEtaRange(const int &i) const
Definition: HcalDDDRecConstants.h:74
HcalTestNumberingTester::beginJob
void beginJob() override
Definition: HcalTestNumberingTest.cc:50
HcalEndcap
Definition: HcalAssistant.h:34
Frameworkfwd.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
HcalDDDRecConstants.h
EventSetup.h
HcalDDDRecConstants
Definition: HcalDDDRecConstants.h:23
ParameterSet.h
HcalTestNumberingTester::HcalTestNumberingTester
HcalTestNumberingTester(const edm::ParameterSet &)
Definition: HcalTestNumberingTest.cc:59
globals_cff.id2
id2
Definition: globals_cff.py:34
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
HcalTestNumberingScheme.h
HcalSimNumberingRecord
Definition: HcalSimNumberingRecord.h:25
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
HcalTestNumberingTester::tokSim_
const edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord > tokSim_
Definition: HcalTestNumberingTest.cc:55
HcalTestNumberingTester::tokReco_
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tokReco_
Definition: HcalTestNumberingTest.cc:56
HcalDDDSimConstants.h