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, const 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 
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 
69  unsigned int findQualityGEM(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT,
70  bool hasPad, bool hasCoPad);
71 
72  void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
73  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
75  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
76 
77  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
78  GEMPadDigi gemPad,
80 
81  void correlateLCTsGEM(CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
82  GEMPadDigi gemPad, int roll,
84 
85  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
86  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
88  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
89 
91  bool oldDataFormat = false);
93  bool oldDataFormat = true);
95  bool hasPad, bool hasCoPad);
96 
98  std::unique_ptr<GEMCoPadProcessor> coPadProcessor;
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 match to GEM pads
156 
157  // deltas used to match to GEM coincidence pads
160 
162 
163  // drop low quality stubs if they don't have GEMs
166 
167  // correct LCT timing with GEMs
169 
170  // build LCT from ALCT and GEM
173 
175 
176  // promote ALCT-GEM pattern
178 
179  // promote ALCT-GEM quality
182 
183  std::map<int,std::pair<double,double> > gemRollToEtaLimits_;
184  std::map<int,int> cscWgToGemRoll_;
185 
186  // map of pad to HS
187  std::map<int,int> gemPadToCscHs_;
188  std::map<int,std::pair<int,int>> cscHsToGemPad_;
189 
190  // map< bx , vector<gemid, pad> >
191  GEMPads pads_;
192  GEMPads coPads_;
193 };
194 #endif
std::vector< GEMCoPadDigi > readoutCoPads()
int deltaRoll(int wg, int roll)
std::pair< unsigned int, const GEMPadDigi > GEMPadBX
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::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]