Skip to content

Commit 461f45e

Browse files
committed
LumiCalClusterer: convert by collection type, not dynamic cast, always have converted collection
1 parent a7015e1 commit 461f45e

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

source/LumiCalReco/src/LumiCalClusterer_getCalHits.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,16 @@ int LumiCalClustererClass::getCalHits( EVENT::LCEvent * evt,
4848

4949
streamlog_out(DEBUG6) << std::endl << "Getting hit information .... event: " << evt->getEventNumber() << std::endl;
5050

51-
52-
const int nHitsCol = col->getNumberOfElements();
53-
if ( nHitsCol < _clusterMinNumHits ) return 0;
54-
5551
// figure out if we have a CalorimeterHit or SimCalorimeterHit collection,
5652
// and create CalorimeterHit collection if necessary
57-
if (dynamic_cast<EVENT::SimCalorimeterHit*>(col->getElementAt(0)) != nullptr) {
53+
if (col->getTypeName() == EVENT::LCIO::SIMCALORIMETERHIT) {
5854
col = createCaloHitCollection(col);
5955
evt->addCollection(col, _lumiOutName.c_str());
6056
}
6157

58+
const int nHitsCol = col->getNumberOfElements();
59+
if ( nHitsCol < _clusterMinNumHits ) return 0;
60+
6261
if (not _mydecoder) {
6362
_mydecoder =
6463
std::unique_ptr<UTIL::CellIDDecoder<EVENT::CalorimeterHit>>(new UTIL::CellIDDecoder<EVENT::CalorimeterHit>(col));

0 commit comments

Comments
 (0)