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++) {
49 for(
unsigned int bin1 = 0; bin1 !=
nBinsEta_; bin1++) {
50 for(
unsigned int bin2 = 0; bin2 !=
nBinsPhi_; bin2++) {
63 if(!l1tTriggerTowerMappingStream.is_open()) {
65 <<
"Cannot open HGCalTriggerGeometry L1TTriggerTowerMapping file\n";
68 unsigned trigger_cell_id = 0;
69 unsigned short iEta = 0;
70 unsigned short iPhi = 0;
72 for(; l1tTriggerTowerMappingStream >> trigger_cell_id >> iEta >> iPhi;) {
75 <<
"HGCalTriggerTowerGeometryHelper warning inconsistent mapping TC : " << trigger_cell_id
76 <<
" to TT iEta: " << iEta <<
" iPhi: " << iPhi
82 l1tTriggerTowerMappingStream.close();
100 auto bin_eta_l = std::lower_bound(
binsEta_.begin(),
binsEta_.end(), fabs(eta));
101 unsigned int bin_eta = 0;
106 }
else if(fabs(eta) >=
maxEta_) {
109 edm::LogError(
"HGCalTriggerTowerGeometryHelper") <<
" did not manage to map TC " << trigger_cell_id <<
" (eta: " << eta <<
") to any Trigger Tower\n";
112 bin_eta = bin_eta_l -
binsEta_.begin();
117 unsigned int bin_phi = 0;
124 edm::LogError(
"HGCalTriggerTowerGeometryHelper") <<
" did not manage to map TC " << trigger_cell_id <<
" (phi: " << phi <<
") to any Trigger Tower\n";
127 bin_phi = bin_phi_l -
binsPhi_.begin();
129 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)