CMS 3D CMS Logo

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

#include <CSCUpgradeMotherboardLUTGenerator.h>

Classes

class  Helpers
 

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 12 of file CSCUpgradeMotherboardLUTGenerator.h.

Constructor & Destructor Documentation

CSCUpgradeMotherboardLUTGenerator::CSCUpgradeMotherboardLUTGenerator ( )
inline

Definition at line 22 of file CSCUpgradeMotherboardLUTGenerator.h.

22 {}
CSCUpgradeMotherboardLUTGenerator::~CSCUpgradeMotherboardLUTGenerator ( )
inline

Definition at line 23 of file CSCUpgradeMotherboardLUTGenerator.h.

23 {}

Member Function Documentation

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

Definition at line 249 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().

250 {
251  int result = -99;
252  for(const auto& p : lut_) {
253  const float minEta(p.first);
254  const float maxEta(p.second);
255  if (minEta <= std::abs(eta) and std::abs(eta) < maxEta) {
256  result = p.first;
257  break;
258  }
259  }
260  return result;
261 }
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 312 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().

315 {
316  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
317  auto nStrips(keyLayerGeometry->numberOfStrips());
318  for (float i = 0; i< nStrips; i = i+0.5){
319  const LocalPoint lpCSC(keyLayerGeometry->topology()->localPosition(i));
320  const GlobalPoint gp(keyLayer->toGlobal(lpCSC));
321  const LocalPoint lpGEM(randRoll->toLocal(gp));
322  const int HS(i/0.5);
323  const bool edge(HS < minH or HS > maxH);
324  const float pad(edge ? -99 : randRoll->pad(lpGEM));
325  lut.emplace_back(std::floor(pad),std::ceil(pad));
326  }
327 }
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 346 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().

349 {
350  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
351  auto nStrips(keyLayerGeometry->numberOfStrips());
352  for (float i = 0; i< nStrips; i = i+0.5){
353  const LocalPoint lpCSC(keyLayerGeometry->topology()->localPosition(i));
354  const GlobalPoint gp(keyLayer->toGlobal(lpCSC));
355  const LocalPoint lpRPC(randRoll->toLocal(gp));
356  const int HS(i/0.5);
357  const bool edge(HS < minH or HS > maxH);
358  const float strip(edge ? -99 : randRoll->strip(lpRPC));
359  lut.emplace_back(std::floor(strip),std::ceil(strip));
360  }
361 }
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 299 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

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

300 {
301  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
302  const int numberOfWG(keyLayerGeometry->numberOfWireGroups());
303  for (int i = 0; i< numberOfWG; ++i){
304  const float middle_wire(keyLayerGeometry->middleWireOfGroup(i));
305  const std::pair<LocalPoint, LocalPoint> wire_ends(keyLayerGeometry->wireTopology()->wireEnds(middle_wire));
306  const GlobalPoint gp_top(keyLayer->toGlobal(wire_ends.first));
307  const GlobalPoint gp_bottom(keyLayer->toGlobal(wire_ends.first));
308  lut.emplace_back(gp_top.eta(), gp_bottom.eta());
309  }
310 }
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 288 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

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

291 {
292  for (const auto& p: inLUT1){
293  double etaMin(p.first);
294  double etaMax(p.second);
295  outLUT.emplace_back(assignRoll(inLUT2, etaMin), assignRoll(inLUT2, etaMax));
296  }
297 }
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 330 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().

333 {
334  const int nGEMPads(randRoll->npads());
335  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
336  for (int i = 1; i<= nGEMPads; ++i){
337  const LocalPoint lpGEM(randRoll->centreOfPad(i));
338  const GlobalPoint gp(randRoll->toGlobal(lpGEM));
339  const LocalPoint lpCSC(keyLayer->toLocal(gp));
340  const float strip(keyLayerGeometry->strip(lpCSC));
341  lut.push_back( (int) (strip)/0.5 );
342  }
343 }
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 263 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

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

264 {
265  for(const auto& roll : gemChamber->etaPartitions()) {
266  const float half_striplength(roll->specs()->specificTopology().stripLength()/2.);
267  const LocalPoint lp_top(0., half_striplength, 0.);
268  const LocalPoint lp_bottom(0., -half_striplength, 0.);
269  const GlobalPoint gp_top(roll->toGlobal(lp_top));
270  const GlobalPoint gp_bottom(roll->toGlobal(lp_bottom));
271  lut.emplace_back(std::abs(gp_top.eta()), std::abs(gp_bottom.eta()));
272  }
273 }
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 19 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

Referenced by setRPCGeometry().

20 {
21  if (theStation==1) generateLUTsME11(theEndcap, theSector, theSubsector, theTrigChamber);
22  if (theStation==2) generateLUTsME21(theEndcap, theSector, theSubsector, theTrigChamber);
23  if (theStation==3) generateLUTsME3141(theEndcap, 3, theSector, theSubsector, theTrigChamber);
24  if (theStation==4) generateLUTsME3141(theEndcap, 4, theSector, theSubsector, theTrigChamber);
25 }
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 27 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().

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

118 {
119  bool gemGeometryAvailable(false);
120  if (gem_g != nullptr) {
121  LogTrace("CSCUpgradeMotherboardLUTGenerator") << "+++ generateLUTsME11() called for ME21 chamber! +++ \n";
122  gemGeometryAvailable = true;
123  }
124 
125  // check for GEM geometry
126  if (not gemGeometryAvailable){
127  LogTrace("CSCUpgradeMotherboardLUTGenerator") << "+++ generateLUTsME21() called for ME21 chamber without valid GEM geometry! +++ \n";
128  return;
129  }
130 
131  // CSC trigger geometry
132  const int chid = CSCTriggerNumbering::chamberFromTriggerLabels(theSector, theSubsector, 2, theTrigChamber);
133  const CSCDetId csc_id(theEndcap, 2, 1, chid, 0);
134  const CSCChamber* cscChamber(csc_g->chamber(csc_id));
135  const CSCLayer* keyLayer(cscChamber->layer(3));
136 
137  // GEM trigger geometry
138  const int region((theEndcap == 1) ? 1: -1);
139  const GEMDetId gem_id_l1(region, 1, 2, 1, csc_id.chamber(), 0);
140  const GEMDetId gem_id_l2(region, 1, 2, 2, csc_id.chamber(), 0);
141  const GEMChamber* gemChamber_l1(gem_g->chamber(gem_id_l1));
142  const GEMChamber* gemChamber_l2(gem_g->chamber(gem_id_l2));
143  const GEMEtaPartition* randRoll(gemChamber_l1->etaPartition(2));
144 
145  // LUTs
146  std::vector<std::pair<double,double> > gemRollEtaLimits_l1;
147  std::vector<std::pair<double,double> > gemRollEtaLimits_l2;
148  std::vector<std::pair<double,double> > cscWGToEtaLimits;
149  std::vector<std::pair<int,int> > cscWgToGemRoll_l1;
150  std::vector<std::pair<int,int> > cscWgToGemRoll_l2;
151  std::vector<std::pair<int,int> > cscHsToGemPad;
152  std::vector<int> gemPadToCscHs;
153 
154  gemRollToEtaLimitsLUT(gemChamber_l1, gemRollEtaLimits_l1);
155  gemRollToEtaLimitsLUT(gemChamber_l2, gemRollEtaLimits_l2);
156  cscWgToEtaLimitsLUT(keyLayer, cscWGToEtaLimits);
157  cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l1, cscWgToGemRoll_l1);
158  cscWgToRollLUT(cscWGToEtaLimits, gemRollEtaLimits_l2, cscWgToGemRoll_l2);
159  cscHsToGemPadLUT(keyLayer, randRoll, 4, 155, cscHsToGemPad);
160  gemPadToCscHsLUT(keyLayer, randRoll, gemPadToCscHs);
161 
162  std::stringstream os;
163  os << "ME21 "<< csc_id <<std::endl;
164 
165  os << "GEM roll to eta limits L1" << std::endl;
166  os << gemRollEtaLimits_l1;
167 
168  os << "GEM roll to eta limits L2" << std::endl;
169  os << gemRollEtaLimits_l2;
170 
171  os << "WG to eta limits" << std::endl;
172  os << cscWGToEtaLimits;
173 
174  os << "WG to Roll L1" << std::endl;
175  os << cscWgToGemRoll_l1;
176 
177  os << "WG to Roll L2" << std::endl;
178  os << cscWgToGemRoll_l2;
179 
180  os << "CSC HS to GEM pad LUT in ME21" << std::endl;
181  os << cscHsToGemPad;
182 
183  os << "GEM pad to CSC HS LUT in ME21" << std::endl;
184  os << gemPadToCscHs;
185 
186  // print LUTs
187  LogTrace("CSCUpgradeMotherboardLUTGenerator") << os.str();
188 }
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 190 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

Referenced by generateLUTs(), and setRPCGeometry().

191 {
192  bool rpcGeometryAvailable(false);
193  if (rpc_g != nullptr) {
194  LogTrace("CSCUpgradeMotherboardLUTGenerator")<< "+++ generateLUTsME3141() called for ME3141 chamber! +++ \n";
195  rpcGeometryAvailable = true;
196  }
197 
198  if (not rpcGeometryAvailable){
199  LogTrace("CSCUpgradeMotherboardLUTGenerator") << "+++ generateLUTsME3141() called for ME3141 chamber without valid RPC geometry! +++ \n";
200  return;
201  }
202 
203  // CSC trigger geometry
204  const int chid = CSCTriggerNumbering::chamberFromTriggerLabels(theSector, theSubsector, theStation, theTrigChamber);
205  const CSCDetId csc_id(theEndcap, theStation, 1, chid, 0);
206  const CSCChamber* cscChamber(csc_g->chamber(csc_id));
207  const CSCLayer* keyLayer(cscChamber->layer(3));
208 
209  // RPC trigger geometry
211  const RPCChamber* rpcChamber(rpc_g->chamber(rpc_id));
212  const RPCRoll* randRoll(rpcChamber->roll(2));
213 
214  // LUTs
215  std::vector<std::pair<double,double> > rpcRollToEtaLimits;
216  std::vector<std::pair<double,double> > cscWGToEtaLimits;
217  std::vector<std::pair<int,int> > cscWgToRpcRoll;
218  std::vector<std::pair<int,int> > cscHsToRpcStrip;
219  std::vector<int> rpcStripToCscHs;
220 
221  rpcRollToEtaLimitsLUT(rpcChamber, rpcRollToEtaLimits);
222  cscWgToEtaLimitsLUT(keyLayer, cscWGToEtaLimits);
223  cscWgToRollLUT(cscWGToEtaLimits, rpcRollToEtaLimits, cscWgToRpcRoll);
224  cscHsToRpcStripLUT(keyLayer, randRoll, 5, 155, cscHsToRpcStrip);
225  rpcStripToCscHsLUT(keyLayer, randRoll, rpcStripToCscHs);
226 
227  std::stringstream os;
228  os << "ME31/41 "<< csc_id <<std::endl;
229 
230  os << "RPC roll to eta limits" << std::endl;
231  os << rpcRollToEtaLimits;
232 
233  os << "WG to eta limits" << std::endl;
234  os << cscWGToEtaLimits;
235 
236  os << "WG to Roll" << std::endl;
237  os << cscWgToRpcRoll;
238 
239  os << "CSC HS to RPC strip LUT in ME3141" << std::endl;
240  os << cscHsToRpcStrip;
241 
242  os << "RPC strip to CSC HS LUT in ME3141" << std::endl;
243  os << rpcStripToCscHs;
244 
245  // print LUTs
246  LogTrace("CSCUpgradeMotherboardLUTGenerator") << os.str();
247 }
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
static RPCDetId getRPCfromCSC(const CSCDetId &csc_id)
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 276 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

Referenced by generateLUTsME3141(), and setRPCGeometry().

277 {
278  for(const auto& roll : rpcChamber->rolls()) {
279  const float half_striplength(roll->specs()->specificTopology().stripLength()/2.);
280  const LocalPoint lp_top(0., half_striplength, 0.);
281  const LocalPoint lp_bottom(0., -half_striplength, 0.);
282  const GlobalPoint gp_top(roll->toGlobal(lp_top));
283  const GlobalPoint gp_bottom(roll->toGlobal(lp_bottom));
284  lut.push_back(std::make_pair(std::abs(gp_top.eta()), std::abs(gp_bottom.eta())));
285  }
286 }
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 364 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().

366 {
367  const int nRPCStrips(randRoll->nstrips());
368  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
369  for (int i = 1; i<= nRPCStrips; ++i){
370  const LocalPoint lpRPC(randRoll->centreOfStrip(i));
371  const GlobalPoint gp(randRoll->toGlobal(lpRPC));
372  const LocalPoint lpCSC(keyLayer->toLocal(gp));
373  const float strip(keyLayerGeometry->strip(lpCSC));
374  lut.push_back( (int) (strip-0.25)/0.5 );
375  }
376 }
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 26 of file CSCUpgradeMotherboardLUTGenerator.h.

References csc_g, and g.

26 { 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 27 of file CSCUpgradeMotherboardLUTGenerator.h.

References g, and gem_g.

27 { 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 28 of file CSCUpgradeMotherboardLUTGenerator.h.

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

28 { 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 66 of file CSCUpgradeMotherboardLUTGenerator.h.

Referenced by generateLUTsME3141(), and setRPCGeometry().