test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 matchGEMPads();
81 
82  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
83  GEMPadDigi gemPad,
85 
86  void correlateLCTsGEM(CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
87  GEMPadDigi gemPad, int roll,
89 
90  void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT,
91  CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT,
93  const GEMPadsBX& pads = GEMPadsBX(), const GEMPadsBX& copads = GEMPadsBX());
94 
96  bool oldDataFormat = false);
98  bool oldDataFormat = true);
100  bool hasPad, bool hasCoPad);
101 
103  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(int bx);
104  std::vector<CSCCorrelatedLCTDigi> sortLCTsByQuality(std::vector<CSCCorrelatedLCTDigi>);
105  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(int bx);
106  std::vector<CSCCorrelatedLCTDigi> sortLCTsByGEMDPhi(std::vector<CSCCorrelatedLCTDigi>);
107 
108  std::vector<CSCCorrelatedLCTDigi> getLCTs();
109  std::vector<CSCCorrelatedLCTDigi> readoutLCTs();
110  std::vector<GEMCoPadDigi> readoutCoPads();
111 
112  private:
113 
117 
118  static const double lut_pt_vs_dphi_gemcsc[8][3];
119  static const double lut_wg_eta_odd[112][2];
120  static const double lut_wg_eta_even[112][2];
121 
124 
125 
126  std::vector<CSCALCTDigi> alctV;
127  std::vector<CSCCLCTDigi> clctV;
128  std::vector<GEMCoPadDigi> gemCoPadV;
129 
132 
134 
138 
139  unsigned int tmb_cross_bx_algo;
140 
142  unsigned int max_me21_lcts;
143 
144  // masterswitch
146 
149 
154 
157 
161 
164 
165  // debug gem matching
169 
170  // deltas used to construct GEM coincidence pads
173 
174  // deltas used to match to GEM pads
180 
181  // deltas used to match to GEM coincidence pads
184 
186 
187  // drop low quality stubs if they don't have GEMs
190 
191  // correct LCT timing with GEMs
193 
194  // build LCT from ALCT and GEM
197 
199 
200  // promote ALCT-GEM pattern
202 
203  // promote ALCT-GEM quality
206 
207  std::map<int,std::pair<double,double> > gemRollToEtaLimits_;
208  std::map<int,int> cscWgToGemRoll_;
209 
210  // map of pad to HS
211  std::map<int,int> gemPadToCscHs_;
212  std::map<int,std::pair<int,int>> cscHsToGemPad_;
213 
214  // map< bx , vector<gemid, pad> >
217 };
218 #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)
double gem_match_delta_phi_odd
GEM matching dphi and deta.
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
bool do_gem_matching
Do GEM matching?
std::vector< GEMPadBX > GEMPadsBX
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::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]
int gem_match_delta_bx
delta BX for GEM pads matching
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_
bool gem_clear_nomatch_lcts
whether to throw out GEM-fiducial LCTs that have no gem match
static const double lut_wg_eta_even[112][2]