Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-08 22:26:30

0001 #ifndef __L1Trigger_L1THGCal_HGCalTriggerTowerGeometryHelper_h__
0002 #define __L1Trigger_L1THGCal_HGCalTriggerTowerGeometryHelper_h__
0003 
0004 /** \class HGCalTriggerTowerGeometryHelper
0005  *  Handles the mapping between TCs and TTs.
0006  *  The mapping can be provided externally (via a mapping file)
0007  *  or can be derived on the fly based on the TC eta-phi coordinates.
0008  *  The bin boundaries need anyhow to be provided to establish the eta-phi coordinates
0009  *  of the towers (assumed as the Tower Center for the moment)
0010  */
0011 
0012 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "DataFormats/L1THGCal/interface/HGCalTowerID.h"
0015 #include "L1Trigger/L1THGCal/interface/HGCalTriggerTools.h"
0016 #include "DataFormats/L1THGCal/interface/HGCalTriggerCell.h"
0017 #include "DataFormats/L1THGCal/interface/HGCalTriggerSums.h"
0018 
0019 #include <vector>
0020 #include <unordered_map>
0021 
0022 namespace l1t {
0023   class HGCalTowerID;
0024   struct HGCalTowerCoord;
0025 }  // namespace l1t
0026 
0027 class HGCalTriggerTowerGeometryHelper {
0028 public:
0029   HGCalTriggerTowerGeometryHelper(const edm::ParameterSet& conf);
0030 
0031   ~HGCalTriggerTowerGeometryHelper() {}
0032 
0033   void setGeometry(const HGCalTriggerGeometryBase* const geom) { triggerTools_.setGeometry(geom); }
0034 
0035   const std::vector<l1t::HGCalTowerCoord>& getTowerCoordinates() const;
0036 
0037   unsigned short getTriggerTowerFromEtaPhi(const float& eta, const float& phi) const;
0038   unsigned short getTriggerTower(const l1t::HGCalTriggerCell&) const;
0039   unsigned short getTriggerTower(const l1t::HGCalTriggerSums&) const;
0040 
0041   const bool isNose() { return doNose_; }
0042 
0043 private:
0044   std::vector<l1t::HGCalTowerCoord> tower_coords_;
0045   std::unordered_map<unsigned, short> cells_to_trigger_towers_;
0046 
0047   bool doNose_;
0048   double minEta_;
0049   double maxEta_;
0050   double minPhi_;
0051   double maxPhi_;
0052   unsigned int nBinsEta_;
0053   unsigned int nBinsPhi_;
0054 
0055   std::vector<double> binsEta_;
0056   std::vector<double> binsPhi_;
0057 
0058   HGCalTriggerTools triggerTools_;
0059 };
0060 
0061 #endif