Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-22 22:47:08

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   void setESLookupTables(const CSCL1TPLookupTableME11ILT* conf);
0036   void setESLookupTables(const CSCL1TPLookupTableME21ILT* conf);
0037 
0038   // calculate the bending angle
0039   int calculateGEMCSCBending(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) 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) const;
0053 
0054   // matching candidate distance in 1/8 strip, always the total without extrapolation correction, if ForceTotal is true
0055   int matchedClusterDistES(const CSCCLCTDigi& clct,
0056                            const GEMInternalCluster& cluster,
0057                            const bool isLayer2,
0058                            const bool ForceTotal) const;
0059 
0060   // ALCT-CLCT-GEM
0061   void matchingClustersLoc(const CSCALCTDigi& alct,
0062                            const CSCCLCTDigi& clct,
0063                            const GEMInternalClusters& clusters,
0064                            GEMInternalClusters& output) const;
0065 
0066   // best matching clusters by location
0067 
0068   // ALCT-GEM
0069   void bestClusterLoc(const CSCALCTDigi& alct, const GEMInternalClusters& clusters, GEMInternalCluster& best) const;
0070 
0071   // CLCT-GEM
0072   void bestClusterLoc(const CSCCLCTDigi& clct, const GEMInternalClusters& clusters, GEMInternalCluster& best) const;
0073 
0074   // ALCT-CLCT-GEM
0075   void bestClusterLoc(const CSCALCTDigi& alct,
0076                       const CSCCLCTDigi& clct,
0077                       const GEMInternalClusters& clusters,
0078                       GEMInternalCluster& best) const;
0079 
0080 private:
0081   // access to lookup tables via eventsetup
0082   const CSCL1TPLookupTableME11ILT* lookupTableME11ILT_;
0083   const CSCL1TPLookupTableME21ILT* lookupTableME21ILT_;
0084 
0085   //mitigate slope by consistency of slope indicator, if necessary
0086   uint16_t mitigatedSlopeByConsistency(const CSCCLCTDigi& clct) const;
0087 
0088   // calculate slope correction
0089   int CSCGEMSlopeCorrector(const bool isME1a, const int cscSlope, bool isLayer2) const;
0090 
0091   unsigned endcap_;
0092   unsigned station_;
0093   unsigned ring_;
0094   unsigned chamber_;
0095   bool isEven_;
0096 
0097   // enable GEM-CSC matching in ME1a and ME1b
0098   bool enable_match_gem_me1a_;
0099   bool enable_match_gem_me1b_;
0100 
0101   // match GEM-CSC by propagating CLCT to GEM via LUT
0102   bool matchCLCTpropagation_;
0103 
0104   // Matching interval in Half Strips (less bits to deal with in FW), but then used as Eighth Strips (es=hs*4)
0105   unsigned maxDeltaWG_;
0106   unsigned maxDeltaHsEven_;
0107   unsigned maxDeltaHsOdd_;
0108 
0109   bool assign_gem_csc_bending_;
0110   bool mitigateSlopeByCosi_;
0111 };
0112 
0113 #endif