Skip to content

Commit 5d1c399

Browse files
authored
Merge pull request #48528 from bsunanda/Phase2-hgx364U
Phase2-hgx364U Add a few more utility methoods in RecHitTools which depend on the chosen detector geometry scenario
2 parents 8a47ce2 + 6072eed commit 5d1c399

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ namespace edm {
2222
namespace hgcal {
2323
class RecHitTools {
2424
public:
25+
struct siliconWaferInfo {
26+
int32_t type, partialType, orientation, placementIndex, cassette;
27+
siliconWaferInfo(int32_t t = 0, int32_t p = 0, int32_t o = 0, int32_t i = 0, int32_t c = 0)
28+
: type(t), partialType(p), orientation(o), placementIndex(i), cassette(c) {}
29+
};
30+
struct scintillatorTileInfo {
31+
int32_t type, sipm, cassette;
32+
scintillatorTileInfo(int32_t t = 0, int32_t s = 0, int32_t c = 0) : type(t), sipm(s), cassette(c) {}
33+
};
2534
RecHitTools()
2635
: geom_(nullptr),
2736
eeOffset_(0),
@@ -63,6 +72,7 @@ namespace hgcal {
6372

6473
bool isSilicon(const DetId&) const;
6574
bool isScintillator(const DetId&) const;
75+
bool isScintillatorFine(const DetId& id) const;
6676
bool isBarrel(const DetId&) const;
6777

6878
bool isOnlySilicon(const unsigned int layer) const;
@@ -76,6 +86,7 @@ namespace hgcal {
7686
float getEta(const DetId& id, const float& vertex_z = 0.) const;
7787
float getPhi(const DetId& id) const;
7888
float getPt(const DetId& id, const float& hitEnergy, const float& vertex_z = 0.) const;
89+
int getScintMaxIphi(const DetId& id) const;
7990

8091
inline const CaloGeometry* getGeometry() const { return geom_; };
8192
unsigned int lastLayerEE(bool nose = false) const { return (nose ? HFNoseDetId::HFNoseLayerEEmax : fhOffset_); }
@@ -93,6 +104,10 @@ namespace hgcal {
93104
inline int getGeometryType() const { return geometryType_; }
94105
bool maskCell(const DetId& id, int corners = 3) const;
95106

107+
// Informaion of the wafer/tile
108+
siliconWaferInfo getWaferInfo(const DetId& id) const;
109+
scintillatorTileInfo getTileInfo(const DetId& id) const;
110+
96111
private:
97112
const CaloGeometry* geom_;
98113
unsigned int eeOffset_, fhOffset_, bhFirstLayer_, bhLastLayer_, bhOffset_, fhLastLayer_, noseLastLayer_;

RecoLocalCalo/HGCalRecAlgos/src/RecHitTools.cc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ namespace {
4040
return ddd;
4141
}
4242

43+
inline const HGCalDDDConstants* get_ddd(const CaloSubdetectorGeometry* geom, const HGCScintillatorDetId& detid) {
44+
const HGCalGeometry* hg = static_cast<const HGCalGeometry*>(geom);
45+
const HGCalDDDConstants* ddd = &(hg->topology().dddConstants());
46+
check_ddd(ddd);
47+
return ddd;
48+
}
49+
4350
inline const HGCalDDDConstants* get_ddd(const CaloSubdetectorGeometry* geom, const HGCSiliconDetId& detid) {
4451
const HGCalGeometry* hg = static_cast<const HGCalGeometry*>(geom);
4552
const HGCalDDDConstants* ddd = &(hg->topology().dddConstants());
@@ -496,6 +503,14 @@ bool RecHitTools::isSilicon(const DetId& id) const {
496503

497504
bool RecHitTools::isScintillator(const DetId& id) const { return (id.det() == DetId::HGCalHSc); }
498505

506+
bool RecHitTools::isScintillatorFine(const DetId& id) const {
507+
if (id.det() == DetId::HGCalHSc) {
508+
auto hg = static_cast<const HGCalGeometry*>(getSubdetectorGeometry(id));
509+
return hg->topology().dddConstants().scintFine(HGCScintillatorDetId(id).layer());
510+
} else {
511+
return false;
512+
}
513+
}
499514
bool RecHitTools::isBarrel(const DetId& id) const { return (id.det() == DetId::Ecal || id.det() == DetId::Hcal); }
500515
bool RecHitTools::isOnlySilicon(const unsigned int layer) const {
501516
// HFnose TODO
@@ -538,6 +553,15 @@ float RecHitTools::getPt(const DetId& id, const float& hitEnergy, const float& v
538553
return pt;
539554
}
540555

556+
int RecHitTools::getScintMaxIphi(const DetId& id) const {
557+
if (id.det() == DetId::HGCalHSc) {
558+
auto hg = static_cast<const HGCalGeometry*>(getSubdetectorGeometry(id));
559+
return hg->topology().dddConstants().maxCells(HGCScintillatorDetId(id).layer(), true);
560+
} else {
561+
return 0;
562+
}
563+
}
564+
541565
std::pair<uint32_t, uint32_t> RecHitTools::firstAndLastLayer(DetId::Detector det, int subdet) const {
542566
if ((det == DetId::HGCalEE) || ((det == DetId::Forward) && (subdet == HGCEE))) {
543567
return std::make_pair(eeOffset_ + 1, fhOffset_);
@@ -558,3 +582,33 @@ bool RecHitTools::maskCell(const DetId& id, int corners) const {
558582
return hg->topology().dddConstants().maskCell(id, corners);
559583
}
560584
}
585+
586+
RecHitTools::siliconWaferInfo RecHitTools::getWaferInfo(const DetId& id) const {
587+
RecHitTools::siliconWaferInfo info;
588+
if ((id.det() == DetId::HGCalEE) || (id.det() == DetId::HGCalHSi)) {
589+
auto geom = getSubdetectorGeometry(id);
590+
HGCSiliconDetId hid(id);
591+
auto ddd = get_ddd(geom, hid);
592+
HGCalParameters::waferInfo info2 = ddd->waferInfo(hid.layer(), hid.waferU(), hid.waferV());
593+
info.type = info2.type;
594+
info.partialType = info2.part;
595+
info.orientation = info2.orient;
596+
info.cassette = info2.cassette;
597+
info.placementIndex = ddd->placementIndex(hid);
598+
}
599+
return info;
600+
}
601+
602+
RecHitTools::scintillatorTileInfo RecHitTools::getTileInfo(const DetId& id) const {
603+
RecHitTools::scintillatorTileInfo info;
604+
if (isScintillator(id)) {
605+
auto geom = getSubdetectorGeometry(id);
606+
HGCScintillatorDetId hid(id);
607+
auto ddd = get_ddd(geom, hid);
608+
HGCalParameters::tileInfo info2 = ddd->tileInfo(hid.zside(), hid.layer(), hid.ring());
609+
info.type = info2.type;
610+
info.sipm = info2.sipm;
611+
info.cassette = info2.cassette;
612+
}
613+
return info;
614+
}

0 commit comments

Comments
 (0)