Skip to content
Snippets Groups Projects
Commit f61726de authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'master-tile-conditions-private-tools' into 'master'

TileConditions: Use private Tile tools

See merge request atlas/athena!16589
parents 35b07a6d 6ef07697
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef TILECONDITIONS_ITILECELLNOISETOOL_H #ifndef TILECONDITIONS_ITILECELLNOISETOOL_H
...@@ -17,13 +17,9 @@ class ITileCellNoiseTool : virtual public IAlgTool { ...@@ -17,13 +17,9 @@ class ITileCellNoiseTool : virtual public IAlgTool {
virtual ~ITileCellNoiseTool() {} virtual ~ITileCellNoiseTool() {}
static const InterfaceID& interfaceID() {
static const InterfaceID IID_ITileCellNoiseTool("ITileCellNoiseTool", 1 , 0);
return IID_ITileCellNoiseTool;
}
virtual float getCellNoise(const Identifier& cell_id, CaloGain::CaloGain caloGain) const = 0; virtual float getCellNoise(const Identifier& cell_id, CaloGain::CaloGain caloGain) const = 0;
DeclareInterfaceID(ITileCellNoiseTool, 1, 0);
}; };
#endif #endif
...@@ -22,15 +22,12 @@ class ITileCondToolOfc : public virtual IAlgTool { ...@@ -22,15 +22,12 @@ class ITileCondToolOfc : public virtual IAlgTool {
virtual ~ITileCondToolOfc() {} virtual ~ITileCondToolOfc() {}
static const InterfaceID& interfaceID() {
static const InterfaceID IID_ITileCondToolOfc("ITileCondToolOfc", 1 , 0);
return IID_ITileCondToolOfc;
}
virtual const TileOfcWeightsStruct * getOfcWeights(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float& phase, bool of2) = 0 ; virtual const TileOfcWeightsStruct * getOfcWeights(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float& phase, bool of2) = 0 ;
virtual int getNSamples(void) = 0 ; virtual int getNSamples(void) = 0 ;
DeclareInterfaceID(ITileCondToolOfc, 1, 0);
}; };
#endif #endif
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef TILECONDITIONS_TILECELLNOISETOOL_H #ifndef TILECONDITIONS_TILECELLNOISETOOL_H
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
// Tile includes // Tile includes
#include "TileConditions/ITileCellNoiseTool.h" #include "TileConditions/ITileCellNoiseTool.h"
#include "TileConditions/TileCondIdTransforms.h"
#include "TileConditions/ITileCondToolNoise.h"
// Athena includes // Athena includes
#include "AthenaBaseComps/AthAlgTool.h" #include "AthenaBaseComps/AthAlgTool.h"
...@@ -19,14 +21,11 @@ ...@@ -19,14 +21,11 @@
// Forward declaration // Forward declaration
class TileCablingSvc; class TileCablingSvc;
class TileCondIdTransforms;
class ITileCondToolNoise;
class TileCellNoiseTool: public AthAlgTool class TileCellNoiseTool: public extends<AthAlgTool, ITileCellNoiseTool> {
, virtual public ITileCellNoiseTool {
public: public:
static const InterfaceID& interfaceID();
TileCellNoiseTool(const std::string& type, const std::string& name, const IInterface* parent); TileCellNoiseTool(const std::string& type, const std::string& name, const IInterface* parent);
virtual ~TileCellNoiseTool(); virtual ~TileCellNoiseTool();
...@@ -39,8 +38,11 @@ class TileCellNoiseTool: public AthAlgTool ...@@ -39,8 +38,11 @@ class TileCellNoiseTool: public AthAlgTool
//=== used tools //=== used tools
ServiceHandle<TileCablingSvc> m_tileCabling; ServiceHandle<TileCablingSvc> m_tileCabling;
ToolHandle<TileCondIdTransforms> m_tileIdTrans; ToolHandle<TileCondIdTransforms> m_tileIdTrans{this,
ToolHandle<ITileCondToolNoise> m_tileToolNoise; "TileCondIdTransforms", "TileCondIdTransforms", "Tile Id transform helper tool"};
ToolHandle<ITileCondToolNoise> m_tileToolNoise{this,
"TileCondToolNoise", "TileCondToolNoiseSample", "Tile cell noise tool"};
}; };
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
// Tile includes // Tile includes
#include "TileConditions/ITileCondToolOfc.h" #include "TileConditions/ITileCondToolOfc.h"
#include "TileConditions/TileInfo.h" #include "TileConditions/TileInfo.h"
// #include "TileConditions/TileCondToolNoiseSample.h"
#include "TileConditions/TileCondToolAutoCr.h" #include "TileConditions/TileCondToolAutoCr.h"
#include "TileConditions/TileCondToolPulseShape.h" #include "TileConditions/TileCondToolPulseShape.h"
...@@ -39,7 +38,8 @@ class IdContext; ...@@ -39,7 +38,8 @@ class IdContext;
* Optionally, it can create cache table of OFCs with 1-ns step to minimize * Optionally, it can create cache table of OFCs with 1-ns step to minimize
* CPU time. Also, by request, unity A/C matrix can be used. * CPU time. Also, by request, unity A/C matrix can be used.
*/ */
class TileCondToolOfc: public AthAlgTool, public ITileCondToolOfc { class TileCondToolOfc: public extends<AthAlgTool, ITileCondToolOfc> {
public: public:
TileCondToolOfc(const std::string& type, const std::string& name, const IInterface* parent); TileCondToolOfc(const std::string& type, const std::string& name, const IInterface* parent);
...@@ -47,7 +47,6 @@ class TileCondToolOfc: public AthAlgTool, public ITileCondToolOfc { ...@@ -47,7 +47,6 @@ class TileCondToolOfc: public AthAlgTool, public ITileCondToolOfc {
StatusCode initialize(); StatusCode initialize();
StatusCode finalize(); StatusCode finalize();
static const InterfaceID& interfaceID();
void CalcWeights(unsigned int drawerIdx, unsigned int channel, int gain, float phase, bool of2); void CalcWeights(unsigned int drawerIdx, unsigned int channel, int gain, float phase, bool of2);
...@@ -72,9 +71,12 @@ class TileCondToolOfc: public AthAlgTool, public ITileCondToolOfc { ...@@ -72,9 +71,12 @@ class TileCondToolOfc: public AthAlgTool, public ITileCondToolOfc {
typedef std::map<int, std::unique_ptr<TileOfcWeightsStruct> > OfcPhaseCache; typedef std::map<int, std::unique_ptr<TileOfcWeightsStruct> > OfcPhaseCache;
std::vector<std::unique_ptr<OfcPhaseCache> > m_ofc_phase_cache; std::vector<std::unique_ptr<OfcPhaseCache> > m_ofc_phase_cache;
ToolHandle<TileCondToolPulseShape> m_tileToolPulseShape; ToolHandle<TileCondToolPulseShape> m_tileToolPulseShape{this,
ToolHandle<TileCondToolAutoCr> m_tileToolAutoCr; "TileCondToolPulseShape", "TileCondToolPulseShape", "Tile pulse shape tool"};
// ToolHandle<TileCondToolNoiseSample> m_tileToolNoiseSample;
ToolHandle<TileCondToolAutoCr> m_tileToolAutoCr{this,
"TileCondToolAutoCr", "TileCondToolAutoCr", "Tile auto correlation matrix tool"};
const TileInfo* m_tileInfo; const TileInfo* m_tileInfo;
TileOfcWeightsStruct m_weights; TileOfcWeightsStruct m_weights;
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/ */
// Tile includes // Tile includes
#include "TileConditions/TileCellNoiseTool.h" #include "TileConditions/TileCellNoiseTool.h"
#include "TileConditions/ITileCondToolNoise.h"
#include "TileConditions/TileCablingSvc.h" #include "TileConditions/TileCablingSvc.h"
#include "TileConditions/TileCondIdTransforms.h"
#include "TileConditions/Exception.h" #include "TileConditions/Exception.h"
// Athena includes // Athena includes
...@@ -16,26 +14,14 @@ ...@@ -16,26 +14,14 @@
#include <cmath> #include <cmath>
#include <algorithm> #include <algorithm>
//
//____________________________________________________________________
static const InterfaceID IID_TileCellNoiseTool("TileCellNoiseTool", 1, 0);
const InterfaceID&
TileCellNoiseTool::interfaceID() {
return IID_TileCellNoiseTool;
}
// //
//____________________________________________________________________ //____________________________________________________________________
TileCellNoiseTool::TileCellNoiseTool(const std::string& type, const std::string& name, TileCellNoiseTool::TileCellNoiseTool(const std::string& type, const std::string& name,
const IInterface* parent) const IInterface* parent)
: AthAlgTool(type, name, parent) : base_class(type, name, parent)
, m_tileCabling("TileCablingSvc", name) , m_tileCabling("TileCablingSvc", name)
, m_tileIdTrans("TileCondIdTransforms")
, m_tileToolNoise("TileCondToolNoiseSample")
{ {
declareInterface<ITileCellNoiseTool>(this);
declareInterface<TileCellNoiseTool>(this);
declareProperty("NoiseSource", m_tileToolNoise, "Source for cell noise computation");
} }
// //
......
...@@ -2,40 +2,28 @@ ...@@ -2,40 +2,28 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/ */
// Athena includes
#include "AthenaKernel/errorcheck.h"
// Tile includes // Tile includes
#include "TileConditions/TileCondToolOfc.h" #include "TileConditions/TileCondToolOfc.h"
#include "TileConditions/TileCablingService.h" #include "TileConditions/TileCablingService.h"
#include "TileConditions/TileCablingSvc.h" #include "TileConditions/TileCablingSvc.h"
// Athena includes
#include "AthenaKernel/errorcheck.h"
//
//____________________________________________________________________
const InterfaceID& TileCondToolOfc::interfaceID() {
return ITileCondToolOfc::interfaceID();
}
// //
//____________________________________________________________________ //____________________________________________________________________
TileCondToolOfc::TileCondToolOfc(const std::string& type, const std::string& name, TileCondToolOfc::TileCondToolOfc(const std::string& type, const std::string& name,
const IInterface* parent) const IInterface* parent)
: AthAlgTool(type, name, parent) : base_class(type, name, parent)
, m_tileToolPulseShape("TileCondToolPulseShape")
, m_tileToolAutoCr("TileCondToolAutoCr")
// , m_tileToolNoiseSample("TileCondToolNoiseSample")
, m_tileInfo(0) , m_tileInfo(0)
, m_maxChannels(0) , m_maxChannels(0)
, m_maxGains(0) , m_maxGains(0)
, m_drawerCacheSize(0) , m_drawerCacheSize(0)
{ {
declareInterface<ITileCondToolOfc>(this);
declareProperty("nSamples", m_nSamples = 7, "number of samples used in the run"); declareProperty("nSamples", m_nSamples = 7, "number of samples used in the run");
declareProperty("OptFilterDeltaCorrelation", m_deltaCorrelation = false declareProperty("OptFilterDeltaCorrelation", m_deltaCorrelation = false
, "true=> use delta correlation; false=>use calculation obtained from data"); , "true=> use delta correlation; false=>use calculation obtained from data");
declareProperty("TileCondToolPulseShape", m_tileToolPulseShape);
declareProperty("TileCondToolAutoCr", m_tileToolAutoCr);
declareProperty("CacheSize", m_cache = 0, ">0 create cache; ==0 calculate on-fly"); declareProperty("CacheSize", m_cache = 0, ">0 create cache; ==0 calculate on-fly");
m_t0Sample = (m_nSamples - 1) / 2; m_t0Sample = (m_nSamples - 1) / 2;
...@@ -54,16 +42,16 @@ StatusCode TileCondToolOfc::initialize() { ...@@ -54,16 +42,16 @@ StatusCode TileCondToolOfc::initialize() {
ATH_MSG_INFO( "In initialize()" ); ATH_MSG_INFO( "In initialize()" );
//=== Get TileCondToolPulseShape //=== Get TileCondToolPulseShape
CHECK( m_tileToolPulseShape.retrieve() ); ATH_CHECK( m_tileToolPulseShape.retrieve() );
if (!m_deltaCorrelation) { if (!m_deltaCorrelation) {
CHECK(m_tileToolAutoCr.retrieve()); ATH_CHECK(m_tileToolAutoCr.retrieve());
} else { } else {
m_tileToolAutoCr.disable(); m_tileToolAutoCr.disable();
} }
//==== TileInfo //==== TileInfo
CHECK( detStore()->retrieve(m_tileInfo, "TileInfo") ); ATH_CHECK( detStore()->retrieve(m_tileInfo, "TileInfo") );
if (m_nSamples != m_tileInfo->NdigitSamples()) { if (m_nSamples != m_tileInfo->NdigitSamples()) {
ATH_MSG_WARNING( "Changing number of samples from " << m_nSamples ATH_MSG_WARNING( "Changing number of samples from " << m_nSamples
...@@ -89,7 +77,7 @@ StatusCode TileCondToolOfc::initialize() { ...@@ -89,7 +77,7 @@ StatusCode TileCondToolOfc::initialize() {
//=== Initialize max values //=== Initialize max values
ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name()); ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name());
CHECK( cablingSvc.retrieve()); ATH_CHECK( cablingSvc.retrieve());
const TileCablingService* cabling = cablingSvc->cablingService(); const TileCablingService* cabling = cablingSvc->cablingService();
if (!cabling) { if (!cabling) {
......
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