Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-27 04:18:04

0001 #ifndef L1TMuonEndCap_PrimitiveConversion_h
0002 #define L1TMuonEndCap_PrimitiveConversion_h
0003 
0004 #include "L1Trigger/L1TMuonEndCap/interface/Common.h"
0005 
0006 class SectorProcessorLUT;
0007 
0008 class PrimitiveConversion {
0009 public:
0010   void configure(const GeometryTranslator* tp_geom,
0011                  const SectorProcessorLUT* pc_lut,
0012                  int verbose,
0013                  int endcap,
0014                  int sector,
0015                  int bx,
0016                  int bxShiftCSC,
0017                  int bxShiftRPC,
0018                  int bxShiftGEM,
0019                  int bxShiftME0,
0020                  const std::vector<int>& zoneBoundaries,
0021                  int zoneOverlap,
0022                  bool duplicateTheta,
0023                  bool fixZonePhi,
0024                  bool useNewZones,
0025                  bool fixME11Edges,
0026                  bool bugME11Dupes,
0027                  bool useRun3CCLUT_OTMB,
0028                  bool useRun3CCLUT_TMB);
0029 
0030   void process(const std::map<int, TriggerPrimitiveCollection>& selected_prim_map, EMTFHitCollection& conv_hits) const;
0031 
0032   const SectorProcessorLUT& pc_lut() const { return *pc_lut_; }
0033 
0034   // CSC functions
0035   void convert_csc(int pc_sector,
0036                    int pc_station,
0037                    int pc_chamber,
0038                    int pc_segment,
0039                    const TriggerPrimitive& muon_primitive,
0040                    EMTFHit& conv_hit) const;
0041 
0042   void convert_csc_details(EMTFHit& conv_hit) const;  // with specific firmware impl
0043 
0044   // RPC functions
0045   void convert_rpc(int pc_sector,
0046                    int pc_station,
0047                    int pc_chamber,
0048                    int pc_segment,
0049                    const TriggerPrimitive& muon_primitive,
0050                    EMTFHit& conv_hit) const;
0051 
0052   void convert_rpc_details(EMTFHit& conv_hit, bool isCPPF) const;  // with specific firmware impl
0053 
0054   // GEM functions
0055   void convert_gem(int pc_sector,
0056                    int pc_station,
0057                    int pc_chamber,
0058                    int pc_segment,
0059                    const TriggerPrimitive& muon_primitive,
0060                    EMTFHit& conv_hit) const;
0061 
0062   void convert_other_details(EMTFHit& conv_hit) const;  // no firmware impl
0063 
0064   // ME0 functions
0065   void convert_me0(int pc_sector,
0066                    int pc_station,
0067                    int pc_chamber,
0068                    int pc_segment,
0069                    const TriggerPrimitive& muon_primitive,
0070                    EMTFHit& conv_hit) const;
0071 
0072   // DT functions
0073   void convert_dt(int pc_sector,
0074                   int pc_station,
0075                   int pc_chamber,
0076                   int pc_segment,
0077                   const TriggerPrimitive& muon_primitive,
0078                   EMTFHit& conv_hit) const;
0079 
0080   // Aux functions
0081   int get_zone_code(const EMTFHit& conv_hit, int th) const;
0082 
0083   int get_phzvl(const EMTFHit& conv_hit, int zone_code) const;
0084 
0085   int get_fs_zone_code(const EMTFHit& conv_hit) const;
0086 
0087   int get_fs_segment(const EMTFHit& conv_hit, int fw_station, int fw_cscid, int pc_segment) const;
0088 
0089   int get_bt_station(const EMTFHit& conv_hit, int fw_station, int fw_cscid, int pc_segment) const;
0090 
0091   int get_bt_segment(const EMTFHit& conv_hit, int fw_station, int fw_cscid, int pc_segment) const;
0092 
0093   bool is_valid_for_run2(const EMTFHit& conv_hit) const;
0094 
0095 private:
0096   const GeometryTranslator* tp_geom_;
0097 
0098   const SectorProcessorLUT* pc_lut_;
0099 
0100   int verbose_, endcap_, sector_, bx_;
0101 
0102   int bxShiftCSC_, bxShiftRPC_, bxShiftGEM_, bxShiftME0_;
0103 
0104   std::vector<int> zoneBoundaries_;
0105   int zoneOverlap_;
0106   bool duplicateTheta_, fixZonePhi_, useNewZones_, fixME11Edges_;
0107   bool bugME11Dupes_;
0108   // Run 3 CCLUT algorithm
0109   bool useRun3CCLUT_OTMB_;
0110   bool useRun3CCLUT_TMB_;
0111 };
0112 
0113 #endif