Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef __L1Trigger_L1THGCal_HGCalCoarseTriggerCellMapping_h__
0002 #define __L1Trigger_L1THGCal_HGCalCoarseTriggerCellMapping_h__
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "DataFormats/L1THGCal/interface/HGCalTriggerCell.h"
0006 #include "DataFormats/ForwardDetId/interface/HGCSiliconDetIdToROC.h"
0007 #include "L1Trigger/L1THGCal/interface/HGCalTriggerTools.h"
0008 
0009 class HGCalCoarseTriggerCellMapping {
0010 public:
0011   HGCalCoarseTriggerCellMapping(const std::vector<unsigned>& ctcSize);
0012   uint32_t getRepresentativeDetId(uint32_t tcid) const;
0013   std::vector<uint32_t> getConstituentTriggerCells(uint32_t ctcId) const;
0014   GlobalPoint getCoarseTriggerCellPosition(uint32_t ctcId) const;
0015   uint32_t getCoarseTriggerCellId(uint32_t detid) const;
0016   void checkSizeValidity(int ctcSize) const;
0017   void setGeometry(const HGCalTriggerGeometryBase* const geom) { triggerTools_.setGeometry(geom); }
0018 
0019   static constexpr int kCTCsizeCoarse_ = 16;
0020   static constexpr int kCTCsizeMid_ = 8;
0021   static constexpr int kCTCsizeFine_ = 4;
0022   static constexpr int kCTCsizeVeryFine_ = 2;
0023   static constexpr int kCTCsizeIndividual_ = 1;
0024 
0025 private:
0026   static const std::map<int, int> kSplit_;
0027   static const std::map<int, int> kSplit_Scin_;
0028   static constexpr int kSTCidMaskInv_ = ~0xf;
0029   static constexpr int kNThicknesses_ = 4;
0030   static constexpr int kNHGCalLayersMax_ = 52;
0031 
0032   static constexpr int kSplit_Coarse_ = 0;
0033   static constexpr int kSplit_Mid_ = 0x2;
0034   static constexpr int kSplit_Fine_ = 0xa;
0035   static constexpr int kSplit_VeryFine_ = 0xb;
0036   static constexpr int kSplit_Individual_ = 0xf;
0037 
0038   static constexpr int kSplit_Scin_Coarse_ = 0x1f9fc;
0039   static constexpr int kSplit_Scin_Mid_ = 0x1fdfc;
0040   static constexpr int kSplit_Scin_Fine_ = 0x1fdfe;
0041   static constexpr int kSplit_Scin_VeryFine_ = 0x1fffe;
0042   static constexpr int kSplit_Scin_Individual_ = 0x1ffff;
0043 
0044   //For coarse TCs
0045   static constexpr int kRocShift_ = 4;
0046   static constexpr int kRocMask_ = 0xf;
0047   static constexpr int kRotate4_ = 4;
0048   static constexpr int kRotate7_ = 7;
0049   static constexpr int kUShift_ = 2;
0050   static constexpr int kVShift_ = 0;
0051   static constexpr int kUMask_ = 0x3;
0052   static constexpr int kVMask_ = 0x3;
0053   static constexpr int kHGCalCellMaskInv_ = ~0xff;
0054   static constexpr int kHGCalScinCellMaskInv_ = ~0x1ffff;
0055 
0056   static constexpr int kRoc0deg_ = 1;
0057   static constexpr int kRoc120deg_ = 2;
0058   static constexpr int kRoc240deg_ = 3;
0059 
0060   HGCalTriggerTools triggerTools_;
0061   HGCSiliconDetIdToROC detIdToROC_;
0062   std::vector<unsigned> ctcSize_;
0063 };
0064 
0065 #endif