ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

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 > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

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) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
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 48 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.

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

233  {
234 
235  if (jetCollector.empty()) {
236  ATH_MSG_ERROR("HypoTool passed the event for " <<
237  m_chainName << " ev " << m_id <<
238  ", but did not specify which jets participated");
239  return StatusCode::FAILURE;
240  }
241 
242  auto legIndices = jetCollector.legInds();
243  if (!(legIndices.size() == (m_endLabelIndex - m_startLabelIndex))) {
244  ATH_MSG_ERROR("inconsistent number of leg indices");
245  return StatusCode::FAILURE;
246  }
247 
248  ATH_MSG_DEBUG("check passing jets? does it work?");
249  ATH_MSG_DEBUG("There are some indices: " << legIndices.size());
250  for(size_t i = 0; i < legIndices.size(); i ++){
251  ATH_MSG_DEBUG(" -- leg " << i << " has index " << legIndices.at(i));
252  }
253 
254  // jet hypo inputs:
255  // pairs of const xAOD::Jet* (first) and mutable Decision* (second)
256 
257  auto participating_jets = jetCollector.xAODJets();
258  if (infocollector) {
259  infocollector->
260  collect(name(),
261  "no of xAODJets " + std::to_string(participating_jets.size()));
262 
263  auto legInds = jetCollector.legInds();
264  std::stringstream ss;
265 
266  for(const auto& label : legInds){
267  auto jets = jetCollector.xAODJets(label);
268  ss << label << " [\n";
269  for(const auto& j : jets){
270  ss << static_cast<const void*>(j) << '\n';
271  }
272  ss << "]\n";
273  }
274  infocollector->collect(name(), ss.str());
275  }
276 
277  return StatusCode::SUCCESS;
278 }

◆ 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 
125  jets -> end(),
126  hypoJets.begin(),
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  auto monitor_group_passingjets = Monitored::Group( m_monTool, mon_jetEt, mon_jetEta, mon_jetPhi , mon_dipz_z, mon_dipz_negLogSigma2);
206  }
207  //monitor the passing jets for each leg (there should only be one per chain!)
208  auto legInds = jetCollector.legInds();
209  for (const auto& label : legInds) {
210  auto jets = jetCollector.hypoJets(label);
211  auto monitor_nJt = Monitored::Scalar( "NJets", jets.size());
212  auto htsum = Monitored::Scalar("HT", std::accumulate(jets.begin(), jets.end(),0.0,
213  [](double sum, const HypoJetVector::value_type jptr){return sum + jptr->et()*0.001;} ));
214  auto monitor_group_passinght = Monitored::Group(m_monTool, monitor_nJt,htsum);
215  }
216 
217  return StatusCode::SUCCESS;
218 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ 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.

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

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

226  {
227  return m_decisionIDs.at(i-m_startLabelIndex);
228 }

◆ getIDs()

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

Definition at line 221 of file TrigJetHypoTool.cxx.

221  {
222  return m_decisionIDs;
223 }

◆ 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 }

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

326  {
327 
328  return std::find(jets.begin(), jets.end(), pair.first) != jets.end();
329 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ reportLeg()

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

Definition at line 297 of file TrigJetHypoTool.cxx.

299  {
300 
301  // check if input jet is a participating jet. If so , add
302  // its Decision object.
303  for (auto& pair : jetHypoInputs) {
304  if (!inputJetParticipates(jets, pair)){continue;}
305 
306  TrigCompositeUtils::DecisionIDContainer passingIDs; // set<uint32_t>
307 
308  // Add the Leg DecisionID.
309  // Required by any downstream Steps which need to consume jets which
310  // are satisfying this leg's jet cuts and by the following ComboHypo
311  // Note that if the chain is single-leg, then the ID will be the chain-ID
312  // rathe than a leg-specific ID
313  passingIDs.insert(getID(legInd).numeric());
314 
315  // Copy these passingIDs into the Decision Object
316  // This call also performs de-duplication
317  TrigCompositeUtils::insertDecisionIDs(passingIDs, pair.second);
318  }
319 
320  return StatusCode::SUCCESS;
321 }

◆ reportPassingJets()

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

Definition at line 281 of file TrigJetHypoTool.cxx.

282  {
283 
284  auto legIndices = jetCollector.legInds();
285  for(const auto& legInd : legIndices){
286  auto participating_jets = jetCollector.xAODJets(legInd);
287  CHECK(reportLeg(participating_jets, jetHypoInputs, legInd));
288  }
289 
290  return StatusCode::SUCCESS;
291 }

◆ 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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_chainName

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

Definition at line 89 of file TrigJetHypoTool.h.

◆ m_decisionID

HLT::Identifier TrigJetHypoTool::m_decisionID
private

Definition at line 68 of file TrigJetHypoTool.h.

◆ m_decisionIDs

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

Definition at line 75 of file TrigJetHypoTool.h.

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

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

◆ m_id

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

Definition at line 93 of file TrigJetHypoTool.h.

◆ m_monTool

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

Definition at line 95 of file TrigJetHypoTool.h.

◆ m_startLabelIndex

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

Definition at line 80 of file TrigJetHypoTool.h.

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


The documentation for this class was generated from the following files:
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
xAODJetCollector::hypoJets
HypoJetVector hypoJets() const
Definition: xAODJetCollector.cxx:44
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
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
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:47
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
TrigJetHypoTool::m_endLabelIndex
Gaudi::Property< std::size_t > m_endLabelIndex
Definition: TrigJetHypoTool.h:83
xAODJetAsIJetFactory
Definition: xAODJetAsIJetFactory.h:6
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
python.TrigCompositeUtils.isLegId
def isLegId(chainName)
Definition: DecisionHandling/python/TrigCompositeUtils.py:18
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TrigCompositeUtils::insertDecisionIDs
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
Definition: TrigCompositeUtilsRoot.cxx:80
TrigJetHypoTool::m_decisionID
HLT::Identifier m_decisionID
Definition: TrigJetHypoTool.h:68
lineSplitter
std::vector< std::string > lineSplitter(const std::string &s, char delimiter)
Definition: lineSplitter.cxx:8
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TrigJetHypoTool::getID
const HLT::Identifier & getID(std::size_t) const
Definition: TrigJetHypoTool.cxx:226
HLT::Identifier::fromToolName
static HLT::Identifier fromToolName(const std::string &tname)
Definition: HLTIdentifier.cxx:31
xAODJetCollector::xAODJets
std::vector< const xAOD::Jet * > xAODJets() const
Definition: xAODJetCollector.cxx:18
TrigJetHypoTool::m_visitDebug
Gaudi::Property< bool > m_visitDebug
Definition: TrigJetHypoTool.h:86
xAODJetCollector::size
std::size_t size() const
Definition: xAODJetCollector.cxx:66
TrigJetHypoTool::m_startLabelIndex
Gaudi::Property< std::size_t > m_startLabelIndex
Definition: TrigJetHypoTool.h:80
TrigJetHypoTool::reportLeg
StatusCode reportLeg(const std::vector< const xAOD::Jet * > &jets, const std::vector< JetDecision > &jetHypoInputs, int legInd) const
Definition: TrigJetHypoTool.cxx:297
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
lumiFormat.i
int i
Definition: lumiFormat.py:92
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAODJetCollector::legInds
std::vector< int > legInds() const
Definition: xAODJetCollector.cxx:95
DebugInfoCollector
Definition: DebugInfoCollector.h:13
TrigJetHypoTool::m_decisionIDs
std::vector< HLT::Identifier > m_decisionIDs
Definition: TrigJetHypoTool.h:75
calibdata.exception
exception
Definition: calibdata.py:496
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
TrigJetHypoTool::checkPassingJets
StatusCode checkPassingJets(const xAODJetCollector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const
Definition: TrigJetHypoTool.cxx:232
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TrigJetHypoTool::m_id
std::atomic< size_t > m_id
Definition: TrigJetHypoTool.h:93
TrigJetHypoTool::m_chainName
Gaudi::Property< std::string > m_chainName
Definition: TrigJetHypoTool.h:89
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
TrigJetHypoTool::reportPassingJets
StatusCode reportPassingJets(const xAODJetCollector &, const std::vector< JetDecision > &jetHypoInputs) const
Definition: TrigJetHypoTool.cxx:281
TrigJetHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigJetHypoTool.h:95
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
xAODJetCollector::empty
bool empty() const
Definition: xAODJetCollector.cxx:68
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
xAODJetCollector
Definition: xAODJetCollector.h:20
TrigCompositeUtils::createLegName
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.
Definition: TrigCompositeUtilsRoot.cxx:166
TrigJetHypoTool::m_helper
ToolHandle< ITrigJetHypoToolHelper > m_helper
Definition: TrigJetHypoTool.h:77
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Trig::FeatureAccessImpl::collect
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...
Definition: FeatureCollectAthena.h:299
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TrigJetHypoTool::inputJetParticipates
bool inputJetParticipates(const std::vector< const xAOD::Jet * > &jets, const JetDecision &pair) const
Definition: TrigJetHypoTool.cxx:325
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TrigCompositeUtils::getIDFromLeg
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
Definition: TrigCompositeUtilsRoot.cxx:180
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
fitman.k
k
Definition: fitman.py:528