CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TkLayerMap Class Reference

#include <TkDetMap.h>

Classes

struct  XYbin
 

Public Types

enum  TkLayerEnum {
  INVALID =0, TIB_L1, TIB_L2, TIB_L3,
  TIB_L4, TIDM_D1, TIDM_D2, TIDM_D3,
  TIDP_D1, TIDP_D2, TIDP_D3, TOB_L1,
  TOB_L2, TOB_L3, TOB_L4, TOB_L5,
  TOB_L6, TECM_W1, TECM_W2, TECM_W3,
  TECM_W4, TECM_W5, TECM_W6, TECM_W7,
  TECM_W8, TECM_W9, TECP_W1, TECP_W2,
  TECP_W3, TECP_W4, TECP_W5, TECP_W6,
  TECP_W7, TECP_W8, TECP_W9
}
 

Public Member Functions

double & get_highX ()
 
double & get_highY ()
 
double & get_lowX ()
 
double & get_lowY ()
 
int & get_nchX ()
 
int & get_nchY ()
 
uint32_t * getBinToDet ()
 
uint32_t getDetFromBin (int ix, int iy)
 
const XYbin getXY (uint32_t &detid, int layerEnumNb=0)
 
 TkLayerMap (int in)
 
 ~TkLayerMap ()
 

Static Public Member Functions

static const int16_t layerSearch (uint32_t detid)
 

Private Member Functions

void createTEC (std::vector< uint32_t > &TkDetIdList, int layer)
 
void createTIB (std::vector< uint32_t > &TkDetIdList, int layer)
 
void createTID (std::vector< uint32_t > &TkDetIdList, int layer)
 
void createTOB (std::vector< uint32_t > &TkDetIdList, int layer)
 
XYbin getXY_TEC (uint32_t &detid, int layerEnumNb=0)
 
XYbin getXY_TIB (uint32_t &detid, int layerEnumNb=0)
 
XYbin getXY_TID (uint32_t &detid, int layerEnumNb=0)
 
XYbin getXY_TOB (uint32_t &detid, int layerEnumNb=0)
 
void initialize (int layer)
 

Private Attributes

std::vector< uint32_t > BinForRing
 
uint32_t * binToDet
 
double highX
 
double highY
 
int layerEnumNb_
 
double lowX
 
double lowY
 
std::vector< uint32_t > ModulesInRingBack
 
std::vector< uint32_t > ModulesInRingFront
 
int nchX
 
int nchY
 
uint32_t Nrod
 
uint32_t Nstring_ext
 
uint32_t Offset
 
std::vector< uint32_t > SingleExtString
 
XYbin xybin
 

Detailed Description

Definition at line 11 of file TkDetMap.h.

Member Enumeration Documentation

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

Definition at line 22 of file TkDetMap.h.

22  { INVALID=0,
23  TIB_L1, //1
24  TIB_L2,
25  TIB_L3,
26  TIB_L4,
27  TIDM_D1, //5
28  TIDM_D2,
29  TIDM_D3,
30  TIDP_D1, //8
31  TIDP_D2,
32  TIDP_D3,
33  TOB_L1, //11
34  TOB_L2,
35  TOB_L3,
36  TOB_L4,
37  TOB_L5,
38  TOB_L6,
39  TECM_W1, //17
40  TECM_W2,
41  TECM_W3,
42  TECM_W4,
43  TECM_W5,
44  TECM_W6,
45  TECM_W7,
46  TECM_W8,
47  TECM_W9,
48  TECP_W1, //26
49  TECP_W2,
50  TECP_W3,
51  TECP_W4,
52  TECP_W5,
53  TECP_W6,
54  TECP_W7,
55  TECP_W8,
56  TECP_W9 //34
57  };

Constructor & Destructor Documentation

TkLayerMap::TkLayerMap ( int  in)

Definition at line 14 of file TkDetMap.cc.

References createTEC(), createTIB(), createTID(), createTOB(), SiStripDetInfoFileReader::getAllDetIds(), recoMuon::in, initialize(), layerEnumNb_, LogTrace, cppFunctionSkipper::operator, TECM_W1, TECM_W2, TECM_W3, TECM_W4, TECM_W5, TECM_W6, TECM_W7, TECM_W8, TECM_W9, TECP_W1, TECP_W2, TECP_W3, TECP_W4, TECP_W5, TECP_W6, TECP_W7, TECP_W8, TECP_W9, TIB_L1, TIB_L2, TIB_L3, TIB_L4, TIDM_D1, TIDM_D2, TIDM_D3, TIDP_D1, TIDP_D2, TIDP_D3, TOB_L1, TOB_L2, TOB_L3, TOB_L4, TOB_L5, and TOB_L6.

14  :layerEnumNb_(in){
15 
16  LogTrace("TkLayerMap") <<" TkLayerMap::constructor for layer " << in;
17 
19 
20  if(!edm::Service<SiStripDetInfoFileReader>().isAvailable()){
21  edm::LogError("TkLayerMap") <<
22  "\n------------------------------------------"
23  "\nUnAvailable Service SiStripDetInfoFileReader: please insert in the configuration file an instance like"
24  "\n\tprocess.SiStripDetInfoFileReader = cms.Service(\"SiStripDetInfoFileReader\")"
25  "\n------------------------------------------";
26  }
27 
29 
30  std::vector<uint32_t> TkDetIdList=fr->getAllDetIds();
31 
32  switch (layerEnumNb_)
33  {
34  case TkLayerMap::TIB_L1:
35  case TkLayerMap::TIB_L2:
36  case TkLayerMap::TIB_L3:
37  case TkLayerMap::TIB_L4:
38  createTIB(TkDetIdList,layerEnumNb_);
39  break;
46  createTID(TkDetIdList,layerEnumNb_);
47  break;
48  case TkLayerMap::TOB_L1:
49  case TkLayerMap::TOB_L2:
50  case TkLayerMap::TOB_L3:
51  case TkLayerMap::TOB_L4:
52  case TkLayerMap::TOB_L5:
53  case TkLayerMap::TOB_L6:
54  createTOB(TkDetIdList,layerEnumNb_);
55  break;
60  case TkLayerMap::TECP_W5:
69  case TkLayerMap::TECM_W5:
74  createTEC(TkDetIdList,layerEnumNb_);
75  break;
76  default:
77  edm::LogError("TkLayerMap") <<" TkLayerMap::requested creation of a wrong layer Nb "<< layerEnumNb_;
78  }
79 }
void createTEC(std::vector< uint32_t > &TkDetIdList, int layer)
Definition: TkDetMap.cc:487
void createTIB(std::vector< uint32_t > &TkDetIdList, int layer)
Definition: TkDetMap.cc:436
int layerEnumNb_
Definition: TkDetMap.h:97
#define LogTrace(id)
void createTID(std::vector< uint32_t > &TkDetIdList, int layer)
Definition: TkDetMap.cc:470
void createTOB(std::vector< uint32_t > &TkDetIdList, int layer)
Definition: TkDetMap.cc:453
void initialize(int layer)
Definition: TkDetMap.cc:108
TkLayerMap::~TkLayerMap ( )
inline

Definition at line 61 of file TkDetMap.h.

References binToDet.

61  {
62  delete [] binToDet;
63  };
uint32_t * binToDet
Definition: TkDetMap.h:94

Member Function Documentation

void TkLayerMap::createTEC ( std::vector< uint32_t > &  TkDetIdList,
int  layer 
)
private

Definition at line 487 of file TkDetMap.cc.

References binToDet, SiStripSubStructure::getTECDetectors(), getXY_TEC(), highY, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, j, LogTrace, lowY, nchX, Nstring_ext, TECM_W1, TkLayerMap::XYbin::x, xybin, and TkLayerMap::XYbin::y.

Referenced by TkLayerMap().

487  {
488 
489  std::vector<uint32_t> LayerDetIdList;
490  SiStripSubStructure siStripSubStructure;
491 
492  //extract vector of module in the layer
493  siStripSubStructure.getTECDetectors(TkDetIdList,LayerDetIdList,(layerEnumNb-TkLayerMap::TECM_W1)/9+1,(layerEnumNb-TkLayerMap::TECM_W1)%9+1,0,0);
494 
495  LogTrace("TkLayerMap") << "[TkLayerMap::createTEC] layer side " << (layerEnumNb-TkLayerMap::TECM_W1)/9+1 << " " << (layerEnumNb-TkLayerMap::TECM_W1)%9+1 << " number of dets " << LayerDetIdList.size() << " lowY " << lowY << " high " << highY << " Nstring " << Nstring_ext;
496 
497  for(size_t j=0;j<LayerDetIdList.size();++j){
498  xybin=getXY_TEC(LayerDetIdList[j],layerEnumNb);
499  binToDet[(xybin.ix-1)+nchX*(xybin.iy-1)]=LayerDetIdList[j];
500  LogTrace("TkLayerMap") << "[TkLayerMap::createTEC] " << LayerDetIdList[j]<< " " << xybin.ix << " " << xybin.iy << " " << xybin.x << " " << xybin.y ;
501 
502  }
503 }
uint32_t * binToDet
Definition: TkDetMap.h:94
XYbin xybin
Definition: TkDetMap.h:95
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
double lowY
Definition: TkDetMap.h:101
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0) const
XYbin getXY_TEC(uint32_t &detid, int layerEnumNb=0)
Definition: TkDetMap.cc:577
uint32_t Nstring_ext
Definition: TkDetMap.h:104
int nchX
Definition: TkDetMap.h:98
double highY
Definition: TkDetMap.h:101
void TkLayerMap::createTIB ( std::vector< uint32_t > &  TkDetIdList,
int  layer 
)
private

Definition at line 436 of file TkDetMap.cc.

References binToDet, SiStripSubStructure::getTIBDetectors(), getXY_TIB(), highY, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, j, LogTrace, lowY, nchX, Nstring_ext, TkLayerMap::XYbin::x, xybin, and TkLayerMap::XYbin::y.

Referenced by TkLayerMap().

436  {
437 
438  std::vector<uint32_t> LayerDetIdList;
439  SiStripSubStructure siStripSubStructure;
440 
441  //extract vector of module in the layer
442  siStripSubStructure.getTIBDetectors(TkDetIdList,LayerDetIdList,layerEnumNb,0,0,0);
443 
444  LogTrace("TkLayerMap") << "[TkLayerMap::createTIB12] layer " << layerEnumNb << " number of dets " << LayerDetIdList.size() << " lowY " << lowY << " high " << highY << " Nstring " << Nstring_ext;
445 
446  for(size_t j=0;j<LayerDetIdList.size();++j){
447  xybin=getXY_TIB(LayerDetIdList[j],layerEnumNb);
448  binToDet[(xybin.ix-1)+nchX*(xybin.iy-1)]=LayerDetIdList[j];
449  LogTrace("TkLayerMap") << "[TkLayerMap::createTIB] " << LayerDetIdList[j]<< " " << xybin.ix << " " << xybin.iy << " " << xybin.x << " " << xybin.y ;
450  }
451 }
uint32_t * binToDet
Definition: TkDetMap.h:94
XYbin xybin
Definition: TkDetMap.h:95
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
XYbin getXY_TIB(uint32_t &detid, int layerEnumNb=0)
Definition: TkDetMap.cc:527
double lowY
Definition: TkDetMap.h:101
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
uint32_t Nstring_ext
Definition: TkDetMap.h:104
int nchX
Definition: TkDetMap.h:98
double highY
Definition: TkDetMap.h:101
void TkLayerMap::createTID ( std::vector< uint32_t > &  TkDetIdList,
int  layer 
)
private

Definition at line 470 of file TkDetMap.cc.

References binToDet, SiStripSubStructure::getTIDDetectors(), getXY_TID(), highY, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, j, LogTrace, lowY, nchX, Nstring_ext, TIDM_D1, TkLayerMap::XYbin::x, xybin, and TkLayerMap::XYbin::y.

Referenced by TkLayerMap().

470  {
471 
472  std::vector<uint32_t> LayerDetIdList;
473  SiStripSubStructure siStripSubStructure;
474 
475  //extract vector of module in the layer
476  siStripSubStructure.getTIDDetectors(TkDetIdList,LayerDetIdList,(layerEnumNb-TkLayerMap::TIDM_D1)/3+1,(layerEnumNb-TkLayerMap::TIDM_D1)%3+1,0,0);
477 
478  LogTrace("TkLayerMap") << "[TkLayerMap::createTID] layer side " << (layerEnumNb-TkLayerMap::TIDM_D1)/3+1 << " nb " << (layerEnumNb-TkLayerMap::TIDM_D1)%3+1 << " number of dets " << LayerDetIdList.size() << " lowY " << lowY << " high " << highY << " Nstring " << Nstring_ext;
479 
480  for(size_t j=0;j<LayerDetIdList.size();++j){
481  xybin=getXY_TID(LayerDetIdList[j],layerEnumNb);
482  binToDet[(xybin.ix-1)+nchX*(xybin.iy-1)]=LayerDetIdList[j];
483  LogTrace("TkLayerMap") << "[TkLayerMap::createTID] " << LayerDetIdList[j]<< " " << xybin.ix << " " << xybin.iy << " " << xybin.x << " " << xybin.y ;
484  }
485 }
uint32_t * binToDet
Definition: TkDetMap.h:94
XYbin xybin
Definition: TkDetMap.h:95
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
double lowY
Definition: TkDetMap.h:101
XYbin getXY_TID(uint32_t &detid, int layerEnumNb=0)
Definition: TkDetMap.cc:562
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
uint32_t Nstring_ext
Definition: TkDetMap.h:104
int nchX
Definition: TkDetMap.h:98
double highY
Definition: TkDetMap.h:101
void TkLayerMap::createTOB ( std::vector< uint32_t > &  TkDetIdList,
int  layer 
)
private

Definition at line 453 of file TkDetMap.cc.

References binToDet, SiStripSubStructure::getTOBDetectors(), getXY_TOB(), highY, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, j, LogTrace, lowY, nchX, Nstring_ext, TkLayerMap::XYbin::x, xybin, and TkLayerMap::XYbin::y.

Referenced by TkLayerMap().

453  {
454 
455  std::vector<uint32_t> LayerDetIdList;
456  SiStripSubStructure siStripSubStructure;
457 
458  //extract vector of module in the layer
459  siStripSubStructure.getTOBDetectors(TkDetIdList,LayerDetIdList,layerEnumNb-10,0,0);
460 
461  LogTrace("TkLayerMap") << "[TkLayerMap::createTOB] layer " << layerEnumNb-10 << " number of dets " << LayerDetIdList.size() << " lowY " << lowY << " high " << highY << " Nstring " << Nstring_ext;
462 
463  for(size_t j=0;j<LayerDetIdList.size();++j){
464  xybin=getXY_TOB(LayerDetIdList[j],layerEnumNb);
465  binToDet[(xybin.ix-1)+nchX*(xybin.iy-1)]=LayerDetIdList[j];
466  LogTrace("TkLayerMap") << "[TkLayerMap::createTOB] " << LayerDetIdList[j]<< " " << xybin.ix << " " << xybin.iy << " " << xybin.x << " " << xybin.y ;
467  }
468 }
XYbin getXY_TOB(uint32_t &detid, int layerEnumNb=0)
Definition: TkDetMap.cc:547
uint32_t * binToDet
Definition: TkDetMap.h:94
XYbin xybin
Definition: TkDetMap.h:95
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
double lowY
Definition: TkDetMap.h:101
uint32_t Nstring_ext
Definition: TkDetMap.h:104
int nchX
Definition: TkDetMap.h:98
double highY
Definition: TkDetMap.h:101
double& TkLayerMap::get_highX ( )
inline

Definition at line 70 of file TkDetMap.h.

References highX.

70 {return highX;}
double highX
Definition: TkDetMap.h:100
double& TkLayerMap::get_highY ( )
inline

Definition at line 72 of file TkDetMap.h.

References highY.

72 {return highY;}
double highY
Definition: TkDetMap.h:101
double& TkLayerMap::get_lowX ( )
inline

Definition at line 69 of file TkDetMap.h.

References lowX.

69 {return lowX;}
double lowX
Definition: TkDetMap.h:100
double& TkLayerMap::get_lowY ( )
inline

Definition at line 71 of file TkDetMap.h.

References lowY.

71 {return lowY;}
double lowY
Definition: TkDetMap.h:101
int& TkLayerMap::get_nchX ( )
inline

Definition at line 67 of file TkDetMap.h.

References nchX.

67 {return nchX;}
int nchX
Definition: TkDetMap.h:98
int& TkLayerMap::get_nchY ( )
inline

Definition at line 68 of file TkDetMap.h.

References nchY.

68 {return nchY;}
int nchY
Definition: TkDetMap.h:99
uint32_t* TkLayerMap::getBinToDet ( )
inline

Definition at line 77 of file TkDetMap.h.

References binToDet.

77 {return binToDet;}
uint32_t * binToDet
Definition: TkDetMap.h:94
uint32_t TkLayerMap::getDetFromBin ( int  ix,
int  iy 
)

Definition at line 81 of file TkDetMap.cc.

References binToDet, nchX, and nchY.

81  {
82 
83  int val=(ix-1)+nchX*(iy-1);
84  if(val>-1 && val < nchX*nchY)
85  return binToDet[val];
86  return 0;
87 }
uint32_t * binToDet
Definition: TkDetMap.h:94
int nchY
Definition: TkDetMap.h:99
int nchX
Definition: TkDetMap.h:98
const TkLayerMap::XYbin TkLayerMap::getXY ( uint32_t &  detid,
int  layerEnumNb = 0 
)

Definition at line 506 of file TkDetMap.cc.

References edm::hlt::Exception, getXY_TEC(), getXY_TIB(), getXY_TID(), getXY_TOB(), layerEnumNb_, layerSearch(), LogTrace, TIB_L1, TIB_L4, TIDM_D1, TIDP_D3, TOB_L1, and TOB_L6.

506  {
507  LogTrace("TkLayerMap") << "[TkLayerMap::getXY] " << detid << " layer " << layerEnumNb;
508 
509  if(!layerEnumNb)
510  layerEnumNb=layerSearch(detid);
511 
512  if(layerEnumNb!=layerEnumNb_)
513  throw cms::Exception("CorruptedData")
514  << "[TkLayerMap::getXY] Fill of DetId " << detid << " layerEnumNb " << layerEnumNb << " are requested to wrong TkLayerMap " << layerEnumNb_ << " \nPlease check the TkDetMap code";
515 
516 
517  if(layerEnumNb>=TkLayerMap::TIB_L1 && layerEnumNb<=TkLayerMap::TIB_L4)
518  return getXY_TIB(detid,layerEnumNb);
519  else if(layerEnumNb>=TkLayerMap::TIDM_D1 && layerEnumNb<=TkLayerMap::TIDP_D3)
520  return getXY_TID(detid,layerEnumNb);
521  else if(layerEnumNb>=TkLayerMap::TOB_L1 && layerEnumNb<=TkLayerMap::TOB_L6)
522  return getXY_TOB(detid,layerEnumNb);
523  else
524  return getXY_TEC(detid,layerEnumNb);
525 }
XYbin getXY_TOB(uint32_t &detid, int layerEnumNb=0)
Definition: TkDetMap.cc:547
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
int layerEnumNb_
Definition: TkDetMap.h:97
#define LogTrace(id)
XYbin getXY_TIB(uint32_t &detid, int layerEnumNb=0)
Definition: TkDetMap.cc:527
XYbin getXY_TID(uint32_t &detid, int layerEnumNb=0)
Definition: TkDetMap.cc:562
XYbin getXY_TEC(uint32_t &detid, int layerEnumNb=0)
Definition: TkDetMap.cc:577
TkLayerMap::XYbin TkLayerMap::getXY_TEC ( uint32_t &  detid,
int  layerEnumNb = 0 
)
private

Definition at line 577 of file TkDetMap.cc.

References BinForRing, TECDetId::isBackPetal(), TECDetId::isStereo(), TECDetId::isZMinusSide(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, layerSearch(), lowX, lowY, TECDetId::moduleNumber(), ModulesInRingBack, ModulesInRingFront, TECDetId::petalNumber(), TECDetId::ring(), TkLayerMap::XYbin::x, xybin, and TkLayerMap::XYbin::y.

Referenced by createTEC(), and getXY().

577  {
578  if(!layerEnumNb)
579  layerEnumNb=layerSearch(detid);
580 
581  TECDetId D(detid);
582  xybin.ix=D.isZMinusSide()?BinForRing[7]-BinForRing[D.ring()]+1:BinForRing[D.ring()]; //after the introduction of plus and minus histos, the BinForRing should have been changed. on the contrary we hack this part of the code
583  if(D.isStereo())
584  xybin.ix+=(D.isZMinusSide()?-1:1);
585 
586  if(D.isZMinusSide()){
587  xybin.iy= (D.petalNumber()-1)*(ModulesInRingFront[D.ring()]+ModulesInRingBack[D.ring()]) + ModulesInRingFront[D.ring()] - D.moduleNumber() +1;
588  if(D.isBackPetal())
589  xybin.iy+=ModulesInRingBack[D.ring()];
590  }else{
591  xybin.iy= (D.petalNumber()-1)*(ModulesInRingFront[D.ring()]+ModulesInRingBack[D.ring()])+D.moduleNumber();
592  if(D.isBackPetal())
593  xybin.iy+=ModulesInRingFront[D.ring()];
594  }
595 
596  xybin.x=lowX+xybin.ix-0.5;
597  xybin.y=lowY+xybin.iy-0.5;
598  return xybin;
599 }
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
std::vector< uint32_t > BinForRing
Definition: TkDetMap.h:103
XYbin xybin
Definition: TkDetMap.h:95
std::vector< uint32_t > ModulesInRingFront
Definition: TkDetMap.h:103
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
double lowY
Definition: TkDetMap.h:101
std::vector< uint32_t > ModulesInRingBack
Definition: TkDetMap.h:103
double lowX
Definition: TkDetMap.h:100
TkLayerMap::XYbin TkLayerMap::getXY_TIB ( uint32_t &  detid,
int  layerEnumNb = 0 
)
private

Definition at line 527 of file TkDetMap.cc.

References TIBDetId::isInternalString(), TIBDetId::isStereo(), TIBDetId::isZMinusSide(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, TIBDetId::layerNumber(), layerSearch(), lowX, lowY, TIBDetId::moduleNumber(), Nstring_ext, Offset, SingleExtString, TIBDetId::stringNumber(), TkLayerMap::XYbin::x, xybin, and TkLayerMap::XYbin::y.

Referenced by createTIB(), and getXY().

527  {
528  if(!layerEnumNb)
529  layerEnumNb=layerSearch(detid);
530 
531  TIBDetId D(detid);
532  if(D.layerNumber()%2){
533  Offset=D.isInternalString()?2:1;
534  }else{
535  Offset=D.isInternalString()?1:2;
536  }
537  xybin.ix=2*(D.isZMinusSide()?-1*D.moduleNumber()+3:D.moduleNumber()+2)+Offset;
538  xybin.iy=D.isInternalString()?D.stringNumber()+SingleExtString[D.stringNumber()]:D.stringNumber();
539  if(D.layerNumber()<3 && !D.isStereo())
540  xybin.iy+=Nstring_ext+2;
541 
542  xybin.x=lowX+xybin.ix-0.5;
543  xybin.y=lowY+xybin.iy-0.5;
544  return xybin;
545 }
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
XYbin xybin
Definition: TkDetMap.h:95
uint32_t Offset
Definition: TkDetMap.h:104
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
double lowY
Definition: TkDetMap.h:101
std::vector< uint32_t > SingleExtString
Definition: TkDetMap.h:103
uint32_t Nstring_ext
Definition: TkDetMap.h:104
double lowX
Definition: TkDetMap.h:100
TkLayerMap::XYbin TkLayerMap::getXY_TID ( uint32_t &  detid,
int  layerEnumNb = 0 
)
private

Definition at line 562 of file TkDetMap.cc.

References TIDDetId::isBackRing(), TIDDetId::isStereo(), TIDDetId::isZMinusSide(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, layerSearch(), lowX, lowY, TIDDetId::moduleNumber(), TIDDetId::ring(), TkLayerMap::XYbin::x, xybin, and TkLayerMap::XYbin::y.

Referenced by createTID(), and getXY().

562  {
563  if(!layerEnumNb)
564  layerEnumNb=layerSearch(detid);
565 
566  TIDDetId D(detid);
567  xybin.ix=D.isZMinusSide()?-3*D.ring()+10:3*D.ring()-2;
568  if(D.isStereo())
569  xybin.ix+=(D.isZMinusSide()?-1:1);
570  xybin.iy= int(2. * D.moduleNumber() - (D.isBackRing()?0.:1.));
571 
572  xybin.x=lowX+xybin.ix-0.5;
573  xybin.y=lowY+xybin.iy-0.5;
574  return xybin;
575 }
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
XYbin xybin
Definition: TkDetMap.h:95
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
double lowY
Definition: TkDetMap.h:101
double lowX
Definition: TkDetMap.h:100
TkLayerMap::XYbin TkLayerMap::getXY_TOB ( uint32_t &  detid,
int  layerEnumNb = 0 
)
private

Definition at line 547 of file TkDetMap.cc.

References TOBDetId::isStereo(), TOBDetId::isZMinusSide(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, TOBDetId::layerNumber(), layerSearch(), lowX, lowY, TOBDetId::moduleNumber(), Nrod, TOBDetId::rodNumber(), TkLayerMap::XYbin::x, xybin, and TkLayerMap::XYbin::y.

Referenced by createTOB(), and getXY().

547  {
548  if(!layerEnumNb)
549  layerEnumNb=layerSearch(detid);
550 
551  TOBDetId D(detid);
552  xybin.ix=D.isZMinusSide()?-1*D.moduleNumber()+7:D.moduleNumber()+6;
553  xybin.iy=D.rodNumber();
554  if(D.layerNumber()<3 && !D.isStereo())
555  xybin.iy+=Nrod+2;
556 
557  xybin.x=lowX+xybin.ix-0.5;
558  xybin.y=lowY+xybin.iy-0.5;
559  return xybin;
560 }
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
XYbin xybin
Definition: TkDetMap.h:95
uint32_t Nrod
Definition: TkDetMap.h:104
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
double lowY
Definition: TkDetMap.h:101
double lowX
Definition: TkDetMap.h:100
void TkLayerMap::initialize ( int  layer)
private

Definition at line 108 of file TkDetMap.cc.

References BinForRing, binToDet, highX, highY, i, LogTrace, lowX, lowY, ModulesInRingBack, ModulesInRingFront, nchX, nchY, Nrod, Nstring_ext, SingleExtString, TECM_W1, TECM_W2, TECM_W3, TECM_W4, TECM_W5, TECM_W6, TECM_W7, TECM_W8, TECM_W9, TECP_W1, TECP_W2, TECP_W3, TECP_W4, TECP_W5, TECP_W6, TECP_W7, TECP_W8, TECP_W9, TIB_L1, TIB_L2, TIB_L3, TIB_L4, TIDM_D1, TIDM_D2, TIDM_D3, TIDP_D1, TIDP_D2, TIDP_D3, TOB_L1, TOB_L2, TOB_L3, TOB_L4, TOB_L5, and TOB_L6.

Referenced by TkLayerMap().

108  {
109 
110  switch (layer){
111  case TkLayerMap::TIB_L1: //TIBL1
112 
113  Nstring_ext=30;
114  SingleExtString.insert(SingleExtString.begin(),8,0);
115  SingleExtString.insert(SingleExtString.begin()+8,7,1);
116  SingleExtString.insert(SingleExtString.begin()+15,8,2);
117  SingleExtString.insert(SingleExtString.begin()+23,7,3);
118  nchX=12;
119  lowX=-6;
120  highX=6;
121  nchY=2*(Nstring_ext+1);
122  lowY=-1.*(Nstring_ext+1.);
123  highY=(Nstring_ext+1);
124 
125  break;
126  case TkLayerMap::TIB_L2:
127 
128  Nstring_ext=38;
129  SingleExtString.insert(SingleExtString.begin(),10,0);
130  SingleExtString.insert(SingleExtString.begin()+10,9,1);
131  SingleExtString.insert(SingleExtString.begin()+19,10,2);
132  SingleExtString.insert(SingleExtString.begin()+29,9,3);
133  nchX=12;
134  lowX=-6;
135  highX=6;
136  nchY=2*(Nstring_ext+1);
137  lowY=-1.*(Nstring_ext+1.);
138  highY=(Nstring_ext+1);
139 
140  break;
141  case TkLayerMap::TIB_L3:
142 
143  Nstring_ext=46;
144  SingleExtString.insert(SingleExtString.begin(),23,0);
145  SingleExtString.insert(SingleExtString.begin()+23,23,1);
146  nchX=12;
147  lowX=-6;
148  highX=6;
150  lowY=0;
151  highY=nchY;
152 
153  break;
154  case TkLayerMap::TIB_L4:
155 
156  Nstring_ext=56;
157  SingleExtString.insert(SingleExtString.begin(),14,0);
158  SingleExtString.insert(SingleExtString.begin()+14,14,1);
159  SingleExtString.insert(SingleExtString.begin()+28,14,2);
160  SingleExtString.insert(SingleExtString.begin()+42,14,3);
161  nchX=12;
162  lowX=-6.;
163  highX=6.;
165  lowY=0.;
166  highY=nchY;
167 
168  break;
169  case TkLayerMap::TIDM_D1: //TID
170  case TkLayerMap::TIDM_D2: //TID
171  case TkLayerMap::TIDM_D3: //TID
172 
173  nchX=7;
174  lowX=-7.;
175  highX=0.;
176  nchY=40;
177  lowY=0.0;
178  highY=1.*nchY;
179 
180  break;
181  case TkLayerMap::TIDP_D1: //TID
182  case TkLayerMap::TIDP_D2: //TID
183  case TkLayerMap::TIDP_D3: //TID
184 
185  nchX=7;
186  lowX=0.;
187  highX=7.;
188  nchY=40;
189  lowY=0.0;
190  highY=1.*nchY;
191 
192  break;
193  case TkLayerMap::TOB_L1: //TOBL1
194 
195  Nrod=42;
196  nchX=12;
197  lowX=-6.;
198  highX=6.;
199  nchY=2*(Nrod+1);
200  lowY=-1.*(Nrod+1.);
201  highY=(Nrod+1.);
202 
203  break;
204  case TkLayerMap::TOB_L2:
205 
206  Nrod=48;
207  nchX=12;
208  lowX=-6.;
209  highX=6.;
210  nchY=int(2.*(Nrod+1.));
211  lowY=-1.*(Nrod+1.);
212  highY=(Nrod+1.);
213 
214  break;
215  case TkLayerMap::TOB_L3: //TOBL3
216 
217  Nrod=54;
218  nchX=12;
219  lowX=-6.;
220  highX=6.;
221  nchY=Nrod;
222  lowY=0.;
223  highY=1.*Nrod;
224 
225  break;
226  case TkLayerMap::TOB_L4:
227 
228  Nrod=60;
229  nchX=12;
230  lowX=-6.;
231  highX=6.;
232  nchY=Nrod;
233  lowY=0.;
234  highY=1.*Nrod;
235 
236  break;
237  case TkLayerMap::TOB_L5:
238 
239  Nrod=66;
240  nchX=12;
241  lowX=-6.;
242  highX=6.;
243  nchY=Nrod;
244  lowY=0.;
245  highY=1.*Nrod;
246 
247  break;
248  case TkLayerMap::TOB_L6:
249 
250  Nrod=74;
251  nchX=12;
252  lowX=-6.;
253  highX=6.;
254  nchY=Nrod;
255  lowY=0.;
256  highY=1.*Nrod;
257 
258  break;
259  default: //TEC
260  switch (layer){
261  case TkLayerMap::TECM_W1:
262  case TkLayerMap::TECM_W2:
263  case TkLayerMap::TECM_W3:
264  nchX=16;
265  lowX=-16.;
266  highX=0.;
267  nchY=80;
268  lowY=0.;
269  highY=1.*nchY;
270 
271  BinForRing.push_back(0); //null value for component 0
272  BinForRing.push_back(1);
273  BinForRing.push_back(4);
274  BinForRing.push_back(7);
275  BinForRing.push_back(9);
276  BinForRing.push_back(11);
277  BinForRing.push_back(14);
278  BinForRing.push_back(16);
279  break;
280  case TkLayerMap::TECM_W4:
281  case TkLayerMap::TECM_W5:
282  case TkLayerMap::TECM_W6:
283  nchX=13;
284  lowX=-16.;
285  highX=-3.;
286  nchY=80;
287  lowY=0.;
288  highY=1.*nchY;
289 
290  BinForRing.push_back(0); //null value for component 0
291  BinForRing.push_back(0);
292  BinForRing.push_back(1);
293  BinForRing.push_back(4);
294  BinForRing.push_back(6);
295  BinForRing.push_back(8);
296  BinForRing.push_back(11);
297  BinForRing.push_back(13);
298  break;
299  case TkLayerMap::TECM_W7:
300  case TkLayerMap::TECM_W8:
301  nchX=10;
302  lowX=-16.;
303  highX=-6.;
304  nchY=80;
305  lowY=0.;
306  highY=1.*nchY;
307 
308  BinForRing.push_back(0); //null value for component 0
309  BinForRing.push_back(0);
310  BinForRing.push_back(0);
311  BinForRing.push_back(1);
312  BinForRing.push_back(3);
313  BinForRing.push_back(5);
314  BinForRing.push_back(8);
315  BinForRing.push_back(10);
316  break;
317  case TkLayerMap::TECM_W9:
318  nchX=8;
319  lowX=-16.;
320  highX=-8.;
321  nchY=80;
322  lowY=0.;
323  highY=1.*nchY;
324 
325  BinForRing.push_back(0); //null value for component 0
326  BinForRing.push_back(0);
327  BinForRing.push_back(0);
328  BinForRing.push_back(0);
329  BinForRing.push_back(1);
330  BinForRing.push_back(3);
331  BinForRing.push_back(6);
332  BinForRing.push_back(8);
333  break;
334  case TkLayerMap::TECP_W1:
335  case TkLayerMap::TECP_W2:
336  case TkLayerMap::TECP_W3:
337  nchX=16;
338  lowX=0.;
339  highX=16.;
340  nchY=80;
341  lowY=0.;
342  highY=1.*nchY;
343 
344  BinForRing.push_back(0); //null value for component 0
345  BinForRing.push_back(1);
346  BinForRing.push_back(4);
347  BinForRing.push_back(7);
348  BinForRing.push_back(9);
349  BinForRing.push_back(11);
350  BinForRing.push_back(14);
351  BinForRing.push_back(16);
352  break;
353  case TkLayerMap::TECP_W4:
354  case TkLayerMap::TECP_W5:
355  case TkLayerMap::TECP_W6:
356  nchX=13;
357  lowX=3.;
358  highX=16.;
359  nchY=80;
360  lowY=0.;
361  highY=1.*nchY;
362 
363  BinForRing.push_back(0); //null value for component 0
364  BinForRing.push_back(0);
365  BinForRing.push_back(1);
366  BinForRing.push_back(4);
367  BinForRing.push_back(6);
368  BinForRing.push_back(8);
369  BinForRing.push_back(11);
370  BinForRing.push_back(13);
371  break;
372  case TkLayerMap::TECP_W7:
373  case TkLayerMap::TECP_W8:
374  nchX=10;
375  lowX=6.;
376  highX=16.;
377  nchY=80;
378  lowY=0.;
379  highY=1.*nchY;
380 
381  BinForRing.push_back(0); //null value for component 0
382  BinForRing.push_back(0);
383  BinForRing.push_back(0);
384  BinForRing.push_back(1);
385  BinForRing.push_back(3);
386  BinForRing.push_back(5);
387  BinForRing.push_back(8);
388  BinForRing.push_back(10);
389  break;
390  case TkLayerMap::TECP_W9:
391  nchX=8;
392  lowX=8.;
393  highX=16.;
394  nchY=80;
395  lowY=0.;
396  highY=1.*nchY;
397 
398  BinForRing.push_back(0); //null value for component 0
399  BinForRing.push_back(0);
400  BinForRing.push_back(0);
401  BinForRing.push_back(0);
402  BinForRing.push_back(1);
403  BinForRing.push_back(3);
404  BinForRing.push_back(6);
405  BinForRing.push_back(8);
406  }
407 
408 
409  ModulesInRingFront.push_back(0); //null value for component 0
410  ModulesInRingFront.push_back(2);
411  ModulesInRingFront.push_back(2);
412  ModulesInRingFront.push_back(3);
413  ModulesInRingFront.push_back(4);
414  ModulesInRingFront.push_back(2);
415  ModulesInRingFront.push_back(4);
416  ModulesInRingFront.push_back(5);
417 
418  ModulesInRingBack.push_back(0); //null value for component 0
419  ModulesInRingBack.push_back(1);
420  ModulesInRingBack.push_back(1);
421  ModulesInRingBack.push_back(2);
422  ModulesInRingBack.push_back(3);
423  ModulesInRingBack.push_back(3);
424  ModulesInRingBack.push_back(3);
425  ModulesInRingBack.push_back(5);
426  }
427 
428  for (size_t i=0;i<SingleExtString.size();i++)
429  LogTrace("TkLayerMap") << "[initialize SingleExtString["<<i<<"] " << SingleExtString[i];
430 
431  binToDet= new uint32_t[nchX*nchY];
432  for(size_t i=0;i<(size_t) nchX*nchY;++i)
433  binToDet[i]=0;
434 }
int i
Definition: DBlmapReader.cc:9
uint32_t * binToDet
Definition: TkDetMap.h:94
std::vector< uint32_t > BinForRing
Definition: TkDetMap.h:103
uint32_t Nrod
Definition: TkDetMap.h:104
double highX
Definition: TkDetMap.h:100
std::vector< uint32_t > ModulesInRingFront
Definition: TkDetMap.h:103
#define LogTrace(id)
double lowY
Definition: TkDetMap.h:101
int nchY
Definition: TkDetMap.h:99
std::vector< uint32_t > ModulesInRingBack
Definition: TkDetMap.h:103
std::vector< uint32_t > SingleExtString
Definition: TkDetMap.h:103
uint32_t Nstring_ext
Definition: TkDetMap.h:104
double lowX
Definition: TkDetMap.h:100
int nchX
Definition: TkDetMap.h:98
double highY
Definition: TkDetMap.h:101
const int16_t TkLayerMap::layerSearch ( uint32_t  detid)
static

Definition at line 89 of file TkDetMap.cc.

References TOBDetId::layerNumber(), TIBDetId::layerNumber(), TIDDetId::side(), TECDetId::side(), SiStripDetId::TEC, TECM_W1, SiStripDetId::TIB, TIB_L1, SiStripDetId::TID, TIDM_D1, SiStripDetId::TOB, TOB_L1, TIDDetId::wheel(), and TECDetId::wheel().

Referenced by TkDetMap::FindLayer(), getXY(), getXY_TEC(), getXY_TIB(), getXY_TID(), and getXY_TOB().

89  {
90 
91  // switch((detid>>25)&0x7){
92  if(SiStripDetId(detid).subDetector()==SiStripDetId::TIB){
93  TIBDetId D(detid);
94  return TkLayerMap::TIB_L1 -1 +D.layerNumber();
95  } else if (SiStripDetId(detid).subDetector()==SiStripDetId::TID){
96  TIDDetId D(detid);
97  return TkLayerMap::TIDM_D1 -1 + (D.side() -1)*3 + D.wheel();
98  } else if (SiStripDetId(detid).subDetector()==SiStripDetId::TOB){
99  TOBDetId D(detid);
100  return TkLayerMap::TOB_L1 -1 +D.layerNumber();
101  } else if (SiStripDetId(detid).subDetector()==SiStripDetId::TEC){
102  TECDetId D(detid);
103  return TkLayerMap::TECM_W1 -1 + (D.side() -1)*9 + D.wheel();
104  }
105  return 0;
106 }
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150

Member Data Documentation

std::vector<uint32_t> TkLayerMap::BinForRing
private

Definition at line 103 of file TkDetMap.h.

Referenced by getXY_TEC(), and initialize().

uint32_t* TkLayerMap::binToDet
private
double TkLayerMap::highX
private

Definition at line 100 of file TkDetMap.h.

Referenced by get_highX(), and initialize().

double TkLayerMap::highY
private

Definition at line 101 of file TkDetMap.h.

Referenced by createTEC(), createTIB(), createTID(), createTOB(), get_highY(), and initialize().

int TkLayerMap::layerEnumNb_
private

Definition at line 97 of file TkDetMap.h.

Referenced by getXY(), and TkLayerMap().

double TkLayerMap::lowX
private

Definition at line 100 of file TkDetMap.h.

Referenced by get_lowX(), getXY_TEC(), getXY_TIB(), getXY_TID(), getXY_TOB(), and initialize().

double TkLayerMap::lowY
private
std::vector<uint32_t> TkLayerMap::ModulesInRingBack
private

Definition at line 103 of file TkDetMap.h.

Referenced by getXY_TEC(), and initialize().

std::vector<uint32_t> TkLayerMap::ModulesInRingFront
private

Definition at line 103 of file TkDetMap.h.

Referenced by getXY_TEC(), and initialize().

int TkLayerMap::nchX
private

Definition at line 98 of file TkDetMap.h.

Referenced by createTEC(), createTIB(), createTID(), createTOB(), get_nchX(), getDetFromBin(), and initialize().

int TkLayerMap::nchY
private

Definition at line 99 of file TkDetMap.h.

Referenced by get_nchY(), getDetFromBin(), and initialize().

uint32_t TkLayerMap::Nrod
private

Definition at line 104 of file TkDetMap.h.

Referenced by getXY_TOB(), and initialize().

uint32_t TkLayerMap::Nstring_ext
private

Definition at line 104 of file TkDetMap.h.

Referenced by createTEC(), createTIB(), createTID(), createTOB(), getXY_TIB(), and initialize().

uint32_t TkLayerMap::Offset
private

Definition at line 104 of file TkDetMap.h.

Referenced by getXY_TIB().

std::vector<uint32_t> TkLayerMap::SingleExtString
private

Definition at line 103 of file TkDetMap.h.

Referenced by getXY_TIB(), and initialize().

XYbin TkLayerMap::xybin
private