CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
mkfit::LayerNumberConverter Class Reference

#include <LayerNumberConverter.h>

Public Member Functions

int convertBarrelLayerNumber (int cmsswdet, int cmsswlay, bool useMatched, int isStereo) const
 
int convertDiskNumber (int cmsswdet, int cmsswdisk, bool useMatched, int isStereo) const
 
int convertLayerNumber (int det, int lay, bool useMatched, int isStereo, bool posZ) const
 
 LayerNumberConverter (TkLayout layout)
 
unsigned int nLayers () const
 

Private Attributes

TkLayout lo_
 

Detailed Description

Definition at line 8 of file LayerNumberConverter.h.

Constructor & Destructor Documentation

◆ LayerNumberConverter()

mkfit::LayerNumberConverter::LayerNumberConverter ( TkLayout  layout)
inline

Member Function Documentation

◆ convertBarrelLayerNumber()

int mkfit::LayerNumberConverter::convertBarrelLayerNumber ( int  cmsswdet,
int  cmsswlay,
bool  useMatched,
int  isStereo 
) const
inline

Definition at line 37 of file LayerNumberConverter.h.

References lo_, mkfit::phase1, and useMatched.

Referenced by convertLayerNumber().

37  {
38  int lOffset = 0;
39  if (lo_ == TkLayout::phase1)
40  lOffset = 1;
41  if (cmsswdet == 2 || cmsswdet == 4 || cmsswdet == 6)
42  return -1; //FPIX, TID, TEC
43  if (cmsswdet == 1)
44  return cmsswlay - 1; //BPIX
45  if (useMatched) {
46  //TIB
47  if (cmsswdet == 3) {
48  if (cmsswlay == 1 && isStereo == -1)
49  return 3 + lOffset;
50  else if (cmsswlay == 2 && isStereo == -1)
51  return 4 + lOffset;
52  else if (cmsswlay == 3 && isStereo == 0)
53  return 5 + lOffset;
54  else if (cmsswlay == 4 && isStereo == 0)
55  return 6 + lOffset;
56  }
57  //TOB
58  else if (cmsswdet == 5) {
59  if (cmsswlay == 1 && isStereo == -1)
60  return 7 + lOffset;
61  else if (cmsswlay == 2 && isStereo == -1)
62  return 8 + lOffset;
63  else if (cmsswlay >= 3 && cmsswlay <= 6 && isStereo == 0)
64  return 6 + cmsswlay + lOffset;
65  }
66  return -1;
67  } else {
68  //TIB
69  if (cmsswdet == 3) {
70  if ((cmsswlay == 1 || cmsswlay == 2) && (isStereo == 0 || isStereo == 1)) {
71  return 1 + cmsswlay * 2 + isStereo + lOffset;
72  } else if (cmsswlay == 3 && isStereo == 0)
73  return 7 + lOffset;
74  else if (cmsswlay == 4 && isStereo == 0)
75  return 8 + lOffset;
76  }
77  //TOB
78  else if (cmsswdet == 5) {
79  if ((cmsswlay == 1 || cmsswlay == 2) && (isStereo == 0 || isStereo == 1)) {
80  return 7 + cmsswlay * 2 + isStereo + lOffset;
81  } else if (cmsswlay >= 3 && cmsswlay <= 6 && isStereo == 0)
82  return 10 + cmsswlay + lOffset;
83  }
84  return -1;
85  }
86  }
constexpr bool useMatched

◆ convertDiskNumber()

int mkfit::LayerNumberConverter::convertDiskNumber ( int  cmsswdet,
int  cmsswdisk,
bool  useMatched,
int  isStereo 
) const
inline

Definition at line 87 of file LayerNumberConverter.h.

References lo_, mkfit::phase1, and useMatched.

Referenced by convertLayerNumber().

87  {
88  if (cmsswdet == 1 || cmsswdet == 3 || cmsswdet == 5)
89  return -1; //BPIX, TIB, TOB
90  if (cmsswdet == 2)
91  return cmsswdisk - 1; //FPIX
92  int lOffset = 0;
93  if (lo_ == TkLayout::phase1)
94  lOffset = 1;
95  if (useMatched) {
96  return -1;
97  } else {
98  if ((isStereo != 0 && isStereo != 1) || cmsswdisk < 1)
99  return -1;
100  //TID
101  if (cmsswdet == 4 && cmsswdisk <= 3)
102  return cmsswdisk * 2 + isStereo + lOffset;
103  //TEC
104  else if (cmsswdet == 6 && cmsswdisk <= 9)
105  return 6 + cmsswdisk * 2 + isStereo + lOffset;
106  return -1;
107  }
108  }
constexpr bool useMatched

◆ convertLayerNumber()

int mkfit::LayerNumberConverter::convertLayerNumber ( int  det,
int  lay,
bool  useMatched,
int  isStereo,
bool  posZ 
) const
inline

Definition at line 18 of file LayerNumberConverter.h.

References convertBarrelLayerNumber(), convertDiskNumber(), lo_, mkfit::phase1, and useMatched.

Referenced by MkFitSeedConverter::convertSeeds(), MkFitGeometryESProducer::fillShapeAndPlacement(), and main().

18  {
19  if (det == 1 || det == 3 || det == 5) {
20  return convertBarrelLayerNumber(det, lay, useMatched, isStereo);
21  } else {
22  int disk = convertDiskNumber(det, lay, useMatched, isStereo);
23  if (disk < 0)
24  return -1;
25 
26  int lOffset = 0;
27  if (lo_ == TkLayout::phase1)
28  lOffset = 1;
29  disk += 17 + lOffset;
30  if (!posZ)
31  disk += 25 + 2 * lOffset;
32  return disk;
33  }
34  return -1;
35  }
constexpr bool useMatched
int convertDiskNumber(int cmsswdet, int cmsswdisk, bool useMatched, int isStereo) const
int convertBarrelLayerNumber(int cmsswdet, int cmsswlay, bool useMatched, int isStereo) const

◆ nLayers()

unsigned int mkfit::LayerNumberConverter::nLayers ( ) const
inline

Definition at line 11 of file LayerNumberConverter.h.

References lo_, mkfit::phase0, and mkfit::phase1.

Referenced by main().

11  {
12  if (lo_ == TkLayout::phase0)
13  return 69;
14  if (lo_ == TkLayout::phase1)
15  return 72;
16  return 10;
17  }

Member Data Documentation

◆ lo_

TkLayout mkfit::LayerNumberConverter::lo_
private