Skip to content

Commit 69c5983

Browse files
author
Sunanda
committed
Add afew new modes to enable cog computation for wafers as default for the future V19 version of HGCal
1 parent 9fd2c45 commit 69c5983

File tree

19 files changed

+50
-44
lines changed

19 files changed

+50
-44
lines changed

Geometry/HGCalCommonData/data/hgcalCons/v19/hgcalCons.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<SpecPar name="HGCalEELayer">
3939
<PartSelector path="//HGCalEELayer.*"/>
4040
<Parameter name="Volume" value="HGCalEELayer" eval="false"/>
41-
<Parameter name="GeometryMode" value="HGCalGeometryMode::Hexagon8CalibCell" eval="false"/>
41+
<Parameter name="GeometryMode" value="HGCalGeometryMode::Hexagon8FineCell" eval="false"/>
4242
<Parameter name="LevelZSide" value="3"/>
4343
<Parameter name="LevelTop" value="9"/>
4444
<Parameter name="LevelTop" value="12"/>
@@ -102,7 +102,7 @@
102102
<SpecPar name="HGCalHESiliconLayer">
103103
<PartSelector path="//HGCalHESiliconLayer.*"/>
104104
<Parameter name="Volume" value="HGCalHESiliconLayer" eval="false"/>
105-
<Parameter name="GeometryMode" value="HGCalGeometryMode::Hexagon8CalibCell" eval="false"/>
105+
<Parameter name="GeometryMode" value="HGCalGeometryMode::Hexagon8FineCell" eval="false"/>
106106
<Parameter name="LevelZSide" value="3"/>
107107
<Parameter name="LevelTop" value="9"/>
108108
<Parameter name="LevelTop" value="12"/>
@@ -166,7 +166,7 @@
166166
<SpecPar name="HGCalHEScintillatorSensitive">
167167
<PartSelector path="//HGCalHEScintillatorSensitive.*"/>
168168
<Parameter name="Volume" value="HGCalHEScintillatorSensitive" eval="false"/>
169-
<Parameter name="GeometryMode" value="HGCalGeometryMode::TrapezoidFineCassette" eval="false"/>
169+
<Parameter name="GeometryMode" value="HGCalGeometryMode::TrapezoidFinCell" eval="false"/>
170170
<Parameter name="LevelZSide" value="3"/>
171171
<Parameter name="LevelTop" value="9"/>
172172
<Parameter name="LevelTop" value="11"/>

Geometry/HGCalCommonData/interface/HGCalDDDConstants.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ 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));
54+
(mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell) || (mode_ == HGCalGeometryMode::TrapezoidFineCell));
5555
}
5656
bool cassetteShiftScintillator(int zside, int layer, int iphi) const;
5757
bool cassetteShiftSilicon(int zside, int layer, int waferU, int waferV) const;
@@ -113,10 +113,8 @@ class HGCalDDDConstants {
113113
std::pair<float, float> localToGlobal8(
114114
int zside, int lay, int waferU, int waferV, double localX, double localY, bool reco, bool debug) const;
115115
std::pair<float, float> locateCell(int cell, int lay, int type, bool reco) const;
116-
std::pair<float, float> locateCell(
117-
int zside, int lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool norot, bool debug)
118-
const;
119-
std::pair<float, float> locateCell(const HGCSiliconDetId&, bool debug) 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(const HGCSiliconDetId&, bool cog, bool debug) const;
120118
std::pair<float, float> locateCell(const HGCScintillatorDetId&, bool debug) const;
121119
std::pair<float, float> locateCellHex(int cell, int wafer, bool reco) const;
122120
std::pair<float, float> locateCellTrap(int zside, int lay, int ieta, int iphi, bool reco, bool debug) const;
@@ -153,12 +151,12 @@ class HGCalDDDConstants {
153151
inline int tileSiPM(int sipm) const { return ((sipm > 0) ? HGCalTypes::SiPMSmall : HGCalTypes::SiPMLarge); }
154152
bool tileTrapezoid() const {
155153
return ((mode_ == HGCalGeometryMode::Trapezoid) || (mode_ == HGCalGeometryMode::TrapezoidFile) ||
156-
(mode_ == HGCalGeometryMode::TrapezoidModule) || (mode_ == HGCalGeometryMode::TrapezoidCassette));
154+
(mode_ == HGCalGeometryMode::TrapezoidModule) || (mode_ == HGCalGeometryMode::TrapezoidCassette) || (mode_ == HGCalGeometryMode::TrapezoidFineCell));
157155
}
158156
std::pair<int, int> tileType(int layer, int ring, int phi) const;
159157
inline bool trapezoidFile() const {
160158
return ((mode_ == HGCalGeometryMode::TrapezoidFile) || (mode_ == HGCalGeometryMode::TrapezoidModule) ||
161-
(mode_ == HGCalGeometryMode::TrapezoidCassette));
159+
(mode_ == HGCalGeometryMode::TrapezoidCassette) || (mode_ == HGCalGeometryMode::TrapezoidFineCell));
162160
}
163161
inline bool v17OrLess() const { return (mode_ < HGCalGeometryMode::Hexagon8CalibCell); }
164162
inline unsigned int volumes() const { return hgpar_->moduleLayR_.size(); }
@@ -182,15 +180,18 @@ class HGCalDDDConstants {
182180
inline bool waferHexagon8() const {
183181
return ((mode_ == HGCalGeometryMode::Hexagon8) || (mode_ == HGCalGeometryMode::Hexagon8Full) ||
184182
(mode_ == HGCalGeometryMode::Hexagon8File) || (mode_ == HGCalGeometryMode::Hexagon8Module) ||
185-
(mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell));
183+
(mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell));
186184
}
187185
inline bool waferHexagon8File() const {
188186
return ((mode_ == HGCalGeometryMode::Hexagon8File) || (mode_ == HGCalGeometryMode::Hexagon8Module) ||
189-
(mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell));
187+
(mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell));
188+
}
189+
inline bool waferHexagon8Fine() const {
190+
return ((mode_ == HGCalGeometryMode::Hexagon8FineCell));
190191
}
191192
inline bool waferHexagon8Module() const {
192193
return ((mode_ == HGCalGeometryMode::Hexagon8Module) || (mode_ == HGCalGeometryMode::Hexagon8Cassette) ||
193-
(mode_ == HGCalGeometryMode::Hexagon8CalibCell));
194+
(mode_ == HGCalGeometryMode::Hexagon8CalibCell) || (mode_ == HGCalGeometryMode::Hexagon8FineCell));
194195
}
195196
bool waferInLayer(int wafer, int lay, bool reco) const;
196197
bool waferFullInLayer(int wafer, int lay, bool reco) const;

Geometry/HGCalCommonData/interface/HGCalGeometryMode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ namespace HGCalGeometryMode {
3737
Hexagon8Cassette = 10,
3838
TrapezoidCassette = 11,
3939
Hexagon8CalibCell = 12,
40+
TrapezoidFineCell = 13,
41+
Hexagon8FineCell = 14,
4042
};
4143

4244
enum WaferMode { Polyhedra = 0, ExtrudedPolygon = 1 };

Geometry/HGCalCommonData/src/HGCalDDDConstants.cc

Lines changed: 5 additions & 6 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)
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,7 @@ 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(
840-
int zside, int lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool norot, bool debug)
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)
841840
const {
842841
double x(0), y(0);
843842
int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
@@ -859,7 +858,7 @@ std::pair<float, float> HGCalDDDConstants::locateCell(
859858
if (ktr != hgpar_->waferInfoMap_.end())
860859
place = HGCalCell::cellPlacementIndex(1, HGCalTypes::layerFrontBack(layertype), (ktr->second).orient);
861860
}
862-
auto xy = hgcell_->cellUV2XY2(cellU, cellV, place, type);
861+
auto xy = (waferHexagon8Fine() || cog) ? cellOffset_->cellOffsetUV2XY1(cellU, cellV, place, type) : hgcell_->cellUV2XY2(cellU, cellV, place, type);
863862
x = xy.first;
864863
y = xy.second;
865864
if (debug)
@@ -919,8 +918,8 @@ std::pair<float, float> HGCalDDDConstants::locateCell(
919918
return (rotx ? getXY(lay, x, y, false) : std::make_pair(x, y));
920919
}
921920

922-
std::pair<float, float> HGCalDDDConstants::locateCell(const HGCSiliconDetId& id, bool debug) const {
923-
return locateCell(id.zside(), id.layer(), id.waferU(), id.waferV(), id.cellU(), id.cellV(), true, true, false, debug);
921+
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);
924923
}
925924

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

Geometry/HGCalCommonData/src/HGCalGeometryMode.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ HGCalStringToEnumParser<HGCalGeometryMode::GeometryMode>::HGCalStringToEnumParse
1616
enumMap["HGCalGeometryMode::Hexagon8Cassette"] = HGCalGeometryMode::Hexagon8Cassette;
1717
enumMap["HGCalGeometryMode::TrapezoidCassette"] = HGCalGeometryMode::TrapezoidCassette;
1818
enumMap["HGCalGeometryMode::Hexagon8CalibCell"] = HGCalGeometryMode::Hexagon8CalibCell;
19+
enumMap["HGCalGeometryMode::TrapezoidFineCell"] = HGCalGeometryMode::TrapezoidFineCell;
20+
enumMap["HGCalGeometryMode::Hexagon8FineCell"] = HGCalGeometryMode::Hexagon8FineCell;
1921
}
2022

2123
template <>

Geometry/HGCalCommonData/test/HGCalNumberingTester.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void HGCalNumberingTester::analyze(const edm::Event& iEvent, const edm::EventSet
172172
} else {
173173
std::array<int, 5> kxy, lxy;
174174
kxy = hgdc.assignCellHex(localx, localy, zside, i + loff, reco_, false, false);
175-
xy = hgdc.locateCell(zside, i + loff, kxy[0], kxy[1], kxy[3], kxy[4], reco_, true, false, false);
175+
xy = hgdc.locateCell(zside, i + loff, kxy[0], kxy[1], kxy[3], kxy[4], reco_, true, false, false, false);
176176
lxy = hgdc.assignCellHex(xy.first, xy.second, zside, i + loff, reco_, false, false);
177177
flg = (kxy == lxy) ? " " : " ***** Error *****";
178178
edm::LogVerbatim("HGCalGeom") << "Input: (" << localx << "," << localy << ", " << i + loff
@@ -182,7 +182,7 @@ void HGCalNumberingTester::analyze(const edm::Event& iEvent, const edm::EventSet
182182
<< lxy[3] << ":" << lxy[4] << ") Dist "
183183
<< hgdc.distFromEdgeHex(scl * localx, scl * localy, scl * zpos) << " " << flg;
184184
kxy = hgdc.assignCellHex(-localx, -localy, zside, i + loff, reco_, false, false);
185-
xy = hgdc.locateCell(zside, i + loff, kxy[0], kxy[1], kxy[3], kxy[4], reco_, true, false, false);
185+
xy = hgdc.locateCell(zside, i + loff, kxy[0], kxy[1], kxy[3], kxy[4], reco_, true, false, false, false);
186186
lxy = hgdc.assignCellHex(xy.first, xy.second, zside, i + loff, reco_, false, false);
187187
flg = (kxy == lxy) ? " " : " ***** Error *****";
188188
edm::LogVerbatim("HGCalGeom") << "Input: (" << -localx << "," << -localy << ", " << i + loff

Geometry/HGCalCommonData/test/HGCalPartialIDTester.cc

Lines changed: 2 additions & 2 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);
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);
@@ -174,7 +174,7 @@ void HGCalPartialIDTester::beginRun(edm::Run const &iRun, edm::EventSetup const
174174
info = hgcCons_->waferInfo(layer_[i], waferU, waferV);
175175
if ((waferU_[i] != 0) || (waferV_[i] != 0)) {
176176
std::pair<float, float> xy =
177-
hgcCons_->locateCell(zside_[i], layer_[i], waferU, waferV, cellU, cellV, false, true, false, false);
177+
hgcCons_->locateCell(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/HGCalPartialWaferTester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void HGCalPartialWaferTester::analyze(const edm::Event&, const edm::EventSetup&
107107
++alltry;
108108
double zpos = hgdc.waferZ(layer, reco);
109109
int zside = (zpos > 0) ? 1 : -1;
110-
auto xy = hgdc.locateCell(zside, layer, waferU, waferV, ui, vi, reco, all, norot, debug1);
110+
auto xy = hgdc.locateCell(zside, layer, waferU, waferV, ui, vi, reco, all, norot, false, debug1);
111111
int lay(layer), cU(0), cV(0), wType(-1), wU(0), wV(0);
112112
double wt(0);
113113
hgdc.waferFromPosition(HGCalParameters::k_ScaleToDDD * xy.first,

Geometry/HGCalCommonData/test/HGCalValidityTester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ 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);
187+
xy = cons->locateCell(zside, layer, id.waferU(), id.waferV(), id.cellU(), id.cellV(), true, true, false, false, false);
188188
valid = cons->isValidHex8(layer, id.waferU(), id.waferV(), id.cellU(), id.cellV(), false);
189189
auto cell = cons->assignCellHex(zside * xy.first, xy.second, zside, layer, true, false, false);
190190
HGCSiliconDetId newId(id.det(), id.zside(), cell[2], id.layer(), cell[0], cell[1], cell[3], cell[4]);

Geometry/HGCalGeometry/interface/HGCalGeometry.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class HGCalGeometry final : public CaloSubdetectorGeometry {
7070
CaloSubdetectorGeometry::DimVec& dimVector,
7171
CaloSubdetectorGeometry::IVec& dinsVector) const override;
7272

73+
GlobalPoint getPosition(const DetId& id, bool cog, bool debug) const;
7374
GlobalPoint getPosition(const DetId& id, bool debug = false) const;
7475
GlobalPoint getWaferPosition(const DetId& id) const;
7576

0 commit comments

Comments
 (0)