Commit a3546123 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (TrkCollectionAliasAlg-00-00-05)

parent 4cde9a77
################################################################################
# Package: TrkCollectionAliasAlg
################################################################################
# Declare the package name:
atlas_subdir( TrkCollectionAliasAlg )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthenaBaseComps
GaudiKernel
PRIVATE
Tracking/TrkEvent/TrkTrack )
# Component(s) in the package:
atlas_add_component( TrkCollectionAliasAlg
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps GaudiKernel TrkTrack )
# Install files from the package:
atlas_install_headers( TrkCollectionAliasAlg )
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// TrkCollectionAliasAlg.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef TRKTRKCOLLECTIONALIASALG_H
#define TRKTRKCOLLECTIONALIASALG_H
// Gaudi includes
#include "AthenaBaseComps/AthAlgorithm.h"
#include <string>
class AtlasDetectorID;
class Identifier;
namespace Trk
{
/** @class TrkCollectionAliasAlg
This algorithm creates in StoreGate an alias name for
the StoreGate container key given as property
@author Martin Siebel <Martin.Siebel@CERN.ch>
*/
class TrkCollectionAliasAlg : public AthAlgorithm
{
public:
/** Standard Athena-Algorithm Constructor */
TrkCollectionAliasAlg(const std::string& name, ISvcLocator* pSvcLocator);
/** Default Destructor */
~TrkCollectionAliasAlg();
/** standard Athena-Algorithm method */
StatusCode initialize();
/** standard Athena-Algorithm method */
StatusCode execute();
/** standard Athena-Algorithm method */
StatusCode finalize();
private:
/** member variables for algorithm properties: */
// The key of the input track collection
std::string m_collectionName;
// The key that should be given to the alias
std::string m_aliasName;
};
} // end of namespace
#endif
package TrkCollectionAliasAlg
author Martin Siebel <Martin.Siebel@CERN.ch>
private
use TrkTrack TrkTrack-* Tracking/TrkEvent
public
use AtlasPolicy AtlasPolicy-*
use GaudiInterface GaudiInterface-* External
use AthenaBaseComps AthenaBaseComps-* Control
apply_pattern component_library
library TrkCollectionAliasAlg *.cxx components/*.cxx
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
@mainpage TrkCollectionAliasAlg Package
This package contains the Algorithm TrkCollectionAliasAlg which generates a StoreGate alias for a TrackCollection
@author Martin Siebel <Martin.Siebel@CERN.ch>
@section TrkCollectionAliasAlgReq Requirements
@include requirements
*/
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// TrkCollectionAliasAlg.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#include "TrkCollectionAliasAlg/TrkCollectionAliasAlg.h"
#include "TrkTrack/TrackCollection.h"
//================ Constructor =================================================
Trk::TrkCollectionAliasAlg::TrkCollectionAliasAlg(const std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm(name,pSvcLocator)
{
// template for property decalration
declareProperty("CollectionName", m_collectionName = "ResolvedTracks");
declareProperty("AliasName" , m_aliasName = "Tracks");
}
//================ Destructor =================================================
Trk::TrkCollectionAliasAlg::~TrkCollectionAliasAlg()
{}
//================ Initialisation =================================================
StatusCode Trk::TrkCollectionAliasAlg::initialize()
{
return StatusCode::SUCCESS;
}
//================ Finalisation =================================================
StatusCode Trk::TrkCollectionAliasAlg::finalize()
{
return StatusCode::SUCCESS;
}
//================ Execution ====================================================
StatusCode Trk::TrkCollectionAliasAlg::execute()
{
const TrackCollection* trkColPtr=0;
StatusCode sc;
sc = evtStore()->retrieve(trkColPtr,m_collectionName);
if (sc.isFailure())
{
msg(MSG::ERROR) << "Could not retrieve TrackCollection " << m_collectionName << endreq;
return StatusCode::FAILURE;
}
sc = evtStore()->setAlias(trkColPtr,m_aliasName);
if (sc.isFailure())
{
msg(MSG::ERROR) << "Could not alias TrackCollection " << m_collectionName << " to " << m_aliasName << endreq;
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
//============================================================================================
#include "GaudiKernel/DeclareFactoryEntries.h"
#include "TrkCollectionAliasAlg/TrkCollectionAliasAlg.h"
DECLARE_NAMESPACE_ALGORITHM_FACTORY( Trk , TrkCollectionAliasAlg )
DECLARE_FACTORY_ENTRIES( TrkCollectionAliasAlg ) {
DECLARE_NAMESPACE_ALGORITHM( Trk , TrkCollectionAliasAlg )
}
#include "GaudiKernel/LoadFactoryEntries.h"
LOAD_FACTORY_ENTRIES( TrkCollectionAliasAlg )
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment