Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase-hgx323Again Further correction for ring number assignment of scintillator hits in HGCal geometry for versions beyond V13 #39206

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Geometry/CaloTopology/src/HGCalTopology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ bool HGCalTopology::valid(const DetId& idin) const {
if (flag)
flag = hdcons_.isValidHex(id.iLay, id.iSec1, id.iCell1, true);
} else if (tileTrapezoid()) {
flag = ((idin.det() == det_) && hdcons_.isValidTrap(id.iLay, id.iSec1, id.iCell1));
flag = ((idin.det() == det_) && hdcons_.isValidTrap(id.zSide, id.iLay, id.iSec1, id.iCell1));
} else {
flag = ((idin.det() == det_) && hdcons_.isValidHex8(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2));
}
Expand Down Expand Up @@ -566,9 +566,9 @@ void HGCalTopology::addHGCSCintillatorId(
std::vector<DetId>& ids, int zside, int type, int lay, int iradius, int iphi) const {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "addHGCSCintillatorId " << zside << ":" << type << ":" << lay << ":" << iradius
<< ":" << iphi << " ==> Validity " << hdcons_.isValidTrap(lay, iradius, iphi);
<< ":" << iphi << " ==> Validity " << hdcons_.isValidTrap(zside, lay, iradius, iphi);
#endif
if (hdcons_.isValidTrap(lay, iradius, iphi)) {
if (hdcons_.isValidTrap(zside, lay, iradius, iphi)) {
HGCScintillatorDetId id(type, lay, zside * iradius, iphi);
ids.emplace_back(DetId(id));
}
Expand Down
2 changes: 1 addition & 1 deletion Geometry/HGCalCommonData/interface/HGCalDDDConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class HGCalDDDConstants {
bool isValidHex(int lay, int mod, int cell, bool reco) const;
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart = false) const;
bool isValidHex8(int lay, int modU, int modV, int cellU, int cellV, bool fullAndPart = false) const;
bool isValidTrap(int lay, int ieta, int iphi) const;
bool isValidTrap(int zside, int lay, int ieta, int iphi) const;
int lastLayer(bool reco) const;
int layerIndex(int lay, bool reco) const;
unsigned int layers(bool reco) const;
Expand Down
7 changes: 4 additions & 3 deletions Geometry/HGCalCommonData/src/HGCalDDDConstants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -590,13 +590,14 @@ bool HGCalDDDConstants::isValidHex8(int layer, int modU, int modV, int cellU, in
return isValidCell8(layer, modU, modV, cellU, cellV, type);
}

bool HGCalDDDConstants::isValidTrap(int layer, int irad, int iphi) const {
bool HGCalDDDConstants::isValidTrap(int zside, int layer, int irad, int iphi) const {
// Check validity for a layer|eta|phi of scintillator
const auto& indx = getIndex(layer, true);
if (indx.first < 0)
return false;
return ((irad >= hgpar_->iradMinBH_[indx.first]) && (irad <= (hgpar_->iradMaxBH_[indx.first] + 1)) && (iphi > 0) &&
(iphi <= hgpar_->scintCells(layer)));
bool ok = ((irad >= hgpar_->iradMinBH_[indx.first]) && (irad <= (hgpar_->iradMaxBH_[indx.first] + 1)) && (iphi > 0) &&
(iphi <= hgpar_->scintCells(layer)));
return ((ok && trapezoidFile()) ? tileExist(zside, layer, irad, iphi) : ok);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return ((ok && trapezoidFile()) ? tileExist(zside, layer, irad, iphi) : ok);
return ((ok && trapezoidFile()) ? tileExist(zside, layer, irad, iphi) : true);

I understand that in practice ok && ok is identical to ok && true. But translating in C++ the sentence "irrespective of trapezoidFile() the earlier test is good for all types of scintillators" is exactly ok && true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should return the results ok if it is false and if ok is true, then one should see if TrapezoidFile() is the case then should return a test on tileExist. That is the correct logic

}

int HGCalDDDConstants::lastLayer(bool reco) const {
Expand Down
6 changes: 6 additions & 0 deletions SimG4CMS/Calo/data/extraTiles.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
14 7 151
15 7 152
17 7 152
17 7 154
16 7 178
16 7 225
167 changes: 139 additions & 28 deletions SimG4CMS/Calo/data/missingWafers.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,139 @@
1,2,0
1 1 -1
1 0 -2
1 -1 1
1 5 10
1 -2 8
1 10 3
1 -10 -4
2 -2 0
2 -2 -1
2 1 2
2 -10 -5
2 5 10
2 4 -6
2 10 6
5 0 2
5 -2 -1
5 -2 0
5 5 10
5 -2 8
5 10 3
5 -10 -4
6 5 10
6 -5 5
6 -10 -6
6 -5 -10
6 10 5
6 5 -5
1 2 0
1 1 -1
1 0 -2
1 -1 1
1 5 10
1 -2 8
1 10 3
1 -10 -4
2 -2 0
2 -2 -1
2 1 2
2 -10 -5
2 5 10
2 4 -6
2 10 6
5 0 2
5 -2 -1
5 -2 0
5 5 10
5 -2 8
5 10 3
5 -10 -4
6 5 10
6 -5 5
6 -10 -6
6 -5 -10
6 10 5
6 5 -5
27 1 10
27 -10 -9
27 9 -1
27 2 0
27 0 2
27 -2 -2
27 2 2
27 -2 0
27 0 -2
27 4 11
27 -11 -7
27 7 -4
27 5 11
27 -11 -6
27 6 -5
27 6 11
27 -11 -5
27 5 -6
27 7 11
27 -11 -4
27 4 -7
27 8 11
27 -11 -3
27 3 -8
27 9 0
27 0 9
27 -9 -9
27 9 9
27 -9 0
27 0 -9
27 9 10
27 -10 -1
27 1 -9
27 10 1
27 -1 9
27 -9 -10
27 10 9
27 -9 1
27 -1 -10
27 11 3
27 -3 8
27 -8 -11
27 11 4
27 -4 7
27 -7 -11
27 11 5
27 -5 6
27 -6 -11
27 11 6
27 -6 5
27 -5 -11
27 11 7
27 -7 4
27 -4 -11
27 11 8
27 -8 3
27 -3 -11
34 1 10
34 -9 -8
34 9 0
34 2 4
34 -3 -1
34 2 -1
34 3 1
34 0 3
34 -2 -2
34 3 3
34 -2 1
34 0 -2
34 3 11
34 -10 -7
34 8 -2
34 4 11
34 -10 -6
34 7 -3
34 5 11
34 -10 -5
34 6 -4
34 6 11
34 -10 -4
34 5 -5
34 7 11
34 -10 -3
34 4 -6
34 8 11
34 -10 -2
34 3 -7
34 9 10
34 -9 0
34 1 -8
34 10 2
34 -1 9
34 -8 -9
34 10 3
34 -2 8
34 -7 -9
34 10 8
34 -7 3
34 -2 -9
34 10 9
34 -8 2
34 -1 -9
34 11 5
34 -4 7
34 -6 -10
34 11 6
34 -5 6
34 -5 -10
34 11 7
34 -6 5
34 -4 -10
28 changes: 28 additions & 0 deletions SimG4CMS/Calo/data/missingWafersEE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
1 2 0
1 1 -1
1 0 -2
1 -1 1
1 5 10
1 -2 8
1 10 3
1 -10 -4
2 -2 0
2 -2 -1
2 1 2
2 -10 -5
2 5 10
2 4 -6
2 10 6
5 0 2
5 -2 -1
5 -2 0
5 5 10
5 -2 8
5 10 3
5 -10 -4
6 5 10
6 -5 5
6 -10 -6
6 -5 -10
6 10 5
6 5 -5