CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
HGCalGeomRotation Class Reference

#include <HGCalGeomRotation.h>

Public Types

enum  SectorType { SectorType::Sector120Degrees, SectorType::Sector60Degrees }
 
enum  WaferCentring { WaferCentring::WaferCentred, WaferCentring::CornerCentredY, WaferCentring::CornerCentredMercedes }
 

Public Member Functions

 HGCalGeomRotation (SectorType sectorType)
 
void uvMappingFromSector0 (WaferCentring waferCentring, int &moduleU, int &moduleV, unsigned sector) const
 
unsigned uvMappingToSector0 (WaferCentring waferCentring, int &moduleU, int &moduleV) const
 
 ~HGCalGeomRotation ()=default
 

Private Member Functions

void RotateModule120DegreesAnticlockwise (int &moduleU, int &moduleV, int offset) const
 
void RotateModule120DegreesClockwise (int &moduleU, int &moduleV, int offset) const
 
void RotateModule60DegreesAnticlockwise (int &moduleU, int &moduleV) const
 
void RotateModule60DegreesClockwise (int &moduleU, int &moduleV) const
 
void uvMappingFrom120DegreeSector0 (WaferCentring waferCentring, int &moduleU, int &moduleV, unsigned sector) const
 
void uvMappingFrom60DegreeSector0 (WaferCentring waferCentring, int &moduleU, int &moduleV, unsigned sector) const
 
unsigned uvMappingTo120DegreeSector0 (WaferCentring waferCentring, int &moduleU, int &moduleV) const
 
unsigned uvMappingTo60DegreeSector0 (WaferCentring waferCentring, int &moduleU, int &moduleV) const
 

Private Attributes

SectorType sectorType_
 

Detailed Description

Definition at line 4 of file HGCalGeomRotation.h.

Member Enumeration Documentation

◆ SectorType

Enumerator
Sector120Degrees 
Sector60Degrees 

Definition at line 6 of file HGCalGeomRotation.h.

6 { Sector120Degrees, Sector60Degrees };

◆ WaferCentring

Enumerator
WaferCentred 
CornerCentredY 
CornerCentredMercedes 

Definition at line 7 of file HGCalGeomRotation.h.

7 { WaferCentred, CornerCentredY, CornerCentredMercedes };

Constructor & Destructor Documentation

◆ HGCalGeomRotation()

HGCalGeomRotation::HGCalGeomRotation ( SectorType  sectorType)
inline

Definition at line 9 of file HGCalGeomRotation.h.

References sectorType_.

9 { sectorType_ = sectorType; };

◆ ~HGCalGeomRotation()

HGCalGeomRotation::~HGCalGeomRotation ( )
default

Member Function Documentation

◆ RotateModule120DegreesAnticlockwise()

void HGCalGeomRotation::RotateModule120DegreesAnticlockwise ( int &  moduleU,
int &  moduleV,
int  offset 
) const
private

Definition at line 175 of file HGCalGeomRotation.cc.

References hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by uvMappingFrom120DegreeSector0().

175  {
176  int moduleURotated, moduleVRotated;
177 
178  moduleURotated = -moduleV + offset;
179  moduleVRotated = moduleU - moduleV + offset;
180 
181  moduleU = moduleURotated;
182  moduleV = moduleVRotated;
183 }

◆ RotateModule120DegreesClockwise()

void HGCalGeomRotation::RotateModule120DegreesClockwise ( int &  moduleU,
int &  moduleV,
int  offset 
) const
private

Definition at line 185 of file HGCalGeomRotation.cc.

References hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by uvMappingTo120DegreeSector0().

185  {
186  int moduleURotated, moduleVRotated;
187 
188  moduleURotated = moduleV - moduleU;
189  moduleVRotated = -moduleU + offset;
190 
191  moduleU = moduleURotated;
192  moduleV = moduleVRotated;
193 }

◆ RotateModule60DegreesAnticlockwise()

void HGCalGeomRotation::RotateModule60DegreesAnticlockwise ( int &  moduleU,
int &  moduleV 
) const
private

Definition at line 157 of file HGCalGeomRotation.cc.

Referenced by uvMappingFrom60DegreeSector0().

157  {
158  int moduleURotated, moduleVRotated;
159  moduleURotated = moduleU - moduleV;
160  moduleVRotated = moduleU;
161 
162  moduleU = moduleURotated;
163  moduleV = moduleVRotated;
164 }

◆ RotateModule60DegreesClockwise()

void HGCalGeomRotation::RotateModule60DegreesClockwise ( int &  moduleU,
int &  moduleV 
) const
private

Definition at line 166 of file HGCalGeomRotation.cc.

Referenced by uvMappingTo60DegreeSector0().

166  {
167  int moduleURotated, moduleVRotated;
168  moduleURotated = moduleV;
169  moduleVRotated = moduleV - moduleU;
170 
171  moduleU = moduleURotated;
172  moduleV = moduleVRotated;
173 }

◆ uvMappingFrom120DegreeSector0()

void HGCalGeomRotation::uvMappingFrom120DegreeSector0 ( WaferCentring  waferCentring,
int &  moduleU,
int &  moduleV,
unsigned  sector 
) const
private

Definition at line 50 of file HGCalGeomRotation.cc.

References CornerCentredMercedes, CornerCentredY, Exception, hltrates_dqm_sourceclient-live_cfg::offset, makeMuonMisalignmentScenario::rot, RotateModule120DegreesAnticlockwise(), and WaferCentred.

Referenced by uvMappingFromSector0().

53  {
54  int offset;
55 
56  if (waferCentring == WaferCentring::WaferCentred) {
57  offset = 0;
58  } else if (waferCentring == WaferCentring::CornerCentredY) {
59  offset = -1;
60  } else if (waferCentring == WaferCentring::CornerCentredMercedes) {
61  offset = 1;
62  } else {
63  throw cms::Exception("RotationException")
64  << "HGCalGeomRotation: WaferCentring must be one of: WaferCentred, CornerCentredY or CornerCentredMercedes";
65  }
66 
67  if (sector > 2) {
68  edm::LogError("RotationException") << "HGCalGeomRotation: desired sector must be either 0, 1 or 2";
69  return;
70  }
71  for (unsigned rot = 0; rot < sector; rot++) {
73  }
74 }
Log< level::Error, false > LogError
void RotateModule120DegreesAnticlockwise(int &moduleU, int &moduleV, int offset) const

◆ uvMappingFrom60DegreeSector0()

void HGCalGeomRotation::uvMappingFrom60DegreeSector0 ( WaferCentring  waferCentring,
int &  moduleU,
int &  moduleV,
unsigned  sector 
) const
private

Definition at line 32 of file HGCalGeomRotation.cc.

References Exception, makeMuonMisalignmentScenario::rot, RotateModule60DegreesAnticlockwise(), and WaferCentred.

Referenced by uvMappingFromSector0().

35  {
36  if (waferCentring != WaferCentring::WaferCentred) {
37  edm::LogError("HGCalGeomRotation")
38  << "HGCalGeomRotation: 60 degree sector defintion selected, but not WaferCentred centring. This is "
39  "incompatible, assuming WaferCentred centring";
40  }
41 
42  if (sector > 5) {
43  throw cms::Exception("RotationException") << "HGCalGeomRotation: desired sector must be either 0, 1, 2, 3, 4, or 5";
44  }
45  for (unsigned rot = 0; rot < sector; rot++) {
46  RotateModule60DegreesAnticlockwise(moduleU, moduleV);
47  }
48 }
Log< level::Error, false > LogError
void RotateModule60DegreesAnticlockwise(int &moduleU, int &moduleV) const

◆ uvMappingFromSector0()

void HGCalGeomRotation::uvMappingFromSector0 ( WaferCentring  waferCentring,
int &  moduleU,
int &  moduleV,
unsigned  sector 
) const

Definition at line 5 of file HGCalGeomRotation.cc.

References Sector120Degrees, Sector60Degrees, sectorType_, uvMappingFrom120DegreeSector0(), and uvMappingFrom60DegreeSector0().

Referenced by HGCalTriggerGeometryV9Imp3::getOrderedTriggerCellsFromModule(), and HGCalTriggerGeometryV9Imp3::getTriggerCellsFromModule().

8  {
9  if (sector == 0) {
10  return;
11  }
12 
14  uvMappingFrom60DegreeSector0(waferCentring, moduleU, moduleV, sector);
16  uvMappingFrom120DegreeSector0(waferCentring, moduleU, moduleV, sector);
17  }
18 }
void uvMappingFrom120DegreeSector0(WaferCentring waferCentring, int &moduleU, int &moduleV, unsigned sector) const
void uvMappingFrom60DegreeSector0(WaferCentring waferCentring, int &moduleU, int &moduleV, unsigned sector) const

◆ uvMappingTo120DegreeSector0()

unsigned HGCalGeomRotation::uvMappingTo120DegreeSector0 ( WaferCentring  waferCentring,
int &  moduleU,
int &  moduleV 
) const
private

Definition at line 76 of file HGCalGeomRotation.cc.

References CornerCentredMercedes, CornerCentredY, Exception, hltrates_dqm_sourceclient-live_cfg::offset, makeMuonMisalignmentScenario::rot, RotateModule120DegreesClockwise(), and WaferCentred.

Referenced by uvMappingToSector0().

76  {
77  unsigned sector = 0;
78  int offset;
79 
80  if (waferCentring == WaferCentring::WaferCentred) {
81  if (moduleU > 0 && moduleV >= 0)
82  return sector;
83 
84  offset = 0;
85  if (moduleU >= moduleV && moduleV < 0)
86  sector = 2;
87  else
88  sector = 1;
89 
90  } else if (waferCentring == WaferCentring::CornerCentredY) {
91  if (moduleU >= 0 && moduleV >= 0)
92  return sector;
93 
94  offset = -1;
95  if (moduleU > moduleV && moduleV < 0)
96  sector = 2;
97  else
98  sector = 1;
99 
100  } else if (waferCentring == WaferCentring::CornerCentredMercedes) {
101  if (moduleU >= 1 && moduleV >= 1)
102  return sector;
103 
104  offset = 1;
105  if (moduleU >= moduleV && moduleV < 1)
106  sector = 2;
107  else
108  sector = 1;
109  } else {
110  throw cms::Exception("RotationException")
111  << "HGCalGeomRotation: WaferCentring must be one of: WaferCentred, CornerCentredY or CornerCentredMercedes";
112  }
113 
114  for (unsigned rot = 0; rot < sector; rot++) {
115  RotateModule120DegreesClockwise(moduleU, moduleV, offset);
116  }
117 
118  return sector;
119 }
void RotateModule120DegreesClockwise(int &moduleU, int &moduleV, int offset) const

◆ uvMappingTo60DegreeSector0()

unsigned HGCalGeomRotation::uvMappingTo60DegreeSector0 ( WaferCentring  waferCentring,
int &  moduleU,
int &  moduleV 
) const
private

Definition at line 121 of file HGCalGeomRotation.cc.

References makeMuonMisalignmentScenario::rot, RotateModule60DegreesClockwise(), and WaferCentred.

Referenced by uvMappingToSector0().

121  {
122  unsigned sector = 0;
123 
124  if (waferCentring != WaferCentring::WaferCentred) {
125  edm::LogError("HGCalGeomRotation")
126  << "HGCalGeomRotation: 60 degree sector defintion selected, but not WaferCentred centring. This is "
127  "incompatible, assuming WaferCentred centring";
128  }
129 
130  if (moduleU > 0 && moduleV >= 0) {
131  if (moduleV < moduleU) {
132  return sector;
133  } else {
134  sector = 1;
135  }
136  } else if (moduleU >= moduleV && moduleV < 0) {
137  if (moduleU >= 0) {
138  sector = 5;
139  } else {
140  sector = 4;
141  }
142  } else {
143  if (moduleV > 0) {
144  sector = 2;
145  } else {
146  sector = 3;
147  }
148  }
149 
150  for (unsigned rot = 0; rot < sector; rot++) {
151  RotateModule60DegreesClockwise(moduleU, moduleV);
152  }
153 
154  return sector;
155 }
void RotateModule60DegreesClockwise(int &moduleU, int &moduleV) const
Log< level::Error, false > LogError

◆ uvMappingToSector0()

unsigned HGCalGeomRotation::uvMappingToSector0 ( WaferCentring  waferCentring,
int &  moduleU,
int &  moduleV 
) const

Definition at line 20 of file HGCalGeomRotation.cc.

References Sector120Degrees, Sector60Degrees, sectorType_, uvMappingTo120DegreeSector0(), and uvMappingTo60DegreeSector0().

Referenced by HGCalTriggerGeometryV9Imp3::getModuleFromTriggerCell().

20  {
21  unsigned sector = 0;
22 
24  sector = uvMappingTo60DegreeSector0(waferCentring, moduleU, moduleV);
26  sector = uvMappingTo120DegreeSector0(waferCentring, moduleU, moduleV);
27  }
28 
29  return sector;
30 }
unsigned uvMappingTo60DegreeSector0(WaferCentring waferCentring, int &moduleU, int &moduleV) const
unsigned uvMappingTo120DegreeSector0(WaferCentring waferCentring, int &moduleU, int &moduleV) const

Member Data Documentation

◆ sectorType_

SectorType HGCalGeomRotation::sectorType_
private

Definition at line 27 of file HGCalGeomRotation.h.

Referenced by HGCalGeomRotation(), uvMappingFromSector0(), and uvMappingToSector0().