Skip to content
Snippets Groups Projects
Commit be9a400e authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

AthenaBaseComps: delete unused AthHistogram classes

Delete unused AthHistogramFilterAlgorithm and AthHistogramTool.
parent 80f95a76
Branches test
No related tags found
No related merge requests found
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017, 2019 CERN for the benefit of the ATLAS collaboration
*/
/// @class AthHistogramFilterAlgorithm.h
/// Header file for AthHistogramAlgorithm
/// @author: Karsten Koeneke (karsten.koeneke@cern.ch)
///////////////////////////////////////////////////////////////////
#ifndef ATHENABASECOMPS_ATHHISTOGRAMFILTERALGORITHM_H
#define ATHENABASECOMPS_ATHHISTOGRAMFILTERALGORITHM_H 1
// STL includes
#include <string>
// Framework includes
#include "AthenaBaseComps/AthFilterAlgorithm.h"
#include "AthenaBaseComps/AthHistogramming.h"
#include "GaudiKernel/ServiceHandle.h"
// Some needed forward declarations
class ITHistSvc;
class AthHistogramFilterAlgorithm
: public ::AthFilterAlgorithm,
public ::AthHistogramming
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
/// Constructor with parameters:
AthHistogramFilterAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
/// Destructor:
virtual ~AthHistogramFilterAlgorithm();
/** Initialization method invoked by the framework. This method is responsible
* for any bookkeeping of initialization required by the framework itself.
* It will in turn invoke the initialize() method of the derived algorithm,
* and of any sub-algorithms which it creates.
*/
virtual StatusCode sysInitialize();
///////////////////////////////////////////////////////////////////
// Const methods:
///////////////////////////////////////////////////////////////////
/** @brief The standard @c THistSvc (for writing histograms and TTrees
* and more to a root file)
* Returns (kind of) a pointer to the @c THistSvc
*/
const ServiceHandle<ITHistSvc>& histSvc() const;
///////////////////////////////////////////////////////////////////
// Private methods:
///////////////////////////////////////////////////////////////////
private:
/// Default constructor:
///AthHistogramFilterAlgorithm();
///////////////////////////////////////////////////////////////////
// Private data:
///////////////////////////////////////////////////////////////////
private:
/// a handle on the Hist/TTree registration service
ServiceHandle<ITHistSvc> m_histSvc;
/// Name of the ROOT output stream (file)
std::string m_prefix;
/// Name of the ROOT directory
std::string m_rootDir;
/// The prefix for the histogram THx name
std::string m_histNamePrefix;
/// The postfix for the histogram THx name
std::string m_histNamePostfix;
/// The prefix for the histogram THx title
std::string m_histTitlePrefix;
/// The postfix for the histogram THx title
std::string m_histTitlePostfix;
};
// I/O operators
//////////////////////
// For the THistSvc
inline const ServiceHandle<ITHistSvc>& AthHistogramFilterAlgorithm::histSvc() const
{
return m_histSvc;
}
#endif //> !ATHENABASECOMPS_ATHHISTOGRAMFILTERALGORITHM_H
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// AthHistogramTool.h
// Header file for class AthHistogramTool
// Author: Karsten Koeneke
///////////////////////////////////////////////////////////////////
#ifndef ATHENABASECOMPS_ATHHISTOGRAMTOOL_H
#define ATHENABASECOMPS_ATHHISTOGRAMTOOL_H 1
// STL includes
#include <string>
// Framework includes
#include "AthenaBaseComps/AthAlgTool.h"
#include "AthenaBaseComps/AthHistogramming.h"
#include "GaudiKernel/ServiceHandle.h"
// Some needed forward declarations
class ITHistSvc;
class AthHistogramTool
: public ::AthAlgTool,
public ::AthHistogramming
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
/// Constructor with parameters:
AthHistogramTool( const std::string& type,
const std::string& name,
const IInterface* parent );
/// Destructor:
virtual ~AthHistogramTool();
///////////////////////////////////////////////////////////////////
// Const methods:
///////////////////////////////////////////////////////////////////
/** @brief The standard @c THistSvc (for writing histograms and TTrees
* and more to a root file)
* Returns (kind of) a pointer to the @c THistSvc
*/
const ServiceHandle<ITHistSvc>& histSvc() const;
///////////////////////////////////////////////////////////////////
// Non-const methods:
///////////////////////////////////////////////////////////////////
/** Initialization method invoked by the framework. This method is responsible
* for any bookkeeping of initialization required by the framework itself.
* It will in turn invoke the initialize() method of the derived algorithm,
* and of any sub-algorithms which it creates.
*/
virtual StatusCode sysInitialize();
///////////////////////////////////////////////////////////////////
// Private data:
///////////////////////////////////////////////////////////////////
protected:
/// Pointer to the THistSvc (event store by default)
ServiceHandle<ITHistSvc> m_histSvc;
/// Name of the ROOT output stream (file)
std::string m_prefix;
/// Name of the ROOT directory
std::string m_rootDir;
/// The prefix for the histogram THx name
std::string m_histNamePrefix;
/// The postfix for the histogram THx name
std::string m_histNamePostfix;
/// The prefix for the histogram THx title
std::string m_histTitlePrefix;
/// The postfix for the histogram THx title
std::string m_histTitlePostfix;
};
///////////////////////////////////////////////////////////////////
// Inline methods:
///////////////////////////////////////////////////////////////////
// For the THistSvc
inline const ServiceHandle<ITHistSvc>& AthHistogramTool::histSvc() const
{
return m_histSvc;
}
#endif //> !ATHENABASECOMPS_ATHHISTOGRAMTOOL_H
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/// @class AthHistogramFilterAlgorithm.h
/// Header file for class AthHistogramAlgorithm
/// @author: Karsten Koeneke (karsten.koeneke@cern.ch)
///////////////////////////////////////////////////////////////////
// This class' header file
#include "AthenaBaseComps/AthHistogramFilterAlgorithm.h"
// STL includes
#include <string>
// Framework includes
#include "Gaudi/Property.h"
#include "GaudiKernel/ITHistSvc.h"
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
// Constructors
////////////////
AthHistogramFilterAlgorithm::AthHistogramFilterAlgorithm( const std::string& name,
ISvcLocator* pSvcLocator ) :
::AthFilterAlgorithm( name, pSvcLocator ),
::AthHistogramming( name ),
m_histSvc ( "THistSvc/THistSvc", name )
{
//
// Property declaration
//
// The histogram service
declareProperty("THistSvc",
m_histSvc = ServiceHandle<ITHistSvc>("THistSvc/THistSvc", name),
"Handle to a THistSvc instance: it will be used to write "
"ROOT objects to ROOT files" );
//declareProperty("THistService", m_histSvc, "The THistSvc" );
declareProperty("RootStreamName", m_prefix = "/ANALYSIS", "Name of the output ROOT stream (file) that the THistSvc uses");
declareProperty("RootDirName", m_rootDir = "",
"Name of the ROOT directory inside the ROOT file where the histograms will go");
declareProperty( "HistNamePrefix", m_histNamePrefix = "", "The prefix for the histogram THx name" );
declareProperty( "HistNamePostfix", m_histNamePostfix = "", "The postfix for the histogram THx name" );
declareProperty( "HistTitlePrefix", m_histTitlePrefix = "", "The prefix for the histogram THx title" );
declareProperty( "HistTitlePostfix", m_histTitlePostfix = "", "The postfix for the histogram THx title" );
}
// Destructor
///////////////
AthHistogramFilterAlgorithm::~AthHistogramFilterAlgorithm()
{
ATH_MSG_DEBUG ("Calling destructor");
}
/** Initialization method invoked by the framework. This method is responsible
* for any bookkeeping of initialization required by the framework itself.
* It will in turn invoke the initialize() method of the derived algorithm,
* and of any sub-algorithms which it creates.
*/
StatusCode AthHistogramFilterAlgorithm::sysInitialize()
{
// ---- stolen from GaudiKernel/Algorithm::sysInitialize -------
// Bypass the initialization if the algorithm
// has already been initialized.
if ( Gaudi::StateMachine::INITIALIZED <= FSMState() ) return StatusCode::SUCCESS;
// Set the Algorithm's properties
ATH_CHECK(setProperties());
// Bypass the initialization if the algorithm is disabled.
// Need to do this after setProperties.
if ( !isEnabled( ) ) return StatusCode::SUCCESS;
// ---- stolen from GaudiKernel/Algorithm::sysInitialize ------- END ---
// Get the THistSvc
ATH_CHECK ( histSvc().retrieve() );
// Configure the underlying AthHistogramming helper
ATH_CHECK ( AthHistogramming::configAthHistogramming( histSvc(),
m_prefix, m_rootDir,
m_histNamePrefix, m_histNamePostfix,
m_histTitlePrefix, m_histTitlePostfix ) );
// Print some setup information into the log file
ATH_MSG_DEBUG ("Initializing " << name() << "...");
ATH_MSG_DEBUG (" using THistService = " << m_histSvc );
ATH_MSG_DEBUG (" using RootStreamName = " << m_prefix );
ATH_MSG_DEBUG (" using RootDirName = " << m_rootDir );
ATH_MSG_DEBUG (" using HistNamePrefix = " << m_histNamePrefix );
ATH_MSG_DEBUG (" using HistNamePostfix = " << m_histNamePostfix );
ATH_MSG_DEBUG (" using HistTitlePrefix = " << m_histTitlePrefix );
ATH_MSG_DEBUG (" using HistTitlePostfix = " << m_histTitlePostfix );
// re-direct to base class...
return AthFilterAlgorithm::sysInitialize();
}
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// AthHistogramTool.cxx
// Implementation file for class AthHistogramTool
// Author: Karsten Koeneke
///////////////////////////////////////////////////////////////////
// This class' header includes
#include "AthenaBaseComps/AthHistogramTool.h"
// STL includes
#include <string>
// Framework includes
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/ITHistSvc.h"
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
// Constructors
////////////////
AthHistogramTool::AthHistogramTool( const std::string& type,
const std::string& name,
const IInterface* parent ) :
::AthAlgTool( type, name, parent ),
::AthHistogramming( name ),
m_histSvc ( "THistSvc/THistSvc", name )
{
// Properties go here
declareProperty("THistSvc",
m_histSvc = ServiceHandle<ITHistSvc>("THistSvc/THistSvc", name),
"Handle to a THistSvc instance: it will be used to write "
"ROOT objects to ROOT files" );
declareProperty("RootStreamName", m_prefix = "/ANALYSIS", "Name of the output ROOT stream (file) that the THistSvc uses");
declareProperty("RootDirName", m_rootDir = "",
"Name of the ROOT directory inside the ROOT file where the histograms will go");
declareProperty( "HistNamePrefix", m_histNamePrefix = "", "The prefix for the histogram THx name" );
declareProperty( "HistNamePostfix", m_histNamePostfix = "", "The postfix for the histogram THx name" );
declareProperty( "HistTitlePrefix", m_histTitlePrefix = "", "The prefix for the histogram THx title" );
declareProperty( "HistTitlePostfix", m_histTitlePostfix = "", "The postfix for the histogram THx title" );
}
// Destructor
///////////////
AthHistogramTool::~AthHistogramTool()
{
ATH_MSG_DEBUG ("Calling destructor");
}
///////////////////////////////////////////////////////////////////
// Non-const methods:
///////////////////////////////////////////////////////////////////
//=============================================================================
// Athena initialize method
//=============================================================================
StatusCode AthHistogramTool::sysInitialize()
{
/*
// ---- stolen from GaudiKernel/Algorithm::sysInitialize -------
// Bypass the initialization if the algorithm
// has already been initialized.
if ( Gaudi::StateMachine::INITIALIZED <= FSMState() ) return StatusCode::SUCCESS;
// Set the Algorithm's properties
ATH_CHECK(setProperties());
// Bypass the initialization if the algorithm is disabled.
// Need to do this after setProperties.
if ( !isEnabled( ) ) return StatusCode::SUCCESS;
// ---- stolen from GaudiKernel/Algorithm::sysInitialize ------- END ---
*/
// Get the THistSvc
ATH_CHECK ( histSvc().retrieve() );
// Configure the underlying AthHistogramming helper
ATH_CHECK ( AthHistogramming::configAthHistogramming( histSvc(),
m_prefix, m_rootDir,
m_histNamePrefix, m_histNamePostfix,
m_histTitlePrefix, m_histTitlePostfix ) );
// Print some setup information into the log file
ATH_MSG_DEBUG ("Initializing " << name() << "...");
ATH_MSG_DEBUG (" using THistService = " << m_histSvc );
ATH_MSG_DEBUG (" using RootStreamName = " << m_prefix );
ATH_MSG_DEBUG (" using RootDirName = " << m_rootDir );
ATH_MSG_DEBUG (" using HistNamePrefix = " << m_histNamePrefix );
ATH_MSG_DEBUG (" using HistNamePostfix = " << m_histNamePostfix );
ATH_MSG_DEBUG (" using HistTitlePrefix = " << m_histTitlePrefix );
ATH_MSG_DEBUG (" using HistTitlePostfix = " << m_histTitlePostfix );
// re-direct to base class...
return AthAlgTool::sysInitialize();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment