Skip to content
Snippets Groups Projects
Commit 2b8ab80b authored by Scott Snyder's avatar Scott Snyder Committed by scott snyder
Browse files

TileRecUtils: Make ITileRawChannelTool::process const.

Working on making calo tools reentrant.

Still have issues with TileBeamInfoProvider and TileCondToolOFC.


Former-commit-id: 1e6d1d4f
parent cb21b506
No related branches found
No related tags found
No related merge requests found
...@@ -13,15 +13,13 @@ class TileRawChannelContainer ; ...@@ -13,15 +13,13 @@ class TileRawChannelContainer ;
#include "GaudiKernel/IAlgTool.h" #include "GaudiKernel/IAlgTool.h"
static const InterfaceID IID_ITileRawChannelTool("ITileRawChannelTool", 1 , 0); class ITileRawChannelTool: virtual public IAlgTool
{
class ITileRawChannelTool: virtual public IAlgTool {
public: public:
// update TileRawChannelContainer, subtract common mode noise for example DeclareInterfaceID (ITileRawChannelTool, 1, 0);
virtual StatusCode process(TileRawChannelContainer * rchCnt)=0 ;
static const InterfaceID& interfaceID() { return IID_ITileRawChannelTool;} // update TileRawChannelContainer, subtract common mode noise for example
virtual StatusCode process(TileRawChannelContainer * rchCnt) const = 0;
}; };
#endif #endif
...@@ -32,7 +32,8 @@ class TileBeamInfoProvider; ...@@ -32,7 +32,8 @@ class TileBeamInfoProvider;
@class TileRawChannelNoiseFilter @class TileRawChannelNoiseFilter
@brief This tool subtracts common-mode noise from all TileRawChannels in one container @brief This tool subtracts common-mode noise from all TileRawChannels in one container
*/ */
class TileRawChannelNoiseFilter: public AthAlgTool, virtual public ITileRawChannelTool { class TileRawChannelNoiseFilter: public extends<AthAlgTool, ITileRawChannelTool>
{
public: public:
/** AlgTool like constructor */ /** AlgTool like constructor */
...@@ -42,16 +43,13 @@ class TileRawChannelNoiseFilter: public AthAlgTool, virtual public ITileRawChann ...@@ -42,16 +43,13 @@ class TileRawChannelNoiseFilter: public AthAlgTool, virtual public ITileRawChann
/** Virtual destructor */ /** Virtual destructor */
virtual ~TileRawChannelNoiseFilter() {}; virtual ~TileRawChannelNoiseFilter() {};
/** AlgTool InterfaceID */
static const InterfaceID& interfaceID();
/** AlgTool initialize method.*/ /** AlgTool initialize method.*/
virtual StatusCode initialize(); virtual StatusCode initialize() override;
/** AlgTool finalize method */ /** AlgTool finalize method */
virtual StatusCode finalize(); virtual StatusCode finalize() override;
/** proceed the coherent noise subtruction algorithm and correct TileRawChannel amplitudes */ /** proceed the coherent noise subtruction algorithm and correct TileRawChannel amplitudes */
virtual StatusCode process(TileRawChannelContainer *rchCnt); virtual StatusCode process(TileRawChannelContainer *rchCnt) const override;
private: private:
......
...@@ -36,8 +36,9 @@ class TileCondToolEmscale; ...@@ -36,8 +36,9 @@ class TileCondToolEmscale;
@class TileRawChannelOF1Corrector @class TileRawChannelOF1Corrector
@brief This tool correct TileRawChannels amplitudes which came from OF1 DSP if pedestal changed @brief This tool correct TileRawChannels amplitudes which came from OF1 DSP if pedestal changed
*/ */
class TileRawChannelOF1Corrector: public AthAlgTool, virtual public ITileRawChannelTool { class TileRawChannelOF1Corrector: public extends<AthAlgTool, ITileRawChannelTool>
public: {
public:
/** AlgTool like constructor */ /** AlgTool like constructor */
TileRawChannelOF1Corrector(const std::string& type, const std::string& name, const IInterface* parent); TileRawChannelOF1Corrector(const std::string& type, const std::string& name, const IInterface* parent);
...@@ -45,16 +46,13 @@ class TileRawChannelOF1Corrector: public AthAlgTool, virtual public ITileRawChan ...@@ -45,16 +46,13 @@ class TileRawChannelOF1Corrector: public AthAlgTool, virtual public ITileRawChan
/** Virtual destructor */ /** Virtual destructor */
virtual ~TileRawChannelOF1Corrector() {}; virtual ~TileRawChannelOF1Corrector() {};
/** AlgTool InterfaceID */
static const InterfaceID& interfaceID();
/** AlgTool initialize method.*/ /** AlgTool initialize method.*/
virtual StatusCode initialize() override; virtual StatusCode initialize() override;
/** AlgTool finalize method */ /** AlgTool finalize method */
virtual StatusCode finalize() override; virtual StatusCode finalize() override;
/** Correct TileRawChannel amplitudes if pedestal changed */ /** Correct TileRawChannel amplitudes if pedestal changed */
virtual StatusCode process(TileRawChannelContainer* rawChannelContainer) override; virtual StatusCode process(TileRawChannelContainer* rawChannelContainer) const override;
private: private:
......
...@@ -17,17 +17,12 @@ ...@@ -17,17 +17,12 @@
#include "TileConditions/TileCondToolNoiseSample.h" #include "TileConditions/TileCondToolNoiseSample.h"
#include "TileRecUtils/TileBeamInfoProvider.h" #include "TileRecUtils/TileBeamInfoProvider.h"
static const InterfaceID IID_ITileRawChannelNoiseFilter("TileRawChannelNoiseFilter", 1, 0);
const InterfaceID& TileRawChannelNoiseFilter::interfaceID() {
return IID_ITileRawChannelNoiseFilter;
}
//======================================================== //========================================================
// constructor // constructor
TileRawChannelNoiseFilter::TileRawChannelNoiseFilter(const std::string& type, TileRawChannelNoiseFilter::TileRawChannelNoiseFilter(const std::string& type,
const std::string& name, const IInterface* parent) const std::string& name, const IInterface* parent)
: AthAlgTool(type, name, parent) : base_class(type, name, parent)
, m_tileHWID(0) , m_tileHWID(0)
, m_tileToolEmscale("TileCondToolEmscale") , m_tileToolEmscale("TileCondToolEmscale")
, m_tileToolNoiseSample("TileCondToolNoiseSample") , m_tileToolNoiseSample("TileCondToolNoiseSample")
...@@ -38,9 +33,6 @@ TileRawChannelNoiseFilter::TileRawChannelNoiseFilter(const std::string& type, ...@@ -38,9 +33,6 @@ TileRawChannelNoiseFilter::TileRawChannelNoiseFilter(const std::string& type,
, m_useTwoGaussNoise(false) // do not use 2G - has no sense for ADC HF noise for the moment , m_useTwoGaussNoise(false) // do not use 2G - has no sense for ADC HF noise for the moment
, m_useGapCells(false) // use gap cells for noise filter as all normal cells , m_useGapCells(false) // use gap cells for noise filter as all normal cells
{ {
declareInterface<ITileRawChannelTool>(this);
declareInterface<TileRawChannelNoiseFilter>(this);
declareProperty("TileCondToolEmscale", m_tileToolEmscale); declareProperty("TileCondToolEmscale", m_tileToolEmscale);
declareProperty("TileCondToolNoiseSample", m_tileToolNoiseSample); declareProperty("TileCondToolNoiseSample", m_tileToolNoiseSample);
declareProperty("TileBadChanTool", m_tileBadChanTool); declareProperty("TileBadChanTool", m_tileBadChanTool);
...@@ -88,9 +80,9 @@ StatusCode TileRawChannelNoiseFilter::initialize() { ...@@ -88,9 +80,9 @@ StatusCode TileRawChannelNoiseFilter::initialize() {
// ============================================================================ // ============================================================================
// process container // process container
StatusCode TileRawChannelNoiseFilter::process( StatusCode TileRawChannelNoiseFilter::process (
TileRawChannelContainer *rchCont) { TileRawChannelContainer *rchCont) const
{
ATH_MSG_DEBUG("in process()"); ATH_MSG_DEBUG("in process()");
TileRawChannelUnit::UNIT rChUnit = rchCont->get_unit(); TileRawChannelUnit::UNIT rChUnit = rchCont->get_unit();
...@@ -111,7 +103,8 @@ StatusCode TileRawChannelNoiseFilter::process( ...@@ -111,7 +103,8 @@ StatusCode TileRawChannelNoiseFilter::process(
ATH_MSG_VERBOSE( "Units in container is " << units[rChUnit] ); ATH_MSG_VERBOSE( "Units in container is " << units[rChUnit] );
// Now retrieve the TileDQStatus // Now retrieve the TileDQStatus
const TileDQstatus* DQstatus = m_beamInfo->getDQstatus(); // FIXME: const violation
const TileDQstatus* DQstatus = m_beamInfo.unConst()->getDQstatus();
TileRawChannelContainer::const_iterator collItr = rchCont->begin(); TileRawChannelContainer::const_iterator collItr = rchCont->begin();
TileRawChannelContainer::const_iterator lastColl = rchCont->end(); TileRawChannelContainer::const_iterator lastColl = rchCont->end();
......
...@@ -18,17 +18,11 @@ ...@@ -18,17 +18,11 @@
#include "StoreGate/ReadHandle.h" #include "StoreGate/ReadHandle.h"
#include "AthenaKernel/errorcheck.h" #include "AthenaKernel/errorcheck.h"
static const InterfaceID IID_ITileRawChannelOF1Corrector("TileRawChannelOF1Corrector", 1, 0);
const InterfaceID& TileRawChannelOF1Corrector::interfaceID() {
return IID_ITileRawChannelOF1Corrector;
}
//======================================================== //========================================================
// constructor // constructor
TileRawChannelOF1Corrector::TileRawChannelOF1Corrector(const std::string& type, TileRawChannelOF1Corrector::TileRawChannelOF1Corrector(const std::string& type,
const std::string& name, const IInterface* parent) const std::string& name, const IInterface* parent)
: AthAlgTool(type, name, parent) : base_class(type, name, parent)
, m_tileHWID(0) , m_tileHWID(0)
, m_tileToolNoiseSample("TileCondToolNoiseSample") , m_tileToolNoiseSample("TileCondToolNoiseSample")
, m_tileCondToolOfc("TileCondToolOfcCool/TileCondToolOfcCoolOF1") , m_tileCondToolOfc("TileCondToolOfcCool/TileCondToolOfcCoolOF1")
...@@ -36,9 +30,6 @@ TileRawChannelOF1Corrector::TileRawChannelOF1Corrector(const std::string& type, ...@@ -36,9 +30,6 @@ TileRawChannelOF1Corrector::TileRawChannelOF1Corrector(const std::string& type,
, m_tileToolEms("TileCondToolEmscale") , m_tileToolEms("TileCondToolEmscale")
, m_tileDspThreshold("TileCondToolDspThreshold") , m_tileDspThreshold("TileCondToolDspThreshold")
{ {
declareInterface<ITileRawChannelTool>(this);
declareInterface<TileRawChannelOF1Corrector>(this);
declareProperty("TileCondToolNoiseSample", m_tileToolNoiseSample); declareProperty("TileCondToolNoiseSample", m_tileToolNoiseSample);
declareProperty("TileCondToolOfc", m_tileCondToolOfc); declareProperty("TileCondToolOfc", m_tileCondToolOfc);
declareProperty("TileCondToolTiming", m_tileToolTiming); declareProperty("TileCondToolTiming", m_tileToolTiming);
...@@ -97,8 +88,8 @@ StatusCode TileRawChannelOF1Corrector::initialize() { ...@@ -97,8 +88,8 @@ StatusCode TileRawChannelOF1Corrector::initialize() {
// ============================================================================ // ============================================================================
// process container // process container
StatusCode TileRawChannelOF1Corrector::process(TileRawChannelContainer* rawChannelContainer) { StatusCode TileRawChannelOF1Corrector::process(TileRawChannelContainer* rawChannelContainer) const
{
ATH_MSG_DEBUG("in process()"); ATH_MSG_DEBUG("in process()");
TileFragHash::TYPE rawChannelType = rawChannelContainer->get_type(); TileFragHash::TYPE rawChannelType = rawChannelContainer->get_type();
...@@ -153,7 +144,8 @@ StatusCode TileRawChannelOF1Corrector::process(TileRawChannelContainer* rawChann ...@@ -153,7 +144,8 @@ StatusCode TileRawChannelOF1Corrector::process(TileRawChannelContainer* rawChann
float onlinePedestalDifference = m_tileToolNoiseSample->getOnlinePedestalDifference(drawerIdx, channel, gain, rawChannelUnit); float onlinePedestalDifference = m_tileToolNoiseSample->getOnlinePedestalDifference(drawerIdx, channel, gain, rawChannelUnit);
float phase = -m_tileToolTiming->getSignalPhase(drawerIdx, channel, gain); float phase = -m_tileToolTiming->getSignalPhase(drawerIdx, channel, gain);
const TileOfcWeightsStruct* weights = m_tileCondToolOfc->getOfcWeights(drawerIdx, channel, gain, phase, false); // FIXME: const violation
const TileOfcWeightsStruct* weights = m_tileCondToolOfc.unConst()->getOfcWeights(drawerIdx, channel, gain, phase, false);
float weightsSum(0.0); float weightsSum(0.0);
for (int i = 0; i < weights->n_samples; ++i) weightsSum += weights->w_a[i]; for (int i = 0; i < weights->n_samples; ++i) weightsSum += weights->w_a[i];
float energyCorrection = onlinePedestalDifference * weightsSum; float energyCorrection = onlinePedestalDifference * weightsSum;
......
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