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 
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  CSCMotherboardME21GEM(unsigned endcap, unsigned station, unsigned sector,
32  unsigned subsector, unsigned chamber,
33  const edm::ParameterSet& conf);
34 
37 
38  void clear();
39 
42  void run(const CSCWireDigiCollection* wiredc,
43  const CSCComparatorDigiCollection* compdc,
44  const GEMPadDigiCollection* gemPads);
45 
47  void setCSCGeometry(const CSCGeometry *g) { csc_g = g; }
48  void setGEMGeometry(const GEMGeometry *g) { gem_g = g; }
49 
50  void buildCoincidencePads(const GEMPadDigiCollection* out_pads,
51  GEMCoPadDigiCollection& out_co_pads,
52  CSCDetId csc_id);
53 
54  void retrieveGEMPads(const GEMPadDigiCollection* pads, unsigned id);
55  void retrieveGEMCoPads(const GEMCoPadDigiCollection* pads, unsigned id);
56 
57  std::map<int,std::pair<double,double> > createGEMRollEtaLUT();
58 
59  int assignGEMRoll(double eta);
60  int deltaRoll(int wg, int roll);
61  int deltaPad(int hs, int pad);
62 
63  void printGEMTriggerPads(int minBX, int maxBx, bool iscopad = false);
64 
65  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const GEMPadsBX& pads = GEMPadsBX(),
66  bool isCopad = false, bool first = true);
67  GEMPadsBX matchingGEMPads(const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
68  bool isCopad = false, bool first = true);
69  GEMPadsBX matchingGEMPads(const CSCCLCTDigi& cLCT, const CSCALCTDigi& aLCT, const GEMPadsBX& pads = GEMPadsBX(),
70  bool isCopad = false, bool first = true);
71 
72  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT,
73  bool hasPad, bool hasCoPad);
74 
75  void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
76  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
78  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
79 
80  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
81  GEMPadDigi gemPad,
83 
84  void correlateLCTsGEM(CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
85  GEMPadDigi gemPad, int roll,
87 
88  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
89  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
91  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
92 
94  bool oldDataFormat = false);
96  bool oldDataFormat = true);
98  bool hasPad, bool hasCoPad);
99 
101  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(int bx);
102  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(std::vector<CSCCorrelatedLCTDigi>);
103  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(int bx);
104  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(std::vector<CSCCorrelatedLCTDigi>);
105 
106  std::vector<CSCCorrelatedLCTDigi> getLCTs();
107  std::vector<CSCCorrelatedLCTDigi> readoutLCTs();
108  std::vector<GEMCoPadDigi> readoutCoPads();
109 
110  private:
111 
115 
116  static const double lut_pt_vs_dphi_gemcsc[8][3];
117  static const double lut_wg_eta_odd[112][2];
118  static const double lut_wg_eta_even[112][2];
119 
122 
123 
124  std::vector<CSCALCTDigi> alctV;
125  std::vector<CSCCLCTDigi> clctV;
126  std::vector<GEMCoPadDigi> gemCoPadV;
127 
130 
132 
136 
137  unsigned int tmb_cross_bx_algo;
138 
140  unsigned int max_me21_lcts;
141 
142  // masterswitch
144 
145  // debug gem matching
149 
150  // deltas used to construct GEM coincidence pads
153 
154  // deltas used to match to GEM pads
160 
161  // deltas used to match to GEM coincidence pads
164 
166 
167  // drop low quality stubs if they don't have GEMs
170 
171  // correct LCT timing with GEMs
173 
174  // build LCT from ALCT and GEM
177 
179 
180  // promote ALCT-GEM pattern
182 
183  // promote ALCT-GEM quality
186 
187  std::map<int,std::pair<double,double> > gemRollToEtaLimits_;
188  std::map<int,int> cscWgToGemRoll_;
189 
190  // map of pad to HS
191  std::map<int,int> gemPadToCscHs_;
192  std::map<int,std::pair<int,int>> cscHsToGemPad_;
193 
194  // map< bx , vector<gemid, pad> >
195  GEMPads pads_;
196  GEMPads coPads_;
197 };
198 #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::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::vector< GEMPadBX > GEMPadsBX
std::pair< unsigned int, const GEMPadDigi * > GEMPadBX
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 buildCoincidencePads(const GEMPadDigiCollection *out_pads, GEMCoPadDigiCollection &out_co_pads, CSCDetId csc_id)
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 retrieveGEMCoPads(const GEMCoPadDigiCollection *pads, unsigned id)
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]