Skip to content

Commit e00eab5

Browse files
authored
Merge pull request #48538 from bsunanda/Phse2-hgx364V
Phse2-hgx364V Provide a method to extract thicknesses of depleted layers of different types of silicon wafers
2 parents c1f23fb + 2392d53 commit e00eab5

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

Geometry/HGCalCommonData/interface/HGCalDDDConstants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class HGCalDDDConstants {
6767
inline std::pair<double, double> cellSizeTrap(int type, int irad) const {
6868
return std::make_pair(hgpar_->radiusLayer_[type][irad - 1], hgpar_->radiusLayer_[type][irad]);
6969
}
70+
std::vector<double> cellThickness() const;
7071
double cellThickness(int layer, int waferU, int waferV) const;
7172
int32_t cellType(int type, int waferU, int waferV, int iz, int fwdBack, int orient) const;
7273
double distFromEdgeHex(double x, double y, double z) const;

Geometry/HGCalCommonData/interface/HGCalGeomParameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class HGCalGeomParameters {
8686
void loadCellParsHexagon(const cms::DDVectorsMap& vmap, HGCalParameters& php);
8787
void loadCellParsHexagon(const HGCalParameters& php);
8888
void loadCellTrapezoid(HGCalParameters& php);
89+
static void rescale(std::vector<double>&, const double s);
8990

9091
struct layerParameters {
9192
double rmin, rmax, zpos;
@@ -153,7 +154,6 @@ class HGCalGeomParameters {
153154
int wafer,
154155
double xx,
155156
double yy);
156-
void rescale(std::vector<double>&, const double s);
157157
void resetZero(std::vector<double>&);
158158

159159
constexpr static double tan30deg_ = 0.5773502693;

Geometry/HGCalCommonData/src/HGCalDDDConstants.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,18 @@ bool HGCalDDDConstants::cellInLayer(int waferU, int waferV, int cellU, int cellV
407407
}
408408
}
409409

410+
std::vector<double> HGCalDDDConstants::cellThickness() const {
411+
std::vector<double> thick;
412+
if (waferHexagon8()) {
413+
thick = hgpar_->cellThickness_;
414+
HGCalGeomParameters::rescale(thick, 10000.0); //cm to micron
415+
} else if (waferHexagon6()) {
416+
for (int k = 0; k < 3; ++k)
417+
thick.emplace_back(100.0 * (k + 1));
418+
}
419+
return thick;
420+
}
421+
410422
double HGCalDDDConstants::cellThickness(int layer, int waferU, int waferV) const {
411423
double thick(-1);
412424
int type = waferType(layer, waferU, waferV, false);

Geometry/HGCalCommonData/src/HGCalGeomParameters.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,6 +2633,10 @@ std::vector<double> HGCalGeomParameters::getDDDArray(const std::string& str, con
26332633
}
26342634
}
26352635

2636+
void HGCalGeomParameters::rescale(std::vector<double>& v, const double s) {
2637+
std::for_each(v.begin(), v.end(), [s](double& n) { n *= s; });
2638+
}
2639+
26362640
std::pair<double, double> HGCalGeomParameters::cellPosition(
26372641
const std::vector<HGCalGeomParameters::cellParameters>& wafers,
26382642
std::vector<HGCalGeomParameters::cellParameters>::const_iterator& itrf,
@@ -2660,10 +2664,6 @@ std::pair<double, double> HGCalGeomParameters::cellPosition(
26602664
return std::make_pair(dx, dy);
26612665
}
26622666

2663-
void HGCalGeomParameters::rescale(std::vector<double>& v, const double s) {
2664-
std::for_each(v.begin(), v.end(), [s](double& n) { n *= s; });
2665-
}
2666-
26672667
void HGCalGeomParameters::resetZero(std::vector<double>& v) {
26682668
for (auto& n : v) {
26692669
if (std::abs(n) < tolmin)

Geometry/HGCalGeometry/test/HGCalGeometryDump.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h"
1111
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
1212
#include <iostream>
13+
#include <sstream>
1314

1415
class HGCalGeometryDump : public edm::one::EDAnalyzer<> {
1516
public:
@@ -49,6 +50,14 @@ void HGCalGeometryDump::analyze(const edm::Event& /*iEvent*/, const edm::EventSe
4950
for (unsigned int k = 0; k < names_.size(); ++k) {
5051
const auto& geomR = iSetup.getData(geomTokens_[k]);
5152
const HGCalGeometry* geom = &geomR;
53+
54+
std::vector<double> thick = geom->topology().dddConstants().cellThickness();
55+
std::ostringstream st1;
56+
st1 << "Geometry has " << thick.size() << " wafers of thickness (micron)";
57+
for (unsigned int k = 0; k < thick.size(); ++k)
58+
st1 << " : " << thick[k];
59+
edm::LogVerbatim("HGCalGeomX") << st1.str() << std::endl;
60+
5261
const std::vector<DetId>& ids = geom->getValidDetIds();
5362
edm::LogVerbatim("HGCalGeomX") << ids.size() << " valid Ids for detector " << names_[k];
5463
int nall(0);

Geometry/HGCalGeometry/test/python/testHGCalCellDumpDDD_cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
process.load('FWCore.MessageService.MessageLogger_cfi')
4747

4848
if hasattr(process,'MessageLogger'):
49-
process.MessageLogger.HGCalGeom=dict()
49+
process.MessageLogger.HGCalGeomX=dict()
5050

5151
process.source = cms.Source("EmptySource")
5252
process.maxEvents = cms.untracked.PSet(

0 commit comments

Comments
 (0)