CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCUpgradeMotherboardLUTGenerator Class Reference

#include <CSCUpgradeMotherboardLUTGenerator.h>

Public Member Functions

int assignRoll (const std::vector< std::pair< double, double > > &, double eta) const
 
 CSCUpgradeMotherboardLUTGenerator ()
 
void generateLUTs (unsigned e, unsigned s, unsigned se, unsigned sb, unsigned c) const
 generate and print LUT More...
 
void generateLUTsME11 (unsigned e, unsigned se, unsigned sb, unsigned c) const
 
void generateLUTsME21 (unsigned e, unsigned se, unsigned sb, unsigned c) const
 
void generateLUTsME3141 (unsigned e, unsigned s, unsigned se, unsigned sb, unsigned c) const
 
void setCSCGeometry (const CSCGeometry *g)
 set CSC and GEM geometries for the matching needs More...
 
void setGEMGeometry (const GEMGeometry *g)
 
void setRPCGeometry (const RPCGeometry *g)
 
 ~CSCUpgradeMotherboardLUTGenerator ()
 

Private Member Functions

void cscHsToGemPadLUT (const CSCLayer *, const GEMEtaPartition *, int minH, int maxH, std::vector< std::pair< int, int > > &) const
 
void cscHsToRpcStripLUT (const CSCLayer *, const RPCRoll *, int minH, int maxH, std::vector< std::pair< int, int > > &) const
 
void cscWgToEtaLimitsLUT (const CSCLayer *, 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
 
void gemPadToCscHsLUT (const CSCLayer *, const GEMEtaPartition *, std::vector< int > &) const
 
void gemRollToEtaLimitsLUT (const GEMChamber *c, std::vector< std::pair< double, double > > &) const
 
void rpcRollToEtaLimitsLUT (const RPCChamber *c, std::vector< std::pair< double, double > > &) const
 
void rpcStripToCscHsLUT (const CSCLayer *, const RPCRoll *, std::vector< int > &) const
 

Private Attributes

const CSCGeometrycsc_g
 
const GEMGeometrygem_g
 
const RPCGeometryrpc_g
 

Detailed Description

Definition at line 27 of file CSCUpgradeMotherboardLUTGenerator.h.

Constructor & Destructor Documentation

CSCUpgradeMotherboardLUTGenerator::CSCUpgradeMotherboardLUTGenerator ( )
inline

Definition at line 31 of file CSCUpgradeMotherboardLUTGenerator.h.

31 {}
CSCUpgradeMotherboardLUTGenerator::~CSCUpgradeMotherboardLUTGenerator ( )
inline

Definition at line 32 of file CSCUpgradeMotherboardLUTGenerator.h.

32 {}

Member Function Documentation

int CSCUpgradeMotherboardLUTGenerator::assignRoll ( const std::vector< std::pair< double, double > > &  lut_,
double  eta 
) const

Definition at line 238 of file CSCUpgradeMotherboardLUTGenerator.cc.

References funct::abs(), maxEta, cutBasedElectronID_CSA14_50ns_V0_cff::minEta, AlCaHLTBitMon_ParallelJobs::p, and mps_fire::result.

Referenced by cscWgToRollLUT(), and setRPCGeometry().

239 {
240  int result = -99;
241  for(const auto& p : lut_) {
242  const float minEta(p.first);
243  const float maxEta(p.second);
244  if (minEta <= std::abs(eta) and std::abs(eta) < maxEta) {
245  result = p.first;
246  break;
247  }
248  }
249  return result;
250 }
double maxEta
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void CSCUpgradeMotherboardLUTGenerator::cscHsToGemPadLUT ( const CSCLayer keyLayer,
const GEMEtaPartition randRoll,
int  minH,
int  maxH,
std::vector< std::pair< int, int > > &  lut 
) const
private

Definition at line 301 of file CSCUpgradeMotherboardLUTGenerator.cc.

References CSCLayer::geometry(), runTauDisplay::gp, mps_fire::i, lumiPlot::lut, GEMEtaPartition::pad(), GeomDet::toGlobal(), and GeomDet::toLocal().

Referenced by generateLUTsME11(), generateLUTsME21(), and setRPCGeometry().

304 {
305  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
306  auto nStrips(keyLayerGeometry->numberOfStrips());
307  for (float i = 0; i< nStrips; i = i+0.5){
308  const LocalPoint lpCSC(keyLayerGeometry->topology()->localPosition(i));
309  const GlobalPoint gp(keyLayer->toGlobal(lpCSC));
310  const LocalPoint lpGEM(randRoll->toLocal(gp));
311  const int HS(i/0.5);
312  const bool edge(HS < minH or HS > maxH);
313  const float pad(edge ? -99 : randRoll->pad(lpGEM));
314  lut.emplace_back(std::floor(pad),std::ceil(pad));
315  }
316 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
float pad(const LocalPoint &lp) const
returns FRACTIONAL pad number [0.,npads] for a point
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void CSCUpgradeMotherboardLUTGenerator::cscHsToRpcStripLUT ( const CSCLayer keyLayer,
const RPCRoll randRoll,
int  minH,
int  maxH,
std::vector< std::pair< int, int > > &  lut 
) const
private

Definition at line 335 of file CSCUpgradeMotherboardLUTGenerator.cc.

References CSCLayer::geometry(), runTauDisplay::gp, mps_fire::i, lumiPlot::lut, digi_MixPreMix_cfi::strip, RPCRoll::strip(), GeomDet::toGlobal(), and GeomDet::toLocal().

Referenced by generateLUTsME3141(), and setRPCGeometry().

338 {
339  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
340  auto nStrips(keyLayerGeometry->numberOfStrips());
341  for (float i = 0; i< nStrips; i = i+0.5){
342  const LocalPoint lpCSC(keyLayerGeometry->topology()->localPosition(i));
343  const GlobalPoint gp(keyLayer->toGlobal(lpCSC));
344  const LocalPoint lpRPC(randRoll->toLocal(gp));
345  const int HS(i/0.5);
346  const bool edge(HS < minH or HS > maxH);
347  const float strip(edge ? -99 : randRoll->strip(lpRPC));
348  lut.emplace_back(std::floor(strip),std::ceil(strip));
349  }
350 }
float strip(const LocalPoint &lp) const
Definition: RPCRoll.cc:71
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void CSCUpgradeMotherboardLUTGenerator::cscWgToEtaLimitsLUT ( const CSCLayer keyLayer,
std::vector< std::pair< double, double > > &  lut 
) const
private

Definition at line 288 of file CSCUpgradeMotherboardLUTGenerator.cc.

References CSCLayer::geometry(), mps_fire::i, lumiPlot::lut, and GeomDet::toGlobal().

Referenced by generateLUTsME11(), generateLUTsME21(), generateLUTsME3141(), and setRPCGeometry().

289 {
290  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
291  const int numberOfWG(keyLayerGeometry->numberOfWireGroups());
292  for (int i = 0; i< numberOfWG; ++i){
293  const float middle_wire(keyLayerGeometry->middleWireOfGroup(i));
294  const std::pair<LocalPoint, LocalPoint> wire_ends(keyLayerGeometry->wireTopology()->wireEnds(middle_wire));
295  const GlobalPoint gp_top(keyLayer->toGlobal(wire_ends.first));
296  const GlobalPoint gp_bottom(keyLayer->toGlobal(wire_ends.first));
297  lut.emplace_back(gp_top.eta(), gp_bottom.eta());
298  }
299 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void CSCUpgradeMotherboardLUTGenerator::cscWgToRollLUT ( const std::vector< std::pair< double, double > > &  inLUT1,
const std::vector< std::pair< double, double > > &  inLUT2,
std::vector< std::pair< int, int > > &  outLUT 
) const
private

Definition at line 277 of file CSCUpgradeMotherboardLUTGenerator.cc.

References assignRoll(), ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by generateLUTsME11(), generateLUTsME21(), generateLUTsME3141(), and setRPCGeometry().

280 {
281  for (const auto& p: inLUT1){
282  double etaMin(p.first);
283  double etaMax(p.second);
284  outLUT.emplace_back(assignRoll(inLUT2, etaMin), assignRoll(inLUT2, etaMax));
285  }
286 }
int assignRoll(const std::vector< std::pair< double, double > > &, double eta) const
void CSCUpgradeMotherboardLUTGenerator::gemPadToCscHsLUT ( const CSCLayer keyLayer,
const GEMEtaPartition randRoll,
std::vector< int > &  lut 
) const
private

Definition at line 319 of file CSCUpgradeMotherboardLUTGenerator.cc.

References GEMEtaPartition::centreOfPad(), CSCLayer::geometry(), runTauDisplay::gp, mps_fire::i, GEMEtaPartition::npads(), digi_MixPreMix_cfi::strip, GeomDet::toGlobal(), and GeomDet::toLocal().

Referenced by generateLUTsME11(), generateLUTsME21(), and setRPCGeometry().

322 {
323  const int nGEMPads(randRoll->npads());
324  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
325  for (int i = 1; i<= nGEMPads; ++i){
326  const LocalPoint lpGEM(randRoll->centreOfPad(i));
327  const GlobalPoint gp(randRoll->toGlobal(lpGEM));
328  const LocalPoint lpCSC(keyLayer->toLocal(gp));
329  const float strip(keyLayerGeometry->strip(lpCSC));
330  lut.push_back( (int) (strip)/0.5 );
331  }
332 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
int npads() const
number of GEM-CSC trigger readout pads in partition
LocalPoint centreOfPad(int pad) const
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void CSCUpgradeMotherboardLUTGenerator::gemRollToEtaLimitsLUT ( const GEMChamber c,
std::vector< std::pair< double, double > > &  lut 
) const
private

Definition at line 252 of file CSCUpgradeMotherboardLUTGenerator.cc.

References funct::abs(), GEMChamber::etaPartitions(), and lumiPlot::lut.

Referenced by generateLUTsME11(), generateLUTsME21(), and setRPCGeometry().

253 {
254  for(const auto& roll : gemChamber->etaPartitions()) {
255  const float half_striplength(roll->specs()->specificTopology().stripLength()/2.);
256  const LocalPoint lp_top(0., half_striplength, 0.);
257  const LocalPoint lp_bottom(0., -half_striplength, 0.);
258  const GlobalPoint gp_top(roll->toGlobal(lp_top));
259  const GlobalPoint gp_bottom(roll->toGlobal(lp_bottom));
260  lut.emplace_back(std::abs(gp_top.eta()), std::abs(gp_bottom.eta()));
261  }
262 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void CSCUpgradeMotherboardLUTGenerator::generateLUTs ( unsigned  e,
unsigned  s,
unsigned  se,
unsigned  sb,
unsigned  c 
) const

generate and print LUT

Definition at line 8 of file CSCUpgradeMotherboardLUTGenerator.cc.

References generateLUTsME11(), generateLUTsME21(), and generateLUTsME3141().

Referenced by setRPCGeometry().

9 {
10  if (theStation==1) generateLUTsME11(theEndcap, theSector, theSubsector, theTrigChamber);
11  if (theStation==2) generateLUTsME21(theEndcap, theSector, theSubsector, theTrigChamber);
12  if (theStation==3) generateLUTsME3141(theEndcap, 3, theSector, theSubsector, theTrigChamber);
13  if (theStation==4) generateLUTsME3141(theEndcap, 4, theSector, theSubsector, theTrigChamber);
14 }
void generateLUTsME3141(unsigned e, unsigned s, unsigned se, unsigned sb, unsigned c) const
void generateLUTsME21(unsigned e, unsigned se, unsigned sb, unsigned c) const
void generateLUTsME11(unsigned e, unsigned se, unsigned sb, unsigned c) const
void CSCUpgradeMotherboardLUTGenerator::generateLUTsME11 ( unsigned  e,
unsigned  se,
unsigned  sb,
unsigned  c 
) const

Definition at line 16 of file CSCUpgradeMotherboardLUTGenerator.cc.

References CSCDetId::chamber(), CSCGeometry::chamber(), GEMGeometry::chamber(), CSCTriggerNumbering::chamberFromTriggerLabels(), csc_g, cscHsToGemPadLUT(), cscWgToEtaLimitsLUT(), cscWgToRollLUT(), gem_g, gemPadToCscHsLUT(), gemRollToEtaLimitsLUT(), and LogTrace.

Referenced by generateLUTs(), and setRPCGeometry().

17 {
18  bool gemGeometryAvailable(false);
19  if (gem_g != nullptr) {
20  LogTrace("CSCUpgradeMotherboardLUTGenerator")
21  << "+++ generateLUTsME11() called for ME11 chamber! +++ \n";
22  gemGeometryAvailable = true;
23  }
24 
25  // check for GEM geometry
26  if (not gemGeometryAvailable){
27  LogTrace("CSCUpgradeMotherboardLUTGenerator")
28  << "+++ generateLUTsME11() called for ME11 chamber without valid GEM geometry! +++ \n";
29  return;
30  }
31 
32  // CSC trigger geometry
33  const int chid = CSCTriggerNumbering::chamberFromTriggerLabels(theSector, theSubsector, 1, theTrigChamber);
34  const CSCDetId me1bId(theEndcap, 1, 1, chid, 0);
35  const CSCDetId me1aId(theEndcap, 1, 4, chid, 0);
36  const CSCChamber* cscChamberME1b(csc_g->chamber(me1bId));
37  const CSCChamber* cscChamberME1a(csc_g->chamber(me1aId));
38  const CSCLayer* keyLayerME1b(cscChamberME1b->layer(3));
39  const CSCLayer* keyLayerME1a(cscChamberME1a->layer(3));
40 
41  // GEM trigger geometry
42  const int region((theEndcap == 1) ? 1: -1);
43  const GEMDetId gem_id_l1(region, 1, 1, 1, me1bId.chamber(), 0);
44  const GEMDetId gem_id_l2(region, 1, 1, 2, me1bId.chamber(), 0);
45  const GEMChamber* gemChamber_l1(gem_g->chamber(gem_id_l1));
46  const GEMChamber* gemChamber_l2(gem_g->chamber(gem_id_l2));
47  const GEMEtaPartition* randRoll(gemChamber_l1->etaPartition(2));
48 
49  // LUTs
50  std::vector<std::pair<double,double> > gemRollEtaLimits_l1;
51  std::vector<std::pair<double,double> > gemRollEtaLimits_l2;
52  std::vector<std::pair<double,double> > cscWGToEtaLimits;
53  std::vector<std::pair<int,int> > cscWgToGemRoll_l1;
54  std::vector<std::pair<int,int> > cscWgToGemRoll_l2;
55  std::vector<std::pair<int,int> > cscHsToGemPadME1a;
56  std::vector<std::pair<int,int> > cscHsToGemPadME1b;
57  std::vector<int> gemPadToCscHsME1a;
58  std::vector<int> gemPadToCscHsME1b;
59 
60  gemRollToEtaLimitsLUT(gemChamber_l1, gemRollEtaLimits_l1);
61  gemRollToEtaLimitsLUT(gemChamber_l2, gemRollEtaLimits_l2);
62  cscWgToEtaLimitsLUT(keyLayerME1b, cscWGToEtaLimits);
63  cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l1, cscWgToGemRoll_l1);
64  cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l2, cscWgToGemRoll_l2);
65  cscHsToGemPadLUT(keyLayerME1a, randRoll, 4, 93, cscHsToGemPadME1a);
66  cscHsToGemPadLUT(keyLayerME1b, randRoll, 5, 124, cscHsToGemPadME1b);
67  gemPadToCscHsLUT(keyLayerME1a, randRoll, gemPadToCscHsME1a);
68  gemPadToCscHsLUT(keyLayerME1b, randRoll, gemPadToCscHsME1b);
69 
70  // print LUTs
71  std::stringstream os;
72  os << "ME11 "<< me1bId <<std::endl;
73 
74  os << "GEM L1 roll to eta limits" << std::endl;
75  os << gemRollEtaLimits_l1;
76 
77  os << "GEM L2 roll to eta limits" << std::endl;
78  os << gemRollEtaLimits_l2;
79 
80  os << "ME1b "<< me1bId <<std::endl;
81  os << "WG roll to eta limits" << std::endl;
82  os << cscWGToEtaLimits;
83 
84  os << "WG to Roll L1" << std::endl;
85  os << cscWgToGemRoll_l1;
86 
87  os << "WG to Roll L2" << std::endl;
88  os << cscWgToGemRoll_l2;
89 
90  os << "CSC HS to GEM pad LUT in ME1a" << std::endl;
91  os << cscHsToGemPadME1a;
92 
93  os << "CSC HS to GEM pad LUT in ME1b" << std::endl;
94  os << cscHsToGemPadME1b;
95 
96  os << "GEM pad to CSC HS LUT in ME1a" << std::endl;
97  os << gemPadToCscHsME1a;
98 
99  os << "GEM pad to CSC HS LUT in ME1b" << std::endl;
100  os << gemPadToCscHsME1b;
101 
102  // print LUTs
103  LogTrace("CSCUpgradeMotherboardLUTGenerator") << os.str();
104 }
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 cscWgToEtaLimitsLUT(const CSCLayer *, std::vector< std::pair< double, double > > &) const
#define LogTrace(id)
void cscWgToRollLUT(const std::vector< std::pair< double, double > > &, const std::vector< std::pair< double, double > > &, std::vector< std::pair< int, int > > &) const
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:95
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
void gemPadToCscHsLUT(const CSCLayer *, const GEMEtaPartition *, std::vector< int > &) const
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
void CSCUpgradeMotherboardLUTGenerator::generateLUTsME21 ( unsigned  e,
unsigned  se,
unsigned  sb,
unsigned  c 
) const

Definition at line 106 of file CSCUpgradeMotherboardLUTGenerator.cc.

References CSCDetId::chamber(), CSCGeometry::chamber(), GEMGeometry::chamber(), CSCTriggerNumbering::chamberFromTriggerLabels(), csc_g, cscHsToGemPadLUT(), cscWgToEtaLimitsLUT(), cscWgToRollLUT(), gem_g, gemPadToCscHsLUT(), gemRollToEtaLimitsLUT(), and LogTrace.

Referenced by generateLUTs(), and setRPCGeometry().

107 {
108  bool gemGeometryAvailable(false);
109  if (gem_g != nullptr) {
110  LogTrace("CSCUpgradeMotherboardLUTGenerator") << "+++ generateLUTsME11() called for ME21 chamber! +++ \n";
111  gemGeometryAvailable = true;
112  }
113 
114  // check for GEM geometry
115  if (not gemGeometryAvailable){
116  LogTrace("CSCUpgradeMotherboardLUTGenerator") << "+++ generateLUTsME21() called for ME21 chamber without valid GEM geometry! +++ \n";
117  return;
118  }
119 
120  // CSC trigger geometry
121  const int chid = CSCTriggerNumbering::chamberFromTriggerLabels(theSector, theSubsector, 2, theTrigChamber);
122  const CSCDetId csc_id(theEndcap, 2, 1, chid, 0);
123  const CSCChamber* cscChamber(csc_g->chamber(csc_id));
124  const CSCLayer* keyLayer(cscChamber->layer(3));
125 
126  // GEM trigger geometry
127  const int region((theEndcap == 1) ? 1: -1);
128  const GEMDetId gem_id_l1(region, 1, 2, 1, csc_id.chamber(), 0);
129  const GEMDetId gem_id_l2(region, 1, 2, 2, csc_id.chamber(), 0);
130  const GEMChamber* gemChamber_l1(gem_g->chamber(gem_id_l1));
131  const GEMChamber* gemChamber_l2(gem_g->chamber(gem_id_l2));
132  const GEMEtaPartition* randRoll(gemChamber_l1->etaPartition(2));
133 
134  // LUTs
135  std::vector<std::pair<double,double> > gemRollEtaLimits_l1;
136  std::vector<std::pair<double,double> > gemRollEtaLimits_l2;
137  std::vector<std::pair<double,double> > cscWGToEtaLimits;
138  std::vector<std::pair<int,int> > cscWgToGemRoll_l1;
139  std::vector<std::pair<int,int> > cscWgToGemRoll_l2;
140  std::vector<std::pair<int,int> > cscHsToGemPad;
141  std::vector<int> gemPadToCscHs;
142 
143  gemRollToEtaLimitsLUT(gemChamber_l1, gemRollEtaLimits_l1);
144  gemRollToEtaLimitsLUT(gemChamber_l2, gemRollEtaLimits_l2);
145  cscWgToEtaLimitsLUT(keyLayer, cscWGToEtaLimits);
146  cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l1, cscWgToGemRoll_l1);
147  cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l2, cscWgToGemRoll_l2);
148  cscHsToGemPadLUT(keyLayer, randRoll, 4, 155, cscHsToGemPad);
149  gemPadToCscHsLUT(keyLayer, randRoll, gemPadToCscHs);
150 
151  std::stringstream os;
152  os << "ME21 "<< csc_id <<std::endl;
153 
154  os << "GEM roll to eta limits L1" << std::endl;
155  os << gemRollEtaLimits_l1;
156 
157  os << "GEM roll to eta limits L2" << std::endl;
158  os << gemRollEtaLimits_l2;
159 
160  os << "WG to eta limits" << std::endl;
161  os << cscWGToEtaLimits;
162 
163  os << "WG to Roll L1" << std::endl;
164  os << cscWgToGemRoll_l1;
165 
166  os << "WG to Roll L2" << std::endl;
167  os << cscWgToGemRoll_l2;
168 
169  os << "CSC HS to GEM pad LUT in ME21" << std::endl;
170  os << cscHsToGemPad;
171 
172  os << "GEM pad to CSC HS LUT in ME21" << std::endl;
173  os << gemPadToCscHs;
174 
175  // print LUTs
176  LogTrace("CSCUpgradeMotherboardLUTGenerator") << os.str();
177 }
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 cscWgToEtaLimitsLUT(const CSCLayer *, std::vector< std::pair< double, double > > &) const
#define LogTrace(id)
void cscWgToRollLUT(const std::vector< std::pair< double, double > > &, const std::vector< std::pair< double, double > > &, std::vector< std::pair< int, int > > &) const
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:95
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
void gemPadToCscHsLUT(const CSCLayer *, const GEMEtaPartition *, std::vector< int > &) const
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
void CSCUpgradeMotherboardLUTGenerator::generateLUTsME3141 ( unsigned  e,
unsigned  s,
unsigned  se,
unsigned  sb,
unsigned  c 
) const

Definition at line 179 of file CSCUpgradeMotherboardLUTGenerator.cc.

References RPCGeometry::chamber(), CSCGeometry::chamber(), CSCTriggerNumbering::chamberFromTriggerLabels(), csc_g, cscHsToRpcStripLUT(), cscWgToEtaLimitsLUT(), cscWgToRollLUT(), LogTrace, rpc_g, rpcRollToEtaLimitsLUT(), and rpcStripToCscHsLUT().

Referenced by generateLUTs(), and setRPCGeometry().

180 {
181  bool rpcGeometryAvailable(false);
182  if (rpc_g != nullptr) {
183  LogTrace("CSCUpgradeMotherboardLUTGenerator")<< "+++ generateLUTsME3141() called for ME3141 chamber! +++ \n";
184  rpcGeometryAvailable = true;
185  }
186 
187  if (not rpcGeometryAvailable){
188  LogTrace("CSCUpgradeMotherboardLUTGenerator") << "+++ generateLUTsME3141() called for ME3141 chamber without valid RPC geometry! +++ \n";
189  return;
190  }
191 
192  // CSC trigger geometry
193  const int chid = CSCTriggerNumbering::chamberFromTriggerLabels(theSector, theSubsector, theStation, theTrigChamber);
194  const CSCDetId csc_id(theEndcap, theStation, 1, chid, 0);
195  const CSCChamber* cscChamber(csc_g->chamber(csc_id));
196  const CSCLayer* keyLayer(cscChamber->layer(3));
197 
198  // RPC trigger geometry
199  const RPCDetId rpc_id(getRPCfromCSC(csc_id));
200  const RPCChamber* rpcChamber(rpc_g->chamber(rpc_id));
201  const RPCRoll* randRoll(rpcChamber->roll(2));
202 
203  // LUTs
204  std::vector<std::pair<double,double> > rpcRollToEtaLimits;
205  std::vector<std::pair<double,double> > cscWGToEtaLimits;
206  std::vector<std::pair<int,int> > cscWgToRpcRoll;
207  std::vector<std::pair<int,int> > cscHsToRpcStrip;
208  std::vector<int> rpcStripToCscHs;
209 
210  rpcRollToEtaLimitsLUT(rpcChamber, rpcRollToEtaLimits);
211  cscWgToEtaLimitsLUT(keyLayer, cscWGToEtaLimits);
212  cscWgToRollLUT(cscWGToEtaLimits, rpcRollToEtaLimits, cscWgToRpcRoll);
213  cscHsToRpcStripLUT(keyLayer, randRoll, 5, 155, cscHsToRpcStrip);
214  rpcStripToCscHsLUT(keyLayer, randRoll, rpcStripToCscHs);
215 
216  std::stringstream os;
217  os << "ME31/41 "<< csc_id <<std::endl;
218 
219  os << "RPC roll to eta limits" << std::endl;
220  os << rpcRollToEtaLimits;
221 
222  os << "WG to eta limits" << std::endl;
223  os << cscWGToEtaLimits;
224 
225  os << "WG to Roll" << std::endl;
226  os << cscWgToRpcRoll;
227 
228  os << "CSC HS to RPC strip LUT in ME3141" << std::endl;
229  os << cscHsToRpcStrip;
230 
231  os << "RPC strip to CSC HS LUT in ME3141" << std::endl;
232  os << rpcStripToCscHs;
233 
234  // print LUTs
235  LogTrace("CSCUpgradeMotherboardLUTGenerator") << os.str();
236 }
void cscHsToRpcStripLUT(const CSCLayer *, const RPCRoll *, int minH, int maxH, std::vector< std::pair< int, int > > &) const
const RPCChamber * chamber(RPCDetId id) const
Definition: RPCGeometry.cc:71
void rpcStripToCscHsLUT(const CSCLayer *, const RPCRoll *, std::vector< int > &) const
void cscWgToEtaLimitsLUT(const CSCLayer *, std::vector< std::pair< double, double > > &) const
#define LogTrace(id)
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
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
void CSCUpgradeMotherboardLUTGenerator::rpcRollToEtaLimitsLUT ( const RPCChamber c,
std::vector< std::pair< double, double > > &  lut 
) const
private

Definition at line 265 of file CSCUpgradeMotherboardLUTGenerator.cc.

References funct::abs(), lumiPlot::lut, and RPCChamber::rolls().

Referenced by generateLUTsME3141(), and setRPCGeometry().

266 {
267  for(const auto& roll : rpcChamber->rolls()) {
268  const float half_striplength(roll->specs()->specificTopology().stripLength()/2.);
269  const LocalPoint lp_top(0., half_striplength, 0.);
270  const LocalPoint lp_bottom(0., -half_striplength, 0.);
271  const GlobalPoint gp_top(roll->toGlobal(lp_top));
272  const GlobalPoint gp_bottom(roll->toGlobal(lp_bottom));
273  lut.push_back(std::make_pair(std::abs(gp_top.eta()), std::abs(gp_bottom.eta())));
274  }
275 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void CSCUpgradeMotherboardLUTGenerator::rpcStripToCscHsLUT ( const CSCLayer keyLayer,
const RPCRoll randRoll,
std::vector< int > &  lut 
) const
private

Definition at line 353 of file CSCUpgradeMotherboardLUTGenerator.cc.

References RPCRoll::centreOfStrip(), CSCLayer::geometry(), runTauDisplay::gp, mps_fire::i, RPCRoll::nstrips(), digi_MixPreMix_cfi::strip, GeomDet::toGlobal(), and GeomDet::toLocal().

Referenced by generateLUTsME3141(), and setRPCGeometry().

355 {
356  const int nRPCStrips(randRoll->nstrips());
357  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
358  for (int i = 1; i<= nRPCStrips; ++i){
359  const LocalPoint lpRPC(randRoll->centreOfStrip(i));
360  const GlobalPoint gp(randRoll->toGlobal(lpRPC));
361  const LocalPoint lpCSC(keyLayer->toLocal(gp));
362  const float strip(keyLayerGeometry->strip(lpCSC));
363  lut.push_back( (int) (strip-0.25)/0.5 );
364  }
365 }
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:52
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
int nstrips() const
Definition: RPCRoll.cc:46
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void CSCUpgradeMotherboardLUTGenerator::setCSCGeometry ( const CSCGeometry g)
inline

set CSC and GEM geometries for the matching needs

Definition at line 35 of file CSCUpgradeMotherboardLUTGenerator.h.

References csc_g, and g.

35 { csc_g = g; }
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
void CSCUpgradeMotherboardLUTGenerator::setGEMGeometry ( const GEMGeometry g)
inline

Definition at line 36 of file CSCUpgradeMotherboardLUTGenerator.h.

References g, and gem_g.

36 { gem_g = g; }
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
void CSCUpgradeMotherboardLUTGenerator::setRPCGeometry ( const RPCGeometry g)
inline

Definition at line 37 of file CSCUpgradeMotherboardLUTGenerator.h.

References assignRoll(), EnergyCorrector::c, cscHsToGemPadLUT(), cscHsToRpcStripLUT(), cscWgToEtaLimitsLUT(), cscWgToRollLUT(), MillePedeFileConverter_cfg::e, stringResolutionProvider_cfi::eta, g, gemPadToCscHsLUT(), gemRollToEtaLimitsLUT(), generateLUTs(), generateLUTsME11(), generateLUTsME21(), generateLUTsME3141(), rpc_g, rpcRollToEtaLimitsLUT(), rpcStripToCscHsLUT(), and alignCSCRings::s.

37 { rpc_g = g; }
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

Member Data Documentation

const CSCGeometry* CSCUpgradeMotherboardLUTGenerator::csc_g
private
const GEMGeometry* CSCUpgradeMotherboardLUTGenerator::gem_g
private
const RPCGeometry* CSCUpgradeMotherboardLUTGenerator::rpc_g
private

Definition at line 75 of file CSCUpgradeMotherboardLUTGenerator.h.

Referenced by generateLUTsME3141(), and setRPCGeometry().