14 : minEta_(conf.getParameter<double>(
"minEta")),
15 maxEta_(conf.getParameter<double>(
"maxEta")),
16 minPhi_(conf.getParameter<double>(
"minPhi")),
17 maxPhi_(conf.getParameter<double>(
"maxPhi")),
18 nBinsEta_(conf.getParameter<
int>(
"nBinsEta")),
19 nBinsPhi_(conf.getParameter<
int>(
"nBinsPhi")),
20 binsEta_(conf.getParameter<
std::
vector<double> >(
"binsEta")),
21 binsPhi_(conf.getParameter<
std::
vector<double> >(
"binsPhi")) {
24 <<
"HGCalTriggerTowerGeometryHelper nBinsEta for the tower map not consistent with binsEta size" << std::endl;
29 <<
"HGCalTriggerTowerGeometryHelper nBinsPhi for the tower map not consistent with binsPhi size" << std::endl;
34 for (
unsigned int bin1 = 0; bin1 !=
nBinsEta_ + 1; bin1++) {
41 for (
unsigned int bin2 = 0; bin2 !=
nBinsPhi_ + 1; bin2++) {
47 for (
unsigned int bin1 = 0; bin1 !=
nBinsEta_; bin1++) {
48 for (
unsigned int bin2 = 0; bin2 !=
nBinsPhi_; bin2++) {
61 if (!l1tTriggerTowerMappingStream.is_open()) {
62 throw cms::Exception(
"MissingDataFile") <<
"Cannot open HGCalTriggerGeometry L1TTriggerTowerMapping file\n";
65 unsigned trigger_cell_id = 0;
66 unsigned short iEta = 0;
67 unsigned short iPhi = 0;
69 for (; l1tTriggerTowerMappingStream >> trigger_cell_id >>
iEta >> iPhi;) {
72 <<
"HGCalTriggerTowerGeometryHelper warning inconsistent mapping TC : " << trigger_cell_id
73 <<
" to TT iEta: " <<
iEta <<
" iPhi: " << iPhi <<
" when max #bins eta: " <<
nBinsEta_
79 l1tTriggerTowerMappingStream.close();
89 unsigned int bin_eta = 0;
98 <<
" did not manage to map eta " <<
eta <<
" to any Trigger Tower\n";
101 bin_eta = bin_eta_l -
binsEta_.begin() - 1;
105 unsigned int bin_phi = 0;
113 <<
" did not manage to map phi " <<
phi <<
" to any Trigger Tower\n";
116 bin_phi = bin_phi_l -
binsPhi_.begin() - 1;
123 unsigned int trigger_cell_id = thecell.
detId();
129 return tower_id_itr->second;