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 setCSCGeometry (const CSCGeometry *g)
 set CSC and GEM geometries for the matching needs More...
 
void setGEMGeometry (const GEMGeometry *g)
 
 ~CSCUpgradeMotherboardLUTGenerator ()
 

Private Member Functions

void cscHsToGemPadLUT (const CSCLayer *, const GEMEtaPartition *, 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
 

Private Attributes

const CSCGeometrycsc_g
 
const GEMGeometrygem_g
 

Detailed Description

Definition at line 11 of file CSCUpgradeMotherboardLUTGenerator.h.

Constructor & Destructor Documentation

CSCUpgradeMotherboardLUTGenerator::CSCUpgradeMotherboardLUTGenerator ( )
inline

Definition at line 15 of file CSCUpgradeMotherboardLUTGenerator.h.

15 {}
CSCUpgradeMotherboardLUTGenerator::~CSCUpgradeMotherboardLUTGenerator ( )
inline

Definition at line 16 of file CSCUpgradeMotherboardLUTGenerator.h.

16 {}

Member Function Documentation

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

Definition at line 176 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

Referenced by cscWgToRollLUT(), and setGEMGeometry().

177 {
178  int result = -99;
179  for(const auto& p : lut_) {
180  const float minEta(p.first);
181  const float maxEta(p.second);
182  if (minEta <= std::abs(eta) and std::abs(eta) < maxEta) {
183  result = p.first;
184  break;
185  }
186  }
187  return result;
188 }
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 227 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 setGEMGeometry().

230 {
231  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
232  auto nStrips(keyLayerGeometry->numberOfStrips());
233  for (float i = 0; i< nStrips; i = i+0.5){
234  const LocalPoint lpCSC(keyLayerGeometry->topology()->localPosition(i));
235  const GlobalPoint gp(keyLayer->toGlobal(lpCSC));
236  const LocalPoint lpGEM(randRoll->toLocal(gp));
237  const int HS(i/0.5);
238  const bool edge(HS < minH or HS > maxH);
239  const float pad(edge ? -99 : randRoll->pad(lpGEM));
240  lut.emplace_back(std::floor(pad),std::ceil(pad));
241  }
242 }
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::cscWgToEtaLimitsLUT ( const CSCLayer keyLayer,
std::vector< std::pair< double, double > > &  lut 
) const
private

Definition at line 214 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

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

215 {
216  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
217  const int numberOfWG(keyLayerGeometry->numberOfWireGroups());
218  for (int i = 0; i< numberOfWG; ++i){
219  const float middle_wire(keyLayerGeometry->middleWireOfGroup(i));
220  const std::pair<LocalPoint, LocalPoint> wire_ends(keyLayerGeometry->wireTopology()->wireEnds(middle_wire));
221  const GlobalPoint gp_top(keyLayer->toGlobal(wire_ends.first));
222  const GlobalPoint gp_bottom(keyLayer->toGlobal(wire_ends.first));
223  lut.emplace_back(gp_top.eta(), gp_bottom.eta());
224  }
225 }
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 203 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

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

206 {
207  for (const auto& p: inLUT1){
208  double etaMin(p.first);
209  double etaMax(p.second);
210  outLUT.emplace_back(assignRoll(inLUT2, etaMin), assignRoll(inLUT2, etaMax));
211  }
212 }
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 245 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

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

248 {
249  const int nGEMPads(randRoll->npads());
250  const CSCLayerGeometry* keyLayerGeometry(keyLayer->geometry());
251  for (int i = 1; i<= nGEMPads; ++i){
252  const LocalPoint lpGEM(randRoll->centreOfPad(i));
253  const GlobalPoint gp(randRoll->toGlobal(lpGEM));
254  const LocalPoint lpCSC(keyLayer->toLocal(gp));
255  const float strip(keyLayerGeometry->strip(lpCSC));
256  lut.push_back( (int) (strip)/0.5 );
257  }
258 }
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 190 of file CSCUpgradeMotherboardLUTGenerator.cc.

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

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

191 {
192  for(const auto& roll : gemChamber->etaPartitions()) {
193  const float half_striplength(roll->specs()->specificTopology().stripLength()/2.);
194  const LocalPoint lp_top(0., half_striplength, 0.);
195  const LocalPoint lp_bottom(0., -half_striplength, 0.);
196  const GlobalPoint gp_top(roll->toGlobal(lp_top));
197  const GlobalPoint gp_bottom(roll->toGlobal(lp_bottom));
198  lut.emplace_back(std::abs(gp_top.eta()), std::abs(gp_bottom.eta()));
199  }
200 }
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 7 of file CSCUpgradeMotherboardLUTGenerator.cc.

References generateLUTsME11(), and generateLUTsME21().

Referenced by setGEMGeometry().

8 {
9  if (theStation==1) generateLUTsME11(theEndcap, theSector, theSubsector, theTrigChamber);
10  if (theStation==2) generateLUTsME21(theEndcap, theSector, theSubsector, theTrigChamber);
11 }
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 13 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 setGEMGeometry().

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

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

set CSC and GEM geometries for the matching needs

Definition at line 19 of file CSCUpgradeMotherboardLUTGenerator.h.

References csc_g, and g.

19 { 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 20 of file CSCUpgradeMotherboardLUTGenerator.h.

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

20 { 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

Member Data Documentation

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