ATLAS Offline Software
Loading...
Searching...
No Matches
TrigJetHypoTool Class Reference

#include <TrigJetHypoTool.h>

Inheritance diagram for TrigJetHypoTool:
Collaboration diagram for TrigJetHypoTool:

Public Types

using JetDecision = std::pair<const xAOD::Jet*,TrigCompositeUtils::Decision*>

Public Member Functions

 TrigJetHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
 ~TrigJetHypoTool ()
StatusCode initialize ()
StatusCode finalize ()
StatusCode decide (const xAOD::JetContainer *jets, const TrigCompositeUtils::DecisionIDContainer &previousDecisionIDs, std::vector< JetDecision > &jetHypoInputs) const
const HLT::IdentifiergetID (std::size_t) const
const std::vector< HLT::Identifier > & getIDs () const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode checkPassingJets (const xAODJetCollector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const
StatusCode reportPassingJets (const xAODJetCollector &, const std::vector< JetDecision > &jetHypoInputs) const
StatusCode reportLeg (const std::vector< const xAOD::Jet * > &jets, const std::vector< JetDecision > &jetHypoInputs, int legInd) const
bool inputJetParticipates (const std::vector< const xAOD::Jet * > &jets, const JetDecision &pair) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

HLT::Identifier m_decisionID
std::vector< HLT::Identifierm_decisionIDs {}
ToolHandle< ITrigJetHypoToolHelperm_helper
Gaudi::Property< std::size_t > m_startLabelIndex
Gaudi::Property< std::size_t > m_endLabelIndex
Gaudi::Property< bool > m_visitDebug
Gaudi::Property< std::string > m_chainName
std::atomic< size_t > m_id = 0
ToolHandle< GenericMonitoringToolm_monTool {this,"MonTool","","Monitoring tool"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 29 of file TrigJetHypoTool.h.

Member Typedef Documentation

◆ JetDecision

Definition at line 42 of file TrigJetHypoTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrigJetHypoTool()

TrigJetHypoTool::TrigJetHypoTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 37 of file TrigJetHypoTool.cxx.

39 :
40 AthAlgTool(type, name, parent),
42{
43}
AthAlgTool()
Default constructor:
static HLT::Identifier fromToolName(const std::string &tname)
HLT::Identifier m_decisionID

◆ ~TrigJetHypoTool()

TrigJetHypoTool::~TrigJetHypoTool ( )

Definition at line 46 of file TrigJetHypoTool.cxx.

46 {
47}

Member Function Documentation

◆ checkPassingJets()

StatusCode TrigJetHypoTool::checkPassingJets ( const xAODJetCollector & jetCollector,
const std::unique_ptr< ITrigJetHypoInfoCollector > & infocollector ) const
private

Definition at line 269 of file TrigJetHypoTool.cxx.

270 {
271
272 if (jetCollector.empty()) {
273 ATH_MSG_ERROR("HypoTool passed the event for " <<
274 m_chainName << " ev " << m_id <<
275 ", but did not specify which jets participated");
276 return StatusCode::FAILURE;
277 }
278
279 auto legIndices = jetCollector.legInds();
280 if (!(legIndices.size() == (m_endLabelIndex - m_startLabelIndex))) {
281 ATH_MSG_ERROR("inconsistent number of leg indices");
282 return StatusCode::FAILURE;
283 }
284
285 ATH_MSG_DEBUG("check passing jets? does it work?");
286 ATH_MSG_DEBUG("There are some indices: " << legIndices.size());
287 for(size_t i = 0; i < legIndices.size(); i ++){
288 ATH_MSG_DEBUG(" -- leg " << i << " has index " << legIndices.at(i));
289 }
290
291 // jet hypo inputs:
292 // pairs of const xAOD::Jet* (first) and mutable Decision* (second)
293
294 auto participating_jets = jetCollector.xAODJets();
295 if (infocollector) {
296 infocollector->
297 collect(name(),
298 "no of xAODJets " + std::to_string(participating_jets.size()));
299
300 auto legInds = jetCollector.legInds();
301 std::stringstream ss;
302
303 for(const auto& label : legInds){
304 auto jets = jetCollector.xAODJets(label);
305 ss << label << " [\n";
306 for(const auto& j : jets){
308 }
309 ss << "]\n";
310 }
311 infocollector->collect(name(), ss.str());
312 }
313
314 return StatusCode::SUCCESS;
315}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t ss
virtual void collect(const std::string &, const std::string &)=0
std::atomic< size_t > m_id
Gaudi::Property< std::size_t > m_endLabelIndex
Gaudi::Property< std::string > m_chainName
Gaudi::Property< std::size_t > m_startLabelIndex
std::vector< const xAOD::Jet * > xAODJets() const
std::vector< int > legInds() const
std::string label(const std::string &format, int i)
Definition label.h:19
void collect(const HLT::TriggerElement *te, std::vector< Trig::Feature< T > > &data, const std::string &label, unsigned int condition, const std::string &teName, const HLT::TrigNavStructure *navstructure)
actual feature acceess implementation It has (thanks to the ClassTraits) functionality to flatten con...

◆ decide()

StatusCode TrigJetHypoTool::decide ( const xAOD::JetContainer * jets,
const TrigCompositeUtils::DecisionIDContainer & previousDecisionIDs,
std::vector< JetDecision > & jetHypoInputs ) const

Definition at line 100 of file TrigJetHypoTool.cxx.

102 {
103
104 // need only check against the decision ID corresponding to the name
105 // of this hypo. Leg indices are irrelevant at this point.
107 previousDecisionIDs)) {
108 return StatusCode::SUCCESS;
109 }
110
111 std::unique_ptr<ITrigJetHypoInfoCollector> infocollector(nullptr);
112 std::unique_ptr<ITrigJetHypoInfoCollector> jetdumper(nullptr);
113 if(m_visitDebug){
114 auto collectorName = name() + "_" + std::to_string(m_id++);
115 infocollector.reset(new DebugInfoCollector(collectorName));
116 auto jetdumperName =
117 name()+"_passingjets_" + std::to_string(m_id++);
118 jetdumper.reset(new DebugInfoCollector(jetdumperName));
119 }
120
121
122 HypoJetVector hypoJets(jets->size());
123
124 std::transform(jets -> begin(),
125 jets -> end(),
126 hypoJets.begin(),
127 xAODJetAsIJetFactory());
128
129 /* apply cleaning and hypothesis alg */
130 ATH_MSG_DEBUG("hypo helper start... "
131 << " no of jets ... "
132 << jets->size()
133 << "...");
134
135 // steady_clock::time_point t = steady_clock::now();
136 // monitoring -- timing plots (filled for every call)
137 auto mon_NInputs = Monitored::Scalar("NJetsIn",jets->size());
138 auto mon_NOutputs = Monitored::Scalar("NJetsOut",-1);
139 auto tHypo = Monitored::Timer<std::chrono::milliseconds>("TIME_jetHypo");
140 auto monitor_group_multTime = Monitored::Group( m_monTool, tHypo, mon_NOutputs, mon_NInputs);
141
142 xAODJetCollector jetCollector;
143 bool pass;
144 try{
145 pass = m_helper->pass(hypoJets, jetCollector, infocollector);
146 } catch(std::exception& e){
147 ATH_MSG_ERROR("Exception raised by the TrigJetHypoToolHelper: "
148 << e.what());
149 return StatusCode::FAILURE;
150 }
151 tHypo.stop();
152
153 if (!pass) {
154
155 if (infocollector){
156
157 std::string msg =
158 "hypo testing done: no of input jets " + std::to_string(jets->size())
159 + " no of participating jets " + std::to_string(jetCollector.size())
160 + " pass: false ";
161
162 infocollector->collect("TrigJetHypoTool", msg);
163 }
164
165 return StatusCode::SUCCESS;
166 }
167
168 CHECK(checkPassingJets(jetCollector, infocollector));
169 CHECK(reportPassingJets(jetCollector, jetHypoInputs));
170
171 // accumulateTime(steady_clock::now() - t);
172
173
174 if (infocollector){
175
176 std::string msg =
177 "hypo testing done: no of input jets " + std::to_string(jets->size())
178 + " no of particlating jets " + std::to_string(jetCollector.size())
179 + " pass: true";
180
181
182 infocollector->collect("TrigJetHypoTool", msg);
183 infocollector->write();
184
185 std::stringstream ss;
186 ss << jetCollector.hypoJets();
187 jetdumper->collect("passed", ss.str());
188 }
189
190 //monitoring -- filled in passing events
191 HypoJetVector hjv = jetCollector.hypoJets();
192
193 mon_NOutputs = hjv.size();
194 for(const auto& j : hjv) {
195 auto mon_jetEt = Monitored::Scalar("Et", j->et()*0.001);
196 auto mon_jetEta = Monitored::Scalar("Eta", j->eta());
197 auto mon_jetPhi = Monitored::Scalar("Phi", j->phi());
198 auto mon_jetMass = Monitored::Scalar("Mass", j->m()*0.001);
199 float this_z = 999;
200 float this_negLogSigma2 = 999;
201 j->getAttribute("dipz20231122_z", this_z);
202 j->getAttribute("dipz20231122_negLogSigma2", this_negLogSigma2);
203 auto mon_dipz_z = Monitored::Scalar( "dipz_z", this_z);
204 auto mon_dipz_negLogSigma2 = Monitored::Scalar( "dipz_negLogSigma2", this_negLogSigma2);
205 float this_GN2X_phbb{999.}, this_GN2X_phcc{999.}, this_GN2X_pqcd{999.}, this_GN2X_ptop{999.};
206 j->getAttribute("GN2Xv01_phbb", this_GN2X_phbb);
207 j->getAttribute("GN2Xv01_phcc", this_GN2X_phcc);
208 j->getAttribute("GN2Xv01_ptop", this_GN2X_ptop);
209 j->getAttribute("GN2Xv01_pqcd", this_GN2X_pqcd);
210 auto mon_GN2X_phbb = Monitored::Scalar("GN2Xv01_phbb", this_GN2X_phbb);
211 auto mon_GN2X_phcc = Monitored::Scalar("GN2Xv01_phcc", this_GN2X_phcc);
212 auto mon_GN2X_ptop = Monitored::Scalar("GN2Xv01_ptop", this_GN2X_ptop);
213 auto mon_GN2X_pqcd = Monitored::Scalar("GN2Xv01_pqcd", this_GN2X_pqcd);
214 float this_GN2X_discriminant{999.};
215 if (this_GN2X_phbb > 0.){
216 float top_frac{0.25};
217 float denom = this_GN2X_pqcd*(1. - top_frac) + this_GN2X_ptop * top_frac;
218 if (denom > 0.){
219 this_GN2X_discriminant = log(this_GN2X_phbb/denom);
220 }
221 }
222 auto mon_GN2X_discriminant = Monitored::Scalar("GN2Xv01_discriminant", this_GN2X_discriminant);
223
224 float this_GN2XTrig_phbb{999.}, this_GN2XTrig_pqcd{999.}, this_GN2XTrig_ptop{999.};
225 j->getAttribute("GN2XTrig_phbb", this_GN2XTrig_phbb);
226 j->getAttribute("GN2XTrig_ptop", this_GN2XTrig_ptop);
227 j->getAttribute("GN2XTrig_pqcd", this_GN2XTrig_pqcd);
228 auto mon_GN2XTrig_phbb = Monitored::Scalar("GN2XTrig_phbb", this_GN2XTrig_phbb);
229 auto mon_GN2XTrig_ptop = Monitored::Scalar("GN2XTrig_ptop", this_GN2XTrig_ptop);
230 auto mon_GN2XTrig_pqcd = Monitored::Scalar("GN2XTrig_pqcd", this_GN2XTrig_pqcd);
231 float this_GN2XTrig_discriminant{999.};
232 if (this_GN2XTrig_phbb > 0.){
233 float top_frac{0.25};
234 float denom = this_GN2XTrig_pqcd*(1. - top_frac) + this_GN2XTrig_ptop * top_frac;
235 if (denom > 0.){
236 this_GN2XTrig_discriminant = log(this_GN2XTrig_phbb/denom);
237 }
238 }
239 auto mon_GN2XTrig_discriminant = Monitored::Scalar("GN2XTrig_discriminant", this_GN2XTrig_discriminant);
240
241 auto monitor_group_passingjets = Monitored::Group( m_monTool, mon_jetEt, mon_jetEta, mon_jetPhi , mon_dipz_z, mon_dipz_negLogSigma2, mon_jetMass, mon_GN2X_phbb, mon_GN2X_phcc, mon_GN2X_ptop, mon_GN2X_pqcd, mon_GN2X_discriminant, mon_GN2XTrig_phbb, mon_GN2XTrig_ptop, mon_GN2XTrig_pqcd, mon_GN2XTrig_discriminant);
242
243 }
244 //monitor the passing jets for each leg (there should only be one per chain!)
245 auto legInds = jetCollector.legInds();
246 for (const auto& label : legInds) {
247 auto jets = jetCollector.hypoJets(label);
248 auto monitor_nJt = Monitored::Scalar( "NJets", jets.size());
249 auto htsum = Monitored::Scalar("HT", std::accumulate(jets.begin(), jets.end(),0.0,
250 [](double sum, const HypoJetVector::value_type jptr){return sum + jptr->et()*0.001;} ));
251 auto monitor_group_passinght = Monitored::Group(m_monTool, monitor_nJt,htsum);
252 }
253
254 return StatusCode::SUCCESS;
255}
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
MsgStream & msg() const
StatusCode checkPassingJets(const xAODJetCollector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const
ToolHandle< ITrigJetHypoToolHelper > m_helper
Gaudi::Property< bool > m_visitDebug
ToolHandle< GenericMonitoringTool > m_monTool
StatusCode reportPassingJets(const xAODJetCollector &, const std::vector< JetDecision > &jetHypoInputs) const
std::size_t size() const
HypoJetVector hypoJets() const
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode TrigJetHypoTool::finalize ( )

Definition at line 94 of file TrigJetHypoTool.cxx.

94 {
95 return StatusCode::SUCCESS;
96}

◆ getID()

const HLT::Identifier & TrigJetHypoTool::getID ( std::size_t i) const

Definition at line 263 of file TrigJetHypoTool.cxx.

263 {
264 return m_decisionIDs.at(i-m_startLabelIndex);
265}
std::vector< HLT::Identifier > m_decisionIDs

◆ getIDs()

const std::vector< HLT::Identifier > & TrigJetHypoTool::getIDs ( ) const

Definition at line 258 of file TrigJetHypoTool.cxx.

258 {
259 return m_decisionIDs;
260}

◆ initialize()

StatusCode TrigJetHypoTool::initialize ( )

Definition at line 49 of file TrigJetHypoTool.cxx.

49 {
50
51 if (!(m_endLabelIndex > 0)){
52 ATH_MSG_ERROR("endLabelIndex must be > 0, is " + std::to_string(m_endLabelIndex));
53 return StatusCode::FAILURE;
54 }
55
56 if (m_endLabelIndex == 1u) {
57
58 // This is a single-leg jet chain.
59 m_decisionIDs.push_back(m_decisionID);
60
61 } else {
62
63 // This is a multi-leg chain with (m_endLabelIndex - m_startLabelIndex) jet legs contained within
64
65 if(not isLegId(m_decisionID)){
66 ATH_MSG_ERROR(name() << " is being configured to do jet selection for a multi-leg chain, from leg " << m_startLabelIndex <<
67 " to " << m_endLabelIndex << ", the HypoTool's name must therefore start with legXXX_ rather than HLT_");
68 return StatusCode::FAILURE;
69 }
70
71 HLT::Identifier noLegNameDecisionID = getIDFromLeg(m_decisionID);
72 for (std::size_t i = m_startLabelIndex; i != m_endLabelIndex; ++i){
73 m_decisionIDs.push_back(createLegName(noLegNameDecisionID, i));
74 ATH_MSG_DEBUG("Adding jet-leg " << m_decisionIDs.size()-1 << " for " << noLegNameDecisionID << ", this is leg " << i << " in the chain:" << m_decisionIDs.back());
75 }
76
77 }
78
79 if (m_visitDebug){
80 DebugInfoCollector collector(name() + "_init");
81 CHECK(m_helper->getDescription(collector));
82 auto s = collector.toString();
83
84 for(const auto& l : lineSplitter(s)){
85 ATH_MSG_INFO(l);
86 }
87 }
88
89 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
90 return StatusCode::SUCCESS;
91}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
bool isLegId(const HLT::Identifier &legIdentifier)
Recognise whether the chain ID is a leg ID.
std::vector< std::string > lineSplitter(const std::string &s, char delimiter)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ inputJetParticipates()

bool TrigJetHypoTool::inputJetParticipates ( const std::vector< const xAOD::Jet * > & jets,
const JetDecision & pair ) const
private

Definition at line 362 of file TrigJetHypoTool.cxx.

363 {
364
365 return std::find(jets.begin(), jets.end(), pair.first) != jets.end();
366}

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

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 > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ reportLeg()

StatusCode TrigJetHypoTool::reportLeg ( const std::vector< const xAOD::Jet * > & jets,
const std::vector< JetDecision > & jetHypoInputs,
int legInd ) const
private

Definition at line 334 of file TrigJetHypoTool.cxx.

336 {
337
338 // check if input jet is a participating jet. If so , add
339 // its Decision object.
340 for (auto& pair : jetHypoInputs) {
341 if (!inputJetParticipates(jets, pair)){continue;}
342
343 TrigCompositeUtils::DecisionIDContainer passingIDs; // set<uint32_t>
344
345 // Add the Leg DecisionID.
346 // Required by any downstream Steps which need to consume jets which
347 // are satisfying this leg's jet cuts and by the following ComboHypo
348 // Note that if the chain is single-leg, then the ID will be the chain-ID
349 // rathe than a leg-specific ID
350 passingIDs.insert(getID(legInd).numeric());
351
352 // Copy these passingIDs into the Decision Object
353 // This call also performs de-duplication
354 TrigCompositeUtils::insertDecisionIDs(passingIDs, pair.second);
355 }
356
357 return StatusCode::SUCCESS;
358}
const HLT::Identifier & getID(std::size_t) const
bool inputJetParticipates(const std::vector< const xAOD::Jet * > &jets, const JetDecision &pair) const
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
std::set< DecisionID > DecisionIDContainer

◆ reportPassingJets()

StatusCode TrigJetHypoTool::reportPassingJets ( const xAODJetCollector & jetCollector,
const std::vector< JetDecision > & jetHypoInputs ) const
private

Definition at line 318 of file TrigJetHypoTool.cxx.

319 {
320
321 auto legIndices = jetCollector.legInds();
322 for(const auto& legInd : legIndices){
323 auto participating_jets = jetCollector.xAODJets(legInd);
324 CHECK(reportLeg(participating_jets, jetHypoInputs, legInd));
325 }
326
327 return StatusCode::SUCCESS;
328}
StatusCode reportLeg(const std::vector< const xAOD::Jet * > &jets, const std::vector< JetDecision > &jetHypoInputs, int legInd) const

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_chainName

Gaudi::Property<std::string> TrigJetHypoTool::m_chainName
private
Initial value:
{
this, "chain_name", {}, "chain name"}

Definition at line 83 of file TrigJetHypoTool.h.

83 {
84 this, "chain_name", {}, "chain name"};

◆ m_decisionID

HLT::Identifier TrigJetHypoTool::m_decisionID
private

Definition at line 62 of file TrigJetHypoTool.h.

◆ m_decisionIDs

std::vector<HLT::Identifier> TrigJetHypoTool::m_decisionIDs {}
private

Definition at line 69 of file TrigJetHypoTool.h.

69{};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_endLabelIndex

Gaudi::Property<std::size_t> TrigJetHypoTool::m_endLabelIndex
private
Initial value:
{
this, "endLabelIndex", {0}, "end value for leg indices"}

Definition at line 77 of file TrigJetHypoTool.h.

77 { // no of chain parts + 1
78 this, "endLabelIndex", {0}, "end value for leg indices"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_helper

ToolHandle<ITrigJetHypoToolHelper> TrigJetHypoTool::m_helper
private
Initial value:
{
this, "helper_tool", {}, "Jet hypo helper AlgTool"}

Definition at line 71 of file TrigJetHypoTool.h.

71 {
72 this, "helper_tool", {}, "Jet hypo helper AlgTool"};

◆ m_id

std::atomic<size_t> TrigJetHypoTool::m_id = 0
mutableprivate

Definition at line 87 of file TrigJetHypoTool.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> TrigJetHypoTool::m_monTool {this,"MonTool","","Monitoring tool"}
private

Definition at line 89 of file TrigJetHypoTool.h.

89{this,"MonTool","","Monitoring tool"};

◆ m_startLabelIndex

Gaudi::Property<std::size_t> TrigJetHypoTool::m_startLabelIndex
private
Initial value:
{
this, "startLabelIndex", {0}, "start value for leg indices"}

Definition at line 74 of file TrigJetHypoTool.h.

74 { // no of chain parts + 1
75 this, "startLabelIndex", {0}, "start value for leg indices"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_visitDebug

Gaudi::Property<bool> TrigJetHypoTool::m_visitDebug
private
Initial value:
{
this, "visit_debug", false, "debug flag"}

Definition at line 80 of file TrigJetHypoTool.h.

80 {
81 this, "visit_debug", false, "debug flag"};

The documentation for this class was generated from the following files: