ATLAS Offline Software
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 
14 namespace 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 
59 StatusCode 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 }
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
TrigCompositeUtils.h
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:47
TrigEgammaForwardPrecisionElectronHypoTool::initialize
virtual StatusCode initialize() override
Definition: TrigEgammaForwardPrecisionElectronHypoTool.cxx:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition: TrigCompositeUtilsRoot.cxx:61
ITrigEgammaForwardPrecisionElectronHypoTool::ElectronInfo
Definition: ITrigEgammaForwardPrecisionElectronHypoTool.h:25
TrigEgammaForwardPrecisionElectronHypoTool::decide
virtual StatusCode decide(std::vector< ITrigEgammaForwardPrecisionElectronHypoTool::ElectronInfo > &input) const override
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigEgammaForwardPrecisionElectronHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigEgammaForwardPrecisionElectronHypoTool.h:31
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TrigEgammaForwardPrecisionElectronHypoTool::TrigEgammaForwardPrecisionElectronHypoTool
TrigEgammaForwardPrecisionElectronHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigEgammaForwardPrecisionElectronHypoTool.cxx:16
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigEgammaForwardPrecisionElectronHypoTool::findCutIndex
int findCutIndex(float eta) const
Definition: TrigEgammaForwardPrecisionElectronHypoTool.cxx:49
TrigEgammaForwardPrecisionElectronHypoTool::m_etabin
Gaudi::Property< std::vector< float > > m_etabin
selection variable for PRECISION electron selection:eta bins
Definition: TrigEgammaForwardPrecisionElectronHypoTool.h:33
Combinators.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HLTIdentifier.h
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:232
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
TrigRoiDescriptor.h
Electron.h
TrigEgammaForwardPrecisionElectronHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigEgammaForwardPrecisionElectronHypoTool.h:35
TrigEgammaForwardPrecisionElectronHypoTool.h