CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 175 of file TkDetMap.h.

Constructor & Destructor Documentation

TkDetMap::TkDetMap ( const TrackerTopology tTopo)
inline

Definition at line 177 of file TkDetMap.h.

References TkLayerMap::NUMLAYERS, and TkMap.

177  : tTopo_(tTopo) {
179  } // maximal number of layers
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:209
const TrackerTopology * tTopo_
Definition: TkDetMap.h:210

Member Function Documentation

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

Definition at line 568 of file TkDetMap.cc.

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

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

571  {
572  if (detid == cached_detid)
573  return cached_layer;
574 
575  cached_detid = detid;
576 
577  int16_t layer = TkLayerMap::layerSearch(detid, tTopo_);
578  LogTrace("TkDetMap") << "[findLayer] detid " << detid.rawId() << " layer " << layer;
579  if (layer != cached_layer) {
580  cached_layer = layer;
581  }
582  cached_XYbin = TkMap[cached_layer].getXY(detid, layer);
583  LogTrace("TkDetMap") << "[findLayer] detid " << detid.rawId() << " cached_XYbin " << cached_XYbin.ix << " "
584  << cached_XYbin.iy;
585 
586  return cached_layer;
587 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static const int16_t layerSearch(DetId detid, const TrackerTopology *tTopo)
Definition: TkDetMap.cc:141
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:209
const TrackerTopology * tTopo_
Definition: TkDetMap.h:210
void TkDetMap::getComponents ( int  layer,
int &  nchX,
double &  lowX,
double &  highX,
int &  nchY,
double &  lowY,
double &  highY 
) const

Definition at line 589 of file TkDetMap.cc.

References phase1PixelTopology::layer, and TkMap.

Referenced by TkHistoMap::createTkHistoMap(), and TrackerRemapper::fillStripRemap().

590  {
591  nchX = TkMap[layer].get_nchX();
592  lowX = TkMap[layer].get_lowX();
593  highX = TkMap[layer].get_highX();
594  nchY = TkMap[layer].get_nchY();
595  lowY = TkMap[layer].get_lowY();
596  highY = TkMap[layer].get_highY();
597 }
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:209
DetId TkDetMap::getDetFromBin ( int  layer,
int  ix,
int  iy 
) const
inline

Definition at line 191 of file TkDetMap.h.

References phase1PixelTopology::layer, and TkMap.

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

191 { return TkMap[layer].getDetFromBin(ix, iy); }
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:209
DetId TkDetMap::getDetFromBin ( const std::string &  layerName,
int  ix,
int  iy 
) const
inline

Definition at line 192 of file TkDetMap.h.

References getDetFromBin(), and getLayerNum().

192  {
193  return getDetFromBin(getLayerNum(layerName), ix, iy);
194  }
constexpr char const * layerName[numberOfLayers]
static int getLayerNum(const std::string &in)
Definition: TkDetMap.cc:311
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:191
std::vector<DetId> TkDetMap::getDetsForLayer ( int  layer) const
inline

Definition at line 196 of file TkDetMap.h.

References phase1PixelTopology::layer, and TkMap.

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

196  {
197  return TkMap[layer].getBinToDet();
198  } // const vector& -> vector conversion will copy
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:209
std::string TkDetMap::getLayerName ( int  in)
static

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

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

Definition at line 311 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 getDetFromBin(), 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().

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

Definition at line 548 of file TkDetMap.cc.

References findLayer(), 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().

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

Definition at line 182 of file TkDetMap.h.

References phase1PixelTopology::layer, and TkMap.

182 { TkMap[layer] = lyrMap; }
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:209
void TkDetMap::setLayerMap ( int  layer,
TkLayerMap &&  lyrMap 
)
inline

Definition at line 183 of file TkDetMap.h.

References phase1PixelTopology::layer, and TkMap.

183 { TkMap[layer] = lyrMap; }
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< TkLayerMap > TkMap
Definition: TkDetMap.h:209

Member Data Documentation

std::vector<TkLayerMap> TkDetMap::TkMap
private
const TrackerTopology* TkDetMap::tTopo_
private

Definition at line 210 of file TkDetMap.h.

Referenced by findLayer().