CMS 3D CMS Logo

CSCMotherboardME11GEM.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCMotherboardME11GEM_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCMotherboardME11GEM_h
3 
18 
19 class CSCGeometry;
20 class CSCChamber;
21 class GEMGeometry;
22 class GEMSuperChamber;
23 
25 {
26  typedef std::pair<unsigned int, const GEMPadDigi> GEMPadBX;
27  typedef std::vector<GEMPadBX> GEMPadsBX;
28  typedef std::map<int, GEMPadsBX> GEMPads;
29 
30  public:
32  CSCMotherboardME11GEM(unsigned endcap, unsigned station, unsigned sector,
33  unsigned subsector, unsigned chamber,
34  const edm::ParameterSet& conf);
35 
38 
41 
44  void run(const CSCWireDigiCollection* wiredc,
45  const CSCComparatorDigiCollection* compdc,
46  const GEMPadDigiCollection* gemPads);
47 
49  std::vector<CSCCorrelatedLCTDigi> getLCTs1a();
50  std::vector<CSCCorrelatedLCTDigi> getLCTs1b();
51 
53  enum ME11Part {ME1B = 1, ME1A=4};
54 
56  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(int bx, enum ME11Part = ME1B);
57  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(enum ME11Part = ME1B);
58  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(std::vector<CSCCorrelatedLCTDigi>);
59  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(int bx, enum ME11Part = ME1B);
60  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(enum ME11Part = ME1B);
61  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(std::vector<CSCCorrelatedLCTDigi>);
62 
64  std::vector<CSCALCTDigi> getALCTs1b() {return alctV;}
65 
67  std::vector<CSCCLCTDigi> getCLCTs1a() {return clctV1a;}
68  std::vector<CSCCLCTDigi> getCLCTs1b() {return clctV1b;}
69 
72  void clear();
73 
75  void setConfigParameters(const CSCDBL1TPParameters* conf);
76 
78  std::unique_ptr<CSCCathodeLCTProcessor> clct1a;
79 
80  std::vector<CSCCorrelatedLCTDigi> readoutLCTs1a();
81  std::vector<CSCCorrelatedLCTDigi> readoutLCTs1b();
82  std::vector<CSCCorrelatedLCTDigi> readoutLCTs(enum ME11Part me1ab);
83  std::vector<GEMCoPadDigi> readoutCoPads();
84 
86  std::unique_ptr<GEMCoPadProcessor> coPadProcessor;
87 
89  void setCSCGeometry(const CSCGeometry *g) { csc_g = g; }
90  void setGEMGeometry(const GEMGeometry *g) { gem_g = g; }
91 
92  private:
93 
94  static const int lut_wg_vs_hs_me1b[48][2];
95  static const int lut_wg_vs_hs_me1a[48][2];
96  static const int lut_wg_vs_hs_me1ag[48][2];
97  static const double lut_pt_vs_dphi_gemcsc[8][3];
98  static const double lut_wg_etaMin_etaMax_odd[48][3];
99  static const double lut_wg_etaMin_etaMax_even[48][3];
100 
103 
104  bool doesALCTCrossCLCT(CSCALCTDigi &a, CSCCLCTDigi &c, int me);
105 
107  //CSCCorrelatedLCTDigi firstLCT1a[MAX_LCT_BINS];
108 
110  //CSCCorrelatedLCTDigi secondLCT1a[MAX_LCT_BINS];
111 
116 
117  void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
118  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
120 
121  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
122  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
123  CSCCorrelatedLCTDigi& lct1, CSCCorrelatedLCTDigi& lct2, int me,
124  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
125 
126  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, GEMPadDigi gemPad,
127  CSCCorrelatedLCTDigi& lct1, CSCCorrelatedLCTDigi& lct2, int me);
128 
129  void correlateLCTsGEM(CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, GEMPadDigi gemPad, int roll,
130  CSCCorrelatedLCTDigi& lct1, CSCCorrelatedLCTDigi& lct2, int me);
131 
132  void retrieveGEMPads(const GEMPadDigiCollection* pads, unsigned id);
133  void retrieveGEMCoPads();
134 
135  void createGEMRollEtaLUT(bool isEven);
136 
137  int assignGEMRoll(double eta);
138  int deltaRoll(int wg, int roll);
139  int deltaPad(int hs, int pad);
140 
142  int me, bool oldDataFormat = false);
143  CSCCorrelatedLCTDigi constructLCTsGEM(const CSCCLCTDigi& clct, const GEMPadDigi& gem, int roll,
144  int me, bool oldDataFormat = true);
146  bool hasPad, bool hasCoPad);
147 
148  unsigned int encodePatternGEM(const int ptn, const int highPt);
149  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const GEMPadDigi& gem);
150  unsigned int findQualityGEM(const CSCCLCTDigi& cLCT, const GEMPadDigi& gem);
151  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT,
152  bool hasPad, bool hasCoPad);
153 
154  void printGEMTriggerPads(int minBX, int maxBx, bool iscopad = false);
155 
156  bool isPadInOverlap(int roll);
157 
158  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const GEMPadsBX& pads = GEMPadsBX(),
159  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
160  GEMPadsBX matchingGEMPads(const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
161  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
162  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
163  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
164 
165  std::vector<CSCALCTDigi> alctV;
166  std::vector<CSCCLCTDigi> clctV1b;
167  std::vector<CSCCLCTDigi> clctV1a;
168  std::vector<GEMCoPadDigi> gemCoPadV;
169 
172 
175 
179 
183 
184  unsigned int tmb_cross_bx_algo;
185 
187  unsigned int max_me11_lcts;
188 
191 
194 
195  // debug gem matching
199 
200  // deltas used to match to GEM pads
207 
208  // deltas used to match to GEM coincidence pads
215 
216  // Drop low quality stubs if they don't have GEMs
221 
222  // build LCT from ALCT and GEM
227 
228  // LCT ghostbusting
230 
231  // correct LCT timing with GEMs
233 
234  // send LCT old dataformat
236 
237  // send only first 2 lcts
239 
240  // promote ALCT-GEM pattern
242 
243  // promote ALCT-GEM quality
247 
248  // map of roll N to min and max eta
249  std::map<int,std::pair<double,double> > gemRollToEtaLimits_;
250  std::map<int,std::pair<int,int>> cscWgToGemRoll_;
251 
252  // map of pad to HS
253  std::map<int,int> gemPadToCscHsME1a_;
254  std::map<int,int> gemPadToCscHsME1b_;
255  std::map<int,std::pair<int,int>> cscHsToGemPadME1a_;
256  std::map<int,std::pair<int,int>> cscHsToGemPadME1b_;
257 
258  // map< bx , vector<gemid, pad> >
259  GEMPads pads_;
260  GEMPads coPads_;
261 };
262 #endif
std::map< int, std::pair< int, int > > cscHsToGemPadME1a_
std::vector< CSCCorrelatedLCTDigi > sortLCTsByQuality(int bx, enum ME11Part=ME1B)
static const int lut_wg_vs_hs_me1ag[48][2]
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a()
std::vector< CSCCorrelatedLCTDigi > readoutLCTs()
void setGEMGeometry(const GEMGeometry *g)
unsigned int encodePatternGEM(const int ptn, const int highPt)
static const double lut_pt_vs_dphi_gemcsc[8][3]
bool runME11ILT_
GEM-CSC integrated local algorithm.
std::map< int, std::pair< int, int > > cscHsToGemPadME1b_
int deltaPad(int hs, int pad)
std::pair< unsigned int, const GEMPadDigi > GEMPadBX
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
static const int lut_wg_vs_hs_me1b[48][2]
GEMPadsBX matchingGEMPads(const CSCCLCTDigi &cLCT, const GEMPadsBX &pads=GEMPadsBX(), enum ME11Part=ME1B, bool isCopad=false, bool first=true)
CSCCorrelatedLCTDigi allLCTs1a[MAX_LCT_BINS][15][2]
void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, int me, const GEMPadsBX &pads=GEMPadsBX(), const GEMPadsBX &copads=GEMPadsBX())
std::vector< CSCCLCTDigi > getCLCTs1b()
std::map< int, std::pair< double, double > > gemRollToEtaLimits_
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMPadDigi &gem, int me, bool oldDataFormat=false)
void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2)
std::vector< CSCCorrelatedLCTDigi > getLCTs1b()
int deltaRoll(int wg, int roll)
void printGEMTriggerPads(int minBX, int maxBx, bool iscopad=false)
std::vector< CSCCorrelatedLCTDigi > getLCTs1a()
static const int lut_wg_vs_hs_me1a[48][2]
std::vector< CSCCLCTDigi > getCLCTs1a()
void setCSCGeometry(const CSCGeometry *g)
set CSC and GEM geometries for the matching needs
std::vector< CSCALCTDigi > alctV
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
const GEMGeometry * gem_g
unsigned int findQualityGEM(const CSCALCTDigi &aLCT, const GEMPadDigi &gem)
std::vector< GEMCoPadDigi > gemCoPadV
bool doesALCTCrossCLCT(CSCALCTDigi &a, CSCCLCTDigi &c, int me)
std::map< int, int > gemPadToCscHsME1a_
std::map< int, std::pair< int, int > > cscWgToGemRoll_
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b()
void createGEMRollEtaLUT(bool isEven)
std::unique_ptr< CSCAnodeLCTProcessor > alct
double a
Definition: hdecay.h:121
std::vector< CSCCLCTDigi > clctV1b
std::vector< CSCCLCTDigi > clctV1a
std::unique_ptr< CSCCathodeLCTProcessor > clct
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)
CSCCorrelatedLCTDigi allLCTs1b[MAX_LCT_BINS][15][2]
std::map< int, int > gemPadToCscHsME1b_
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
std::map< int, GEMPadsBX > GEMPads
const CSCGeometry * csc_g
std::vector< GEMCoPadDigi > readoutCoPads()
std::vector< CSCALCTDigi > getALCTs1b()
static const double lut_wg_etaMin_etaMax_even[48][3]
static const double lut_wg_etaMin_etaMax_odd[48][3]
std::vector< GEMPadBX > GEMPadsBX
void setConfigParameters(const CSCDBL1TPParameters *conf)
std::vector< CSCCorrelatedLCTDigi > sortLCTsByGEMDPhi(int bx, enum ME11Part=ME1B)