Skip to content
Snippets Groups Projects
Commit c0d96c8e authored by Jack Cranshaw's avatar Jack Cranshaw Committed by Walter Lampl
Browse files

Propagate boolean properties of input attribute list to output attribute

list.
parent 3c885243
No related branches found
No related tags found
No related merge requests found
Showing
with 792 additions and 4 deletions
......@@ -67,9 +67,15 @@ athenapoolmultitest_run_test( AthenaPoolMultiTestEventSplitDecision EventSplitDe
athenapoolmultitest_run_test( AthenaPoolMultiTestEventNoSplit EventNoSplit_jo
post_check_es
DEPENDS AthenaPoolMultiTestBuildInput )
athenapoolmultitest_run_test( AthenaPoolMultiTestPropagate DecisionPropagation_jo
post_check_p
DEPENDS AthenaPoolMultiTestEventSplitDecision )
athenapoolmultitest_run_test( AthenaPoolMultiTestStreamSelect CheckStreamSelector_jo
post_check_ss
DEPENDS AthenaPoolMultiTestEventNoSplit )
DEPENDS AthenaPoolMultiTestEventSplitDecision )
athenapoolmultitest_run_test( AthenaPoolMultiTestPropagateSelect CheckStreamPropagate_jo
post_check_ss
DEPENDS AthenaPoolMultiTestPropagate )
#athenapoolmultitest_run_test( AthenaPoolMultiTestCheckNull CheckNull_jo
# post_check_cn
# DEPENDS AthenaPoolMultiTestEventSplit )
......
Py:Athena INFO including file "AthenaPoolMultiTest/ExampleStreamConfig.py"
PoolSvc INFO Setting up APR FileCatalog and Streams
DecisionSvc INFO Inserting stream: StreamAllP with no Algs
OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
StreamAllP.Stre... INFO Initializing StreamAllP.StreamAllPTool - package version AthenaServices-00-00-00
StreamAllP.Stre... INFO Initializing StreamAllP.StreamAllP_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
StreamAllP INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAllP_MakeEventStreamInfo'])
StreamAllP INFO Data output: AthenaPoolMultiTest_Propagate.root
StreamAllP INFO I/O reinitialization...
StorageSvc INFO EventStreamInfo_p3 [11DF1B8C-0DEE-4687-80D7-E74B520ACBB4]
StreamAllP INFO Records written: 21
ItemListSvc DEBUG STREAM StreamAllP has (7) items
ItemListSvc DEBUG - EventStreamInfo_StreamAllP
## @file CheckExplicit_jo.py
## @brief TopOptions (but dependent SplittableData_jo.py, EventSplit_jo.py):
## Checks that the root collection is readable with the EventSelector
## @author Jack Cranshaw (Jack.Cranshaw@cern.ch)
## $Id: CheckExplicit_jo.py,v 1.9 2009-05-20 13:34:21 cranshaw Exp $
###############################################################
#
# Job options file
#
#==============================================================
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
from AthenaCommon.AlgSequence import AthSequencer
topSequence = AthSequencer("AthAlgSeq")
athRegSeq = AthSequencer("AthRegSeq")
from AthenaCommon.AppMgr import theApp
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
theApp.EvtMax = 200000
#--------------------------------------------------------------
# Load POOL support
#--------------------------------------------------------------
include( "AthenaPoolExampleConverter/AthenaPoolExampleConverter_jobOption.py" )
include( "AthenaPoolTestAthenaPool/AthenaPoolTestAthenaPool_joboptions.py" )
#--------------------------------------------------------------
#--- Read portion -----
#--------------------------------------------------------------
import AthenaPoolCnvSvc.ReadAthenaPool
from PoolSvc.PoolSvcConf import PoolSvc
svcMgr += PoolSvc()
PoolSvc = svcMgr.PoolSvc
PoolSvc.ReadCatalog = ["xmlcatalog_file:EventSplit.xml"]
EventSelector = svcMgr.EventSelector
EventSelector.InputCollections = [ "AthenaPoolMultiTest_Propagate.root" ];
# Include the StreamSelectorTool
from EventBookkeeperTools.EventBookkeeperToolsConf import StreamSelectorTool
# Select existing Stream1
selector1 = StreamSelectorTool("Selector1")
selector1.SelectedStream = "Stream1"
selector1.OutputLevel = DEBUG
svcMgr.EventSelector.HelperTools += [selector1]
# Select existing Stream1, but use a separate CutFlowSvc
# Create the CutFlowSvc instance(s)
from EventBookkeeperTools.EventBookkeeperToolsConf import CutFlowSvc
cfs = CfgMgr.CutFlowSvc("SS_CutFlowSvc")
svcMgr += cfs
cfs.InputStream = "StreamAll"
cfs.OutputCollName = "StreamSelect"
cfs.OutputIncompleteCollName = "IncompleteStreamSelect"
selector2 = StreamSelectorTool("Selector2")
selector2.SelectedStream = "Stream1"
selector2.CutFlowSvc = cfs
selector2.OutputLevel = DEBUG
svcMgr.EventSelector.HelperTools += [selector2]
# Select non-existing StreamX
selectorx = StreamSelectorTool("SelectorX")
selectorx.SelectedStream = "StreamX"
selectorx.OutputLevel = DEBUG
svcMgr.EventSelector.HelperTools += [selectorx]
#--------------------------------------------------------------
# Configure the filters
#--------------------------------------------------------------
from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__ReadData
topSequence += AthPoolEx__ReadData("ReadData")
#from AthenaPoolMultiTest.AthenaPoolMultiTestConf import EventTagReader
from AthenaPoolMultiTest.AthenaPoolMultiTestConf import *
#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
#--------------------------------------------------------------
svcMgr.MessageSvc.infoLimit = 5000
svcMgr.MessageSvc.debugLimit = 5000
svcMgr.MessageSvc.OutputLevel = INFO
#==============================================================
#
# End of job options file
#
###############################################################
#####################################################################
#
## @file EventSplitDecision_jo.py
## @brief
## Second part of AthenaPoolMultiTest gmake check
##<br><br>
## @author JackCranshaw (Jack.Cranshaw@cern.ch)
## $Id: EventNoSplit_jo.py,v 1.27 2009-05-20 13:34:21 cranshaw Exp $
#====================================================================
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
from AthenaCommon.AlgSequence import AthSequencer
topSequence = AthSequencer("AthAlgSeq")
athOutSeq = AthSequencer("AthOutSeq")
from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
alg = xAODMaker__EventInfoCnvAlg()
topSequence += alg
from AthenaCommon.AppMgr import theApp
theApp.EvtMax = 200000
#--------------------------------------------------------------
# Load POOL support
#--------------------------------------------------------------
import AthenaPoolCnvSvc.ReadAthenaPool
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from PoolSvc.PoolSvcConf import PoolSvc
svcMgr += PoolSvc()
PoolSvc = svcMgr.PoolSvc
PoolSvc.ReadCatalog = ["xmlcatalog_file:EventSplit.xml"]
svcMgr.EventSelector.InputCollections = ["AthenaPoolMultiTest_StreamAll2.root"]
svcMgr.AthenaPoolAddressProviderSvc.DataHeaderIterator = False
#--------------------------------------------------------------
# Private Application Configuration options
#--------------------------------------------------------------
# include stream transform
include( "AthenaPoolMultiTest/ExampleStreamConfig.py" )
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
# Unfiltered stream
StreamAll = AthenaPoolOutputStream( "StreamAllP", "AthenaPoolMultiTest_Propagate.root", False, noTag=False, decisionFilter="Stream" )
StreamAll.CheckNumberOfWrites = False
StreamAll.WritingTool.AttributeListKey="SimpleTag"
StreamAll.WritingTool.SaveDecisions = False
StreamAll.TakeItemsFromInput = True
StreamAll.ForceRead=TRUE
#EventInfoTagBuilder.FilterString = "Stream"
#EventInfoTagBuilder.PropagateInput=True
# Add the outputstreams to the execution sequence
#athOutSeq+=StreamAll
#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
#--------------------------------------------------------------
svcMgr.MessageSvc.OutputLevel = INFO
svcMgr.MessageSvc.debugLimit = 5000
import AthenaCommon.CfgMgr as CfgMgr
if not hasattr(svcMgr, 'DecisionSvc'): svcMgr += CfgMgr.DecisionSvc()
svcMgr.DecisionSvc.CalcStats = True
if not hasattr(svcMgr, 'ItemListSvc'): svcMgr += CfgMgr.ItemListSvc()
svcMgr.ItemListSvc.OutputLevel = DEBUG
#==============================================================
#
# End of job options file
#
###############################################################
......@@ -22,6 +22,7 @@ else
reflog=../share/${test}.ref
grep -e 'Splitter' \
-e 'Triggered' \
-e 'EventInfoTag' \
-e 'Stream' \
-e 'Coll' \
-e 'Others' \
......
#!/bin/sh
#/** @file post_check_es.sh
# @brief sh script that check the return code of an executable and compares
# its output with a reference (if available). Modified to restrict checks
# to output from AthenaPoolMultiTest EventSplit test.
# @param test_name
#
# @author Jack Cranshaw (Jack.Cranshaw@cern.ch), Paolo Calafiura.
# $Id: post_check_es.sh,v 1.6 2009-04-01 21:18:33 cranshaw Exp $
# **/
test=$1
status=${?}
if [ -z "$status" ]
then
echo " post_check_es.sh> Warning: athena exit status is not available "
else
# check exit status
joblog=${test}.log
if [ "$status" = 0 ]
then
#echo " post_check_es.sh> OK: ${test} exited normally. Output is in $joblog "
reflog=../share/${test}.ref
grep -e 'Splitter' \
-e 'Triggered' \
-e 'EventInfoTag' \
-e 'Stream' \
-e 'Coll' \
-e 'Others' \
-e 'Bad' \
-e 'ERROR' \
-e 'Error' \
${joblog} |
grep -v 'StreamAll2' |
grep -v 'RootDatabase.open' |
grep -v 'Handler' |
grep -v 'EventSelectorAthenaPool' |\
grep -v 'CLIDRegistry' |\
grep -v 'PassNumber' |\
grep -v 'POOLCollFactory' |\
grep -v 'PoolXMLFileCatalog' |\
grep -v 'AthenaSealSvc' |\
grep -v 'EventBookkeeper' |\
grep -v 'EventTagWriter' > ${joblog}.small
joblog=${joblog}.small
if [ -r $reflog ]
then
# echo " post_check_es.sh> Now comparing output with reference"
diff -a -b -B $joblog $reflog |\
# ignore diff annotations
egrep -a -v '^---|^[[:digit:]]+[acd,][[:digit:]]+' |\
# ignore hex addresses
egrep -a -v ' 0x\w{4,}' |\
# ignore package names e.g. Package-00-00-00
egrep -a -v '\w+-[[:digit:]]{2}-[[:digit:]]{2}-[[:digit:]]{2}' |\
# ignore cpu usage printouts
egrep -a -v 'ChronoStatSvc +INFO Time' |\
egrep -a -v 'Time left.+ Seconds' |\
egrep -a -v 'Timeleft.+ sec' |\
egrep -a -v 'INFO Time User' |\
egrep -a -v 'OutputStreamSequencerSvc' |\
# ignore clid db file name
grep -a -v 'from CLIDDB file' |\
# ignore slug machine printout
egrep -a -v ' Machine: .* System and Processor Info' |\
egrep -a -v ' Jobname = .* Machine =' |\
# ignore slug pid printout
grep -a -v 'Atlas Detector Simulation, Reconstruction and Analysis Running on' |\
egrep -a -v 'Program: Slug-Dice-Arecon .+ pid +[[:digit:]]+' |\
#ignore DllClassManager DEBUG messages
egrep -a -v 'DllClassManager DEBUG' |\
# ignore slug Library printout
egrep -a -v 'Library of +[[:digit:]]+ at +[[:digit:]]+' |\
egrep -a -v 'Library compiled on +[[:digit:]]' |\
# ignore ClassIDSvc "in memory db" printouts
egrep -a -v 'CLID: .* - type name:' |\
# ignore ClassIDSvc "already set" printouts
egrep -a -v 'ClassIDSvc .* setTypeNameForID: .* already set for' |\
# ignore ClassIDSvc finalize output
egrep -a -v 'ClassIDSvc * DEBUG finalize: wrote .*' |\
# ignore rcs version comments
egrep -a -v 'Id: .+ Exp \$' |\
# ignore listings
egrep -a -v 'athena.*listing' |\
# ignore ptr values for LArCell
egrep -a -v 'Found elem' |\
# ignore Dict issues
egrep -a -v 'Dict.so' |\
# ignore file mgr
egrep -a -v 'FileMgr' |\
# ignore file names
egrep -a -v 'Reading file' |\
# ignore root collect key
egrep -a -v 'NewEventCollection.root, recovered' |\
# ignore new file catalog messages
egrep -a -v 'registerPFN'
diffStatus=$?
if [ $diffStatus -ne 1 ]
then
echo " post_check_es.sh> ERROR: $joblog and $reflog differ "
exit 1
else
true
#echo " post_check_es.sh> OK: $joblog and $reflog identical "
fi
else
tail $joblog
echo " post_check_es.sh> WARNING: reference output $reflog not available "
echo " post_check_es.sh> Please check ${PWD}/$joblog"
exit 1
fi
else
tail $joblog
echo " post_check_es.sh> ERROR: Athena exited abnormally! Exit code: $status "
echo " post_check_es.sh> Please check ${PWD}/$joblog"
fi
fi
# Check output for ERROR/FATAL
joblog=${test}.log
#echo
exit $status
......@@ -14,7 +14,7 @@ from AthenaServices.AthenaServicesConf import AthenaOutputStream
from AthenaServices.AthenaServicesConf import AthenaOutputStreamTool
def createOutputStream( streamName, fileName = "", asAlg = False, noTag = False,
eventInfoKey = "EventInfo" ):
eventInfoKey = "EventInfo", decisionFilter="" ):
# define athena output stream
writingTool = AthenaOutputStreamTool( streamName + "Tool" )
outputStream = AthenaOutputStream(
......@@ -41,7 +41,7 @@ def createOutputStream( streamName, fileName = "", asAlg = False, noTag = False,
# build eventinfo attribute list
from .OutputStreamAthenaPoolConf import EventInfoAttListTool, EventInfoTagBuilder
svcMgr.ToolSvc += EventInfoAttListTool()
EventInfoTagBuilder = EventInfoTagBuilder(AttributeList=key, EventInfoKey=eventInfoKey)
EventInfoTagBuilder = EventInfoTagBuilder(AttributeList=key, EventInfoKey=eventInfoKey, FilterString=decisionFilter)
topSequence += EventInfoTagBuilder
# decide where to put outputstream in sequencing
......@@ -91,3 +91,4 @@ def createOutputConditionStream( streamName, fileName = "" ):
## backward compat
AthenaPoolOutputStream = createOutputStream
AthenaPoolOutputConditionStream = createOutputConditionStream
......@@ -30,7 +30,7 @@ Purpose : create a EventInfoAttList - The Tag information associated to the even
/** the constructor */
EventInfoAttListTool::EventInfoAttListTool (const std::string& type, const
std::string& name, const IInterface* parent) :
AthAlgTool( type, name, parent )
AthAlgTool( type, name, parent )
{
declareInterface<EventInfoAttListTool>( this );
}
......
......@@ -11,7 +11,10 @@ EventInfoTagBuilder::EventInfoTagBuilder( const std::string& name, ISvcLocator*
: AthAlgorithm(name, pSvcLocator),
m_tool("EventInfoAttListTool/EventInfoAttListTool",this) {
declareProperty("EventInfoKey", m_evtKey = "EventInfo");
declareProperty("InputList", m_inputAttList = "Input");
declareProperty("AttributeList", m_attributeListName);
declareProperty("PropagateInput", m_propInput = true);
declareProperty("FilterString", m_filter = "");
}
EventInfoTagBuilder::~EventInfoTagBuilder()
......@@ -24,6 +27,7 @@ StatusCode EventInfoTagBuilder::initialize() {
ATH_CHECK( m_evtKey.initialize() );
ATH_CHECK( m_attributeListName.initialize() );
ATH_CHECK( m_inputAttList.initialize() );
return StatusCode::SUCCESS;
}
......@@ -32,6 +36,7 @@ StatusCode EventInfoTagBuilder::initialize() {
StatusCode EventInfoTagBuilder::execute() {
ATH_MSG_DEBUG( "Executing " << name() );
SG::ReadHandle<xAOD::EventInfo> h_evt(m_evtKey);
/** create a EventInfo Tag and ask the tool to fill it */
......@@ -39,6 +44,30 @@ StatusCode EventInfoTagBuilder::execute() {
auto attribList = std::make_unique<AthenaAttributeList>
( m_tool->getAttributeList( *h_evt ) );
// Check whether to propagate
if (m_propInput) {
SG::ReadHandle<AthenaAttributeList> h_att(m_inputAttList);
// Check if there is an input to propagate
if (h_att.isValid()) {
for (auto it = h_att->specification().begin();
it!= h_att->specification().end(); ++it) {
// Only propagate bool properties
if (it->typeName()=="bool"&&!attribList->exists(it->name())) {
// Check if there is filtering on the name
if (m_filter != "") {
if (it->name().find(m_filter)!=std::string::npos) {
// Add those bools to the output attribute list
(*attribList).extend(it->name(),it->type());
(*attribList)[it->name()].data<bool>() = (*h_att)[it->name()].data<bool>();
}
}
} // take only bools
} // loop
} else { // valid input
ATH_MSG_INFO("No input attribute list");
}
} // propagate
/** record attribute list to SG */
SG::WriteHandle<AthenaAttributeList> wh(m_attributeListName);
ATH_CHECK( wh.record(std::move(attribList)) );
......
......@@ -54,7 +54,10 @@ private:
ToolHandle<EventInfoAttListTool> m_tool;
SG::ReadHandleKey<xAOD::EventInfo> m_evtKey;
SG::ReadHandleKey<AthenaAttributeList> m_inputAttList;
SG::WriteHandleKey<AthenaAttributeList> m_attributeListName;
bool m_propInput;
std::string m_filter;
};
......
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