Commit 35a583be authored by Niels Van Eldik's avatar Niels Van Eldik Committed by Graeme Stewart
Browse files

adopt new IMuonCreatorTool interface (MuonCombinedAlgs-00-00-09)

	* adopt new IMuonCreatorTool interface
	* tagging as MuonCombinedAlgs-00-00-09
04-12-2014 Sue Cheatham
	* muonCreatorTool fix for slowMuon
	* tagging as MuonCombinedAlgs-00-00-08

01-12-2014 Sue Cheatham
	* create slowMuon container and its aux store
	* tagging as MuonCombinedAlgs-00-00-07
parent 447d0c43
......@@ -14,6 +14,8 @@
#include "xAODTracking/TrackParticleAuxContainer.h"
#include "TrkSegment/SegmentCollection.h"
#include "MuonSegment/MuonSegment.h"
#include "xAODMuon/SlowMuonContainer.h"
#include "xAODMuon/SlowMuonAuxContainer.h"
MuonCreatorAlg::MuonCreatorAlg(const std::string& name, ISvcLocator* pSvcLocator):
AthAlgorithm(name,pSvcLocator),
......@@ -21,11 +23,13 @@ MuonCreatorAlg::MuonCreatorAlg(const std::string& name, ISvcLocator* pSvcLocator
{
declareProperty("MuonCreatorTool",m_muonCreatorTool);
declareProperty("MuonContainerLocation",m_muonCollectionName = "Muons" );
declareProperty("SlowMuonContainerLocation",m_slowMuonCollectionName = "SlowMuons" );
declareProperty("CombinedLocation", m_combinedCollectionName = "CombinedMuon" );
declareProperty("ExtrapolatedLocation", m_extrapolatedCollectionName = "ExtrapolatedMuon" );
declareProperty("InDetCandidateLocation",m_indetCandidateCollectionName = "InDetCandidates" );
declareProperty("MuonCandidateLocation", m_muonCandidateCollectionName = "MuonCandidates" );
declareProperty("SegmentContainerName", m_segContainerName = "MuonSegments" );
declareProperty("BuildSlowMuon",m_buildSlowMuon=false);
}
MuonCreatorAlg::~MuonCreatorAlg()
......@@ -58,6 +62,7 @@ StatusCode MuonCreatorAlg::execute()
return StatusCode::FAILURE;
}
}
// Create the xAOD container and its auxiliary store:
xAOD::MuonContainer* xaod = new xAOD::MuonContainer();
......@@ -68,20 +73,27 @@ StatusCode MuonCreatorAlg::execute()
xaod->setStore( aux );
ATH_MSG_DEBUG( "Recorded Muons with key: " << m_muonCollectionName );
xAOD::TrackParticleContainer* combinedTP = 0;
TrackCollection* combinedTracks = 0;
ATH_CHECK(createAndRecord(combinedTP,combinedTracks,m_combinedCollectionName));
MuonCombined::IMuonCreatorTool::OutputData output(*xaod);
if (m_buildSlowMuon){
// Create the xAOD slow muon container and its auxiliary store:
output.slowMuonContainer = new xAOD::SlowMuonContainer();
ATH_CHECK( evtStore()->record( output.slowMuonContainer, m_slowMuonCollectionName ) );
xAOD::SlowMuonAuxContainer* auxSlowMuon = new xAOD::SlowMuonAuxContainer();
ATH_CHECK( evtStore()->record( auxSlowMuon, m_slowMuonCollectionName + "Aux." ) );
output.slowMuonContainer->setStore( auxSlowMuon );
ATH_MSG_DEBUG( "Recorded Slow Muons with key: " << m_slowMuonCollectionName );
}
xAOD::TrackParticleContainer* extrapolatedTP = 0;
TrackCollection* extrapolatedTracks = 0;
ATH_CHECK(createAndRecord(extrapolatedTP,extrapolatedTracks,m_extrapolatedCollectionName));
ATH_CHECK(createAndRecord(output.combinedTrackParticleContainer,output.combinedTrackCollection,m_combinedCollectionName));
xAOD::MuonSegmentContainer* xaodSegments = 0;
Trk::SegmentCollection* segments = 0;
ATH_CHECK(createAndRecordSegments(xaodSegments,segments,m_segContainerName));
ATH_CHECK(createAndRecord(output.extrapolatedTrackParticleContainer,output.extrapolatedTrackCollection,m_extrapolatedCollectionName));
m_muonCreatorTool->create(muonCandidateCollection,indetCandidateCollection,*xaod,combinedTP,combinedTracks,extrapolatedTP,extrapolatedTracks,xaodSegments, segments);
ATH_CHECK(createAndRecordSegments(output.xaodSegmentContainer,output.muonSegmentCollection,m_segContainerName));
m_muonCreatorTool->create(muonCandidateCollection,indetCandidateCollection,output);
return StatusCode::SUCCESS;
}
......
......@@ -10,6 +10,7 @@
#include <string>
#include "xAODMuon/MuonContainer.h"
#include "xAODMuon/SlowMuonContainer.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "TrkTrack/TrackCollection.h"
#include "MuonSegment/MuonSegment.h"
......@@ -35,11 +36,14 @@ class MuonCreatorAlg : public AthAlgorithm
ToolHandle<MuonCombined::IMuonCreatorTool> m_muonCreatorTool;
std::string m_muonCollectionName;
std::string m_slowMuonCollectionName;
std::string m_combinedCollectionName;
std::string m_extrapolatedCollectionName;
std::string m_indetCandidateCollectionName;
std::string m_muonCandidateCollectionName;
std::string m_segContainerName;
bool m_buildSlowMuon;
};
......
Markdown is supported
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