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

Added scintillator information to RecHitTools #34391

Merged
merged 4 commits into from Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h
Expand Up @@ -37,6 +37,8 @@ namespace hgcal {
std::float_t getRadiusToSide(const DetId&) const;
int getSiThickIndex(const DetId&) const;

std::pair<float, float> getScintDEtaDPhi(const DetId&) const;

unsigned int getLayer(DetId::Detector type, bool nose = false) const;
unsigned int getLayer(ForwardSubdetector type) const;
unsigned int getLayer(const DetId&) const;
Expand All @@ -47,6 +49,7 @@ namespace hgcal {
bool isHalfCell(const DetId&) const;

bool isSilicon(const DetId&) const;
bool isScintillator(const DetId&) const;

bool isOnlySilicon(const unsigned int layer) const;

Expand Down
12 changes: 12 additions & 0 deletions RecoLocalCalo/HGCalRecAlgos/src/RecHitTools.cc
Expand Up @@ -219,6 +219,16 @@ int RecHitTools::getSiThickIndex(const DetId& id) const {
return thickIndex;
}

std::pair<float, float> RecHitTools::getScintDEtaDPhi(const DetId& id) const {
if (!isScintillator(id)) {
LogDebug("getScintDEtaDPhi::InvalidSintDetid")
jkiesele marked this conversation as resolved.
Show resolved Hide resolved
<< "det id: " << std::hex << id.rawId() << std::dec << ":" << id.det() << " is not HGCal scintillator!";
return std::pair<float, float>(0., 0.);
jkiesele marked this conversation as resolved.
Show resolved Hide resolved
}
auto geom = static_cast<const HGCalGeometry*>(getSubdetectorGeometry(id));
return std::pair<float, float>(geom->getGeometry(id)->etaSpan(), geom->getGeometry(id)->phiSpan());
jkiesele marked this conversation as resolved.
Show resolved Hide resolved
}

std::float_t RecHitTools::getRadiusToSide(const DetId& id) const {
auto geom = getSubdetectorGeometry(id);
std::float_t size(std::numeric_limits<std::float_t>::max());
Expand Down Expand Up @@ -417,6 +427,8 @@ bool RecHitTools::isSilicon(const DetId& id) const {
(id.det() == DetId::Forward && id.subdetId() == static_cast<int>(HFNose)));
}

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

bool RecHitTools::isOnlySilicon(const unsigned int layer) const {
// HFnose TODO
bool isonlysilicon = (layer % bhLastLayer_) < bhOffset_;
Expand Down