ATLAS Offline Software
TrigTrkPrecHypoTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <iterator>
6 #include <sstream>
7 
8 //
9 #include "TLorentzVector.h"
10 
11 #include "GaudiKernel/IToolSvc.h"
12 #include "GaudiKernel/StatusCode.h"
13 #include "GaudiKernel/ListItem.h"
14 //
15 
17 #include "CxxUtils/phihelper.h"
18 
20 
22 
23 #include "TrigTrkPrecHypoTool.h"
24 
25 //class ISvcLocator;
26 
27 using namespace TrigCompositeUtils;
28 
30  const std::string& name,
31  const IInterface* parent )
32  : base_class( type, name, parent ),
33  m_decisionId( HLT::Identifier::fromToolName( name ) )
34 {
35 }
36 
38 {
39 }
40 
42 {
43 
44  ATH_MSG_DEBUG( "in initialize()" );
45 
46  if ( !m_monTool.empty() ) CHECK( m_monTool.retrieve() );
47 
48  ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
49 
50  ATH_MSG_DEBUG( " REGTEST: Simple pass-trhough hypo, no selection is applied" );
51 
52 
53  ATH_MSG_DEBUG( "Initialization of TrigTrkPrecHypoTool completed successfully" );
54  return StatusCode::SUCCESS;
55 }
56 
58 
59  // Get the messaging service, print where you are
60  ATH_MSG_DEBUG( "REGTEST:"<< name() << ": in execute()" );
61 
62  bool pass = false;
63 
64  //get RoI descriptor
65  auto roiDescriptor = input.roi;
66  float roIEta = roiDescriptor->eta();
67  float roIPhi = roiDescriptor->phi();
68  float roIZ = roiDescriptor->zed();
69 
70  ATH_MSG_DEBUG( "Input RoI eta: " << roIEta << " Input RoI phi: " << roIPhi << " Input RoI z: " << roIZ);
71 
72  // get the tracks collection
73  // Retrieve Input TrackCollection
74  auto foundTracks = input.trackparticles;
75 
76  if(!foundTracks->empty()){
77  ATH_MSG_DEBUG( " Input track collection has size " << foundTracks->size() );
78  }
79 
80  pass = true;
81 
82  ATH_MSG_DEBUG( " REGTEST: TE accepted !! " );
83 
84  return pass;
85 }
86 
87 
88 StatusCode TrigTrkPrecHypoTool::decide( std::vector<TrackingInfo>& input ) const {
89 
90  for ( auto& i: input ) {
91  if ( passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) {
92  if ( decide( i ) ) {
93  addDecisionID( m_decisionId, i.decision );
94  }
95  }
96  }
97  return StatusCode::SUCCESS;
98 }
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
TrigTrkPrecHypoTool::initialize
virtual StatusCode initialize() override
Definition: TrigTrkPrecHypoTool.cxx:41
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:47
TrigTrkPrecHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigTrkPrecHypoTool.h:41
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition: TrigCompositeUtilsRoot.cxx:61
TrigTrkPrecHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigTrkPrecHypoTool.h:43
TrigTrkPrecHypoTool::~TrigTrkPrecHypoTool
virtual ~TrigTrkPrecHypoTool()
Definition: TrigTrkPrecHypoTool.cxx:37
TrigTrkPrecHypoTool::decide
virtual StatusCode decide(std::vector< ITrigTrkPrecHypoTool::TrackingInfo > &input) const override
TrigTrkPrecHypoTool.h
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
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
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
ITrigTrkPrecHypoTool::TrackingInfo
Definition: ITrigTrkPrecHypoTool.h:18
TrigTrkPrecHypoTool::TrigTrkPrecHypoTool
TrigTrkPrecHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigTrkPrecHypoTool.cxx:29
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
phihelper.h
Helper for azimuthal angle calculations.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
TrigRoiDescriptor.h
TrackParticleContainer.h