ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaForwardPrecisionElectronHypoTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <algorithm>
11#include "xAODEgamma/Electron.h"
13
14namespace TCU = TrigCompositeUtils;
15
17 const std::string& name,
18 const IInterface* parent )
19 : base_class( type, name, parent ),
20 m_decisionId( HLT::Identifier::fromToolName( name ) ) {
21}
22
23
25{
26 ATH_MSG_DEBUG( "Initialization completed successfully" );
27
28 ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
29
30 if ( not m_monTool.name().empty() )
31 CHECK( m_monTool.retrieve() );
32
33 return StatusCode::SUCCESS;
34}
35
36
38
39 bool pass = true;
40
41 // Reach this point successfully
42 ATH_MSG_DEBUG( "pass = " << pass );
43
44 return pass;
45}
46
47
48
50 const float absEta = std::abs(eta);
51 auto binIterator = std::adjacent_find( m_etabin.begin(), m_etabin.end(), [=](float left, float right){ return left < absEta and absEta < right; } );
52 if ( binIterator == m_etabin.end() ) {
53 return -1;
54 }
55 return binIterator - m_etabin.begin();
56}
57
58
59StatusCode TrigEgammaForwardPrecisionElectronHypoTool::decide( std::vector<ElectronInfo>& input) const {
60 for ( auto& i: input ) {
61 if ( TCU::passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) {
62 if ( decide( i ) ) {
63 TCU::addDecisionID( m_decisionId, i.decision );
64 }
65 }
66 }
67 return StatusCode::SUCCESS;
68}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Header file to be included by clients of the Monitored infrastructure.
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Gaudi::Property< std::vector< float > > m_etabin
selection variable for PRECISION electron selection:eta bins
TrigEgammaForwardPrecisionElectronHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode decide(std::vector< ITrigEgammaForwardPrecisionElectronHypoTool::ElectronInfo > &input) const override
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.