ATLAS Offline Software
TrigTrackPreSelHypoTool.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 #include "xAODJet/Jet.h"
21 #include "xAODJet/JetContainer.h"
24 
26 
27 #include "TrkTrack/Track.h"
29 
31 
33 
34 //class ISvcLocator;
35 
36 using namespace TrigCompositeUtils;
37 
39  const std::string& name,
40  const IInterface* parent )
41  : base_class( type, name, parent ),
42  m_decisionId( HLT::Identifier::fromToolName( name ) )
43 {
44 }
45 
47 {
48 }
49 
51 {
52 
53  ATH_MSG_DEBUG( "in initialize()" );
54 
55  if ( !m_monTool.empty() ) CHECK( m_monTool.retrieve() );
56 
57  ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
58 
59  ATH_MSG_DEBUG( " REGTEST: Simple pass-trhough hypo, no selection is applied" );
60 
61  ATH_MSG_DEBUG( "Initialization of TrigTrackPreSelHypoTool completed successfully" );
62  return StatusCode::SUCCESS;
63 }
64 
66 
67  // Get the messaging service, print where you are
68  ATH_MSG_DEBUG( "REGTEST:"<< name() << ": in execute()" );
69 
70  bool pass = false;
71 
72  //get RoI descriptor
73  auto roiDescriptor = input.roi;
74  float roIEta = roiDescriptor->eta();
75  float roIPhi = roiDescriptor->phi();
76  float roIZ = roiDescriptor->zed();
77 
78  ATH_MSG_DEBUG( "Input RoI eta: " << roIEta << " Input RoI phi: " << roIPhi << " Input RoI z: " << roIZ);
79 
80  // get the tracks collection
81  // Retrieve Input TrackCollection
82  auto foundTracks = input.trackcollection;
83 
84  if(!foundTracks->empty()){
85  ATH_MSG_DEBUG( " Input track collection has size " << foundTracks->size() );
86  }
87 
88  pass = true;
89 
90  ATH_MSG_DEBUG( " REGTEST: TE accepted !! " );
91 
92  return pass;
93 
94 }
95 
96 StatusCode TrigTrackPreSelHypoTool::decide( std::vector<TrackingInfo>& input ) const {
97 
98  for ( auto& i: input ) {
99  if ( passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) {
100  if ( decide( i ) ) {
101  addDecisionID( m_decisionId, i.decision );
102  }
103  }
104  }
105  return StatusCode::SUCCESS;
106 }
Jet.h
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
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:47
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition: TrigCompositeUtilsRoot.cxx:61
TrigTrackPreSelHypoTool.h
TrigTrackPreSelHypoTool::initialize
virtual StatusCode initialize() override
Definition: TrigTrackPreSelHypoTool.cxx:50
TrigPassBits.h
Track.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
CaloCluster.h
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
TrackCollection.h
ITrigTrackPreSelHypoTool::TrackingInfo
Definition: ITrigTrackPreSelHypoTool.h:18
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
TauJetContainer.h
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.
TrigTrackPreSelHypoTool::TrigTrackPreSelHypoTool
TrigTrackPreSelHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigTrackPreSelHypoTool.cxx:38
TrigTrackPreSelHypoTool::~TrigTrackPreSelHypoTool
virtual ~TrigTrackPreSelHypoTool()
Definition: TrigTrackPreSelHypoTool.cxx:46
TrigTrackPreSelHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigTrackPreSelHypoTool.h:43
TrigTrackPreSelHypoTool::decide
virtual StatusCode decide(std::vector< ITrigTrackPreSelHypoTool::TrackingInfo > &input) const override
JetContainer.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloClusterContainer.h
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
TrigRoiDescriptor.h
TrigTrackPreSelHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigTrackPreSelHypoTool.h:41