15 ISvcLocator* pSvcLocator ) :
31 return StatusCode::SUCCESS;
39 ATH_MSG_DEBUG(
"StatusCode TrigMuonEFIdtpHypoAlg::execute start");
43 ATH_CHECK( previousDecisionsHandle.isValid() );
44 ATH_MSG_DEBUG(
"Running with "<< previousDecisionsHandle->size() <<
" previous decisions");
48 auto decisions = outputHandle.
ptr();
50 std::vector<TrigMuonEFIdtpHypoTool::MuonEFIdperfInfo> toolInput;
54 for (
const auto previousDecision: *previousDecisionsHandle ) {
65 if( ptTrkHandle->size()==0 ) {
71 if( ftfTrkHandle->size()==0 ) {
80 auto muonSALink = prevMuInfo.at(0).link;
83 if( muonSA->
muonType() != xAOD::Muon::MuonType::MuonStandAlone ) {
84 ATH_MSG_VERBOSE(
"previous decision muon is not SA, skipping this decision");
93 std::vector<ElementLink<xAOD::TrackParticleContainer>> thePTTrackLinks;
97 if (idtrack->pt()< 1*Gaudi::Units::GeV )
continue;
101 thePTTrack = idtrack;
104 if( thePTTrack !=
nullptr ) {
107 thePTTrackLinks.push_back(idtrackLink);
108 ATH_MSG_VERBOSE(
"... best selected PT track pt / eta / phi / dr = " << thePTTrack->
pt()/Gaudi::Units::GeV <<
" / " << thePTTrack->
eta() <<
" / " << thePTTrack->
phi() <<
" / " << dRmin <<
", fitter=" << thePTTrack->
trackFitter());
114 std::vector<ElementLink<xAOD::TrackParticleContainer>> theFTFTrackLinks;
118 if (idtrack->pt()< 1*Gaudi::Units::GeV )
continue;
122 theFTFTrack = idtrack;
125 if( theFTFTrack !=
nullptr ) {
128 theFTFTrackLinks.push_back(idtrackLink);
129 ATH_MSG_VERBOSE(
"... best selected FTF track pt / eta / phi / dr = " << theFTFTrack->
pt()/Gaudi::Units::GeV <<
" / " << theFTFTrack->
eta() <<
" / " << theFTFTrack->
phi() <<
" / " << dRmin <<
", fitter=" << theFTFTrack->
trackFitter());
136 toolInput.emplace_back( newd, muonSA, thePTTrack, theFTFTrack, previousDecision );
139 newd -> addObjectCollectionLinks(
m_PTTracksKey.key(), thePTTrackLinks );
140 newd -> addObjectCollectionLinks(
m_FTFTracksKey.key(), theFTFTrackLinks );
141 ATH_MSG_VERBOSE(
"Setting object link for PT / FTF track: size="<<thePTTrackLinks.size()<<
" / "<<theFTFTrackLinks.size());
145 ATH_MSG_DEBUG(
"Found "<<toolInput.size()<<
" inputs to tools");
148 StatusCode
sc = StatusCode::SUCCESS;
151 sc = tool->decide(toolInput);
152 if (!
sc.isSuccess()) {
154 return StatusCode::FAILURE;
160 ATH_MSG_DEBUG(
"StatusCode TrigMuonEFIdtpHypoAlg::execute success");
161 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
DataVector< SG::View > ViewContainer
View container for recording in StoreGate.
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput() const
methods for derived classes to access handles of the base class input other read/write handles may be...
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput() const
methods for derived classes to access handles of the base class output other read/write handles may b...
StatusCode hypoBaseOutputProcessing(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
Base class function to be called once slice specific code has finished. Handles debug printing and va...
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
size_t index() const
Return the index of this element within its container.
pointer_type ptr()
Dereference the pointer.
TrigMuonEFIdtpHypoAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &context) const override
ToolHandleArray< TrigMuonEFIdtpHypoTool > m_hypoTools
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_PTTracksKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_FTFTracksKey
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual double pt() const
The transverse momentum ( ) of the particle.
MuonType muonType() const
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be NULL) to the TrackParticle used in identification of this muon.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
TrackFitter trackFitter() const
Returns the fitter.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const std::string & viewString()
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
const std::string & featureString()
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
void findLinks(const Decision *start, const std::string &linkName, std::vector< LinkInfo< T > > &links, unsigned int behaviour=TrigDefs::allFeaturesOfType, std::set< const xAOD::TrigComposite * > *fullyExploredFrom=nullptr)
search back the TC links for the object of type T linked to the one of TC (recursively) Populates pro...
const std::string & hypoAlgNodeName()
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
float matchingMetric(const xAOD::TrackParticle *metrack, const xAOD::TrackParticle *idtrack)
auto makeHandle(const SG::View *view, const KEY &key, const EventContext &ctx)
Create a view handle from a handle key.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Muon_v1 Muon
Reference the current persistent version: