9 unsigned theEndcap,
unsigned theStation,
unsigned theSector,
unsigned theSubsector,
unsigned theTrigChamber)
const {
18 unsigned theSubsector,
19 unsigned theTrigChamber)
const {
20 bool gemGeometryAvailable(
false);
21 if (
gem_g !=
nullptr) {
22 LogTrace(
"CSCUpgradeMotherboardLUTGenerator") <<
"+++ generateLUTsME11() called for ME11 chamber! +++ \n";
23 gemGeometryAvailable =
true;
27 if (not gemGeometryAvailable) {
28 LogTrace(
"CSCUpgradeMotherboardLUTGenerator")
29 <<
"+++ generateLUTsME11() called for ME11 chamber without valid GEM geometry! +++ \n";
35 const CSCDetId me1bId(theEndcap, 1, 1, chid, 0);
36 const CSCDetId me1aId(theEndcap, 1, 4, chid, 0);
39 const CSCLayer* keyLayerME1b(cscChamberME1b->layer(3));
40 const CSCLayer* keyLayerME1a(cscChamberME1a->layer(3));
43 const int region((theEndcap == 1) ? 1 : -1);
51 std::vector<std::pair<double, double> > gemRollEtaLimits_l1;
52 std::vector<std::pair<double, double> > gemRollEtaLimits_l2;
53 std::vector<std::pair<double, double> > cscWGToEtaLimits;
54 std::vector<std::pair<int, int> > cscWgToGemRoll_l1;
55 std::vector<std::pair<int, int> > cscWgToGemRoll_l2;
56 std::vector<std::pair<int, int> > cscHsToGemPadME1a;
57 std::vector<std::pair<int, int> > cscHsToGemPadME1b;
58 std::vector<int> gemPadToCscHsME1a;
59 std::vector<int> gemPadToCscHsME1b;
60 std::vector<int> gemRollToCscWg1b;
65 cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l1, cscWgToGemRoll_l1);
66 cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l2, cscWgToGemRoll_l2);
75 os <<
"ME11 " << me1bId << std::endl;
77 os <<
"GEM L1 roll to eta limits" << std::endl;
78 os << gemRollEtaLimits_l1;
80 os <<
"GEM L2 roll to eta limits" << std::endl;
81 os << gemRollEtaLimits_l2;
83 os <<
"ME1b " << me1bId << std::endl;
84 os <<
"WG roll to eta limits" << std::endl;
85 os << cscWGToEtaLimits;
87 os <<
"WG to Roll L1" << std::endl;
88 os << cscWgToGemRoll_l1;
90 os <<
"WG to Roll L2" << std::endl;
91 os << cscWgToGemRoll_l2;
93 os <<
"CSC HS to GEM pad LUT in ME1a" << std::endl;
94 os << cscHsToGemPadME1a;
96 os <<
"CSC HS to GEM pad LUT in ME1b" << std::endl;
97 os << cscHsToGemPadME1b;
99 os <<
"GEM pad to CSC HS LUT in ME1a" << std::endl;
100 os << gemPadToCscHsME1a;
102 os <<
"GEM pad to CSC HS LUT in ME1b" << std::endl;
103 os << gemPadToCscHsME1b;
105 os <<
"GEM roll to CSC WG" << std::endl;
106 os << gemRollToCscWg1b;
109 LogTrace(
"CSCUpgradeMotherboardLUTGenerator") << os.str();
114 unsigned theSubsector,
115 unsigned theTrigChamber)
const {
116 bool gemGeometryAvailable(
false);
117 if (
gem_g !=
nullptr) {
118 LogTrace(
"CSCUpgradeMotherboardLUTGenerator") <<
"+++ generateLUTsME11() called for ME21 chamber! +++ \n";
119 gemGeometryAvailable =
true;
123 if (not gemGeometryAvailable) {
124 LogTrace(
"CSCUpgradeMotherboardLUTGenerator")
125 <<
"+++ generateLUTsME21() called for ME21 chamber without valid GEM geometry! +++ \n";
131 const CSCDetId csc_id(theEndcap, 2, 1, chid, 0);
133 const CSCLayer* keyLayer(cscChamber->layer(3));
136 const int region((theEndcap == 1) ? 1 : -1);
144 std::vector<std::pair<double, double> > gemRollEtaLimits_l1;
145 std::vector<std::pair<double, double> > gemRollEtaLimits_l2;
146 std::vector<std::pair<double, double> > cscWGToEtaLimits;
147 std::vector<std::pair<int, int> > cscWgToGemRoll_l1;
148 std::vector<std::pair<int, int> > cscWgToGemRoll_l2;
149 std::vector<std::pair<int, int> > cscHsToGemPad;
150 std::vector<int> gemPadToCscHs;
151 std::vector<int> gemRollToCscWg;
156 cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l1, cscWgToGemRoll_l1);
157 cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l2, cscWgToGemRoll_l2);
162 std::stringstream os;
163 os <<
"ME21 " << csc_id << std::endl;
165 os <<
"GEM roll to eta limits L1" << std::endl;
166 os << gemRollEtaLimits_l1;
168 os <<
"GEM roll to eta limits L2" << std::endl;
169 os << gemRollEtaLimits_l2;
171 os <<
"WG to eta limits" << std::endl;
172 os << cscWGToEtaLimits;
174 os <<
"WG to Roll L1" << std::endl;
175 os << cscWgToGemRoll_l1;
177 os <<
"WG to Roll L2" << std::endl;
178 os << cscWgToGemRoll_l2;
180 os <<
"CSC HS to GEM pad LUT in ME21" << std::endl;
183 os <<
"GEM pad to CSC HS LUT in ME21" << std::endl;
186 os <<
"GEM roll to CSC WG" << std::endl;
187 os << gemRollToCscWg;
190 LogTrace(
"CSCUpgradeMotherboardLUTGenerator") << os.str();
197 for (
const auto&
p : lut) {
210 std::vector<std::pair<double, double> >& lut)
const {
212 const float half_striplength(roll->specs()->specificTopology().stripLength() / 2.);
213 const LocalPoint lp_top(0., half_striplength, 0.);
214 const LocalPoint lp_bottom(0., -half_striplength, 0.);
216 const GlobalPoint gp_bottom(roll->toGlobal(lp_bottom));
217 const double bottom_eta(
std::abs(gp_bottom.eta()));
218 const double top_eta(
std::abs(gp_top.eta()));
219 lut.emplace_back(
std::min(bottom_eta, top_eta),
std::max(bottom_eta, top_eta));
224 const std::vector<std::pair<double, double> >& inLUT2,
226 for (
const auto&
p : inLUT1) {
234 std::vector<std::pair<double, double> >& lut)
const {
236 const int numberOfWG(keyLayerGeometry->numberOfWireGroups());
237 for (
int i = 0;
i < numberOfWG; ++
i) {
238 const float middle_wire(keyLayerGeometry->middleWireOfGroup(
i));
239 const std::pair<LocalPoint, LocalPoint> wire_ends(keyLayerGeometry->wireTopology()->wireEnds(middle_wire));
242 const double bottom_eta(
std::abs(gp_bottom.eta()));
243 const double top_eta(
std::abs(gp_top.eta()));
244 lut.emplace_back(
std::min(bottom_eta, top_eta),
std::max(bottom_eta, top_eta));
254 auto nStrips(keyLayerGeometry->numberOfStrips());
256 const LocalPoint lpCSC(keyLayerGeometry->topology()->localPosition(
i));
259 const float pad(randRoll->
pad(lpGEM));
260 lut.emplace_back(std::floor(pad),
std::ceil(pad));
266 std::vector<int>& lut)
const {
267 const int nGEMPads(randRoll->
npads());
269 for (
int i = 0;
i < nGEMPads; ++
i) {
273 const float strip(keyLayerGeometry->strip(lpCSC));
274 lut.push_back(
int(
strip * 2));
280 std::vector<int>& lut)
const {
283 const float half_striplength(roll->specs()->specificTopology().stripLength() / 2.);
284 const LocalPoint lp_top(0., half_striplength, 0.);
285 const LocalPoint lp_bottom(0., -half_striplength, 0.);
287 const GlobalPoint gp_bottom(roll->toGlobal(lp_bottom));
289 x = (gp_top.x() + gp_bottom.x()) / 2.;
290 y = (gp_top.y() + gp_bottom.y()) / 2.;
291 z = (gp_top.z() + gp_bottom.z()) / 2.;
294 const int wire(keyLayerGeometry->nearestWire(lp_ave));
295 const int wg(keyLayerGeometry->wireGroup(wire));
296 lut.emplace_back(wg);