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")) {
26 <<
"HGCalTriggerTowerGeometryHelper nBinsEta for the tower map not consistent with binsEta size"<<std::endl;
31 <<
"HGCalTriggerTowerGeometryHelper nBinsPhi for the tower map not consistent with binsPhi size"<<std::endl;
36 for(
unsigned int bin1 = 0; bin1 !=
nBinsEta_+1; bin1++) {
43 for(
unsigned int bin2 = 0; bin2 !=
nBinsPhi_+1; bin2++) {
50 for(
unsigned int bin1 = 0; bin1 !=
nBinsEta_; bin1++) {
51 for(
unsigned int bin2 = 0; bin2 !=
nBinsPhi_; bin2++) {
64 if(!l1tTriggerTowerMappingStream.is_open()) {
66 <<
"Cannot open HGCalTriggerGeometry L1TTriggerTowerMapping file\n";
69 unsigned trigger_cell_id = 0;
70 unsigned short iEta = 0;
71 unsigned short iPhi = 0;
73 for(; l1tTriggerTowerMappingStream >> trigger_cell_id >> iEta >> iPhi;) {
76 <<
"HGCalTriggerTowerGeometryHelper warning inconsistent mapping TC : " << trigger_cell_id
77 <<
" to TT iEta: " << iEta <<
" iPhi: " << iPhi
83 l1tTriggerTowerMappingStream.close();
101 auto bin_eta_l = std::lower_bound(
binsEta_.begin(),
binsEta_.end(), fabs(eta));
102 unsigned int bin_eta = 0;
107 }
else if(fabs(eta) >=
maxEta_) {
110 edm::LogError(
"HGCalTriggerTowerGeometryHelper") <<
" did not manage to map TC " << trigger_cell_id <<
" (eta: " << eta <<
") to any Trigger Tower\n";
113 bin_eta = bin_eta_l -
binsEta_.begin() - 1;
118 unsigned int bin_phi = 0;
125 edm::LogError(
"HGCalTriggerTowerGeometryHelper") <<
" did not manage to map TC " << trigger_cell_id <<
" (phi: " << phi <<
") to any Trigger Tower\n";
128 bin_phi = bin_phi_l -
binsPhi_.begin() - 1;
130 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
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)