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 31 of file TrigJetHypoTool.h.

Member Typedef Documentation

◆ JetDecision

Definition at line 44 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 41 of file TrigJetHypoTool.cxx.

43 :
44 AthAlgTool(type, name, parent),
46{
47}
AthAlgTool()
Default constructor:
static HLT::Identifier fromToolName(const std::string &tname)
HLT::Identifier m_decisionID

◆ ~TrigJetHypoTool()

TrigJetHypoTool::~TrigJetHypoTool ( )

Definition at line 50 of file TrigJetHypoTool.cxx.

50 {
51}

Member Function Documentation

◆ checkPassingJets()

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

Definition at line 273 of file TrigJetHypoTool.cxx.

274 {
275
276 if (jetCollector.empty()) {
277 ATH_MSG_ERROR("HypoTool passed the event for " <<
278 m_chainName << " ev " << m_id <<
279 ", but did not specify which jets participated");
280 return StatusCode::FAILURE;
281 }
282
283 auto legIndices = jetCollector.legInds();
284 if (!(legIndices.size() == (m_endLabelIndex - m_startLabelIndex))) {
285 ATH_MSG_ERROR("inconsistent number of leg indices");
286 return StatusCode::FAILURE;
287 }
288
289 ATH_MSG_DEBUG("check passing jets? does it work?");
290 ATH_MSG_DEBUG("There are some indices: " << legIndices.size());
291 for(size_t i = 0; i < legIndices.size(); i ++){
292 ATH_MSG_DEBUG(" -- leg " << i << " has index " << legIndices.at(i));
293 }
294
295 // jet hypo inputs:
296 // pairs of const xAOD::Jet* (first) and mutable Decision* (second)
297
298 auto participating_jets = jetCollector.xAODJets();
299 if (infocollector) {
300 infocollector->
301 collect(name(),
302 "no of xAODJets " + std::to_string(participating_jets.size()));
303
304 auto legInds = jetCollector.legInds();
305 std::stringstream ss;
306
307 for(const auto& label : legInds){
308 auto jets = jetCollector.xAODJets(label);
309 ss << label << " [\n";
310 for(const auto& j : jets){
312 }
313 ss << "]\n";
314 }
315 infocollector->collect(name(), ss.str());
316 }
317
318 return StatusCode::SUCCESS;
319}
#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 104 of file TrigJetHypoTool.cxx.

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

98 {
99 return StatusCode::SUCCESS;
100}

◆ getID()

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

Definition at line 267 of file TrigJetHypoTool.cxx.

267 {
268 return m_decisionIDs.at(i-m_startLabelIndex);
269}
std::vector< HLT::Identifier > m_decisionIDs

◆ getIDs()

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

Definition at line 262 of file TrigJetHypoTool.cxx.

262 {
263 return m_decisionIDs;
264}

◆ initialize()

StatusCode TrigJetHypoTool::initialize ( )

Definition at line 53 of file TrigJetHypoTool.cxx.

53 {
54
55 if (!(m_endLabelIndex > 0)){
56 ATH_MSG_ERROR("endLabelIndex must be > 0, is " + std::to_string(m_endLabelIndex));
57 return StatusCode::FAILURE;
58 }
59
60 if (m_endLabelIndex == 1u) {
61
62 // This is a single-leg jet chain.
63 m_decisionIDs.push_back(m_decisionID);
64
65 } else {
66
67 // This is a multi-leg chain with (m_endLabelIndex - m_startLabelIndex) jet legs contained within
68
69 if(not isLegId(m_decisionID)){
70 ATH_MSG_ERROR(name() << " is being configured to do jet selection for a multi-leg chain, from leg " << m_startLabelIndex <<
71 " to " << m_endLabelIndex << ", the HypoTool's name must therefore start with legXXX_ rather than HLT_");
72 return StatusCode::FAILURE;
73 }
74
75 HLT::Identifier noLegNameDecisionID = getIDFromLeg(m_decisionID);
76 for (std::size_t i = m_startLabelIndex; i != m_endLabelIndex; ++i){
77 m_decisionIDs.push_back(createLegName(noLegNameDecisionID, i));
78 ATH_MSG_DEBUG("Adding jet-leg " << m_decisionIDs.size()-1 << " for " << noLegNameDecisionID << ", this is leg " << i << " in the chain:" << m_decisionIDs.back());
79 }
80
81 }
82
83 if (m_visitDebug){
84 DebugInfoCollector collector(name() + "_init");
85 CHECK(m_helper->getDescription(collector));
86 auto s = collector.toString();
87
88 for(const auto& l : lineSplitter(s)){
89 ATH_MSG_INFO(l);
90 }
91 }
92
93 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
94 return StatusCode::SUCCESS;
95}
#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 366 of file TrigJetHypoTool.cxx.

367 {
368
369 return std::find(jets.begin(), jets.end(), pair.first) != jets.end();
370}

◆ 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 338 of file TrigJetHypoTool.cxx.

340 {
341
342 // check if input jet is a participating jet. If so , add
343 // its Decision object.
344 for (auto& pair : jetHypoInputs) {
345 if (!inputJetParticipates(jets, pair)){continue;}
346
347 TrigCompositeUtils::DecisionIDContainer passingIDs; // set<uint32_t>
348
349 // Add the Leg DecisionID.
350 // Required by any downstream Steps which need to consume jets which
351 // are satisfying this leg's jet cuts and by the following ComboHypo
352 // Note that if the chain is single-leg, then the ID will be the chain-ID
353 // rathe than a leg-specific ID
354 passingIDs.insert(getID(legInd).numeric());
355
356 // Copy these passingIDs into the Decision Object
357 // This call also performs de-duplication
358 TrigCompositeUtils::insertDecisionIDs(passingIDs, pair.second);
359 }
360
361 return StatusCode::SUCCESS;
362}
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 322 of file TrigJetHypoTool.cxx.

323 {
324
325 auto legIndices = jetCollector.legInds();
326 for(const auto& legInd : legIndices){
327 auto participating_jets = jetCollector.xAODJets(legInd);
328 CHECK(reportLeg(participating_jets, jetHypoInputs, legInd));
329 }
330
331 return StatusCode::SUCCESS;
332}
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 85 of file TrigJetHypoTool.h.

85 {
86 this, "chain_name", {}, "chain name"};

◆ m_decisionID

HLT::Identifier TrigJetHypoTool::m_decisionID
private

Definition at line 64 of file TrigJetHypoTool.h.

◆ m_decisionIDs

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

Definition at line 71 of file TrigJetHypoTool.h.

71{};

◆ 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 79 of file TrigJetHypoTool.h.

79 { // no of chain parts + 1
80 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 73 of file TrigJetHypoTool.h.

73 {
74 this, "helper_tool", {}, "Jet hypo helper AlgTool"};

◆ m_id

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

Definition at line 89 of file TrigJetHypoTool.h.

◆ m_monTool

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

Definition at line 91 of file TrigJetHypoTool.h.

91{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 76 of file TrigJetHypoTool.h.

76 { // no of chain parts + 1
77 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 82 of file TrigJetHypoTool.h.

82 {
83 this, "visit_debug", false, "debug flag"};

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