Skip to content
Snippets Groups Projects
Commit dbaf5a32 authored by Tomasz Bold's avatar Tomasz Bold
Browse files

Added merging of decision objectso we ouptut one per RoI

parent 0279e079
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,7 @@ StatusCode EventViewCreatorAlgorithm::execute_r( const EventContext& context ) c
newDecision = outputDecisions.get()->back();
newDecision->setObjectLink( "seedEnd", ElementLink<TrigCompositeUtils::DecisionContainer>( inputHandle.key(), inputCounter ) );
insertDecisions( inputDecision, newDecision );
ATH_MSG_DEBUG("No need to create another output decision object, just adding decision IDs");
}
// search for existing view
......@@ -108,10 +109,8 @@ StatusCode EventViewCreatorAlgorithm::execute_r( const EventContext& context ) c
viewMap[roiDescriptor]=viewVector->size()-1;
ATH_MSG_DEBUG( "Adding new view to new decision; storing view in viewVector component " << viewVector->size()-1 );
ATH_CHECK( linkViewToParent( inputDecision, viewVector->back() ) );
ATH_CHECK( placeRoIInView( roiDescriptor, viewVector->back(), contexts.back() ) );
ATH_CHECK( placeRoIInView( roiDescriptor, viewVector->back(), contexts.back() ) );
}
}
......@@ -119,20 +118,17 @@ StatusCode EventViewCreatorAlgorithm::execute_r( const EventContext& context ) c
ATH_CHECK( outputHandles[outputIndex].record( std::move( outputDecisions ), std::move( decAux ) ) );
}
ATH_MSG_DEBUG( "Launching execution in " << viewVector->size() << " views" );
ATH_CHECK( ViewHelper::ScheduleViews( viewVector.get(), // Vector containing views
m_viewNodeName, // CF node to attach views to
context, // Source context
m_scheduler.get() ) );
// store views
auto viewsHandle = SG::makeHandle( m_viewsKey );
ATH_CHECK( viewsHandle.record( std::move( viewVector ) ) );
ATH_MSG_DEBUG( "Store "<< viewsHandle->size() <<" Views");
size_t validInputCount = countInputHandles( context );
size_t validOutputCount = 0;
for ( auto outHandle: outputHandles ) {
......@@ -145,9 +141,7 @@ StatusCode EventViewCreatorAlgorithm::execute_r( const EventContext& context ) c
ATH_MSG_ERROR("Found " << validInputCount << " inputs and " << validOutputCount << " outputs");
return StatusCode::FAILURE;
}
printDecisions( outputHandles );
printDecisions( outputHandles );
return StatusCode::SUCCESS;
}
......@@ -171,13 +165,13 @@ void EventViewCreatorAlgorithm::printDecisions( const std::vector<SG::WriteHandl
for ( auto outHandle: outputHandles ) {
if( not outHandle.isValid() ) continue;
ATH_MSG_DEBUG(outHandle.key() << " with " << outHandle->size() << " decisions:");
for ( auto outdecision: *outHandle ) {
for ( auto outDecision: *outHandle ) {
TrigCompositeUtils::DecisionIDContainer objDecisions;
TrigCompositeUtils::decisionIDs( outdecision, objDecisions );
TrigCompositeUtils::decisionIDs( outDecision, objDecisions );
ATH_MSG_DEBUG("Number of positive decisions for this output: " << objDecisions.size() );
for ( TrigCompositeUtils::DecisionID id : objDecisions ) {
for ( TrigCompositeUtils::DecisionID id : TrigCompositeUtils::decisionIDs(outDecision) ) {
ATH_MSG_DEBUG( " --- decision " << HLT::Identifier( id ) );
}
}
......@@ -186,8 +180,11 @@ void EventViewCreatorAlgorithm::printDecisions( const std::vector<SG::WriteHandl
void EventViewCreatorAlgorithm::insertDecisions( const TrigCompositeUtils::Decision* src, TrigCompositeUtils::Decision* dest ) const {
using namespace TrigCompositeUtils;
decisionIDs(dest).reserve( decisionIDs(dest).size() + decisionIDs(src).size() );
decisionIDs(dest).insert( decisionIDs(dest).end(), decisionIDs(src).begin(), decisionIDs(src).end() );
DecisionIDContainer ids;
decisionIDs( dest, ids );
decisionIDs( src, ids );
decisionIDs( dest ).clear();
decisionIDs(dest).insert( decisionIDs(dest).end(), ids.begin(), ids.end() );
}
StatusCode EventViewCreatorAlgorithm::linkViewToParent( const TrigCompositeUtils::Decision* inputDecision, SG::View* newView ) const {
......
......@@ -147,7 +147,6 @@ theElectronFex.OutputLevel=VERBOSE
filterCaloRoIsAlg = RoRSeqFilter("filterCaloRoIsAlg")
caloHypoDecisions = findAlgorithm(egammaCaloStep, "L2CaloHypo").HypoOutputDecisions
print "kkkk ", caloHypoDecisions
filterCaloRoIsAlg.Input = [caloHypoDecisions]
filterCaloRoIsAlg.Output = ["Filtered" + caloHypoDecisions]
filterCaloRoIsAlg.Chains = testChains
......@@ -184,6 +183,7 @@ theElectronHypo.HypoOutputDecisions = "ElectronL2Decisions"
theElectronHypo.Electrons = theElectronFex.ElectronsName
theElectronHypo.OutputLevel = VERBOSE
print 'kkk', theElectronHypo
theElectronHypo.HypoTools = [ TrigL2ElectronHypoToolFromName( c,c ) for c in testChains ]
......@@ -192,10 +192,36 @@ for t in theElectronHypo.HypoTools:
# topSequence += theElectronHypo
# InDetCacheCreatorTrigViews,
electronSequence = seqAND("electronSequence", eventAlgs + [l2ElectronViewsMaker, electronInViewAlgs, theElectronHypo ] )
egammaIDStep = stepSeq("egammaIDStep", filterCaloRoIsAlg, [ electronSequence ] )
filterL2ElectronRoIsAlg = RoRSeqFilter("filterL2ElectronRoIsAlg")
electronHypoDecisions = findAlgorithm(egammaIDStep, "TrigL2ElectronHypoAlgMT").HypoOutputDecisions
filterL2ElectronRoIsAlg.Input = [electronHypoDecisions]
filterL2ElectronRoIsAlg.Output = ["Filtered" + electronHypoDecisions]
filterL2ElectronRoIsAlg.Chains = testChains
filterL2ElectronRoIsAlg.OutputLevel = DEBUG
efClusterViewsMaker = EventViewCreatorAlgorithm("efClusterViewsMaker", OutputLevel=DEBUG)
efClusterViewsMaker.InputMakerInputDecisions = [ filterL2ElectronRoIsAlg.Output[0] ] # output of L2CaloHypo
efClusterViewsMaker.RoIsLink = "roi" # -||-
efClusterViewsMaker.InViewRoIs = "CaloRoIs" # contract with the fastCalo
efClusterViewsMaker.Views = "EFCaloViews"
efClusterViewsMaker.ViewFallThrough = True
efClusterViewsMaker.InputMakerOutputDecisions = ["EFClusterLinks"]
efClusterSequence = seqAND("efClusterSequence", [efClusterViewsMaker] )
egammaEFCaloStep = stepSeq("egammaEFCalotep", filterL2ElectronRoIsAlg, [ efClusterSequence ] )
# CF construction
from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg
......@@ -208,6 +234,7 @@ summaryStep0.OutputLevel = DEBUG
step0 = parOR("step0", [ egammaCaloStep, summaryStep0 ] )
step1 = parOR("step1", [ egammaIDStep ] )
step2 = parOR("step2", [ egammaEFCaloStep ] )
egammaCaloStepRR = createFastCaloSequence( rerun=True )
......@@ -246,10 +273,11 @@ summary.OutputLevel = DEBUG
step0filter = parOR("step0filter", [ findAlgorithm( egammaCaloStep, "filterL1RoIsAlg") ] )
step1filter = parOR("step1filter", [ findAlgorithm(egammaIDStep, "filterCaloRoIsAlg") ] )
step2filter = parOR("step2filter", [ findAlgorithm(egammaEFCaloStep, "filterL2ElectronRoIsAlg") ] )
step0rfilter = parOR("step0rfilter", [ findAlgorithm(egammaCaloStepRR, "Rerurn_filterL1RoIsAlg") ] )
steps = seqAND("HLTSteps", [ step0filter, step0, step1filter, step1, step0rfilter, step0r ] )
steps = seqAND("HLTSteps", [ step0filter, step0, step1filter, step1, step2filter, step2, step0rfilter, step0r ] )
from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT, DecisionCollectorTool
mon = TrigSignatureMoniMT()
......
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