Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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 
0030   /* Returns clusters around deltaBX for a given BX
0031     The parameter option determines which clusters should be returned
0032     1: single and coincidence, 2: only coincidence, 3: only single
0033   */
0034   enum ClusterTypes { AllClusters = 1, SingleClusters = 2, CoincidenceClusters = 3 };
0035   std::vector<GEMInternalCluster> getClusters(int bx, ClusterTypes option = AllClusters) const;
0036 
0037   /** Returns vector of CoPads in the read-out time window, if any. */
0038   std::vector<GEMCoPadDigi> readoutCoPads() const;
0039 
0040   bool hasGE21Geometry16Partitions() const { return hasGE21Geometry16Partitions_; }
0041 
0042   void setESLookupTables(const CSCL1TPLookupTableME11ILT* conf);
0043 
0044   void setESLookupTables(const CSCL1TPLookupTableME21ILT* conf);
0045 
0046 private:
0047   // put coincidence clusters in GEMInternalCluster vector
0048   void addCoincidenceClusters(const GEMPadDigiClusterCollection*);
0049 
0050   // put single clusters in GEMInternalCluster vector who are not
0051   // part of any coincidence cluster
0052   void addSingleClusters(const GEMPadDigiClusterCollection*);
0053 
0054   // translate the cluster central pad numbers into 1/8-strip number,
0055   // and roll numbers into min and max wiregroup numbers
0056   // for matching with CSC trigger primitives
0057   void doCoordinateConversion();
0058 
0059   // Chamber id (trigger-type labels)
0060   const int region_;
0061   const int station_;
0062   const int chamber_;
0063   bool isEven_;
0064 
0065   unsigned int tmbL1aWindowSize_;
0066   unsigned int delayGEMinOTMB_;
0067   unsigned int maxDeltaPad_;
0068   unsigned int maxDeltaBX_;
0069   unsigned int maxDeltaRoll_;
0070 
0071   bool hasGE21Geometry16Partitions_;
0072 
0073   // output collection
0074   std::vector<GEMInternalCluster> clusters_;
0075 
0076   const CSCL1TPLookupTableME11ILT* lookupTableME11ILT_;
0077   const CSCL1TPLookupTableME21ILT* lookupTableME21ILT_;
0078 };
0079 
0080 #endif