Skip to content

Commit

Permalink
Merge pull request #34391 from jkiesele/rechittools_CMSSW_12_0_0_pre2
Browse files Browse the repository at this point in the history
Added scintillator information to RecHitTools
  • Loading branch information
cmsbuild committed Jul 9, 2021
2 parents 91b871c + 3046eb5 commit 76b9b71
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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::InvalidScintDetid")
<< "det id: " << std::hex << id.rawId() << std::dec << ":" << id.det() << " is not HGCal scintillator!";
return {0.f, 0.f};
}
auto cellGeom = getSubdetectorGeometry(id)->getGeometry(id);
return {cellGeom->etaSpan(), cellGeom->phiSpan()};
}

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

0 comments on commit 76b9b71

Please sign in to comment.