CMS 3D CMS Logo

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

#include <TkDetMap.h>

Public Member Functions

int16_t findLayer (DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
 
void getComponents (int layer, int &nchX, double &lowX, double &highX, int &nchY, double &lowY, double &highY) const
 
DetId getDetFromBin (int layer, int ix, int iy) const
 
DetId getDetFromBin (const std::string &layerName, int ix, int iy) const
 
std::vector< DetIdgetDetsForLayer (int layer) const
 
const TkLayerMap::XYbingetXY (DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
 
void setLayerMap (int layer, const TkLayerMap &lyrMap)
 
void setLayerMap (int layer, TkLayerMap &&lyrMap)
 
 TkDetMap (const TrackerTopology *tTopo)
 

Static Public Member Functions

static std::string getLayerName (int in)
 
static int getLayerNum (const std::string &in)
 
static void getSubDetLayerSide (int in, SiStripDetId::SubDetector &, uint32_t &layer, uint32_t &side)
 

Private Attributes

std::vector< TkLayerMapTkMap
 
const TrackerTopologytTopo_
 

Detailed Description

Definition at line 124 of file TkDetMap.h.

Constructor & Destructor Documentation

TkDetMap::TkDetMap ( const TrackerTopology tTopo)
inline

Definition at line 127 of file TkDetMap.h.

References TkLayerMap::NUMLAYERS.

127 : tTopo_(tTopo) { TkMap.resize(TkLayerMap::NUMLAYERS); } // maximal number of layers
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:157
const TrackerTopology * tTopo_
Definition: TkDetMap.h:158

Member Function Documentation

int16_t TkDetMap::findLayer ( DetId  detid,
DetId cached_detid,
int16_t &  cached_layer,
TkLayerMap::XYbin cached_XYbin 
) const

Definition at line 563 of file TkDetMap.cc.

References TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, TkLayerMap::layerSearch(), LogTrace, DetId::rawId(), and TkLayerMap::tTopo_.

Referenced by TkHistoMap::add(), TkHistoMap::fill(), TkHistoMap::getEntries(), TkHistoMap::getValue(), and TkHistoMap::setBinContent().

564 {
565  if ( detid == cached_detid )
566  return cached_layer;
567 
568  cached_detid = detid;
569 
570  int16_t layer = TkLayerMap::layerSearch(detid, tTopo_);
571  LogTrace("TkDetMap") << "[findLayer] detid " << detid.rawId() << " layer " << layer;
572  if ( layer != cached_layer ) {
573  cached_layer=layer;
574  }
575  cached_XYbin = TkMap[cached_layer].getXY(detid, layer);
576  LogTrace("TkDetMap") << "[findLayer] detid " << detid.rawId() << " cached_XYbin " << cached_XYbin.ix << " " << cached_XYbin.iy;
577 
578  return cached_layer;
579 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
static const int16_t layerSearch(DetId detid, const TrackerTopology *tTopo)
Definition: TkDetMap.cc:123
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:157
#define LogTrace(id)
const TrackerTopology * tTopo_
Definition: TkDetMap.h:158
void TkDetMap::getComponents ( int  layer,
int &  nchX,
double &  lowX,
double &  highX,
int &  nchY,
double &  lowY,
double &  highY 
) const

Definition at line 581 of file TkDetMap.cc.

Referenced by TkHistoMap::createTkHistoMap().

584 {
585  nchX = TkMap[layer].get_nchX();
586  lowX = TkMap[layer].get_lowX();
587  highX = TkMap[layer].get_highX();
588  nchY = TkMap[layer].get_nchY();
589  lowY = TkMap[layer].get_lowY();
590  highY = TkMap[layer].get_highY();
591 }
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:157
DetId TkDetMap::getDetFromBin ( int  layer,
int  ix,
int  iy 
) const
inline

Definition at line 139 of file TkDetMap.h.

Referenced by TkHistoMap::createTkHistoMap(), TkHistoMap::getDetId(), and SiStripQualityChecker::getModuleStatus().

140  { return TkMap[layer].getDetFromBin(ix, iy); }
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:157
DetId TkDetMap::getDetFromBin ( const std::string &  layerName,
int  ix,
int  iy 
) const
inline

Definition at line 141 of file TkDetMap.h.

References TkLayerMap::getDetFromBin().

142  { return getDetFromBin(getLayerNum(layerName), ix, iy); }
static int getLayerNum(const std::string &in)
Definition: TkDetMap.cc:310
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:139
std::vector<DetId> TkDetMap::getDetsForLayer ( int  layer) const
inline

Definition at line 144 of file TkDetMap.h.

References TkLayerMap::getXY().

Referenced by TkHistoMap::dumpInTkMap(), and SiStripTrackerMapCreator::paintTkMapFromHistogram().

145  { return TkMap[layer].getBinToDet(); } // const vector& -> vector conversion will copy
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:157
std::string TkDetMap::getLayerName ( int  in)
static

Definition at line 235 of file TkDetMap.cc.

References TkLayerMap::TECM_W1, TkLayerMap::TECM_W2, TkLayerMap::TECM_W3, TkLayerMap::TECM_W4, TkLayerMap::TECM_W5, TkLayerMap::TECM_W6, TkLayerMap::TECM_W7, TkLayerMap::TECM_W8, TkLayerMap::TECM_W9, TkLayerMap::TECP_W1, TkLayerMap::TECP_W2, TkLayerMap::TECP_W3, TkLayerMap::TECP_W4, TkLayerMap::TECP_W5, TkLayerMap::TECP_W6, TkLayerMap::TECP_W7, TkLayerMap::TECP_W8, TkLayerMap::TECP_W9, TkLayerMap::TIB_L1, TkLayerMap::TIB_L2, TkLayerMap::TIB_L3, TkLayerMap::TIB_L4, TkLayerMap::TIDM_D1, TkLayerMap::TIDM_D2, TkLayerMap::TIDM_D3, TkLayerMap::TIDP_D1, TkLayerMap::TIDP_D2, TkLayerMap::TIDP_D3, TkLayerMap::TOB_L1, TkLayerMap::TOB_L2, TkLayerMap::TOB_L3, TkLayerMap::TOB_L4, TkLayerMap::TOB_L5, and TkLayerMap::TOB_L6.

Referenced by TkHistoMap::folderDefinition().

236 {
237  switch (in) {
238  case TkLayerMap::TIB_L1:
239  return "TIB_L1";
240  case TkLayerMap::TIB_L2:
241  return "TIB_L2";
242  case TkLayerMap::TIB_L3:
243  return "TIB_L3";
244  case TkLayerMap::TIB_L4:
245  return "TIB_L4";
246  case TkLayerMap::TIDP_D1:
247  return "TIDP_D1";
248  case TkLayerMap::TIDP_D2:
249  return "TIDP_D2";
250  case TkLayerMap::TIDP_D3:
251  return "TIDP_D3";
252  case TkLayerMap::TIDM_D1:
253  return "TIDM_D1";
254  case TkLayerMap::TIDM_D2:
255  return "TIDM_D2";
256  case TkLayerMap::TIDM_D3:
257  return "TIDM_D3";
258  case TkLayerMap::TOB_L1:
259  return "TOB_L1";
260  case TkLayerMap::TOB_L2:
261  return "TOB_L2";
262  case TkLayerMap::TOB_L3:
263  return "TOB_L3";
264  case TkLayerMap::TOB_L4:
265  return "TOB_L4";
266  case TkLayerMap::TOB_L5:
267  return "TOB_L5";
268  case TkLayerMap::TOB_L6:
269  return "TOB_L6";
270  case TkLayerMap::TECP_W1:
271  return "TECP_W1";
272  case TkLayerMap::TECP_W2:
273  return "TECP_W2";
274  case TkLayerMap::TECP_W3:
275  return "TECP_W3";
276  case TkLayerMap::TECP_W4:
277  return "TECP_W4";
278  case TkLayerMap::TECP_W5:
279  return "TECP_W5";
280  case TkLayerMap::TECP_W6:
281  return "TECP_W6";
282  case TkLayerMap::TECP_W7:
283  return "TECP_W7";
284  case TkLayerMap::TECP_W8:
285  return "TECP_W8";
286  case TkLayerMap::TECP_W9:
287  return "TECP_W9";
288  case TkLayerMap::TECM_W1:
289  return "TECM_W1";
290  case TkLayerMap::TECM_W2:
291  return "TECM_W2";
292  case TkLayerMap::TECM_W3:
293  return "TECM_W3";
294  case TkLayerMap::TECM_W4:
295  return "TECM_W4";
296  case TkLayerMap::TECM_W5:
297  return "TECM_W5";
298  case TkLayerMap::TECM_W6:
299  return "TECM_W6";
300  case TkLayerMap::TECM_W7:
301  return "TECM_W7";
302  case TkLayerMap::TECM_W8:
303  return "TECM_W8";
304  case TkLayerMap::TECM_W9:
305  return "TECM_W9";
306  }
307  return "Invalid";
308 }
int TkDetMap::getLayerNum ( const std::string &  in)
static

Definition at line 310 of file TkDetMap.cc.

References TkLayerMap::TECM_W1, TkLayerMap::TECM_W2, TkLayerMap::TECM_W3, TkLayerMap::TECM_W4, TkLayerMap::TECM_W5, TkLayerMap::TECM_W6, TkLayerMap::TECM_W7, TkLayerMap::TECM_W8, TkLayerMap::TECM_W9, TkLayerMap::TECP_W1, TkLayerMap::TECP_W2, TkLayerMap::TECP_W3, TkLayerMap::TECP_W4, TkLayerMap::TECP_W5, TkLayerMap::TECP_W6, TkLayerMap::TECP_W7, TkLayerMap::TECP_W8, TkLayerMap::TECP_W9, TkLayerMap::TIB_L1, TkLayerMap::TIB_L2, TkLayerMap::TIB_L3, TkLayerMap::TIB_L4, TkLayerMap::TIDM_D1, TkLayerMap::TIDM_D2, TkLayerMap::TIDM_D3, TkLayerMap::TIDP_D1, TkLayerMap::TIDP_D2, TkLayerMap::TIDP_D3, TkLayerMap::TOB_L1, TkLayerMap::TOB_L2, TkLayerMap::TOB_L3, TkLayerMap::TOB_L4, TkLayerMap::TOB_L5, and TkLayerMap::TOB_L6.

Referenced by TkHistoMap::getLayerNum(), and SiStripTrackerMapCreator::paintTkMapFromHistogram().

311 {
312  if ( in == "TIB_L1" )
313  return TkLayerMap::TIB_L1;
314  if ( in == "TIB_L2" )
315  return TkLayerMap::TIB_L2;
316  if ( in == "TIB_L3" )
317  return TkLayerMap::TIB_L3;
318  if ( in == "TIB_L4" )
319  return TkLayerMap::TIB_L4;
320  if ( in == "TIDP_D1" )
321  return TkLayerMap::TIDP_D1;
322  if ( in == "TIDP_D2" )
323  return TkLayerMap::TIDP_D2;
324  if ( in == "TIDP_D3" )
325  return TkLayerMap::TIDP_D3;
326  if ( in == "TIDM_D1" )
327  return TkLayerMap::TIDM_D1;
328  if ( in == "TIDM_D2" )
329  return TkLayerMap::TIDM_D2;
330  if ( in == "TIDM_D3" )
331  return TkLayerMap::TIDM_D3;
332  if ( in == "TOB_L1" )
333  return TkLayerMap::TOB_L1;
334  if ( in == "TOB_L2" )
335  return TkLayerMap::TOB_L2;
336  if ( in == "TOB_L3" )
337  return TkLayerMap::TOB_L3;
338  if ( in == "TOB_L4" )
339  return TkLayerMap::TOB_L4;
340  if ( in == "TOB_L5" )
341  return TkLayerMap::TOB_L5;
342  if ( in == "TOB_L6" )
343  return TkLayerMap::TOB_L6;
344  if ( in == "TECP_W1" )
345  return TkLayerMap::TECP_W1;
346  if ( in == "TECP_W2" )
347  return TkLayerMap::TECP_W2;
348  if ( in == "TECP_W3" )
349  return TkLayerMap::TECP_W3;
350  if ( in == "TECP_W4" )
351  return TkLayerMap::TECP_W4;
352  if ( in == "TECP_W5" )
353  return TkLayerMap::TECP_W5;
354  if ( in == "TECP_W6" )
355  return TkLayerMap::TECP_W6;
356  if ( in == "TECP_W7" )
357  return TkLayerMap::TECP_W7;
358  if ( in == "TECP_W8" )
359  return TkLayerMap::TECP_W8;
360  if ( in == "TECP_W9" )
361  return TkLayerMap::TECP_W9;
362  if ( in == "TECM_W1" )
363  return TkLayerMap::TECM_W1;
364  if ( in == "TECM_W2" )
365  return TkLayerMap::TECM_W2;
366  if ( in == "TECM_W3" )
367  return TkLayerMap::TECM_W3;
368  if ( in == "TECM_W4" )
369  return TkLayerMap::TECM_W4;
370  if ( in == "TECM_W5" )
371  return TkLayerMap::TECM_W5;
372  if ( in == "TECM_W6" )
373  return TkLayerMap::TECM_W6;
374  if ( in == "TECM_W7" )
375  return TkLayerMap::TECM_W7;
376  if ( in == "TECM_W8" )
377  return TkLayerMap::TECM_W8;
378  if ( in == "TECM_W9" )
379  return TkLayerMap::TECM_W9;
380  return 0;
381 }
void TkDetMap::getSubDetLayerSide ( int  in,
SiStripDetId::SubDetector subDet,
uint32_t &  layer,
uint32_t &  side 
)
static

Definition at line 383 of file TkDetMap.cc.

References SiStripDetId::TEC, TkLayerMap::TECM_W1, TkLayerMap::TECM_W2, TkLayerMap::TECM_W3, TkLayerMap::TECM_W4, TkLayerMap::TECM_W5, TkLayerMap::TECM_W6, TkLayerMap::TECM_W7, TkLayerMap::TECM_W8, TkLayerMap::TECM_W9, TkLayerMap::TECP_W1, TkLayerMap::TECP_W2, TkLayerMap::TECP_W3, TkLayerMap::TECP_W4, TkLayerMap::TECP_W5, TkLayerMap::TECP_W6, TkLayerMap::TECP_W7, TkLayerMap::TECP_W8, TkLayerMap::TECP_W9, SiStripDetId::TIB, TkLayerMap::TIB_L1, TkLayerMap::TIB_L2, TkLayerMap::TIB_L3, TkLayerMap::TIB_L4, SiStripDetId::TID, TkLayerMap::TIDM_D1, TkLayerMap::TIDM_D2, TkLayerMap::TIDM_D3, TkLayerMap::TIDP_D1, TkLayerMap::TIDP_D2, TkLayerMap::TIDP_D3, SiStripDetId::TOB, TkLayerMap::TOB_L1, TkLayerMap::TOB_L2, TkLayerMap::TOB_L3, TkLayerMap::TOB_L4, TkLayerMap::TOB_L5, and TkLayerMap::TOB_L6.

Referenced by TkHistoMap::folderDefinition().

384 {
385  switch (in) {
386  case TkLayerMap::TIB_L1:
387  subDet = SiStripDetId::TIB;
388  layer = 1;
389  break;
390  case TkLayerMap::TIB_L2:
391  subDet = SiStripDetId::TIB;
392  layer = 2;
393  break;
394  case TkLayerMap::TIB_L3:
395  subDet = SiStripDetId::TIB;
396  layer = 3;
397  break;
398  case TkLayerMap::TIB_L4:
399  subDet = SiStripDetId::TIB;
400  layer = 4;
401  break;
402  case TkLayerMap::TIDP_D1:
403  subDet = SiStripDetId::TID;
404  layer = 1;
405  side = 2;
406  break;
407  case TkLayerMap::TIDP_D2:
408  subDet = SiStripDetId::TID;
409  layer = 2;
410  side = 2;
411  break;
412  case TkLayerMap::TIDP_D3:
413  subDet = SiStripDetId::TID;
414  layer = 3;
415  side = 2;
416  break;
417  case TkLayerMap::TIDM_D1:
418  subDet = SiStripDetId::TID;
419  layer = 1;
420  side = 1;
421  break;
422  case TkLayerMap::TIDM_D2:
423  subDet = SiStripDetId::TID;
424  layer = 2;
425  side = 1;
426  break;
427  case TkLayerMap::TIDM_D3:
428  subDet = SiStripDetId::TID;
429  layer = 3;
430  side = 1;
431  break;
432  case TkLayerMap::TOB_L1:
433  subDet = SiStripDetId::TOB;
434  layer = 1;
435  break;
436  case TkLayerMap::TOB_L2:
437  subDet = SiStripDetId::TOB;
438  layer = 2;
439  break;
440  case TkLayerMap::TOB_L3:
441  subDet = SiStripDetId::TOB;
442  layer = 3;
443  break;
444  case TkLayerMap::TOB_L4:
445  subDet = SiStripDetId::TOB;
446  layer = 4;
447  break;
448  case TkLayerMap::TOB_L5:
449  subDet = SiStripDetId::TOB;
450  layer = 5;
451  break;
452  case TkLayerMap::TOB_L6:
453  subDet = SiStripDetId::TOB;
454  layer = 6;
455  break;
456  case TkLayerMap::TECP_W1:
457  subDet = SiStripDetId::TEC;
458  layer = 1;
459  side = 2;
460  break;
461  case TkLayerMap::TECP_W2:
462  subDet = SiStripDetId::TEC;
463  layer = 2;
464  side = 2;
465  break;
466  case TkLayerMap::TECP_W3:
467  subDet = SiStripDetId::TEC;
468  layer = 3;
469  side = 2;
470  break;
471  case TkLayerMap::TECP_W4:
472  subDet = SiStripDetId::TEC;
473  layer = 4;
474  side = 2;
475  break;
476  case TkLayerMap::TECP_W5:
477  subDet = SiStripDetId::TEC;
478  layer = 5;
479  side = 2;
480  break;
481  case TkLayerMap::TECP_W6:
482  subDet = SiStripDetId::TEC;
483  layer = 6;
484  side = 2;
485  break;
486  case TkLayerMap::TECP_W7:
487  subDet = SiStripDetId::TEC;
488  layer = 7;
489  side = 2;
490  break;
491  case TkLayerMap::TECP_W8:
492  subDet = SiStripDetId::TEC;
493  layer = 8;
494  side = 2;
495  break;
496  case TkLayerMap::TECP_W9:
497  subDet = SiStripDetId::TEC;
498  layer = 9;
499  side = 2;
500  break;
501  case TkLayerMap::TECM_W1:
502  subDet = SiStripDetId::TEC;
503  layer = 1;
504  side = 1;
505  break;
506  case TkLayerMap::TECM_W2:
507  subDet = SiStripDetId::TEC;
508  layer = 2;
509  side = 1;
510  break;
511  case TkLayerMap::TECM_W3:
512  subDet = SiStripDetId::TEC;
513  layer = 3;
514  side = 1;
515  break;
516  case TkLayerMap::TECM_W4:
517  subDet = SiStripDetId::TEC;
518  layer = 4;
519  side = 1;
520  break;
521  case TkLayerMap::TECM_W5:
522  subDet = SiStripDetId::TEC;
523  layer = 5;
524  side = 1;
525  break;
526  case TkLayerMap::TECM_W6:
527  subDet = SiStripDetId::TEC;
528  layer = 6;
529  side = 1;
530  break;
531  case TkLayerMap::TECM_W7:
532  subDet = SiStripDetId::TEC;
533  layer = 7;
534  side = 1;
535  break;
536  case TkLayerMap::TECM_W8:
537  subDet = SiStripDetId::TEC;
538  layer = 8;
539  side = 1;
540  break;
541  case TkLayerMap::TECM_W9:
542  subDet = SiStripDetId::TEC;
543  layer = 9;
544  side = 1;
545  break;
546  }
547 }
const TkLayerMap::XYbin & TkDetMap::getXY ( DetId  detid,
DetId cached_detid,
int16_t &  cached_layer,
TkLayerMap::XYbin cached_XYbin 
) const

Definition at line 549 of file TkDetMap.cc.

References TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, LogTrace, DetId::rawId(), TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

Referenced by TkHistoMap::add(), TkHistoMap::fill(), TkHistoMap::getEntries(), TkHistoMap::getValue(), SiStripTrackerMapCreator::paintTkMapFromHistogram(), and TkHistoMap::setBinContent().

550 {
551  LogTrace("TkDetMap") << "[getXY] detid " << detid.rawId() << " cache " << cached_detid.rawId() << " layer " << cached_layer << " XY " << cached_XYbin.ix << " " << cached_XYbin.iy << " " << cached_XYbin.x << " " << cached_XYbin.y;
552  if ( detid == cached_detid )
553  return cached_XYbin;
554 
555  /*FIXME*/
556  //if (layer!=INVALID)
557  findLayer(detid, cached_detid , cached_layer, cached_XYbin);
558  LogTrace("TkDetMap") << "[getXY] detid " << detid.rawId() << " cache " << cached_detid.rawId() << " layer " << cached_layer << " XY " << cached_XYbin.ix << " " << cached_XYbin.iy << " " << cached_XYbin.x << " " << cached_XYbin.y;
559 
560  return cached_XYbin;
561 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
#define LogTrace(id)
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:563
void TkDetMap::setLayerMap ( int  layer,
const TkLayerMap lyrMap 
)
inline

Definition at line 130 of file TkDetMap.h.

130 { TkMap[layer] = lyrMap; }
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:157
void TkDetMap::setLayerMap ( int  layer,
TkLayerMap &&  lyrMap 
)
inline

Definition at line 131 of file TkDetMap.h.

References recoMuon::in, and AlCaHLTBitMon_QueryRunRegistry::string.

131 { TkMap[layer] = lyrMap; }
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:157

Member Data Documentation

std::vector<TkLayerMap> TkDetMap::TkMap
private

Definition at line 157 of file TkDetMap.h.

const TrackerTopology* TkDetMap::tTopo_
private

Definition at line 158 of file TkDetMap.h.