CMS 3D CMS Logo

CSCMotherboardME21GEM.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCMotherboardME21GEM_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCMotherboardME21GEM_h
3 
18 
19 class CSCGeometry;
20 class CSCChamber;
21 class GEMGeometry;
22 class GEMSuperChamber;
23 
25 {
26  typedef std::pair<unsigned int, GEMPadDigi> GEMPadBX;
27  typedef std::vector<GEMPadBX> GEMPadsBX;
28  typedef std::map<int, GEMPadsBX> GEMPads;
29 
30  public:
32  CSCMotherboardME21GEM(unsigned endcap, unsigned station, unsigned sector,
33  unsigned subsector, unsigned chamber,
34  const edm::ParameterSet& conf);
35 
37  ~CSCMotherboardME21GEM() override;
38 
39  void clear();
40 
43  void run(const CSCWireDigiCollection* wiredc,
44  const CSCComparatorDigiCollection* compdc,
45  const GEMPadDigiCollection* gemPads);
46 
48  void setCSCGeometry(const CSCGeometry *g) { csc_g = g; }
49  void setGEMGeometry(const GEMGeometry *g) { gem_g = g; }
50 
51  void retrieveGEMPads(const GEMPadDigiCollection* pads, unsigned id);
52  void retrieveGEMCoPads();
53 
54  std::map<int,std::pair<double,double> > createGEMRollEtaLUT();
55 
56  int assignGEMRoll(double eta);
57  int deltaRoll(int wg, int roll);
58  int deltaPad(int hs, int pad);
59 
60  void printGEMTriggerPads(int minBX, int maxBx, bool iscopad = false);
61 
62  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const GEMPadsBX& pads = GEMPadsBX(),
63  bool isCopad = false, bool first = true);
64  GEMPadsBX matchingGEMPads(const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
65  bool isCopad = false, bool first = true);
66  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
67  bool isCopad = false, bool first = true);
68  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const CSCCLCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
69  bool isCopad = false);
70  GEMPadsBX matchingGEMPads(const CSCALCTDigi& cLCT, const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
71  bool isCopad = false);
72  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const CSCCLCTDigi&,
73  const CSCALCTDigi& aLCT, const CSCALCTDigi&,
74  const GEMPadsBX& pads = GEMPadsBX(),
75  bool isCopad = false, bool first = true);
76 
77  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT,
78  bool hasPad, bool hasCoPad);
79 
80  void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
81  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
83  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
84 
85  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
86  GEMPadDigi gemPad,
88 
89  void correlateLCTsGEM(CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
90  GEMPadDigi gemPad, int roll,
92 
93  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
94  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
96  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
97 
99  bool oldDataFormat = false);
100  CSCCorrelatedLCTDigi constructLCTsGEM(const CSCCLCTDigi& clct, const GEMPadDigi& gem, int roll,
101  bool oldDataFormat = true);
103  bool hasPad, bool hasCoPad);
104 
106  std::unique_ptr<GEMCoPadProcessor> coPadProcessor;
107 
109  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(int bx);
110  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(std::vector<CSCCorrelatedLCTDigi>);
111  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(int bx);
112  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(std::vector<CSCCorrelatedLCTDigi>);
113 
114  std::vector<CSCCorrelatedLCTDigi> getLCTs();
115  std::vector<CSCCorrelatedLCTDigi> readoutLCTs();
116  std::vector<GEMCoPadDigi> readoutCoPads();
117 
118  private:
119 
123 
124  static const double lut_pt_vs_dphi_gemcsc[8][3];
125  static const double lut_wg_eta_odd[112][2];
126  static const double lut_wg_eta_even[112][2];
127 
130 
131 
132  std::vector<CSCALCTDigi> alctV;
133  std::vector<CSCCLCTDigi> clctV;
134  std::vector<GEMCoPadDigi> gemCoPadV;
135 
138 
140 
144 
145  unsigned int tmb_cross_bx_algo;
146 
148  unsigned int max_me21_lcts;
149 
150  // masterswitch
152 
153  // debug gem matching
156 
157  // deltas used to match to GEM pads
162 
163  // deltas used to match to GEM coincidence pads
168 
170 
171  // drop low quality stubs if they don't have GEMs
174 
175  // correct LCT timing with GEMs
177 
178  // build LCT from ALCT and GEM
181 
183 
184  // promote ALCT-GEM pattern
186 
187  // promote ALCT-GEM quality
190 
191  std::map<int,std::pair<double,double> > gemRollToEtaLimits_;
192  std::map<int,int> cscWgToGemRoll_;
193 
194  // map of pad to HS
195  std::map<int,int> gemPadToCscHs_;
196  std::map<int,std::pair<int,int>> cscHsToGemPad_;
197 
198  // map< bx , vector<gemid, pad> >
199  GEMPads pads_;
200  GEMPads coPads_;
201 };
202 #endif
std::vector< GEMCoPadDigi > readoutCoPads()
int deltaRoll(int wg, int roll)
std::vector< CSCCorrelatedLCTDigi > getLCTs()
GEMPadsBX matchingGEMPads(const CSCCLCTDigi &cLCT, const GEMPadsBX &pads=GEMPadsBX(), bool isCopad=false, bool first=true)
unsigned int findQualityGEM(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, bool hasPad, bool hasCoPad)
std::map< int, GEMPadsBX > GEMPads
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
std::map< int, std::pair< double, double > > gemRollToEtaLimits_
const CSCGeometry * csc_g
std::vector< CSCCLCTDigi > clctV
std::vector< CSCCorrelatedLCTDigi > sortLCTsByQuality(int bx)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
int deltaPad(int hs, int pad)
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
static const double lut_wg_eta_odd[112][2]
void setCSCGeometry(const CSCGeometry *g)
set CSC and GEM geometries for the matching needs
std::pair< unsigned int, GEMPadDigi > GEMPadBX
std::vector< GEMPadBX > GEMPadsBX
void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, const GEMPadsBX &pads=GEMPadsBX(), const GEMPadsBX &copads=GEMPadsBX())
std::map< int, std::pair< double, double > > createGEMRollEtaLUT()
static const double lut_pt_vs_dphi_gemcsc[8][3]
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)
std::map< int, std::pair< int, int > > cscHsToGemPad_
std::map< int, int > gemPadToCscHs_
CSCCorrelatedLCTDigi allLCTs[MAX_LCT_BINS][15][2]
const GEMGeometry * gem_g
std::vector< GEMCoPadDigi > gemCoPadV
std::unique_ptr< CSCAnodeLCTProcessor > alct
void printGEMTriggerPads(int minBX, int maxBx, bool iscopad=false)
std::vector< CSCALCTDigi > alctV
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMPadDigi &gem, bool oldDataFormat=false)
std::vector< CSCCorrelatedLCTDigi > sortLCTsByGEMDPhi(int bx)
std::unique_ptr< CSCCathodeLCTProcessor > clct
std::vector< CSCCorrelatedLCTDigi > readoutLCTs()
void setGEMGeometry(const GEMGeometry *g)
CSCMotherboardME21GEM(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, GEMPadDigi gemPad, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2)
std::map< int, int > cscWgToGemRoll_
static const double lut_wg_eta_even[112][2]