Skip to content

Commit

Permalink
LumiCalClusterer: use enum for success/failure status
Browse files Browse the repository at this point in the history
  • Loading branch information
andresailer committed Apr 3, 2024
1 parent 5ac3f25 commit 217e8a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 6 additions & 1 deletion source/LumiCalReco/include/LumiCalClusterer.h
Expand Up @@ -25,6 +25,11 @@
#include <string>
#include <memory>

enum RETVAL {
NOK = 0,
OK = 1,
};

namespace EVENT {
class CalorimeterHit;
class LCEvent;
Expand All @@ -45,7 +50,7 @@ class LumiCalClustererClass {
void setCutOnFiducialVolume( bool cutFlag ) { _cutOnFiducialVolume = cutFlag; }

// main actions in each event -Called for every event - the working horse.
int processEvent( EVENT::LCEvent * evt ) ;
RETVAL processEvent( EVENT::LCEvent * evt ) ;

MapIntMapIntVInt _superClusterIdToCellId;
MapIntMapIntVDouble _superClusterIdToCellEngy;
Expand Down
8 changes: 3 additions & 5 deletions source/LumiCalReco/src/LumiCalClusterer.cpp
Expand Up @@ -154,9 +154,7 @@ void LumiCalClustererClass::init( GlobalMethodsClass const& gmc ){
/* ============================================================================
main actions in each event:
========================================================================= */
int LumiCalClustererClass::processEvent( EVENT::LCEvent * evt ) {
int OK = 1;
int NOK = 0;
RETVAL LumiCalClustererClass::processEvent( EVENT::LCEvent * evt ) {
// increment / initialize global variables
_totEngyArm[-1] = _totEngyArm[1] = 0.;
_numHitsInArm[-1] = _numHitsInArm[1] = 0;
Expand All @@ -175,7 +173,7 @@ int LumiCalClustererClass::processEvent( EVENT::LCEvent * evt ) {
of IMPL::CalorimeterHitImpl. Hits are split in two std::vectors, one for each arm
of LumiCal.
-------------------------------------------------------------------------- */
if ( !getCalHits(evt , calHits) ) return NOK;
if ( !getCalHits(evt , calHits) ) return RETVAL::NOK;


/* --------------------------------------------------------------------------
Expand Down Expand Up @@ -258,6 +256,6 @@ int LumiCalClustererClass::processEvent( EVENT::LCEvent * evt ) {
}
}

return OK;
return RETVAL::OK;

}
4 changes: 2 additions & 2 deletions source/LumiCalReco/src/MarlinLumiCalClusterer.cpp
Expand Up @@ -57,7 +57,7 @@ void MarlinLumiCalClusterer::TryMarlinLumiCalClusterer(EVENT::LCEvent* evt) {
create clusters using: LumiCalClustererClass
-------------------------------------------------------------------------- */

bool stat = LumiCalClusterer.processEvent(evt);
RETVAL status = LumiCalClusterer.processEvent(evt);

LCCollectionVec* LCalClusterCol = new LCCollectionVec(LCIO::CLUSTER);
IMPL::LCFlagImpl lcFlagImpl;
Expand All @@ -66,7 +66,7 @@ void MarlinLumiCalClusterer::TryMarlinLumiCalClusterer(EVENT::LCEvent* evt) {

LCCollectionVec* LCalRPCol = new LCCollectionVec(LCIO::RECONSTRUCTEDPARTICLE);

if (stat) {
if (status == RETVAL::OK) {
streamlog_out(DEBUG6) << " Transfering reco results to LCalClusterCollection....." << std::endl;

for (int armNow = -1; armNow < 2; armNow += 2) {
Expand Down

0 comments on commit 217e8a5

Please sign in to comment.