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 const float&
phi)
const {
95 return tower_id_itr->second;
97 auto bin_eta_l = std::lower_bound(
binsEta_.begin(),
binsEta_.end(), fabs(eta));
98 unsigned int bin_eta = 0;
103 }
else if (fabs(eta) >=
maxEta_) {
107 <<
" did not manage to map TC " << trigger_cell_id <<
" (eta: " << eta <<
") to any Trigger Tower\n";
110 bin_eta = bin_eta_l -
binsEta_.begin() - 1;
114 unsigned int bin_phi = 0;
122 <<
" did not manage to map TC " << trigger_cell_id <<
" (phi: " << phi <<
") to any Trigger Tower\n";
125 bin_phi = bin_phi_l -
binsPhi_.begin() - 1;
127 int zside = eta < 0 ? -1 : 1;
T getParameter(std::string const &) const
const std::vector< l1t::HGCalTowerCoord > & getTowerCoordinates() const
unsigned short getTriggerTowerFromTriggerCell(const unsigned tcId, const float &eta, const float &phi) const
HGCalTriggerTools triggerTools_
std::vector< double > binsPhi_
std::vector< l1t::HGCalTowerCoord > tower_coords_
std::vector< double > binsEta_
unsigned short rawId() const
std::string fullPath() const
std::unordered_map< unsigned, short > cells_to_trigger_towers_
HGCalTriggerTowerGeometryHelper(const edm::ParameterSet &conf)