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 () const
 
double get_highY () const
 
double get_lowX () const
 
double get_lowY () const
 
int get_nchX () const
 
int get_nchY () const
 
const uint32_t * getBinToDet () const
 
uint32_t getDetFromBin (int ix, int iy) const
 
const XYbin getXY (uint32_t detid, int layerEnumNb=0) const
 
 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)
 
uint32_t get_Offset (TIBDetId) const
 
XYbin getXY_TEC (uint32_t detid, int layerEnumNb=0) const
 
XYbin getXY_TIB (uint32_t detid, int layerEnumNb=0) const
 
XYbin getXY_TID (uint32_t detid, int layerEnumNb=0) const
 
XYbin getXY_TOB (uint32_t detid, int layerEnumNb=0) const
 
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
 

Detailed Description

Definition at line 12 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 23 of file TkDetMap.h.

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

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:494
void createTIB(std::vector< uint32_t > &TkDetIdList, int layer)
Definition: TkDetMap.cc:437
int layerEnumNb_
Definition: TkDetMap.h:99
#define LogTrace(id)
void createTID(std::vector< uint32_t > &TkDetIdList, int layer)
Definition: TkDetMap.cc:475
void createTOB(std::vector< uint32_t > &TkDetIdList, int layer)
Definition: TkDetMap.cc:456
void initialize(int layer)
Definition: TkDetMap.cc:109
TkLayerMap::~TkLayerMap ( )
inline

Definition at line 62 of file TkDetMap.h.

References binToDet.

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

Member Function Documentation

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

Definition at line 494 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, and TkLayerMap::XYbin::y.

Referenced by TkLayerMap().

494  {
495 
496  std::vector<uint32_t> LayerDetIdList;
497  SiStripSubStructure siStripSubStructure;
498 
499  //extract vector of module in the layer
500  siStripSubStructure.getTECDetectors(TkDetIdList,LayerDetIdList,(layerEnumNb-TkLayerMap::TECM_W1)/9+1,(layerEnumNb-TkLayerMap::TECM_W1)%9+1,0,0);
501 
502  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;
503 
504  XYbin xyb;
505 
506  for(size_t j=0;j<LayerDetIdList.size();++j){
507  xyb=getXY_TEC(LayerDetIdList[j],layerEnumNb);
508  binToDet[(xyb.ix-1)+nchX*(xyb.iy-1)]=LayerDetIdList[j];
509  LogTrace("TkLayerMap") << "[TkLayerMap::createTEC] " << LayerDetIdList[j]<< " " << xyb.ix << " " << xyb.iy << " " << xyb.x << " " << xyb.y ;
510 
511  }
512 }
XYbin getXY_TEC(uint32_t detid, int layerEnumNb=0) const
Definition: TkDetMap.cc:597
uint32_t * binToDet
Definition: TkDetMap.h:97
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
double lowY
Definition: TkDetMap.h:103
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
uint32_t Nstring_ext
Definition: TkDetMap.h:106
int nchX
Definition: TkDetMap.h:100
double highY
Definition: TkDetMap.h:103
void TkLayerMap::createTIB ( std::vector< uint32_t > &  TkDetIdList,
int  layer 
)
private

Definition at line 437 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, and TkLayerMap::XYbin::y.

Referenced by TkLayerMap().

437  {
438 
439  std::vector<uint32_t> LayerDetIdList;
440  SiStripSubStructure siStripSubStructure;
441 
442  //extract vector of module in the layer
443  siStripSubStructure.getTIBDetectors(TkDetIdList,LayerDetIdList,layerEnumNb,0,0,0);
444 
445  LogTrace("TkLayerMap") << "[TkLayerMap::createTIB12] layer " << layerEnumNb << " number of dets " << LayerDetIdList.size() << " lowY " << lowY << " high " << highY << " Nstring " << Nstring_ext;
446 
447  XYbin xyb;
448 
449  for(size_t j=0;j<LayerDetIdList.size();++j){
450  xyb=getXY_TIB(LayerDetIdList[j],layerEnumNb);
451  binToDet[(xyb.ix-1)+nchX*(xyb.iy-1)]=LayerDetIdList[j];
452  LogTrace("TkLayerMap") << "[TkLayerMap::createTIB] " << LayerDetIdList[j]<< " " << xyb.ix << " " << xyb.iy << " " << xyb.x << " " << xyb.y ;
453  }
454 }
uint32_t * binToDet
Definition: TkDetMap.h:97
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
XYbin getXY_TIB(uint32_t detid, int layerEnumNb=0) const
Definition: TkDetMap.cc:544
double lowY
Definition: TkDetMap.h:103
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:106
int nchX
Definition: TkDetMap.h:100
double highY
Definition: TkDetMap.h:103
void TkLayerMap::createTID ( std::vector< uint32_t > &  TkDetIdList,
int  layer 
)
private

Definition at line 475 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, and TkLayerMap::XYbin::y.

Referenced by TkLayerMap().

475  {
476 
477  std::vector<uint32_t> LayerDetIdList;
478  SiStripSubStructure siStripSubStructure;
479 
480  //extract vector of module in the layer
481  siStripSubStructure.getTIDDetectors(TkDetIdList,LayerDetIdList,(layerEnumNb-TkLayerMap::TIDM_D1)/3+1,(layerEnumNb-TkLayerMap::TIDM_D1)%3+1,0,0);
482 
483  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;
484 
485  XYbin xyb;
486 
487  for(size_t j=0;j<LayerDetIdList.size();++j){
488  xyb=getXY_TID(LayerDetIdList[j],layerEnumNb);
489  binToDet[(xyb.ix-1)+nchX*(xyb.iy-1)]=LayerDetIdList[j];
490  LogTrace("TkLayerMap") << "[TkLayerMap::createTID] " << LayerDetIdList[j]<< " " << xyb.ix << " " << xyb.iy << " " << xyb.x << " " << xyb.y ;
491  }
492 }
XYbin getXY_TID(uint32_t detid, int layerEnumNb=0) const
Definition: TkDetMap.cc:579
uint32_t * binToDet
Definition: TkDetMap.h:97
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
double lowY
Definition: TkDetMap.h:103
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:106
int nchX
Definition: TkDetMap.h:100
double highY
Definition: TkDetMap.h:103
void TkLayerMap::createTOB ( std::vector< uint32_t > &  TkDetIdList,
int  layer 
)
private

Definition at line 456 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, and TkLayerMap::XYbin::y.

Referenced by TkLayerMap().

456  {
457 
458  std::vector<uint32_t> LayerDetIdList;
459  SiStripSubStructure siStripSubStructure;
460 
461  //extract vector of module in the layer
462  siStripSubStructure.getTOBDetectors(TkDetIdList,LayerDetIdList,layerEnumNb-10,0,0);
463 
464  LogTrace("TkLayerMap") << "[TkLayerMap::createTOB] layer " << layerEnumNb-10 << " number of dets " << LayerDetIdList.size() << " lowY " << lowY << " high " << highY << " Nstring " << Nstring_ext;
465 
466  XYbin xyb;
467 
468  for(size_t j=0;j<LayerDetIdList.size();++j){
469  xyb=getXY_TOB(LayerDetIdList[j],layerEnumNb);
470  binToDet[(xyb.ix-1)+nchX*(xyb.iy-1)]=LayerDetIdList[j];
471  LogTrace("TkLayerMap") << "[TkLayerMap::createTOB] " << LayerDetIdList[j]<< " " << xyb.ix << " " << xyb.iy << " " << xyb.x << " " << xyb.y ;
472  }
473 }
uint32_t * binToDet
Definition: TkDetMap.h:97
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:103
XYbin getXY_TOB(uint32_t detid, int layerEnumNb=0) const
Definition: TkDetMap.cc:562
uint32_t Nstring_ext
Definition: TkDetMap.h:106
int nchX
Definition: TkDetMap.h:100
double highY
Definition: TkDetMap.h:103
double TkLayerMap::get_highX ( ) const
inline

Definition at line 71 of file TkDetMap.h.

References highX.

71 {return highX;}
double highX
Definition: TkDetMap.h:102
double TkLayerMap::get_highY ( ) const
inline

Definition at line 73 of file TkDetMap.h.

References highY.

73 {return highY;}
double highY
Definition: TkDetMap.h:103
double TkLayerMap::get_lowX ( ) const
inline

Definition at line 70 of file TkDetMap.h.

References lowX.

70 {return lowX;}
double lowX
Definition: TkDetMap.h:102
double TkLayerMap::get_lowY ( ) const
inline

Definition at line 72 of file TkDetMap.h.

References lowY.

72 {return lowY;}
double lowY
Definition: TkDetMap.h:103
int TkLayerMap::get_nchX ( ) const
inline

Definition at line 68 of file TkDetMap.h.

References nchX.

68 {return nchX;}
int nchX
Definition: TkDetMap.h:100
int TkLayerMap::get_nchY ( ) const
inline

Definition at line 69 of file TkDetMap.h.

References nchY.

69 {return nchY;}
int nchY
Definition: TkDetMap.h:101
uint32_t TkLayerMap::get_Offset ( TIBDetId  D) const
private

Definition at line 536 of file TkDetMap.cc.

References TIBDetId::isInternalString(), and TIBDetId::layerNumber().

Referenced by getXY_TIB().

536  {
537  if(D.layerNumber()%2)
538  return D.isInternalString()?2:1;
539  else
540  return D.isInternalString()?1:2;
541 }
unsigned int layerNumber() const
Definition: TIBDetId.h:83
bool isInternalString() const
Definition: TIBDetId.h:95
const uint32_t* TkLayerMap::getBinToDet ( ) const
inline

Definition at line 78 of file TkDetMap.h.

References binToDet.

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

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:97
int nchY
Definition: TkDetMap.h:101
int nchX
Definition: TkDetMap.h:100
const TkLayerMap::XYbin TkLayerMap::getXY ( uint32_t  detid,
int  layerEnumNb = 0 
) const

Definition at line 515 of file TkDetMap.cc.

References 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.

515  {
516  LogTrace("TkLayerMap") << "[TkLayerMap::getXY] " << detid << " layer " << layerEnumNb;
517 
518  if(!layerEnumNb)
519  layerEnumNb=layerSearch(detid);
520 
521  if(layerEnumNb!=layerEnumNb_)
522  throw cms::Exception("CorruptedData")
523  << "[TkLayerMap::getXY] Fill of DetId " << detid << " layerEnumNb " << layerEnumNb << " are requested to wrong TkLayerMap " << layerEnumNb_ << " \nPlease check the TkDetMap code";
524 
525 
526  if(layerEnumNb>=TkLayerMap::TIB_L1 && layerEnumNb<=TkLayerMap::TIB_L4)
527  return getXY_TIB(detid,layerEnumNb);
528  else if(layerEnumNb>=TkLayerMap::TIDM_D1 && layerEnumNb<=TkLayerMap::TIDP_D3)
529  return getXY_TID(detid,layerEnumNb);
530  else if(layerEnumNb>=TkLayerMap::TOB_L1 && layerEnumNb<=TkLayerMap::TOB_L6)
531  return getXY_TOB(detid,layerEnumNb);
532  else
533  return getXY_TEC(detid,layerEnumNb);
534 }
XYbin getXY_TID(uint32_t detid, int layerEnumNb=0) const
Definition: TkDetMap.cc:579
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
XYbin getXY_TEC(uint32_t detid, int layerEnumNb=0) const
Definition: TkDetMap.cc:597
int layerEnumNb_
Definition: TkDetMap.h:99
#define LogTrace(id)
XYbin getXY_TIB(uint32_t detid, int layerEnumNb=0) const
Definition: TkDetMap.cc:544
XYbin getXY_TOB(uint32_t detid, int layerEnumNb=0) const
Definition: TkDetMap.cc:562
TkLayerMap::XYbin TkLayerMap::getXY_TEC ( uint32_t  detid,
int  layerEnumNb = 0 
) const
private

Definition at line 597 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, and TkLayerMap::XYbin::y.

Referenced by createTEC(), and getXY().

597  {
598  if(!layerEnumNb)
599  layerEnumNb=layerSearch(detid);
600 
601  TECDetId D(detid);
602 
603  XYbin xyb;
604 
605  xyb.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
606  if(D.isStereo())
607  xyb.ix+=(D.isZMinusSide()?-1:1);
608 
609  if(D.isZMinusSide()){
610  xyb.iy= (D.petalNumber()-1)*(ModulesInRingFront[D.ring()]+ModulesInRingBack[D.ring()]) + ModulesInRingFront[D.ring()] - D.moduleNumber() +1;
611  if(D.isBackPetal())
612  xyb.iy+=ModulesInRingBack[D.ring()];
613  }else{
614  xyb.iy= (D.petalNumber()-1)*(ModulesInRingFront[D.ring()]+ModulesInRingBack[D.ring()])+D.moduleNumber();
615  if(D.isBackPetal())
616  xyb.iy+=ModulesInRingFront[D.ring()];
617  }
618 
619  xyb.x=lowX+xyb.ix-0.5;
620  xyb.y=lowY+xyb.iy-0.5;
621  return xyb;
622 }
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
std::vector< uint32_t > BinForRing
Definition: TkDetMap.h:105
std::vector< uint32_t > ModulesInRingFront
Definition: TkDetMap.h:105
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
double lowY
Definition: TkDetMap.h:103
std::vector< uint32_t > ModulesInRingBack
Definition: TkDetMap.h:105
double lowX
Definition: TkDetMap.h:102
TkLayerMap::XYbin TkLayerMap::getXY_TIB ( uint32_t  detid,
int  layerEnumNb = 0 
) const
private

Definition at line 544 of file TkDetMap.cc.

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

Referenced by createTIB(), and getXY().

544  {
545  if(!layerEnumNb)
546  layerEnumNb=layerSearch(detid);
547 
548  TIBDetId D(detid);
549 
550  XYbin xyb;
551  xyb.ix=2*(D.isZMinusSide()?-1*D.moduleNumber()+3:D.moduleNumber()+2)+get_Offset(D);
552  xyb.iy=D.isInternalString()?D.stringNumber()+SingleExtString[D.stringNumber()]:D.stringNumber();
553  if(D.layerNumber()<3 && !D.isStereo())
554  xyb.iy+=Nstring_ext+2;
555 
556  xyb.x=lowX+xyb.ix-0.5;
557  xyb.y=lowY+xyb.iy-0.5;
558  return xyb;
559 
560 }
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
uint32_t get_Offset(TIBDetId) const
Definition: TkDetMap.cc:536
double lowY
Definition: TkDetMap.h:103
std::vector< uint32_t > SingleExtString
Definition: TkDetMap.h:105
uint32_t Nstring_ext
Definition: TkDetMap.h:106
double lowX
Definition: TkDetMap.h:102
TkLayerMap::XYbin TkLayerMap::getXY_TID ( uint32_t  detid,
int  layerEnumNb = 0 
) const
private

Definition at line 579 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, and TkLayerMap::XYbin::y.

Referenced by createTID(), and getXY().

579  {
580  if(!layerEnumNb)
581  layerEnumNb=layerSearch(detid);
582 
583  TIDDetId D(detid);
584 
585  XYbin xyb;
586 
587  xyb.ix=D.isZMinusSide()?-3*D.ring()+10:3*D.ring()-2;
588  if(D.isStereo())
589  xyb.ix+=(D.isZMinusSide()?-1:1);
590  xyb.iy= int(2. * D.moduleNumber() - (D.isBackRing()?0.:1.));
591 
592  xyb.x=lowX+xyb.ix-0.5;
593  xyb.y=lowY+xyb.iy-0.5;
594  return xyb;
595 }
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
double lowY
Definition: TkDetMap.h:103
double lowX
Definition: TkDetMap.h:102
TkLayerMap::XYbin TkLayerMap::getXY_TOB ( uint32_t  detid,
int  layerEnumNb = 0 
) const
private

Definition at line 562 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, and TkLayerMap::XYbin::y.

Referenced by createTOB(), and getXY().

562  {
563  if(!layerEnumNb)
564  layerEnumNb=layerSearch(detid);
565 
566  TOBDetId D(detid);
567 
568  XYbin xyb;
569  xyb.ix=D.isZMinusSide()?-1*D.moduleNumber()+7:D.moduleNumber()+6;
570  xyb.iy=D.rodNumber();
571  if(D.layerNumber()<3 && !D.isStereo())
572  xyb.iy+=Nrod+2;
573 
574  xyb.x=lowX+xyb.ix-0.5;
575  xyb.y=lowY+xyb.iy-0.5;
576  return xyb;
577 }
static const int16_t layerSearch(uint32_t detid)
Definition: TkDetMap.cc:89
uint32_t Nrod
Definition: TkDetMap.h:106
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
double lowY
Definition: TkDetMap.h:103
double lowX
Definition: TkDetMap.h:102
void TkLayerMap::initialize ( int  layer)
private

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

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

Referenced by getXY_TEC(), and initialize().

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

Definition at line 102 of file TkDetMap.h.

Referenced by get_highX(), and initialize().

double TkLayerMap::highY
private

Definition at line 103 of file TkDetMap.h.

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

int TkLayerMap::layerEnumNb_
private

Definition at line 99 of file TkDetMap.h.

Referenced by getXY(), and TkLayerMap().

double TkLayerMap::lowX
private

Definition at line 102 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 105 of file TkDetMap.h.

Referenced by getXY_TEC(), and initialize().

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

Definition at line 105 of file TkDetMap.h.

Referenced by getXY_TEC(), and initialize().

int TkLayerMap::nchX
private

Definition at line 100 of file TkDetMap.h.

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

int TkLayerMap::nchY
private

Definition at line 101 of file TkDetMap.h.

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

uint32_t TkLayerMap::Nrod
private

Definition at line 106 of file TkDetMap.h.

Referenced by getXY_TOB(), and initialize().

uint32_t TkLayerMap::Nstring_ext
private

Definition at line 106 of file TkDetMap.h.

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

uint32_t TkLayerMap::Offset
private

Definition at line 106 of file TkDetMap.h.

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

Definition at line 105 of file TkDetMap.h.

Referenced by getXY_TIB(), and initialize().