CMS 3D CMS Logo

CSCUpgradeMotherboardLUTGenerator.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCUpgradeMotherboardLUTGenerator_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCUpgradeMotherboardLUTGenerator_h
3 
9 
10 #include <vector>
11 
12 namespace
13 {
14  // function only makes sense for endcap!
15  RPCDetId getRPCfromCSC(const CSCDetId& csc_id)
16  {
17  const int region(csc_id.zendcap());
18  const int csc_trig_sect(CSCTriggerNumbering::triggerSectorFromLabels(csc_id));
19  const int csc_trig_id( CSCTriggerNumbering::triggerCscIdFromLabels(csc_id));
20  const int csc_trig_chid((3*(csc_trig_sect-1)+csc_trig_id)%18 +1);
21  const int rpc_trig_sect((csc_trig_chid-1)/3+1);
22  const int rpc_trig_subsect((csc_trig_chid-1)%3+1);
23  return RPCDetId(region,1,csc_id.station(),rpc_trig_sect,1,rpc_trig_subsect,0);
24  }
25 }
26 
28 {
29 public:
30 
33 
35  void setCSCGeometry(const CSCGeometry *g) { csc_g = g; }
36  void setGEMGeometry(const GEMGeometry *g) { gem_g = g; }
37  void setRPCGeometry(const RPCGeometry *g) { rpc_g = g; }
38 
40  void generateLUTs(unsigned e, unsigned s, unsigned se, unsigned sb, unsigned c) const;
41  void generateLUTsME11(unsigned e, unsigned se, unsigned sb, unsigned c) const;
42  void generateLUTsME21(unsigned e, unsigned se, unsigned sb, unsigned c) const;
43  void generateLUTsME3141(unsigned e, unsigned s, unsigned se, unsigned sb, unsigned c) const;
44  int assignRoll(const std::vector<std::pair<double,double> >&, double eta) const;
45 
46  private:
47  // create LUT: roll->(etaMin,etaMax)
48  void gemRollToEtaLimitsLUT(const GEMChamber* c, std::vector<std::pair<double,double> >& ) const;
49 
50  // create LUT: roll->(etaMin,etaMax)
51  void rpcRollToEtaLimitsLUT(const RPCChamber* c, std::vector<std::pair<double,double> >&) const;
52 
53  // create LUT: WG->(rollMin,rollMax)
54  void cscWgToRollLUT(const std::vector<std::pair<double,double> >&,
55  const std::vector<std::pair<double,double> >&,
56  std::vector<std::pair<int,int> >&) const;
57 
58  // create LUT: WG->(etaMin,etaMax)
59  void cscWgToEtaLimitsLUT(const CSCLayer*, std::vector<std::pair<double,double> >&) const;
60 
61  // create LUT: HS->pad
62  void cscHsToGemPadLUT(const CSCLayer*, const GEMEtaPartition*, int minH, int maxH, std::vector<std::pair<int,int> >&) const;
63 
64  // create LUT: pad->HS
65  void gemPadToCscHsLUT(const CSCLayer*, const GEMEtaPartition*, std::vector<int>&) const;
66 
67  // create LUT: HS->strip
68  void cscHsToRpcStripLUT(const CSCLayer*, const RPCRoll*, int minH, int maxH, std::vector<std::pair<int,int> >&) const;
69 
70  // create LUT: strip->HS
71  void rpcStripToCscHsLUT(const CSCLayer*, const RPCRoll*, std::vector<int>&) const;
72 
76 };
77 
78 template<typename T>
79 std::ostream &operator <<(std::ostream &os, const std::vector<std::pair<T,T> >&v)
80 {
81  int i = 0;
82  os << "{" << std::endl;
83  for(const auto& p : v) {
84  os << " {" << p.first << ", " << p.second << "}, ";
85  if (i%8==0) os << std::endl;
86  i++;
87  }
88  os << "}" << std::endl;
89  os << std::endl;
90 
91  return os;
92 }
93 
94 template<typename T>
95 std::ostream &operator <<(std::ostream &os, const std::vector<T>&v)
96 {
97  int i = 0;
98  os << "{" << std::endl;
99  for(const auto& p : v) {
100  os << " " << p << ",";
101  if (i%10==0) os << std::endl;
102  i++;
103  }
104  os << "}" << std::endl;
105  os << std::endl;
106 
107  return os;
108 }
109 
110 #endif
void cscHsToRpcStripLUT(const CSCLayer *, const RPCRoll *, int minH, int maxH, std::vector< std::pair< int, int > > &) const
void generateLUTsME3141(unsigned e, unsigned s, unsigned se, unsigned sb, unsigned c) const
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 assignRoll(const std::vector< std::pair< double, double > > &, double eta) const
void cscHsToGemPadLUT(const CSCLayer *, const GEMEtaPartition *, int minH, int maxH, std::vector< std::pair< int, int > > &) const
void gemRollToEtaLimitsLUT(const GEMChamber *c, std::vector< std::pair< double, double > > &) const
void rpcStripToCscHsLUT(const CSCLayer *, const RPCRoll *, std::vector< int > &) const
void cscWgToEtaLimitsLUT(const CSCLayer *, std::vector< std::pair< double, double > > &) const
void setCSCGeometry(const CSCGeometry *g)
set CSC and GEM geometries for the matching needs
static int triggerCscIdFromLabels(int station, int ring, int chamber)
short int zendcap() const
Definition: CSCDetId.h:100
void rpcRollToEtaLimitsLUT(const RPCChamber *c, std::vector< std::pair< double, double > > &) const
void cscWgToRollLUT(const std::vector< std::pair< double, double > > &, const std::vector< std::pair< double, double > > &, std::vector< std::pair< int, int > > &) const
static int triggerSectorFromLabels(int station, int ring, int chamber)
void generateLUTsME21(unsigned e, unsigned se, unsigned sb, unsigned c) const
void generateLUTs(unsigned e, unsigned s, unsigned se, unsigned sb, unsigned c) const
generate and print LUT
int station() const
Definition: CSCDetId.h:86
void generateLUTsME11(unsigned e, unsigned se, unsigned sb, unsigned c) const
void gemPadToCscHsLUT(const CSCLayer *, const GEMEtaPartition *, std::vector< int > &) const