Skip to content
Snippets Groups Projects
Commit 5112686d authored by Charles Leggett's avatar Charles Leggett Committed by Graeme Stewart
Browse files

make EventInfoCnvTool::convert(...) const, initialize static maps (xAODEventInfoCnv-00-00-26)

	* make EventInfoCnvTool::convert(...) const, make the static
	  flag maps const, file-scope
	* tag xAODEventInfoCnv-00-00-26

M       src/EventInfoCnvTool.cxx
M       src/EventInfoCnvTool.h


Former-commit-id: bc0085e3
parent d0129934
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: EventInfoCnvTool.cxx 727101 2016-03-01 15:56:08Z krasznaa $
// $Id: EventInfoCnvTool.cxx 793565 2017-01-23 22:00:14Z leggett $
// Gaudi/Athena include(s):
#include "AthenaKernel/errorcheck.h"
......@@ -23,6 +23,27 @@
namespace xAODMaker {
// maps to copy the flags
static const std::map< xAOD::EventInfo::EventFlagSubDet,
EventInfo::EventFlagSubDet > subDetMap =
{ {xAOD::EventInfo::Pixel, EventInfo::Pixel},
{xAOD::EventInfo::SCT, EventInfo::SCT},
{xAOD::EventInfo::TRT, EventInfo::TRT},
{xAOD::EventInfo::LAr, EventInfo::LAr},
{xAOD::EventInfo::Tile, EventInfo::Tile},
{xAOD::EventInfo::Muon, EventInfo::Muon},
{xAOD::EventInfo::ForwardDet, EventInfo::ForwardDet},
{xAOD::EventInfo::Core, EventInfo::Core},
{xAOD::EventInfo::Background, EventInfo::Background},
{xAOD::EventInfo::Lumi, EventInfo::Lumi} };
static const std::map< EventInfo::EventFlagErrorState,
xAOD::EventInfo::EventFlagErrorState > errorStateMap =
{ { EventInfo::NotSet, xAOD::EventInfo::NotSet },
{ EventInfo::Warning, xAOD::EventInfo::Warning },
{ EventInfo::Error, xAOD::EventInfo::Error}
};
/// Hard-coded location of the beam position information
static const std::string INDET_BEAMPOS = "/Indet/Beampos";
......@@ -113,7 +134,7 @@ namespace xAODMaker {
StatusCode EventInfoCnvTool::convert( const EventInfo* aod,
xAOD::EventInfo* xaod,
bool pileUpInfo,
bool copyPileUpLinks ) {
bool copyPileUpLinks ) const {
if( ! aod ) {
ATH_MSG_WARNING( "Null pointer received for input!" );
......@@ -204,29 +225,6 @@ namespace xAODMaker {
}
}
// Construct the maps for the flag copying:
static std::map< xAOD::EventInfo::EventFlagSubDet,
EventInfo::EventFlagSubDet > subDetMap;
if( ! subDetMap.size() ) {
subDetMap[ xAOD::EventInfo::Pixel ] = EventInfo::Pixel;
subDetMap[ xAOD::EventInfo::SCT ] = EventInfo::SCT;
subDetMap[ xAOD::EventInfo::TRT ] = EventInfo::TRT;
subDetMap[ xAOD::EventInfo::LAr ] = EventInfo::LAr;
subDetMap[ xAOD::EventInfo::Tile ] = EventInfo::Tile;
subDetMap[ xAOD::EventInfo::Muon ] = EventInfo::Muon;
subDetMap[ xAOD::EventInfo::ForwardDet ] = EventInfo::ForwardDet;
subDetMap[ xAOD::EventInfo::Core ] = EventInfo::Core;
subDetMap[ xAOD::EventInfo::Background ] = EventInfo::Background;
subDetMap[ xAOD::EventInfo::Lumi ] = EventInfo::Lumi;
}
static std::map< EventInfo::EventFlagErrorState,
xAOD::EventInfo::EventFlagErrorState > errorStateMap;
if( ! errorStateMap.size() ) {
errorStateMap[ EventInfo::NotSet ] = xAOD::EventInfo::NotSet;
errorStateMap[ EventInfo::Warning ] = xAOD::EventInfo::Warning;
errorStateMap[ EventInfo::Error ] = xAOD::EventInfo::Error;
}
// Copy the sub-detector flags:
std::map< xAOD::EventInfo::EventFlagSubDet,
EventInfo::EventFlagSubDet >::const_iterator sd_itr =
......
......@@ -4,7 +4,7 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: EventInfoCnvTool.h 727531 2016-03-03 17:44:38Z krasznaa $
// $Id: EventInfoCnvTool.h 793565 2017-01-23 22:00:14Z leggett $
#ifndef XAODEVENTINFOCNV_EVENTINFOCNVTOOL_H
#define XAODEVENTINFOCNV_EVENTINFOCNVTOOL_H
......@@ -34,8 +34,8 @@ namespace xAODMaker {
*
* @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
*
* $Revision: 727531 $
* $Date: 2016-03-03 18:44:38 +0100 (Thu, 03 Mar 2016) $
* $Revision: 793565 $
* $Date: 2017-01-23 23:00:14 +0100 (Mon, 23 Jan 2017) $
*/
class EventInfoCnvTool : public AthAlgTool,
public virtual IEventInfoCnvTool {
......@@ -52,7 +52,7 @@ namespace xAODMaker {
virtual StatusCode convert( const EventInfo* aod,
xAOD::EventInfo* xaod,
bool pileUpInfo = false,
bool copyPileUpLinks = true );
bool copyPileUpLinks = true ) const;
private:
#ifndef XAOD_ANALYSIS
......
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