Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:34

0001 #ifndef L1Trigger_CSCTriggerPrimitives_CSCGEMMatcher
0002 #define L1Trigger_CSCTriggerPrimitives_CSCGEMMatcher
0003 
0004 /** \class CSCGEMMatcher
0005  *
0006  * Helper class to check if an ALCT or CLCT matches with a GEMInternalCluster
0007  *
0008  * \author Sven Dildick (Rice University)
0009  * \updates by Giovanni Mocellin (UC Davis)
0010  *
0011  */
0012 
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h"
0016 #include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h"
0017 
0018 #include <string>
0019 #include <vector>
0020 
0021 class CSCALCTDigi;
0022 class CSCCLCTDigi;
0023 class GEMInternalCluster;
0024 
0025 class CSCGEMMatcher {
0026 public:
0027   typedef std::vector<GEMInternalCluster> GEMInternalClusters;
0028 
0029   CSCGEMMatcher(int endcap,
0030                 unsigned station,
0031                 unsigned chamber,
0032                 const edm::ParameterSet& tmbParams,
0033                 const edm::ParameterSet& luts);
0034 
0035   // calculate the bending angle
0036   int calculateGEMCSCBending(const CSCCLCTDigi& clct,
0037                              const GEMInternalCluster& cluster,
0038                              const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0039                              const CSCL1TPLookupTableME21ILT* lookupTableME21ILT) const;
0040 
0041   // match by location
0042 
0043   // ALCT-GEM
0044   void matchingClustersLoc(const CSCALCTDigi& alct,
0045                            const GEMInternalClusters& clusters,
0046                            GEMInternalClusters& output) const;
0047 
0048   // CLCT-GEM
0049   void matchingClustersLoc(const CSCCLCTDigi& clct,
0050                            const GEMInternalClusters& clusters,
0051                            GEMInternalClusters& output,
0052                            bool ignoreALCTGEMmatch,
0053                            const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0054                            const CSCL1TPLookupTableME21ILT* lookupTableME21ILT) const;
0055 
0056   // matching candidate distance in 1/8 strip, always the total without extrapolation correction, if ForceTotal is true
0057   int matchedClusterDistES(const CSCCLCTDigi& clct,
0058                            const GEMInternalCluster& cluster,
0059                            const bool isLayer2,
0060                            const bool ForceTotal,
0061                            const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0062                            const CSCL1TPLookupTableME21ILT* lookupTableME21ILT) const;
0063 
0064   // ALCT-CLCT-GEM
0065   void matchingClustersLoc(const CSCALCTDigi& alct,
0066                            const CSCCLCTDigi& clct,
0067                            const GEMInternalClusters& clusters,
0068                            const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0069                            const CSCL1TPLookupTableME21ILT* lookupTableME21ILT,
0070                            GEMInternalClusters& output) const;
0071 
0072   // best matching clusters by location
0073 
0074   // ALCT-GEM
0075   void bestClusterLoc(const CSCALCTDigi& alct, const GEMInternalClusters& clusters, GEMInternalCluster& best) const;
0076 
0077   // CLCT-GEM
0078   void bestClusterLoc(const CSCCLCTDigi& clct,
0079                       const GEMInternalClusters& clusters,
0080                       const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0081                       const CSCL1TPLookupTableME21ILT* lookupTableME21ILT,
0082                       GEMInternalCluster& best) const;
0083 
0084   // ALCT-CLCT-GEM
0085   void bestClusterLoc(const CSCALCTDigi& alct,
0086                       const CSCCLCTDigi& clct,
0087                       const GEMInternalClusters& clusters,
0088                       const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0089                       const CSCL1TPLookupTableME21ILT* lookupTableME21ILT,
0090                       GEMInternalCluster& best) const;
0091 
0092 private:
0093   //mitigate slope by consistency of slope indicator, if necessary
0094   uint16_t mitigatedSlopeByConsistency(const CSCCLCTDigi& clct,
0095                                        const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0096                                        const CSCL1TPLookupTableME21ILT* lookupTableME21ILT) const;
0097 
0098   // calculate slope correction
0099   int CSCGEMSlopeCorrector(const bool isME1a,
0100                            const int cscSlope,
0101                            bool isLayer2,
0102                            const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0103                            const CSCL1TPLookupTableME21ILT* lookupTableME21ILT) const;
0104 
0105   unsigned endcap_;
0106   unsigned station_;
0107   unsigned ring_;
0108   unsigned chamber_;
0109   bool isEven_;
0110 
0111   // enable GEM-CSC matching in ME1a and ME1b
0112   bool enable_match_gem_me1a_;
0113   bool enable_match_gem_me1b_;
0114 
0115   // match GEM-CSC by propagating CLCT to GEM via LUT
0116   bool matchCLCTpropagation_;
0117 
0118   // Matching interval in Half Strips (less bits to deal with in FW), but then used as Eighth Strips (es=hs*4)
0119   unsigned maxDeltaWG_;
0120   unsigned maxDeltaHsEven_;
0121   unsigned maxDeltaHsOdd_;
0122 
0123   bool assign_gem_csc_bending_;
0124   bool mitigateSlopeByCosi_;
0125 };
0126 
0127 #endif