Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h
0002 #define L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h
0003 
0004 /** \class CSCGEMMotherboard
0005  *
0006  * Class for TMBs for the GEM-CSC integrated local trigger. Inherits
0007  * from CSCMotherboard. Provides functionality to match
0008  * ALCT/CLCT to GEM single clusters or coincidences of clusters
0009  *
0010  * \author Sven Dildick (Rice University)
0011  * \updates by Giovanni Mocellin (UC Davis)
0012  *
0013  */
0014 
0015 #include "L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h"
0016 #include "L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h"
0017 #include "L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h"
0018 #include "L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h"
0019 #include "Geometry/GEMGeometry/interface/GEMGeometry.h"
0020 
0021 class CSCGEMMotherboard : public CSCMotherboard {
0022 public:
0023   typedef std::vector<GEMInternalCluster> GEMInternalClusters;
0024 
0025   // standard constructor
0026   CSCGEMMotherboard(unsigned endcap,
0027                     unsigned station,
0028                     unsigned sector,
0029                     unsigned subsector,
0030                     unsigned chamber,
0031                     CSCBaseboard::Parameters& conf);
0032 
0033   ~CSCGEMMotherboard() override;
0034 
0035   // clear stored pads and copads
0036   void clear();
0037 
0038   //helper function to convert GEM-CSC amended slopes into Run2 patterns
0039   uint16_t Run2PatternConverter(const int slope) const;
0040 
0041   struct RunContext {
0042     // set CSC and GEM geometries for the matching needs
0043     const GEMGeometry* gemGeometry_;
0044     const CSCGeometry* cscGeometry_;
0045     // access to lookup tables via eventsetup
0046     const CSCL1TPLookupTableCCLUT* lookupTableCCLUT_;
0047     const CSCL1TPLookupTableME11ILT* lookupTableME11ILT_;
0048     const CSCL1TPLookupTableME21ILT* lookupTableME21ILT_;
0049     const CSCDBL1TPParameters* parameters_;
0050   };
0051 
0052   void run(const CSCWireDigiCollection* wiredc,
0053            const CSCComparatorDigiCollection* compdc,
0054            const GEMPadDigiClusterCollection* gemPads,
0055            RunContext const&);
0056 
0057   /* GEM cluster processor */
0058   std::shared_ptr<GEMClusterProcessor> clusterProc() const { return clusterProc_; }
0059 
0060 private:
0061   /*
0062   Use ALCTs, CLCTs, GEMs to build LCTs. Matches in FW are attempted in the following order:
0063     1) ALCT-CLCT-2GEM (coincidence pad)
0064     2) ALCT-CLCT-GEM
0065     3) ALCT-CLCT (requires CLCT with at least 4 layers)
0066     4) CLCT-2GEM (requires CLCT with at least 4 layers)
0067     5) ALCT-2GEM (requires ALCT with at least 4 layers)
0068     => If there are second ALCTs/CLCTs which could not be matched to GEM:
0069     6) Copy over valid to invalid
0070     7) ALCT-CLCT with unused combination
0071   */
0072   void matchALCTCLCTGEM(const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0073                         const CSCL1TPLookupTableME21ILT* lookupTableME21ILT);
0074 
0075   // correlate ALCT, CLCT with matched pads or copads
0076   void correlateLCTsGEM(const CSCALCTDigi& ALCT,
0077                         const CSCCLCTDigi& CLCT,
0078                         const GEMInternalClusters& clusters,
0079                         const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0080                         const CSCL1TPLookupTableME21ILT* lookupTableME21ILT,
0081                         CSCCorrelatedLCTDigi& lct) const;
0082 
0083   // correlate ALCT and CLCT, no GEM
0084   void correlateLCTsGEM(const CSCALCTDigi& ALCT, const CSCCLCTDigi& CLCT, CSCCorrelatedLCTDigi& lct) const;
0085 
0086   // correlate CLCT with matched pads or copads
0087   void correlateLCTsGEM(const CSCCLCTDigi& CLCT,
0088                         const GEMInternalClusters& clusters,
0089                         const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0090                         const CSCL1TPLookupTableME21ILT* lookupTableME21ILT,
0091                         CSCCorrelatedLCTDigi& lct) const;
0092 
0093   // correlate ALCT with matched pads or copads
0094   void correlateLCTsGEM(const CSCALCTDigi& ALCT, const GEMInternalClusters& clusters, CSCCorrelatedLCTDigi& lct) const;
0095 
0096   // Construct LCT from CSC and GEM information. ALCT+CLCT+GEM
0097   void constructLCTsGEM(const CSCALCTDigi& alct,
0098                         const CSCCLCTDigi& clct,
0099                         const GEMInternalCluster& gem,
0100                         const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0101                         const CSCL1TPLookupTableME21ILT* lookupTableME21ILT,
0102                         CSCCorrelatedLCTDigi& lct) const;
0103 
0104   // Construct LCT from CSC and no GEM information. ALCT+CLCT
0105   void constructLCTsGEM(const CSCALCTDigi& alct, const CSCCLCTDigi& clct, CSCCorrelatedLCTDigi& lct) const;
0106 
0107   // Construct LCT from CSC and GEM information. CLCT+2GEM
0108   void constructLCTsGEM(const CSCCLCTDigi& clct,
0109                         const GEMInternalCluster& gem,
0110                         const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0111                         const CSCL1TPLookupTableME21ILT* lookupTableME21ILT,
0112                         CSCCorrelatedLCTDigi& lct) const;
0113 
0114   // Construct LCT from CSC and GEM information. ALCT+2GEM
0115   void constructLCTsGEM(const CSCALCTDigi& alct, const GEMInternalCluster& gem, CSCCorrelatedLCTDigi& lct) const;
0116 
0117   // LCTs are sorted by quality. If there are two with the same quality,
0118   // then the sorting is done by the slope
0119   void sortLCTs(std::vector<CSCCorrelatedLCTDigi>& lcts) const;
0120 
0121   /** Chamber id (trigger-type labels). */
0122   unsigned gemId;
0123 
0124   // map of BX to vectors of GEM clusters. Makes it easier to match objects
0125   std::map<int, GEMInternalClusters> clusters_;
0126 
0127   /* CSCGEM matcher */
0128   std::unique_ptr<CSCGEMMatcher> cscGEMMatcher_;
0129 
0130   /* GEM cluster processor */
0131   std::shared_ptr<GEMClusterProcessor> clusterProc_;
0132 
0133   // Drop low quality stubs in ME1/b or ME2/1
0134   bool drop_low_quality_alct_;
0135   bool drop_low_quality_clct_;
0136   // Drop low quality stubs in ME1/a
0137   bool drop_low_quality_clct_me1a_;
0138 
0139   // build LCT from ALCT/CLCT and GEM in ME1/b or ME2/1
0140   bool build_lct_from_alct_gem_;
0141   bool build_lct_from_clct_gem_;
0142 
0143   // bunch crossing window cuts
0144   unsigned alct_gem_bx_window_size_;
0145   unsigned clct_gem_bx_window_size_;
0146 
0147   // assign GEM-CSC bending angle
0148   bool assign_gem_csc_bending_;
0149 
0150   // The GE2/1 geometry should have 16 eta partitions
0151   // The 8-eta partition case (older prototype versions) is not supported
0152   bool hasGE21Geometry16Partitions_;
0153 };
0154 
0155 #endif