Skip to content
Snippets Groups Projects
Commit c87f3beb authored by Siarhei Harkusha's avatar Siarhei Harkusha
Browse files

TileRecAlgs: Make Tile digits filter algorithm reentrant

parent b44657fb
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-2019 CERN for the benefit of the ATLAS collaboration
*/ */
//***************************************************************************** //*****************************************************************************
...@@ -35,11 +35,9 @@ ...@@ -35,11 +35,9 @@
// Constructor // Constructor
// //
TileDigitsFilter::TileDigitsFilter(std::string name, ISvcLocator* pSvcLocator) TileDigitsFilter::TileDigitsFilter(std::string name, ISvcLocator* pSvcLocator)
: AthAlgorithm(name, pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator)
, m_tileHWID(0) , m_tileHWID(0)
{ {
declareProperty("LowGainThereshold", m_threshold[0] = 0); // keep all LG except zeros
declareProperty("HighGainThereshold", m_threshold[1] = 10); // keep signals above ~128(106) MeV in A,BC(D) samplings
} }
TileDigitsFilter::~TileDigitsFilter() { TileDigitsFilter::~TileDigitsFilter() {
...@@ -58,6 +56,9 @@ StatusCode TileDigitsFilter::initialize() { ...@@ -58,6 +56,9 @@ StatusCode TileDigitsFilter::initialize() {
ATH_MSG_INFO( "Input raw channel container: '" << m_inputRawChannelContainerKey.key() ATH_MSG_INFO( "Input raw channel container: '" << m_inputRawChannelContainerKey.key()
<< "' output container: '" << m_outputRawChannelContainerKey.key() << "'" ); << "' output container: '" << m_outputRawChannelContainerKey.key() << "'" );
m_threshold[0] = m_lowGainThreashold;
m_threshold[1] = m_highGainThreashold;
ATH_MSG_INFO( "Threshold low gain: " << m_threshold[0] ATH_MSG_INFO( "Threshold low gain: " << m_threshold[0]
<< " counts, high gain: " << m_threshold[1] << " counts" ); << " counts, high gain: " << m_threshold[1] << " counts" );
...@@ -87,7 +88,7 @@ StatusCode TileDigitsFilter::initialize() { ...@@ -87,7 +88,7 @@ StatusCode TileDigitsFilter::initialize() {
// //
// Begin Execution Phase. // Begin Execution Phase.
// //
StatusCode TileDigitsFilter::execute() { StatusCode TileDigitsFilter::execute(const EventContext& ctx) const {
ATH_MSG_DEBUG( "in execute()" ); ATH_MSG_DEBUG( "in execute()" );
...@@ -108,7 +109,7 @@ StatusCode TileDigitsFilter::execute() { ...@@ -108,7 +109,7 @@ StatusCode TileDigitsFilter::execute() {
// Get digit container from TES // Get digit container from TES
if (!m_inputDigitsContainerKey.key().empty()) { if (!m_inputDigitsContainerKey.key().empty()) {
SG::ReadHandle<TileDigitsContainer> inputDigitsContainer(m_inputDigitsContainerKey); SG::ReadHandle<TileDigitsContainer> inputDigitsContainer(m_inputDigitsContainerKey, ctx);
if (inputDigitsContainer.isValid()) { if (inputDigitsContainer.isValid()) {
collItr = inputDigitsContainer->begin(); collItr = inputDigitsContainer->begin();
...@@ -127,7 +128,7 @@ StatusCode TileDigitsFilter::execute() { ...@@ -127,7 +128,7 @@ StatusCode TileDigitsFilter::execute() {
// Get rawChannel container from TES // Get rawChannel container from TES
if (!m_inputRawChannelContainerKey.key().empty()) { if (!m_inputRawChannelContainerKey.key().empty()) {
SG::ReadHandle<TileRawChannelContainer> inputRawChannelContainer(m_inputRawChannelContainerKey); SG::ReadHandle<TileRawChannelContainer> inputRawChannelContainer(m_inputRawChannelContainerKey, ctx);
if (inputRawChannelContainer.isValid()) { if (inputRawChannelContainer.isValid()) {
collRchItr = firstRchColl = inputRawChannelContainer->begin(); collRchItr = firstRchColl = inputRawChannelContainer->begin();
...@@ -240,7 +241,7 @@ StatusCode TileDigitsFilter::execute() { ...@@ -240,7 +241,7 @@ StatusCode TileDigitsFilter::execute() {
if (!m_outputDigitsContainerKey.key().empty()) { if (!m_outputDigitsContainerKey.key().empty()) {
// register new container in the TES // register new container in the TES
SG::WriteHandle<TileDigitsContainer> outputDigitsContainer(m_outputDigitsContainerKey); SG::WriteHandle<TileDigitsContainer> outputDigitsContainer(m_outputDigitsContainerKey, ctx);
ATH_CHECK( outputDigitsContainer.record(std::move(outputCont)) ); ATH_CHECK( outputDigitsContainer.record(std::move(outputCont)) );
ATH_MSG_DEBUG( "TileDigitsContainer registered successfully (" << m_outputDigitsContainerKey.key() << ")"); ATH_MSG_DEBUG( "TileDigitsContainer registered successfully (" << m_outputDigitsContainerKey.key() << ")");
...@@ -249,7 +250,7 @@ StatusCode TileDigitsFilter::execute() { ...@@ -249,7 +250,7 @@ StatusCode TileDigitsFilter::execute() {
if (!m_outputRawChannelContainerKey.key().empty()) { if (!m_outputRawChannelContainerKey.key().empty()) {
// register new container in the TES // register new container in the TES
SG::WriteHandle<TileRawChannelContainer> outputRawChannelContainer(m_outputRawChannelContainerKey); SG::WriteHandle<TileRawChannelContainer> outputRawChannelContainer(m_outputRawChannelContainerKey, ctx);
ATH_CHECK( outputRawChannelContainer.record(std::move(outRchCont)) ); ATH_CHECK( outputRawChannelContainer.record(std::move(outRchCont)) );
ATH_MSG_DEBUG( "TileRawChannelContainer registered successfully (" ATH_MSG_DEBUG( "TileRawChannelContainer registered successfully ("
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
//**************************************************************************** //****************************************************************************
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "TileEvent/TileRawChannelContainer.h" #include "TileEvent/TileRawChannelContainer.h"
// Atlas includes // Atlas includes
#include "AthenaBaseComps/AthAlgorithm.h" #include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "StoreGate/ReadHandleKey.h" #include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h" #include "StoreGate/WriteHandleKey.h"
...@@ -51,7 +51,7 @@ class TileHWID; ...@@ -51,7 +51,7 @@ class TileHWID;
@brief This algorithm copies TileDigits from input container to output container @brief This algorithm copies TileDigits from input container to output container
keeping only channels with (max-min) sample above threshold keeping only channels with (max-min) sample above threshold
*/ */
class TileDigitsFilter: public AthAlgorithm { class TileDigitsFilter: public AthReentrantAlgorithm {
public: public:
// Constructor // Constructor
TileDigitsFilter(std::string name, ISvcLocator* pSvcLocator); TileDigitsFilter(std::string name, ISvcLocator* pSvcLocator);
...@@ -60,31 +60,29 @@ class TileDigitsFilter: public AthAlgorithm { ...@@ -60,31 +60,29 @@ class TileDigitsFilter: public AthAlgorithm {
virtual ~TileDigitsFilter(); virtual ~TileDigitsFilter();
//Gaudi Hooks //Gaudi Hooks
StatusCode initialize(); //!< initialize method virtual StatusCode initialize() override; //!< initialize method
StatusCode execute(); //!< execute method virtual StatusCode execute(const EventContext& ctx) const override; //!< execute method
StatusCode finalize(); //!< finalize method virtual StatusCode finalize() override; //!< finalize method
private: private:
std::string m_inputContainer; //!< Name of the input TileDigitsContainer
std::string m_outputContainer; //!< Name of the output TileDigitsContainer
std::string m_inRchContainer; //!< Name of the input TileRawChannelContainer
std::string m_outRchContainer; //!< Name of the output TileRawChannelContainer
SG::ReadHandleKey<TileDigitsContainer> m_inputDigitsContainerKey{this,"InputDigitsContainer", SG::ReadHandleKey<TileDigitsContainer> m_inputDigitsContainerKey{this,
"TileDigitsCnt", "Input Tile digits container key"}; "InputDigitsContainer", "TileDigitsCnt", "Input Tile digits container key"};
SG::WriteHandleKey<TileDigitsContainer> m_outputDigitsContainerKey{this,"OutputDigitsContainer", SG::WriteHandleKey<TileDigitsContainer> m_outputDigitsContainerKey{this,
"TileDigitsFlt","Output Tile digits container key"}; "OutputDigitsContainer", "TileDigitsFlt","Output Tile digits container key"};
SG::ReadHandleKey<TileRawChannelContainer> m_inputRawChannelContainerKey{this,
"InputRawChannelContainer", "TileRawChannelCnt", "Input Tile raw channels container key"};
SG::ReadHandleKey<TileRawChannelContainer> m_inputRawChannelContainerKey{this,"InputRawChannelContainer", SG::WriteHandleKey<TileRawChannelContainer> m_outputRawChannelContainerKey{this,
"TileRawChannelCnt", "OutputRawChannelContainer", "TileRawChannelFlt", "Output Tile digits container key"};
"Input Tile raw channels container key"};
SG::WriteHandleKey<TileRawChannelContainer> m_outputRawChannelContainerKey{this,"OutputRawChannelContainer", Gaudi::Property<int> m_lowGainThreashold{this,
"TileRawChannelFlt", "LowGainThereshold", 0, "Low gain threshold to keep digits"}; // keep all LG except zeros
"Output Tile digits container key"};
Gaudi::Property<int> m_highGainThreashold{this,
"HighGainThereshold", 10, "High gain threshold to keep digits"}; // keep signals above ~128(106) MeV in A,BC(D) samplings
const TileHWID* m_tileHWID; const TileHWID* m_tileHWID;
......
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