Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1Trigger_CSCTriggerPrimitives_GEMClusterProcessor_h
0002 #define L1Trigger_CSCTriggerPrimitives_GEMClusterProcessor_h
0003 
0004 /** \class GEMClusterProcessor
0005  *
0006  * \author Sven Dildick (Rice University)
0007  * \updates by Giovanni Mocellin (UC Davis)
0008  */
0009 
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "DataFormats/GEMDigi/interface/GEMPadDigiClusterCollection.h"
0012 #include "DataFormats/GEMDigi/interface/GEMCoPadDigi.h"
0013 #include "L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h"
0014 #include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h"
0015 #include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h"
0016 
0017 #include <vector>
0018 
0019 class GEMClusterProcessor {
0020 public:
0021   /** Normal constructor. */
0022   GEMClusterProcessor(int region, unsigned station, unsigned chamber, const edm::ParameterSet& conf);
0023 
0024   /** Clear copad vector */
0025   void clear();
0026 
0027   /** Runs the CoPad processor code. */
0028   void run(const GEMPadDigiClusterCollection*,
0029            const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0030            const CSCL1TPLookupTableME21ILT* lookupTableME21ILT);
0031 
0032   /* Returns clusters around deltaBX for a given BX
0033     The parameter option determines which clusters should be returned
0034     1: single and coincidence, 2: only coincidence, 3: only single
0035   */
0036   enum ClusterTypes { AllClusters = 1, SingleClusters = 2, CoincidenceClusters = 3 };
0037   std::vector<GEMInternalCluster> getClusters(int bx, ClusterTypes option = AllClusters) const;
0038 
0039   /** Returns vector of CoPads in the read-out time window, if any. */
0040   std::vector<GEMCoPadDigi> readoutCoPads() const;
0041 
0042   bool hasGE21Geometry16Partitions() const { return hasGE21Geometry16Partitions_; }
0043 
0044 private:
0045   // put coincidence clusters in GEMInternalCluster vector
0046   void addCoincidenceClusters(const GEMPadDigiClusterCollection*);
0047 
0048   // put single clusters in GEMInternalCluster vector who are not
0049   // part of any coincidence cluster
0050   void addSingleClusters(const GEMPadDigiClusterCollection*);
0051 
0052   // translate the cluster central pad numbers into 1/8-strip number,
0053   // and roll numbers into min and max wiregroup numbers
0054   // for matching with CSC trigger primitives
0055   void doCoordinateConversion(const CSCL1TPLookupTableME11ILT* lookupTableME11ILT,
0056                               const CSCL1TPLookupTableME21ILT* lookupTableME21ILT);
0057 
0058   // Chamber id (trigger-type labels)
0059   const int region_;
0060   const int station_;
0061   const int chamber_;
0062   bool isEven_;
0063 
0064   unsigned int tmbL1aWindowSize_;
0065   unsigned int delayGEMinOTMB_;
0066   unsigned int maxDeltaPad_;
0067   unsigned int maxDeltaBX_;
0068   unsigned int maxDeltaRoll_;
0069 
0070   bool hasGE21Geometry16Partitions_;
0071 
0072   // output collection
0073   std::vector<GEMInternalCluster> clusters_;
0074 };
0075 
0076 #endif