Skip to content

Commit

Permalink
CalorimeterIslandCluster: avoid complaining about missing readouts (#…
Browse files Browse the repository at this point in the history
…1559)

### Briefly, what does this PR introduce?
This fixes a small regression from
#1554 pointed out by @wdconinc. Some
error messages would appear for detectors that are not using matrices
and don't specify "readout" field. This allows the current status quo to
continue, but removes the messages.

### What kind of change does this PR introduce?
- [x] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No

### Does this PR change default behavior?
No

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
  • Loading branch information
veprbl and wdconinc authored Aug 7, 2024
1 parent 72594a3 commit e34c9ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/algorithms/calorimetry/CalorimeterIslandCluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ void CalorimeterIslandCluster::init() {
};

if (m_cfg.readout.empty()) {
error("readoutClass is not provided, it is needed to know the fields in readout ids");
if ((!m_cfg.adjacencyMatrix.empty()) || (!m_cfg.peakNeighbourhoodMatrix.empty())) {
throw std::runtime_error("'readout' is not provided, it is needed to know the fields in readout ids");
}
} else {
m_idSpec = m_detector->readout(m_cfg.readout).idSpec();
}
Expand Down Expand Up @@ -177,7 +179,7 @@ void CalorimeterIslandCluster::init() {
}

if (m_cfg.splitCluster) {
if (m_cfg.peakNeighbourhoodMatrix != "") {
if (!m_cfg.peakNeighbourhoodMatrix.empty()) {
is_maximum_neighbourhood = serviceSvc.service<EvaluatorSvc>("EvaluatorSvc")->compile(m_cfg.peakNeighbourhoodMatrix, hit_pair_to_map);
} else {
is_maximum_neighbourhood = is_neighbour;
Expand Down

0 comments on commit e34c9ed

Please sign in to comment.