Skip to content

Commit da5250d

Browse files
author
Sunanda
committed
Code check
1 parent 220d0b5 commit da5250d

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

Geometry/HGCalCommonData/src/HGCalDDDConstants.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ void HGCalDDDConstants::waferFromPosition(const double x,
18821882
}
18831883
}
18841884
edm::LogVerbatim("HGCalGeom") << "Input x:y:layer " << x << ":" << y << ":" << layer << " Wafer " << waferU << ":"
1885-
<< waferV << " Cell " << cellU << ":" << cellV << ":" << celltype << " wt " << wt;
1885+
<< waferV << " Cell " << cellU << ":" << cellV << ":" << celltype << " wt " << wt;
18861886
}
18871887

18881888
bool HGCalDDDConstants::waferInLayer(int wafer, int lay, bool reco) const {

Geometry/HGCalGeometry/test/HGCalWaferSimWt.cc

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ void HGCalWaferSimWt::fillDescriptions(edm::ConfigurationDescriptions& descripti
4343
}
4444

4545
void HGCalWaferSimWt::analyze(const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup) {
46-
std::vector<std::string> parType = {"Full", "Five", "ChopTwo", "ChopTwoM", "Half", "Semi", "Semi2", "Three", "Half2", "Five2", "JK10", "LDTop", "LDBottom", "LDLeft", "LDRight", "LDFive", "LDThree", "JK17", "JK18", "JK19", "JK20", "HDTop", "HDBottom", "HDLeft", "HDRight", "HDFive"};
46+
std::vector<std::string> parType = {"Full", "Five", "ChopTwo", "ChopTwoM", "Half", "Semi", "Semi2",
47+
"Three", "Half2", "Five2", "JK10", "LDTop", "LDBottom", "LDLeft",
48+
"LDRight", "LDFive", "LDThree", "JK17", "JK18", "JK19", "JK20",
49+
"HDTop", "HDBottom", "HDLeft", "HDRight", "HDFive"};
4750
std::vector<std::string> detType = {"HD120", "LD200", "LD300", "HD200"};
4851
for (unsigned int k = 0; k < names_.size(); ++k) {
4952
const auto& geomR = iSetup.getData(geomTokens_[k]);
@@ -58,25 +61,28 @@ void HGCalWaferSimWt::analyze(const edm::Event& /*iEvent*/, const edm::EventSetu
5861
HGCSiliconDetId hid(id);
5962
int type = hid.type();
6063
int part = geom->topology().dddConstants().partialWaferType(hid.layer(), hid.waferU(), hid.waferV());
61-
int idx = part*10 + type;
64+
int idx = part * 10 + type;
6265
if (std::find(idxs.begin(), idxs.end(), idx) == idxs.end()) {
63-
++ntypes;
64-
idxs.push_back(idx);
65-
double xpos = 10.0 * (cell->getPosition().x());
66-
double ypos = 10.0 * (cell->getPosition().y());
67-
int waferU, waferV, cellU, cellV, cellType;
68-
double wt;
69-
geom->topology().dddConstants().waferFromPosition(xpos, ypos, hid.zside(), hid.layer(), waferU, waferV, cellU, cellV, cellType, wt, false, true);
70-
std::string stype = (type >= 0 && type <= 3) ? detType[type] : ("JK" + std::to_string(type));
71-
std::string spart = (part >= 0 && part <= 25) ? parType[part] : ("JK" + std::to_string(part));
72-
int index = HGCalWaferIndex::waferIndex(hid.layer(), waferU, waferV);
66+
++ntypes;
67+
idxs.push_back(idx);
68+
double xpos = 10.0 * (cell->getPosition().x());
69+
double ypos = 10.0 * (cell->getPosition().y());
70+
int waferU, waferV, cellU, cellV, cellType;
71+
double wt;
72+
geom->topology().dddConstants().waferFromPosition(
73+
xpos, ypos, hid.zside(), hid.layer(), waferU, waferV, cellU, cellV, cellType, wt, false, true);
74+
std::string stype = (type >= 0 && type <= 3) ? detType[type] : ("JK" + std::to_string(type));
75+
std::string spart = (part >= 0 && part <= 25) ? parType[part] : ("JK" + std::to_string(part));
76+
int index = HGCalWaferIndex::waferIndex(hid.layer(), waferU, waferV);
7377
int celltypeX = HGCalWaferType::getType(index, geom->topology().dddConstants().getParameter()->waferInfoMap_);
74-
edm::LogVerbatim("HGCalGeomX") << "[" << ntypes << "] " << stype << " " << spart << " wt " << wt << " for " << hid << " at " << xpos << ":" << ypos << " Wafer " << waferU << ":" << waferV << " cell " << cellU << ":" << cellV << " Type " << cellType << ":" << celltypeX;
78+
edm::LogVerbatim("HGCalGeomX") << "[" << ntypes << "] " << stype << " " << spart << " wt " << wt << " for "
79+
<< hid << " at " << xpos << ":" << ypos << " Wafer " << waferU << ":" << waferV
80+
<< " cell " << cellU << ":" << cellV << " Type " << cellType << ":" << celltypeX;
7581
}
7682
}
77-
edm::LogVerbatim("HGCalGeomX") << "\n\nFinds " << idxs.size() << " different wafer types among " << nall << " cells of the detector\n";
83+
edm::LogVerbatim("HGCalGeomX") << "\n\nFinds " << idxs.size() << " different wafer types among " << nall
84+
<< " cells of the detector\n";
7885
}
7986
}
8087

8188
DEFINE_FWK_MODULE(HGCalWaferSimWt);
82-

0 commit comments

Comments
 (0)