Skip to content

Commit 483ec27

Browse files
author
Sunanda
committed
Code check
1 parent 69c5983 commit 483ec27

File tree

6 files changed

+72
-26
lines changed

6 files changed

+72
-26
lines changed

Geometry/HGCalCommonData/interface/HGCalDDDConstants.h

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class HGCalDDDConstants {
5151
double calibCellRad(bool hd) const { return (hd ? hgpar_->calibCellRHD_ : hgpar_->calibCellRLD_); }
5252
bool cassetteMode() const {
5353
return ((mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::TrapezoidCassette) ||
54-
(mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell) || (mode_ == HGCalGeometryMode::TrapezoidFineCell));
54+
(mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell) ||
55+
(mode_ == HGCalGeometryMode::TrapezoidFineCell));
5556
}
5657
bool cassetteShiftScintillator(int zside, int layer, int iphi) const;
5758
bool cassetteShiftSilicon(int zside, int layer, int waferU, int waferV) const;
@@ -113,7 +114,17 @@ class HGCalDDDConstants {
113114
std::pair<float, float> localToGlobal8(
114115
int zside, int lay, int waferU, int waferV, double localX, double localY, bool reco, bool debug) const;
115116
std::pair<float, float> locateCell(int cell, int lay, int type, bool reco) const;
116-
std::pair<float, float> locateCell(int zside, int lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool norot, bool cog, bool debug) const;
117+
std::pair<float, float> locateCell(int zside,
118+
int lay,
119+
int waferU,
120+
int waferV,
121+
int cellU,
122+
int cellV,
123+
bool reco,
124+
bool all,
125+
bool norot,
126+
bool cog,
127+
bool debug) const;
117128
std::pair<float, float> locateCell(const HGCSiliconDetId&, bool cog, bool debug) const;
118129
std::pair<float, float> locateCell(const HGCScintillatorDetId&, bool debug) const;
119130
std::pair<float, float> locateCellHex(int cell, int wafer, bool reco) const;
@@ -151,7 +162,8 @@ class HGCalDDDConstants {
151162
inline int tileSiPM(int sipm) const { return ((sipm > 0) ? HGCalTypes::SiPMSmall : HGCalTypes::SiPMLarge); }
152163
bool tileTrapezoid() const {
153164
return ((mode_ == HGCalGeometryMode::Trapezoid) || (mode_ == HGCalGeometryMode::TrapezoidFile) ||
154-
(mode_ == HGCalGeometryMode::TrapezoidModule) || (mode_ == HGCalGeometryMode::TrapezoidCassette) || (mode_ == HGCalGeometryMode::TrapezoidFineCell));
165+
(mode_ == HGCalGeometryMode::TrapezoidModule) || (mode_ == HGCalGeometryMode::TrapezoidCassette) ||
166+
(mode_ == HGCalGeometryMode::TrapezoidFineCell));
155167
}
156168
std::pair<int, int> tileType(int layer, int ring, int phi) const;
157169
inline bool trapezoidFile() const {
@@ -180,15 +192,15 @@ class HGCalDDDConstants {
180192
inline bool waferHexagon8() const {
181193
return ((mode_ == HGCalGeometryMode::Hexagon8) || (mode_ == HGCalGeometryMode::Hexagon8Full) ||
182194
(mode_ == HGCalGeometryMode::Hexagon8File) || (mode_ == HGCalGeometryMode::Hexagon8Module) ||
183-
(mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell));
195+
(mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell) ||
196+
(mode_ == HGCalGeometryMode::Hexagon8FineCell));
184197
}
185198
inline bool waferHexagon8File() const {
186199
return ((mode_ == HGCalGeometryMode::Hexagon8File) || (mode_ == HGCalGeometryMode::Hexagon8Module) ||
187-
(mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell));
188-
}
189-
inline bool waferHexagon8Fine() const {
190-
return ((mode_ == HGCalGeometryMode::Hexagon8FineCell));
200+
(mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell) ||
201+
(mode_ == HGCalGeometryMode::Hexagon8FineCell));
191202
}
203+
inline bool waferHexagon8Fine() const { return ((mode_ == HGCalGeometryMode::Hexagon8FineCell)); }
192204
inline bool waferHexagon8Module() const {
193205
return ((mode_ == HGCalGeometryMode::Hexagon8Module) || (mode_ == HGCalGeometryMode::Hexagon8Cassette) ||
194206
(mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell));

Geometry/HGCalCommonData/src/HGCalDDDConstants.cc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ bool HGCalDDDConstants::cellInLayer(int waferU, int waferV, int cellU, int cellV
325325
return HGCalWaferMask::goodCell(cellU, cellV, ncell, part, rotn);
326326
} else if (waferHexagon8() || waferHexagon6()) {
327327
const auto& xy =
328-
((waferHexagon8()) ? locateCell(zside, lay, waferU, waferV, cellU, cellV, reco, true, false, false, false)
328+
((waferHexagon8()) ? locateCell(zside, lay, waferU, waferV, cellU, cellV, reco, true, false, false, false)
329329
: locateCell(cellU, lay, waferU, reco));
330330
double rpos = sqrt(xy.first * xy.first + xy.second * xy.second);
331331
return ((rpos >= hgpar_->rMinLayHex_[indx.first]) && (rpos <= hgpar_->rMaxLayHex_[indx.first]));
@@ -836,8 +836,17 @@ std::pair<float, float> HGCalDDDConstants::locateCell(int cell, int lay, int typ
836836
return std::make_pair(x, y);
837837
}
838838

839-
std::pair<float, float> HGCalDDDConstants::locateCell(int zside, int lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool norot, bool cog, bool debug)
840-
const {
839+
std::pair<float, float> HGCalDDDConstants::locateCell(int zside,
840+
int lay,
841+
int waferU,
842+
int waferV,
843+
int cellU,
844+
int cellV,
845+
bool reco,
846+
bool all,
847+
bool norot,
848+
bool cog,
849+
bool debug) const {
841850
double x(0), y(0);
842851
int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
843852
auto itr = hgpar_->typesInLayers_.find(indx);
@@ -858,7 +867,8 @@ std::pair<float, float> HGCalDDDConstants::locateCell(int zside, int lay, int wa
858867
if (ktr != hgpar_->waferInfoMap_.end())
859868
place = HGCalCell::cellPlacementIndex(1, HGCalTypes::layerFrontBack(layertype), (ktr->second).orient);
860869
}
861-
auto xy = (waferHexagon8Fine() || cog) ? cellOffset_->cellOffsetUV2XY1(cellU, cellV, place, type) : hgcell_->cellUV2XY2(cellU, cellV, place, type);
870+
auto xy = (waferHexagon8Fine() || cog) ? cellOffset_->cellOffsetUV2XY1(cellU, cellV, place, type)
871+
: hgcell_->cellUV2XY2(cellU, cellV, place, type);
862872
x = xy.first;
863873
y = xy.second;
864874
if (debug)
@@ -919,7 +929,8 @@ std::pair<float, float> HGCalDDDConstants::locateCell(int zside, int lay, int wa
919929
}
920930

921931
std::pair<float, float> HGCalDDDConstants::locateCell(const HGCSiliconDetId& id, bool cog, bool debug) const {
922-
return locateCell(id.zside(), id.layer(), id.waferU(), id.waferV(), id.cellU(), id.cellV(), true, true, false, cog, debug);
932+
return locateCell(
933+
id.zside(), id.layer(), id.waferU(), id.waferV(), id.cellU(), id.cellV(), true, true, false, cog, debug);
923934
}
924935

925936
std::pair<float, float> HGCalDDDConstants::locateCell(const HGCScintillatorDetId& id, bool debug) const {

Geometry/HGCalCommonData/test/HGCalPartialIDTester.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void HGCalPartialIDTester::beginRun(edm::Run const &iRun, edm::EventSetup const
154154
double dR(0);
155155
if ((waferU_[i] != 0) || (waferV_[i] != 0)) {
156156
std::pair<float, float> xy =
157-
hgcCons_->locateCell(zside_[i], layer_[i], waferU, waferV, cellU, cellV, false, true, false, false, false);
157+
hgcCons_->locateCell(zside_[i], layer_[i], waferU, waferV, cellU, cellV, false, true, false, false, false);
158158
double dx = (xpos_[i] - xy.first);
159159
double dy = (ypos_[i] - xy.second);
160160
dR = std::sqrt(dx * dx + dy * dy);
@@ -173,8 +173,8 @@ void HGCalPartialIDTester::beginRun(edm::Run const &iRun, edm::EventSetup const
173173
xx, ypos_[i], zside_[i], layer_[i], waferU, waferV, cellU, cellV, waferType, wt, false, debug_);
174174
info = hgcCons_->waferInfo(layer_[i], waferU, waferV);
175175
if ((waferU_[i] != 0) || (waferV_[i] != 0)) {
176-
std::pair<float, float> xy =
177-
hgcCons_->locateCell(zside_[i], layer_[i], waferU, waferV, cellU, cellV, false, true, false, false, false);
176+
std::pair<float, float> xy = hgcCons_->locateCell(
177+
zside_[i], layer_[i], waferU, waferV, cellU, cellV, false, true, false, false, false);
178178
double dx = (xpos_[i] - xy.first);
179179
double dy = (ypos_[i] - xy.second);
180180
dR = std::sqrt(dx * dx + dy * dy);

Geometry/HGCalCommonData/test/HGCalValidityTester.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ void HGCalValidityTester::beginRun(edm::Run const &iRun, edm::EventSetup const &
184184
HGCSiliconDetId id(detIds_[k].first);
185185
layer = id.layer();
186186
zside = id.zside();
187-
xy = cons->locateCell(zside, layer, id.waferU(), id.waferV(), id.cellU(), id.cellV(), true, true, false, false, false);
187+
xy = cons->locateCell(
188+
zside, layer, id.waferU(), id.waferV(), id.cellU(), id.cellV(), true, true, false, false, false);
188189
valid = cons->isValidHex8(layer, id.waferU(), id.waferV(), id.cellU(), id.cellV(), false);
189190
auto cell = cons->assignCellHex(zside * xy.first, xy.second, zside, layer, true, false, false);
190191
HGCSiliconDetId newId(id.det(), id.zside(), cell[2], id.layer(), cell[0], cell[1], cell[3], cell[4]);

Geometry/HGCalGeometry/src/HGCalGeometry.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ bool HGCalGeometry::present(const DetId& detId) const {
204204
GlobalPoint HGCalGeometry::getPosition(const DetId& detid, bool debug) const {
205205
return getPosition(detid, false, debug);
206206
}
207-
207+
208208
GlobalPoint HGCalGeometry::getPosition(const DetId& detid, bool cog, bool debug) const {
209209
unsigned int cellIndex = indexFor(detid);
210210
GlobalPoint glob;
@@ -236,7 +236,8 @@ GlobalPoint HGCalGeometry::getPosition(const DetId& detid, bool cog, bool debug)
236236
<< " Wafer " << id.iSec1 << ":" << id.iSec2 << " Cell " << id.iCell1 << ":"
237237
<< id.iCell2;
238238
}
239-
xy = m_topology.dddConstants().locateCell(id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, true, true, cog, debug);
239+
xy = m_topology.dddConstants().locateCell(
240+
id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, true, true, cog, debug);
240241
double xx = id.zSide * xy.first;
241242
double zz = id.zSide * m_topology.dddConstants().waferZ(id.iLay, true);
242243
glob = GlobalPoint(xx, xy.second, zz);
@@ -322,7 +323,8 @@ HGCalGeometry::CornersVec HGCalGeometry::getCorners(const DetId& detid) const {
322323
co[i] = m_cellVec[cellIndex].getPosition(lcoord);
323324
}
324325
} else {
325-
xy = m_topology.dddConstants().locateCell(id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false, true, false, debugLocate);
326+
xy = m_topology.dddConstants().locateCell(
327+
id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false, true, false, debugLocate);
326328
float zz = m_topology.dddConstants().waferZ(id.iLay, true);
327329
float dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
328330
float dy = k_fac1 * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
@@ -378,7 +380,8 @@ HGCalGeometry::CornersVec HGCalGeometry::get8Corners(const DetId& detid) const {
378380
co[i] = m_cellVec[cellIndex].getPosition(lcoord);
379381
}
380382
} else {
381-
xy = m_topology.dddConstants().locateCell(id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false, true, false, debugLocate);
383+
xy = m_topology.dddConstants().locateCell(
384+
id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false, true, false, debugLocate);
382385
dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
383386
float dy = k_fac1 * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
384387
float dz = -id.zSide * m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
@@ -438,7 +441,8 @@ HGCalGeometry::CornersVec HGCalGeometry::getNewCorners(const DetId& detid, bool
438441
co[i] = m_cellVec[cellIndex].getPosition(lcoord);
439442
}
440443
} else {
441-
xy = m_topology.dddConstants().locateCell(id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false, true, false, debug);
444+
xy = m_topology.dddConstants().locateCell(
445+
id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false, true, false, debug);
442446
float zz = m_topology.dddConstants().waferZ(id.iLay, true);
443447
for (unsigned int i = 0; i < ncorner; ++i) {
444448
double xloc = xy.first + signx[i] * dx;

Validation/HGCalValidation/test/HGCalWaferStudy.cc

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,33 @@ void HGCalWaferStudy::analyze(const edm::Event& iEvent, const edm::EventSetup& i
166166
layer = detId.layer();
167167
zside = detId.zside();
168168
wvtype = hgcons_[k]->waferVirtual(layer, detId.waferU(), detId.waferV());
169-
xy = hgcons_[k]->locateCell(
170-
zside, layer, detId.waferU(), detId.waferV(), detId.cellU(), detId.cellV(), false, true, false, false, false);
169+
xy = hgcons_[k]->locateCell(zside,
170+
layer,
171+
detId.waferU(),
172+
detId.waferV(),
173+
detId.cellU(),
174+
detId.cellV(),
175+
false,
176+
true,
177+
false,
178+
false,
179+
false);
171180
} else if (hgcons_[k]->waferHexagon8()) {
172181
HGCSiliconDetId detId = HGCSiliconDetId(id);
173182
layer = detId.layer();
174183
zside = detId.zside();
175184
wvtype = hgcons_[k]->waferVirtual(layer, detId.waferU(), detId.waferV());
176-
xy = hgcons_[k]->locateCell(
177-
zside, layer, detId.waferU(), detId.waferV(), detId.cellU(), detId.cellV(), false, true, false, false, false);
185+
xy = hgcons_[k]->locateCell(zside,
186+
layer,
187+
detId.waferU(),
188+
detId.waferV(),
189+
detId.cellU(),
190+
detId.cellV(),
191+
false,
192+
true,
193+
false,
194+
false,
195+
false);
178196
} else {
179197
int subdet, sector, type, cell;
180198
HGCalTestNumbering::unpackHexagonIndex(id, subdet, zside, layer, sector, type, cell);

0 commit comments

Comments
 (0)