Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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                     const edm::ParameterSet& 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   void run(const CSCWireDigiCollection* wiredc,
0042            const CSCComparatorDigiCollection* compdc,
0043            const GEMPadDigiClusterCollection* gemPads);
0044 
0045   /* GEM cluster processor */
0046   std::shared_ptr<GEMClusterProcessor> clusterProc() const { return clusterProc_; }
0047 
0048   // set CSC and GEM geometries for the matching needs
0049   void setGEMGeometry(const GEMGeometry* g) { gem_g = g; }
0050 
0051 private:
0052   /*
0053   Use ALCTs, CLCTs, GEMs to build LCTs. Matches in FW are attempted in the following order:
0054     1) ALCT-CLCT-2GEM (coincidence pad)
0055     2) ALCT-CLCT-GEM
0056     3) ALCT-CLCT (requires CLCT with at least 4 layers)
0057     4) CLCT-2GEM (requires CLCT with at least 4 layers)
0058     5) ALCT-2GEM (requires ALCT with at least 4 layers)
0059     => If there are second ALCTs/CLCTs which could not be matched to GEM:
0060     6) Copy over valid to invalid
0061     7) ALCT-CLCT with unused combination
0062   */
0063   void matchALCTCLCTGEM();
0064 
0065   // correlate ALCT, CLCT with matched pads or copads
0066   void correlateLCTsGEM(const CSCALCTDigi& ALCT,
0067                         const CSCCLCTDigi& CLCT,
0068                         const GEMInternalClusters& clusters,
0069                         CSCCorrelatedLCTDigi& lct) const;
0070 
0071   // correlate ALCT and CLCT, no GEM
0072   void correlateLCTsGEM(const CSCALCTDigi& ALCT, const CSCCLCTDigi& CLCT, CSCCorrelatedLCTDigi& lct) const;
0073 
0074   // correlate CLCT with matched pads or copads
0075   void correlateLCTsGEM(const CSCCLCTDigi& CLCT, const GEMInternalClusters& clusters, CSCCorrelatedLCTDigi& lct) const;
0076 
0077   // correlate ALCT with matched pads or copads
0078   void correlateLCTsGEM(const CSCALCTDigi& ALCT, const GEMInternalClusters& clusters, CSCCorrelatedLCTDigi& lct) const;
0079 
0080   // Construct LCT from CSC and GEM information. ALCT+CLCT+GEM
0081   void constructLCTsGEM(const CSCALCTDigi& alct,
0082                         const CSCCLCTDigi& clct,
0083                         const GEMInternalCluster& gem,
0084                         CSCCorrelatedLCTDigi& lct) const;
0085 
0086   // Construct LCT from CSC and no GEM information. ALCT+CLCT
0087   void constructLCTsGEM(const CSCALCTDigi& alct, const CSCCLCTDigi& clct, CSCCorrelatedLCTDigi& lct) const;
0088 
0089   // Construct LCT from CSC and GEM information. CLCT+2GEM
0090   void constructLCTsGEM(const CSCCLCTDigi& clct, const GEMInternalCluster& gem, CSCCorrelatedLCTDigi& lct) const;
0091 
0092   // Construct LCT from CSC and GEM information. ALCT+2GEM
0093   void constructLCTsGEM(const CSCALCTDigi& alct, const GEMInternalCluster& gem, CSCCorrelatedLCTDigi& lct) const;
0094 
0095   // LCTs are sorted by quality. If there are two with the same quality,
0096   // then the sorting is done by the slope
0097   void sortLCTs(std::vector<CSCCorrelatedLCTDigi>& lcts) const;
0098 
0099   /** Chamber id (trigger-type labels). */
0100   unsigned gemId;
0101   const GEMGeometry* gem_g;
0102 
0103   // map of BX to vectors of GEM clusters. Makes it easier to match objects
0104   std::map<int, GEMInternalClusters> clusters_;
0105 
0106   /* CSCGEM matcher */
0107   std::unique_ptr<CSCGEMMatcher> cscGEMMatcher_;
0108 
0109   /* GEM cluster processor */
0110   std::shared_ptr<GEMClusterProcessor> clusterProc_;
0111 
0112   // Drop low quality stubs in ME1/b or ME2/1
0113   bool drop_low_quality_alct_;
0114   bool drop_low_quality_clct_;
0115   // Drop low quality stubs in ME1/a
0116   bool drop_low_quality_clct_me1a_;
0117 
0118   // build LCT from ALCT/CLCT and GEM in ME1/b or ME2/1
0119   bool build_lct_from_alct_gem_;
0120   bool build_lct_from_clct_gem_;
0121 
0122   // bunch crossing window cuts
0123   unsigned alct_gem_bx_window_size_;
0124   unsigned clct_gem_bx_window_size_;
0125 
0126   // assign GEM-CSC bending angle
0127   bool assign_gem_csc_bending_;
0128 
0129   // The GE2/1 geometry should have 16 eta partitions
0130   // The 8-eta partition case (older prototype versions) is not supported
0131   bool hasGE21Geometry16Partitions_;
0132 };
0133 
0134 #endif