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, 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 
40  ~CSCMotherboardME11GEM() override;
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 correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
118  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
119  CSCCorrelatedLCTDigi& lct1, CSCCorrelatedLCTDigi& lct2, int me,
120  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
121 
122  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, GEMPadDigi gemPad,
123  CSCCorrelatedLCTDigi& lct1, CSCCorrelatedLCTDigi& lct2, int me);
124 
125  void correlateLCTsGEM(CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, GEMPadDigi gemPad, int roll,
126  CSCCorrelatedLCTDigi& lct1, CSCCorrelatedLCTDigi& lct2, int me);
127 
128  void retrieveGEMPads(const GEMPadDigiCollection* pads, unsigned id);
129  void retrieveGEMCoPads();
130 
131  void createGEMRollEtaLUT(bool isEven);
132 
133  int assignGEMRoll(double eta);
134  int deltaRoll(int wg, int roll);
135  int deltaPad(int hs, int pad);
136 
138  int me, bool oldDataFormat = false);
139  CSCCorrelatedLCTDigi constructLCTsGEM(const CSCCLCTDigi& clct, const GEMPadDigi& gem, int roll,
140  int me, bool oldDataFormat = true);
142  bool hasPad, bool hasCoPad);
143 
144  unsigned int encodePatternGEM(const int ptn, const int highPt);
145  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const GEMPadDigi& gem);
146  unsigned int findQualityGEM(const CSCCLCTDigi& cLCT, const GEMPadDigi& gem);
147  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT,
148  bool hasPad, bool hasCoPad);
149 
150  void printGEMTriggerPads(int minBX, int maxBx, bool iscopad = false);
151 
152  bool isPadInOverlap(int roll);
153 
154  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const GEMPadsBX& pads = GEMPadsBX(),
155  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
156  GEMPadsBX matchingGEMPads(const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
157  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
158  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
159  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
160 
161  std::vector<CSCALCTDigi> alctV;
162  std::vector<CSCCLCTDigi> clctV1b;
163  std::vector<CSCCLCTDigi> clctV1a;
164  std::vector<GEMCoPadDigi> gemCoPadV;
165 
168 
171 
175 
179 
180  unsigned int tmb_cross_bx_algo;
181 
183  unsigned int max_me11_lcts;
184 
187 
190 
191  // debug gem matching
194 
195  // deltas used to match to GEM pads
202 
203  // deltas used to match to GEM coincidence pads
210 
211  // Drop low quality stubs if they don't have GEMs
216 
217  // build LCT from ALCT and GEM
222 
223  // LCT ghostbusting
225 
226  // correct LCT timing with GEMs
228 
229  // send LCT old dataformat
231 
232  // promote ALCT-GEM pattern
234 
235  // promote ALCT-GEM quality
239 
240  // map of roll N to min and max eta
241  std::map<int,std::pair<double,double> > gemRollToEtaLimits_;
242  std::map<int,std::pair<int,int>> cscWgToGemRoll_;
243 
244  // map of pad to HS
245  std::map<int,int> gemPadToCscHsME1a_;
246  std::map<int,int> gemPadToCscHsME1b_;
247  std::map<int,std::pair<int,int>> cscHsToGemPadME1a_;
248  std::map<int,std::pair<int,int>> cscHsToGemPadME1b_;
249 
250  // map< bx , vector<gemid, pad> >
251  GEMPads pads_;
252  GEMPads coPads_;
253 };
254 #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)
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)
std::vector< CSCCorrelatedLCTDigi > getLCTs1b()
std::pair< unsigned int, GEMPadDigi > GEMPadBX
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)