14 : doNose_(conf.getParameter<bool>(
"doNose")),
15 minEta_(conf.getParameter<double>(
"minEta")),
16 maxEta_(conf.getParameter<double>(
"maxEta")),
17 minPhi_(conf.getParameter<double>(
"minPhi")),
18 maxPhi_(conf.getParameter<double>(
"maxPhi")),
19 nBinsEta_(conf.getParameter<int>(
"nBinsEta")),
20 nBinsPhi_(conf.getParameter<int>(
"nBinsPhi")),
21 binsEta_(conf.getParameter<std::
vector<double> >(
"binsEta")),
22 binsPhi_(conf.getParameter<std::
vector<double> >(
"binsPhi")) {
25 <<
"HGCalTriggerTowerGeometryHelper nBinsEta for the tower map not consistent with binsEta size" << std::endl;
30 <<
"HGCalTriggerTowerGeometryHelper nBinsPhi for the tower map not consistent with binsPhi size" << std::endl;
35 for (
unsigned int bin1 = 0; bin1 !=
nBinsEta_ + 1; bin1++) {
42 for (
unsigned int bin2 = 0; bin2 !=
nBinsPhi_ + 1; bin2++) {
48 for (
unsigned int bin1 = 0; bin1 !=
nBinsEta_; bin1++) {
49 for (
unsigned int bin2 = 0; bin2 !=
nBinsPhi_; bin2++) {
62 if (!l1tTriggerTowerMappingStream.is_open()) {
63 throw cms::Exception(
"MissingDataFile") <<
"Cannot open HGCalTriggerGeometry L1TTriggerTowerMapping file\n";
66 unsigned trigger_cell_id = 0;
67 unsigned short iEta = 0;
68 unsigned short iPhi = 0;
70 for (; l1tTriggerTowerMappingStream >> trigger_cell_id >> iEta >> iPhi;) {
73 <<
"HGCalTriggerTowerGeometryHelper warning inconsistent mapping TC : " << trigger_cell_id
74 <<
" to TT iEta: " << iEta <<
" iPhi: " << iPhi <<
" when max #bins eta: " <<
nBinsEta_
80 l1tTriggerTowerMappingStream.close();
90 unsigned int bin_eta = 0;
95 }
else if (fabs(eta) >=
maxEta_) {
99 <<
" did not manage to map eta " << eta <<
" to any Trigger Tower\n";
102 bin_eta = bin_eta_l -
binsEta_.begin() - 1;
106 unsigned int bin_phi = 0;
114 <<
" did not manage to map phi " << phi <<
" to any Trigger Tower\n";
117 bin_phi = bin_phi_l -
binsPhi_.begin() - 1;
119 int zside = eta < 0 ? -1 : 1;
124 unsigned int trigger_cell_id = thecell.
detId();
130 return tower_id_itr->second;
unsigned short getTriggerTower(const l1t::HGCalTriggerCell &) const
Geom::Phi< T > phi() const
Log< level::Error, false > LogError
const std::vector< l1t::HGCalTowerCoord > & getTowerCoordinates() const
const GlobalPoint & position() const
HGCalTriggerTools triggerTools_
std::vector< double > binsPhi_
const GlobalPoint & position() const
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
unsigned short getTriggerTowerFromEtaPhi(const float &eta, const float &phi) const
std::vector< l1t::HGCalTowerCoord > tower_coords_
std::vector< double > binsEta_
unsigned short rawId() const
T getParameter(std::string const &) const
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::string fullPath() const
std::unordered_map< unsigned, short > cells_to_trigger_towers_
HGCalTriggerTowerGeometryHelper(const edm::ParameterSet &conf)