CMS 3D CMS Logo

CSCUpgradeMotherboard.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCUpgradeMotherboard_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCUpgradeMotherboard_h
3 
8 
9 // generic container type
10 namespace{
11 
12 template <class T>
13 using match = std::pair<unsigned int, T>;
14 
15 template <class T>
16 using matches = std::vector<std::pair<unsigned int, T> >;
17 
18 template <class T>
19 using matchesBX = std::map<int, std::vector<std::pair<unsigned int, T> > >;
20 
21 }
22 
23 class CSCGeometry;
24 class CSCChamber;
25 
27 {
28 public:
29 
32  class LCTContainer {
33  public:
34  LCTContainer (unsigned int match_trig_window_size ) : match_trig_window_size(match_trig_window_size){}
35  CSCCorrelatedLCTDigi& operator()(int bx, int match_bx, int lct) { return data[bx][match_bx][lct]; }
36  void getTimeMatched(const int bx, std::vector<CSCCorrelatedLCTDigi>&) const;
37  void getMatched(std::vector<CSCCorrelatedLCTDigi>&) const;
39  const unsigned int match_trig_window_size;
40  };
41 
42  CSCUpgradeMotherboard(unsigned endcap, unsigned station, unsigned sector,
43  unsigned subsector, unsigned chamber,
44  const edm::ParameterSet& conf);
45 
46  //Default constructor for testing
48 
49  virtual ~CSCUpgradeMotherboard();
50 
51  template <class S>
52  bool compare(const S& p, const S& q);
53 
54  template <class S>
55  S intersection(const S& d1, const S& d2);
56 
58  static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi&, const CSCCorrelatedLCTDigi&);
59  static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi&, const CSCCorrelatedLCTDigi&);
60  void sortLCTs(std::vector<CSCCorrelatedLCTDigi>& lcts, bool (*sorter)(const CSCCorrelatedLCTDigi&,const CSCCorrelatedLCTDigi&));
61 
62  void setCSCGeometry(const CSCGeometry *g) { csc_g = g; }
63  void setupGeometry();
64  void debugLUTs();
65 
66  protected:
67 
69  unsigned theRegion;
70  unsigned theChamber;
72 
75 
78 
79  std::vector<CSCALCTDigi> alctV;
80 
81  std::unique_ptr<CSCUpgradeMotherboardLUTGenerator> generator_;
82 
85 
88 
92 
96 
97  unsigned int tmb_cross_bx_algo;
98 
100  unsigned int max_lcts;
101 
102  // debug gem matching
104 
105  // check look-up-tables
107 };
108 
109 template <class S>
110 bool CSCUpgradeMotherboard::compare(const S& p, const S& q)
111 {
112  return (p.first == q.first) and (p.second == q.second);
113 }
114 
115 template <class S>
117 {
118  S result;
119  for (const auto& p: d1){
120  for (const auto& q: d2){
121  if (compare(p,q)){
122  result.push_back(p);
123  break;
124  }
125  }
126  }
127  return result;
128  }
129 
130 
131 #endif
CSCCorrelatedLCTDigi data[CSCMotherboard::MAX_LCT_BINS][15][2]
LCTContainer(unsigned int match_trig_window_size)
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &))
CSCCorrelatedLCTDigi & operator()(int bx, int match_bx, int lct)
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
void setCSCGeometry(const CSCGeometry *g)
const CSCChamber * cscChamber
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
std::vector< CSCALCTDigi > alctV
bool compare(const S &p, const S &q)
S intersection(const S &d1, const S &d2)
const CSCGeometry * csc_g
edm::ParameterSet commonParams_
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
void getTimeMatched(const int bx, std::vector< CSCCorrelatedLCTDigi > &) const
edm::ParameterSet tmbParams_
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10