Skip to content
Snippets Groups Projects
Commit 8bec5c85 authored by scott snyder's avatar scott snyder
Browse files

LArRecUtils: CaloCellCorrection methods are const.

CaloCellCorrection::MakeCorrection is now const, with an EventContext argument.
Adjust the call to it.
Working to make more of the calorimeter reconstruction reentrant.

Former-commit-id: 607d797e
parent b850ef98
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,8 @@ private: ...@@ -79,7 +79,8 @@ private:
// Find correction factor for this LArCell // Find correction factor for this LArCell
double getCorrection(LArCell* cell, double getCorrection(LArCell* cell,
const std::vector<CaloCellCorrection*>& vCorr ); const std::vector<CaloCellCorrection*>& vCorr,
const EventContext& ctx) const;
// cells in a FEB stored in a vector // cells in a FEB stored in a vector
typedef std::vector<CellInfo> CELL_VEC ; typedef std::vector<CellInfo> CELL_VEC ;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "GaudiKernel/Bootstrap.h" #include "GaudiKernel/Bootstrap.h"
#include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/IToolSvc.h"
#include "GaudiKernel/ThreadLocalContext.h"
#include "StoreGate/StoreGateSvc.h" #include "StoreGate/StoreGateSvc.h"
...@@ -47,7 +48,7 @@ MakeLArCellFromRaw::~MakeLArCellFromRaw() ...@@ -47,7 +48,7 @@ MakeLArCellFromRaw::~MakeLArCellFromRaw()
void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap , void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap ,
const std::vector<CaloCellCorrection*>* pCorr, unsigned int poolMaxSize ) const std::vector<CaloCellCorrection*>* pCorr, unsigned int poolMaxSize )
{ {
const EventContext& ctx = Gaudi::Hive::currentContext();
ISvcLocator* svcLoc = Gaudi::svcLocator( ); ISvcLocator* svcLoc = Gaudi::svcLocator( );
...@@ -182,7 +183,7 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap , ...@@ -182,7 +183,7 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap ,
if(pCorr) { if(pCorr) {
// make a fake LArCell, and get the correction factor. // make a fake LArCell, and get the correction factor.
LArCell larCell(caloDDE,en,time,qu,g); LArCell larCell(caloDDE,en,time,qu,g);
cell.eCorr = getCorrection(&larCell, *pCorr) ; cell.eCorr = getCorrection(&larCell, *pCorr, ctx);
} }
} catch (LArID_Exception& ex){ } catch (LArID_Exception& ex){
++n_em_err; ++n_em_err;
...@@ -224,7 +225,7 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap , ...@@ -224,7 +225,7 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap ,
if(pCorr) { if(pCorr) {
// make a fake LArCell, and get the correction factor. // make a fake LArCell, and get the correction factor.
LArCell larCell(caloDDE,en,time,qu,g); LArCell larCell(caloDDE,en,time,qu,g);
cell.eCorr = getCorrection(&larCell, *pCorr) ; cell.eCorr = getCorrection(&larCell, *pCorr, ctx);
} }
++n_hec; ++n_hec;
} catch (LArID_Exception& ex){ } catch (LArID_Exception& ex){
...@@ -265,7 +266,7 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap , ...@@ -265,7 +266,7 @@ void MakeLArCellFromRaw::initialize( const LArRoI_Map* roiMap ,
if(pCorr) { if(pCorr) {
// make a fake LArCell, and get the correction factor. // make a fake LArCell, and get the correction factor.
LArCell larCell(caloDDE,en,time,qu,g); LArCell larCell(caloDDE,en,time,qu,g);
cell.eCorr = getCorrection(&larCell, *pCorr) ; cell.eCorr = getCorrection(&larCell, *pCorr, ctx);
} }
++n_fcal; ++n_fcal;
} catch (LArID_Exception& ex){ } catch (LArID_Exception& ex){
...@@ -355,19 +356,19 @@ LArCell* MakeLArCellFromRaw::getLArCell(unsigned int feb, unsigned int chan , ...@@ -355,19 +356,19 @@ LArCell* MakeLArCellFromRaw::getLArCell(unsigned int feb, unsigned int chan ,
} }
double MakeLArCellFromRaw::getCorrection (LArCell* cell, double
const std::vector<CaloCellCorrection*>& vCorr ) MakeLArCellFromRaw::getCorrection(LArCell* cell,
const std::vector<CaloCellCorrection*>& vCorr,
const EventContext& ctx) const
{ {
// LArCell was made with energy = 50. // LArCell was made with energy = 50.
double en= 50. * GeV ; double en= 50. * GeV ;
// cell->setEnergy(en); // cell->setEnergy(en);
// apply corrections. // apply corrections.
std::vector<CaloCellCorrection*>::const_iterator it= for (const CaloCellCorrection* corr : vCorr)
vCorr.begin();
for(; it!=vCorr.end(); ++it)
{ {
(*it)->MakeCorrection(cell); corr->MakeCorrection (cell, ctx);
} }
double c= cell->energy()/en; double c= cell->energy()/en;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment