ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTRTHTHhypoTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9namespace TCU = TrigCompositeUtils;
10
12 const std::string& name,
13 const IInterface* parent )
14 : base_class( type, name, parent ),
15 m_decisionId( HLT::Identifier::fromToolName( name ) )
16{}
17
19
20 ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
21
22 return StatusCode::SUCCESS;
23}
24
26
27 bool pass = false;
28
29 auto fHT_road = Monitored::Scalar( "HTRatioRoad", -1. );
30 auto fHT_wedge = Monitored::Scalar( "HTRatioWedge", -1. );
31 auto trththits_road = Monitored::Scalar( "TRTHTHitsRoad" , -1.0 );
32 auto trththits_wedge = Monitored::Scalar( "TRTHTHitsWedge", -1.0 );
33 auto monitorIt = Monitored::Group( m_monTool, fHT_road, fHT_wedge, trththits_road, trththits_wedge);
34
35 if( m_acceptAll ){
36 pass=true;
37 ATH_MSG_DEBUG ( "Accepting all events in " << name());
38 return pass;
39 }
40
41 auto rnn = input.rnnOutput;
42 std::vector<float> vec = rnn->rnnDecision();
43
44 if (vec.size()!=6){
45 pass = true;
46 return pass;
47 }
48
49 //Parse the vector to assign fHT and nHT appropriately
50
51 fHT_road = vec.at(1);
52 fHT_wedge = vec.at(3);
53 trththits_road = vec.at(0);
54 trththits_wedge = vec.at(2);
55
56 ATH_MSG_DEBUG ( "trththits_road: " << trththits_road);
57 ATH_MSG_DEBUG ("m_minTRTHTHitsRoad in hypotool: "<<m_minTRTHTHitsRoad);
58 ATH_MSG_DEBUG ( "trththits_wedge: " << trththits_wedge);
59 ATH_MSG_DEBUG ("m_minTRTHTHitsWedge in hypotool:: "<< m_minTRTHTHitsWedge);
60 ATH_MSG_DEBUG ( "fHT_road: " << fHT_road);
61 ATH_MSG_DEBUG ("m_minHTratioRoad in hypotool: "<<m_minHTratioRoad);
62 ATH_MSG_DEBUG ( "fHT_wedge: " << fHT_wedge);
63 ATH_MSG_DEBUG ("m_minHTratioWedge in hypotool: "<<m_minHTratioWedge);
64
65 //Apply the cuts
66
67 if (fHT_road > m_minHTratioRoad && trththits_road > m_minTRTHTHitsRoad && m_doRoad) pass = true;
68
69 if (fHT_wedge > m_minHTratioWedge && trththits_wedge > m_minTRTHTHitsWedge && m_doWedge) pass = true;
70
71 ATH_MSG_DEBUG ( name() << " hypo result " << pass);
72
73 return pass;
74
75}
76
77
78StatusCode TrigTRTHTHhypoTool::decide( std::vector<RNNOutputInfo>& input ) const {
79 for ( auto& i: input ) {
80 if ( TCU::passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) {
81 if ( decide( i ) ) {
82 TCU::addDecisionID( m_decisionId, i.decision );
83 }
84 }
85 }
86 return StatusCode::SUCCESS;
87}
88
#define ATH_MSG_DEBUG(x)
std::vector< size_t > vec
Header file to be included by clients of the Monitored infrastructure.
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
HLT::Identifier m_decisionId
Gaudi::Property< float > m_minHTratioRoad
ToolHandle< GenericMonitoringTool > m_monTool
virtual StatusCode decide(std::vector< ITrigTRTHTHhypoTool::RNNOutputInfo > &input) const override
Gaudi::Property< bool > m_doWedge
TrigTRTHTHhypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< unsigned int > m_minTRTHTHitsRoad
Gaudi::Property< bool > m_doRoad
Gaudi::Property< unsigned int > m_minTRTHTHitsWedge
Gaudi::Property< float > m_minHTratioWedge
virtual StatusCode initialize() override
Gaudi::Property< bool > m_acceptAll
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.