Skip to content
Snippets Groups Projects
Commit a28e987f authored by Tadej Novak's avatar Tadej Novak
Browse files

Copy jet truth info over with OverlayPool jobs

parent b568838b
No related branches found
No related tags found
No related merge requests found
......@@ -20,10 +20,11 @@ if not isRealData:
outStream.ItemList += ["RecoTimingObj#HITStoRDO_timings"]
if DetFlags.overlay.Truth_on():
outStream.ItemList += [
"McEventCollection#*",
"TrackRecordCollection#*"
]
outStream.ItemList += [ "McEventCollection#*", "TrackRecordCollection#*" ]
outStream.ItemList += [ "xAOD::JetContainer#InTimeAntiKt4TruthJets" ]
outStream.ItemList += [ "xAOD::JetAuxContainer#InTimeAntiKt4TruthJetsAux." ]
outStream.ItemList += [ "xAOD::JetContainer#OutOfTimeAntiKt4TruthJets" ]
outStream.ItemList += [ "xAOD::JetAuxContainer#OutOfTimeAntiKt4TruthJetsAux." ]
if DetFlags.overlay.CSC_on():
outStream.ItemList += [ "CscSimDataCollection#CSC_SDO" ]
if DetFlags.overlay.MDT_on():
......
......@@ -18,3 +18,6 @@ job += CopyMcEventCollection()
if readBS and isRealData:
job.CopyMcEventCollection.RealData = True
if not isRealData:
from OverlayCommonAlgs.OverlayCommonAlgsConf import CopyTruthInfo
job += CopyTruthInfo()
......@@ -11,6 +11,7 @@ atlas_depends_on_subdirs( PUBLIC
PRIVATE
Event/xAOD/xAODEventInfo
Event/xAOD/xAODCnvInterfaces
Event/xAOD/xAODJet
Calorimeter/CaloSimEvent
Control/AthenaBaseComps
Control/AthenaKernel
......@@ -51,7 +52,7 @@ atlas_add_component( OverlayCommonAlgs
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel CaloSimEvent AthenaBaseComps AthenaKernel PileUpToolsLib StoreGateLib SGtests PersistentDataModel Identifier ByteStreamCnvSvcLib EventInfo OverlayAlgBase GeneratorObjects InDetBCM_RawData InDetRawData InDetSimData InDetSimEvent LArRawEvent LArSimEvent MuonDigitContainer MuonRDO MuonSimData MuonSimEvent RecEvent TileEvent TileSimEvent TrigConfHLTData TrigSteeringEvent TrigT1CaloEventLib TrigT1Interfaces TrigT1Result )
LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel CaloSimEvent AthenaBaseComps AthenaKernel PileUpToolsLib StoreGateLib SGtests PersistentDataModel Identifier ByteStreamCnvSvcLib EventInfo OverlayAlgBase GeneratorObjects InDetBCM_RawData InDetRawData InDetSimData InDetSimEvent LArRawEvent LArSimEvent MuonDigitContainer MuonRDO MuonSimData MuonSimEvent RecEvent TileEvent TileSimEvent TrigConfHLTData TrigSteeringEvent TrigT1CaloEventLib TrigT1Interfaces TrigT1Result xAODJet )
# Install files from the package:
atlas_install_python_modules( python/__init__.py python/OverlayFlags.py )
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "CopyTruthInfo.h"
#include "xAODJet/JetAuxContainer.h"
#include "xAODJet/JetContainer.h"
#include <iostream>
#include <typeinfo>
//================================================================
CopyTruthInfo::CopyTruthInfo(const std::string &name, ISvcLocator *pSvcLocator) :
OverlayAlgBase(name, pSvcLocator) {}
//================================================================
StatusCode CopyTruthInfo::overlayInitialize()
{
return StatusCode::SUCCESS;
}
//================================================================
StatusCode CopyTruthInfo::overlayFinalize()
{
return StatusCode::SUCCESS;
}
//================================================================
StatusCode CopyTruthInfo::overlayExecute() {
MsgStream log(msgSvc(), name());
log << MSG::DEBUG << "CopyTruthInfo::execute() begin"<< endreq;
typedef std::vector<std::string> KeyList;
KeyList keys = m_storeGateData->keys<xAOD::JetContainer>();
for(KeyList::const_iterator k=keys.begin(); k!=keys.end(); ++k) {
std::auto_ptr<xAOD::JetContainer> ap(m_storeGateData->retrievePrivateCopy<xAOD::JetContainer>(*k));
log << MSG::DEBUG << "Working on p="<<ap.get()<<", key="<<*k << endreq;
if(!m_storeGateOutput->record(ap, *k).isSuccess()) {
log << MSG::WARNING << "Problem recording object p="<<ap.get()<<", key="<<*k << endreq;
}
}
keys = m_storeGateData->keys<xAOD::JetAuxContainer>();
for(KeyList::const_iterator k=keys.begin(); k!=keys.end(); ++k) {
std::auto_ptr<xAOD::JetAuxContainer> ap(m_storeGateData->retrievePrivateCopy<xAOD::JetAuxContainer>(*k));
log << MSG::DEBUG << "Working on p="<<ap.get()<<", key="<<*k << endreq;
if(!m_storeGateOutput->record(ap, *k).isSuccess()) {
log << MSG::WARNING << "Problem recording object p="<<ap.get()<<", key="<<*k << endreq;
}
}
log << MSG::DEBUG << "CopyObjects::execute() end"<< endreq;
return StatusCode::SUCCESS;
}
//================================================================
//EOF
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef OVERLAYCOMMONALGS_COPYTRUTHINFO_H
#define OVERLAYCOMMONALGS_COPYTRUTHINFO_H
#include <string>
#include "OverlayAlgBase/OverlayAlgBase.h"
class CopyTruthInfo : public OverlayAlgBase {
public:
CopyTruthInfo(const std::string &name,ISvcLocator *pSvcLocator);
virtual StatusCode overlayInitialize();
virtual StatusCode overlayExecute();
virtual StatusCode overlayFinalize();
};
#endif/*OVERLAYCOMMONALGS_COPYTRUTHINFO_H*/
......@@ -2,6 +2,7 @@
#include "../CopyMcEventCollection.h"
#include "../CopyObjects.h"
#include "../CopyTimings.h"
#include "../CopyTruthInfo.h"
#include "../SaveInDetObjects.h"
#include "../RemoveObjects.h"
#include "../UpdateEventInfo.h"
......@@ -14,6 +15,7 @@
DECLARE_ALGORITHM_FACTORY( CopyMcEventCollection )
DECLARE_ALGORITHM_FACTORY( CopyObjects )
DECLARE_ALGORITHM_FACTORY( CopyTimings )
DECLARE_ALGORITHM_FACTORY( CopyTruthInfo )
DECLARE_ALGORITHM_FACTORY( SaveInDetObjects )
DECLARE_ALGORITHM_FACTORY( RemoveObjects )
DECLARE_ALGORITHM_FACTORY( UpdateEventInfo )
......@@ -28,6 +30,7 @@ DECLARE_FACTORY_ENTRIES( OverlayCommonAlgs ) {
DECLARE_ALGORITHM( CopyMcEventCollection )
DECLARE_ALGORITHM( CopyObjects )
DECLARE_ALGORITHM( CopyTimings )
DECLARE_ALGORITHM( CopyTruthInfo )
DECLARE_ALGORITHM( SaveInDetObjects )
DECLARE_ALGORITHM( RemoveObjects )
DECLARE_ALGORITHM( UpdateEventInfo )
......
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