CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCMotherboardME11GEM.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCMotherboardME11GEM_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCMotherboardME11GEM_h
3 
17 
18 class CSCGeometry;
19 class CSCChamber;
20 class GEMGeometry;
21 class GEMSuperChamber;
22 
24 {
25  typedef std::pair<unsigned int, const GEMPadDigi*> GEMPadBX;
26  typedef std::vector<GEMPadBX> GEMPadsBX;
27  typedef std::map<int, GEMPadsBX> GEMPads;
28 
29  public:
31  CSCMotherboardME11GEM(unsigned endcap, unsigned station, unsigned sector,
32  unsigned subsector, unsigned chamber,
33  const edm::ParameterSet& conf);
34 
37 
40 
43  void run(const CSCWireDigiCollection* wiredc,
44  const CSCComparatorDigiCollection* compdc,
45  const GEMPadDigiCollection* gemPads);
46 
48  std::vector<CSCCorrelatedLCTDigi> getLCTs1a();
49  std::vector<CSCCorrelatedLCTDigi> getLCTs1b();
50 
52  enum ME11Part {ME1B = 1, ME1A=4};
53 
55  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(int bx, enum ME11Part = ME1B);
56  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(enum ME11Part = ME1B);
57  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(std::vector<CSCCorrelatedLCTDigi>);
58  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(int bx, enum ME11Part = ME1B);
59  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(enum ME11Part = ME1B);
60  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(std::vector<CSCCorrelatedLCTDigi>);
61 
63  std::vector<CSCALCTDigi> getALCTs1b() {return alctV;}
64 
66  std::vector<CSCCLCTDigi> getCLCTs1a() {return clctV1a;}
67  std::vector<CSCCLCTDigi> getCLCTs1b() {return clctV1b;}
68 
71  void clear();
72 
74  void setConfigParameters(const CSCDBL1TPParameters* conf);
75 
77  std::unique_ptr<CSCCathodeLCTProcessor> clct1a;
78 
79  std::vector<CSCCorrelatedLCTDigi> readoutLCTs1a();
80  std::vector<CSCCorrelatedLCTDigi> readoutLCTs1b();
81  std::vector<CSCCorrelatedLCTDigi> readoutLCTs(enum ME11Part me1ab);
82  std::vector<GEMCoPadDigi> readoutCoPads();
83 
85  void setCSCGeometry(const CSCGeometry *g) { csc_g = g; }
86  void setGEMGeometry(const GEMGeometry *g) { gem_g = g; }
87 
88  private:
89 
90  static const int lut_wg_vs_hs_me1b[48][2];
91  static const int lut_wg_vs_hs_me1a[48][2];
92  static const int lut_wg_vs_hs_me1ag[48][2];
93  static const double lut_pt_vs_dphi_gemcsc[8][3];
94  static const double lut_wg_etaMin_etaMax_odd[48][3];
95  static const double lut_wg_etaMin_etaMax_even[48][3];
96 
99 
101 
103  //CSCCorrelatedLCTDigi firstLCT1a[MAX_LCT_BINS];
104 
106  //CSCCorrelatedLCTDigi secondLCT1a[MAX_LCT_BINS];
107 
112 
113  void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
114  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
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 matchGEMPads(enum ME11Part = ME1B);
129 
130  void buildCoincidencePads(const GEMPadDigiCollection* out_pads,
131  GEMCoPadDigiCollection& out_co_pads,
132  CSCDetId csc_id);
133 
134  void retrieveGEMPads(const GEMPadDigiCollection* pads, unsigned id);
135  void retrieveGEMCoPads(const GEMCoPadDigiCollection* pads, unsigned id);
136 
137  void createGEMRollEtaLUT(bool isEven);
138 
139  int assignGEMRoll(double eta);
140  int deltaRoll(int wg, int roll);
141  int deltaPad(int hs, int pad);
142 
144  int me, bool oldDataFormat = false);
145  CSCCorrelatedLCTDigi constructLCTsGEM(const CSCCLCTDigi& clct, const GEMPadDigi& gem, int roll,
146  int me, bool oldDataFormat = true);
148  bool hasPad, bool hasCoPad);
149 
150  unsigned int encodePatternGEM(const int ptn, const int highPt);
151  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const GEMPadDigi& gem);
152  unsigned int findQualityGEM(const CSCCLCTDigi& cLCT, const GEMPadDigi& gem);
153  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT,
154  bool hasPad, bool hasCoPad);
155 
156  void printGEMTriggerPads(int minBX, int maxBx, bool iscopad = false);
157 
158  bool isPadInOverlap(int roll);
159 
160  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const GEMPadsBX& pads = GEMPadsBX(),
161  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
162  GEMPadsBX matchingGEMPads(const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
163  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
164  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
165  enum ME11Part = ME1B, bool isCopad = false, bool first = true);
166 
167  std::vector<CSCALCTDigi> alctV;
168  std::vector<CSCCLCTDigi> clctV1b;
169  std::vector<CSCCLCTDigi> clctV1a;
170  std::vector<GEMCoPadDigi> gemCoPadV;
171 
174 
177 
181 
185 
186  unsigned int tmb_cross_bx_algo;
187 
189  unsigned int max_me11_lcts;
190 
193 
196 
201 
204 
208 
211 
214 
215  // debug gem matching
219 
220  // deltas used to construct GEM coincidence pads
223 
224  // deltas used to match to GEM pads
231 
232  // deltas used to match to GEM coincidence pads
239 
240  // Drop low quality stubs if they don't have GEMs
245 
246  // build LCT from ALCT and GEM
251 
252  // LCT ghostbusting
254 
255  // correct LCT timing with GEMs
257 
258  // send LCT old dataformat
260 
261  // send only first 2 lcts
263 
264  // promote ALCT-GEM pattern
266 
267  // promote ALCT-GEM quality
271 
272  // map of roll N to min and max eta
273  std::map<int,std::pair<double,double> > gemRollToEtaLimits_;
274  std::map<int,std::pair<int,int>> cscWgToGemRoll_;
275 
276  // map of pad to HS
277  std::map<int,int> gemPadToCscHsME1a_;
278  std::map<int,int> gemPadToCscHsME1b_;
279  std::map<int,std::pair<int,int>> cscHsToGemPadME1a_;
280  std::map<int,std::pair<int,int>> cscHsToGemPadME1b_;
281 
282  // map< bx , vector<gemid, pad> >
285 };
286 #endif
void retrieveGEMCoPads(const GEMCoPadDigiCollection *pads, unsigned id)
std::map< int, std::pair< int, int > > cscHsToGemPadME1a_
std::vector< CSCCorrelatedLCTDigi > sortLCTsByQuality(int bx, enum ME11Part=ME1B)
bool do_gem_matching
Do GEM matching?
static const int lut_wg_vs_hs_me1ag[48][2]
bool gem_clear_nomatch_lcts
whether to throw out GEM-fiducial LCTs that have no gem match
double gem_match_delta_phi_odd
GEM matching dphi and deta.
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a()
std::vector< CSCCorrelatedLCTDigi > readoutLCTs()
void setGEMGeometry(const GEMGeometry *g)
void buildCoincidencePads(const GEMPadDigiCollection *out_pads, GEMCoPadDigiCollection &out_co_pads, CSCDetId csc_id)
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_
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)
int gem_match_delta_bx
delta BX for GEM pads matching
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 matchGEMPads(enum ME11Part=ME1B)
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_
double gem_match_min_eta
min eta of LCT for which we require GEM match (we don&#39;t throw out LCTs below this min eta) ...
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::pair< unsigned int, const GEMPadDigi * > GEMPadBX
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)