ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MTCalibPebHypoTool Class Reference

Base class for tools used by MTCalibPebHypoAlg. More...

#include <MTCalibPebHypoTool.h>

Inheritance diagram for MTCalibPebHypoTool:
Collaboration diagram for MTCalibPebHypoTool:

Classes

struct  Input
 
struct  ROBRequestInstruction
 ROB request instruction description. More...
 

Public Member Functions

 MTCalibPebHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
virtual ~MTCalibPebHypoTool ()
 Standard destructor. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
StatusCode decide (const Input &input) const
 Decides whether to accept the event. More...
 
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

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

Gaudi::Property< bool > m_useRandomSeed
 
Gaudi::Property< double > m_acceptRate
 
Gaudi::Property< unsigned int > m_burnTimePerCycleMillisec
 
Gaudi::Property< unsigned int > m_numBurnCycles
 
Gaudi::Property< bool > m_burnTimeRandomly
 
Gaudi::Property< bool > m_doCrunch
 
Gaudi::Property< bool > m_checkDataConsistency
 
Gaudi::Property< std::map< std::string, std::vector< uint32_t > > > m_robAccessDictProp
 
Gaudi::Property< unsigned int > m_timeBetweenRobReqMillisec
 
Gaudi::Property< std::set< uint32_t > > m_pebRobList
 
Gaudi::Property< std::set< uint32_t > > m_pebSubDetList
 
Gaudi::Property< std::map< std::string, unsigned int > > m_createRandomData
 
ServiceHandle< IROBDataProviderSvcm_robDataProviderSvc {this, "ROBDataProviderSvc", "ROBDataProviderSvc", "Name of the ROB data provider"}
 
ServiceHandle< ICPUCrunchSvc > m_cpuCrunchSvc {this, "CPUCrunchSvc", "CPUCrunchSvc", "Name of the CPU cruncher"}
 
HLT::Identifier m_decisionId
 The decision id of the tool instance. More...
 
SG::WriteHandleKeyArray< xAOD::TrigCompositeContainerm_randomDataWHK
 WriteHandleKey array for collections specified in the CreateRandomData property. More...
 
std::vector< std::pair< ROBRequestInstruction, std::vector< uint32_t > > > m_robAccessDict
 Ordered map of ROB request instructions filled from ROBAccessDict property at initialisation. More...
 
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

Base class for tools used by MTCalibPebHypoAlg.

Definition at line 23 of file MTCalibPebHypoTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MTCalibPebHypoTool()

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

Standard constructor.

Definition at line 119 of file MTCalibPebHypoTool.cxx.

◆ ~MTCalibPebHypoTool()

MTCalibPebHypoTool::~MTCalibPebHypoTool ( )
virtual

Standard destructor.

Definition at line 126 of file MTCalibPebHypoTool.cxx.

126 {}

Member Function Documentation

◆ decide()

StatusCode MTCalibPebHypoTool::decide ( const Input input) const

Decides whether to accept the event.

Definition at line 177 of file MTCalibPebHypoTool.cxx.

177  {
178  // Re-seed the static thread-local RNG
179  if (not m_useRandomSeed.value()) {
180  const seed_t seed = eventSeed(input.eventContext.eventID(), name());
181  ATH_MSG_DEBUG("Using seed " << seed << " for event " << input.eventContext.eventID());
182  threadLocalGenerator().seed(seed);
183  }
184 
185  // ---------------------------------------------------------------------------
186  // Burn CPU time
187  // ---------------------------------------------------------------------------
188  for (unsigned int iCycle = 0; iCycle < m_numBurnCycles; ++iCycle) {
189  if (Athena::Timeout::instance(input.eventContext).reached()) {
190  ATH_MSG_ERROR("Timeout reached in CPU time burning cycle # " << iCycle+1);
192  }
193  unsigned int burnTime = m_burnTimeRandomly
194  ? randomInteger<unsigned int>(0, m_burnTimePerCycleMillisec)
196  ATH_MSG_VERBOSE("CPU time burning cycle # " << iCycle+1 << ", burn time [ms] = " << burnTime);
197  if (m_doCrunch) m_cpuCrunchSvc->crunch_for(std::chrono::milliseconds(burnTime));
198  else std::this_thread::sleep_for(std::chrono::milliseconds(burnTime));
199  }
200 
201  // ---------------------------------------------------------------------------
202  // Prefetch or retrieve ROBs
203  // ---------------------------------------------------------------------------
204  for (const auto& [instr,robVec] : m_robAccessDict) {
205  // Check for timeout
206  if (Athena::Timeout::instance(input.eventContext).reached()) {
207  ATH_MSG_ERROR("Timeout reached in ROB retrieval loop");
209  }
210 
211  // Select a random sample of ROBs from the list, if needed
212  ATH_MSG_DEBUG("Processing instruction " << instr.toString());
213  std::vector<uint32_t> robs;
214  if (instr.isRandom && instr.nRandom < robVec.size()) {
215  std::sample(robVec.begin(),robVec.end(),
216  std::back_inserter(robs),
217  instr.nRandom,
218  threadLocalGenerator());
219  }
220  else robs = robVec;
221 
222  // Execute the ROB requests
223  using ReqType = ROBRequestInstruction::Type;
224  if (instr.type == ReqType::ADD || instr.type == ReqType::ADDGET) {
225  // Prefetch ROBs
226  ATH_MSG_DEBUG("Preloading ROBs: " << idsToString(robs));
227  m_robDataProviderSvc->addROBData(input.eventContext, robs, name()+"-ADD");
228  }
229  if (instr.type == ReqType::GET || instr.type == ReqType::ADDGET) {
230  // Retrieve ROBs
231  ATH_MSG_DEBUG("Retrieving ROBs: " << idsToString(robs));
232  // VROBFRAG is a typedef for std::vector<const eformat::ROBFragment<const uint32_t*>*>
233  IROBDataProviderSvc::VROBFRAG robFragments;
234  m_robDataProviderSvc->getROBData(input.eventContext, robs, robFragments, name()+"-GET");
235  ATH_MSG_DEBUG("Number of ROBs retrieved: " << robFragments.size());
236  if (!robFragments.empty()) {
237  ATH_MSG_DEBUG("List of ROBs found: " << std::endl << format(robFragments));
238  }
239  if (m_checkDataConsistency.value()) {
240  for (const IROBDataProviderSvc::ROBF* rob : robFragments) {
241  try {
242  if (!rob->check_rob() || !rob->check_rod()) {
243  ATH_MSG_ERROR("Data consistency check failed");
244  }
245  }
246  catch (const std::exception& ex) {
247  ATH_MSG_ERROR("Data consistency check failed: " << ex.what());
248  }
249  ATH_MSG_DEBUG("Data consistency check passed for ROB 0x" << std::hex << rob->rob_source_id() << std::dec);
250  }
251  }
252  }
253  if (instr.type == ReqType::COL) {
254  // Event building
255  ATH_MSG_DEBUG("Requesting full event ROBs");
256  int nrobs = m_robDataProviderSvc->collectCompleteEventData(input.eventContext, name()+"-COL");
257  ATH_MSG_DEBUG("Number of ROBs retrieved: " << nrobs);
258  }
259  if (instr.type == ReqType::INVALID) {
260  ATH_MSG_ERROR("Invalid ROB request instruction " << instr.toString());
261  return StatusCode::FAILURE;
262  }
263 
264  // Sleep between ROB requests
265  std::this_thread::sleep_for(std::chrono::milliseconds(m_timeBetweenRobReqMillisec));
266  }
267 
268  // ---------------------------------------------------------------------------
269  // Produce random data
270  // ---------------------------------------------------------------------------
271  {
272  using DataCont = xAOD::TrigCompositeContainer;
273  using AuxCont = xAOD::TrigCompositeAuxContainer;
274  for (const SG::WriteHandleKey<DataCont>& handleKey : m_randomDataWHK) {
275  // Create data and aux container
276  std::unique_ptr<DataCont> data = std::make_unique<DataCont>();
277  std::unique_ptr<AuxCont> aux = std::make_unique<AuxCont>();
278  data->setStore(aux.get());
279  // Record the container in event store
280  SG::WriteHandle<DataCont> handle(handleKey,input.eventContext);
281  ATH_CHECK( handle.record(std::move(data),std::move(aux)) );
282  ATH_MSG_DEBUG("Recorded TrigCompositeContainer " << handleKey.key() << " in event store");
283  // Fill the container with random data
284  unsigned int maxElements = m_createRandomData.value().at(handleKey.key());
285  fillRandomData(*handle,maxElements);
286  }
287  }
288 
289  // ---------------------------------------------------------------------------
290  // Random accept decision with PEB information
291  // ---------------------------------------------------------------------------
292  bool accept = randomAccept(m_acceptRate);
293  if(!accept) {
294  ATH_MSG_DEBUG("Decision " << m_decisionId << " is reject");
295  return StatusCode::SUCCESS;
296  }
297 
298  ATH_MSG_DEBUG("Decision " << m_decisionId << " is accept");
300 
301  if (m_pebRobList.empty() && m_pebSubDetList.empty()) {
302  ATH_MSG_VERBOSE("Not configured to write any PEBInfo, nothing will be attached to the decision");
303  }
304  else {
305  ATH_MSG_DEBUG("Attaching ROBs=[" << idsToString(m_pebRobList) << "] and SubDets=["
306  << idsToString(m_pebSubDetList) << "] to the decision object");
307  ATH_CHECK(appendPEBInfo(input.decision,m_pebRobList,m_pebSubDetList));
308  }
309 
310  return StatusCode::SUCCESS;
311 }

◆ 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 MTCalibPebHypoTool::finalize ( )
overridevirtual

Definition at line 169 of file MTCalibPebHypoTool.cxx.

169  {
170  ATH_MSG_INFO("Finalising " << name());
171  ATH_CHECK(m_robDataProviderSvc.release());
172  ATH_CHECK(m_randomDataWHK.initialize());
173  return StatusCode::SUCCESS;
174 }

◆ initialize()

StatusCode MTCalibPebHypoTool::initialize ( )
overridevirtual

Definition at line 131 of file MTCalibPebHypoTool.cxx.

131  {
132  ATH_MSG_INFO("Initialising " << name());
133  ATH_CHECK(m_robDataProviderSvc.retrieve());
134  if (m_doCrunch) ATH_CHECK(m_cpuCrunchSvc.retrieve());
135 
136  // Copy keys from map<string,uint> to WriteHandleKeyArray
138  m_createRandomData.end(),
139  std::back_inserter(m_randomDataWHK),
140  [](const auto& p){return p.first;});
141  ATH_CHECK(m_randomDataWHK.initialize());
142 
143  // Parse and print the ROB request dictionary
144  for (const auto& [instrString,robVec] : m_robAccessDictProp.value()) {
145  m_robAccessDict.emplace_back(ROBRequestInstruction(instrString),robVec);
146  if (m_robAccessDict.back().first.type==ROBRequestInstruction::Type::INVALID) {
147  ATH_MSG_ERROR("Invalid instruction " << instrString);
148  return StatusCode::FAILURE;
149  }
150  }
151  if (msgLvl(MSG::DEBUG)) {
152  if (!m_robAccessDict.empty()) {
153  ATH_MSG_DEBUG(name() << " will execute the following ROB request instructions:");
154  for (const auto& [instr,robVec] : m_robAccessDict) {
155  ATH_MSG_DEBUG("---> Instruction : " << instr.toString());
156  ATH_MSG_DEBUG(" ROB list : " << idsToString(robVec));
157  }
158  }
159  ATH_MSG_DEBUG(name() << " PEBROBList = [" << idsToString(m_pebRobList) << "]");
160  ATH_MSG_DEBUG(name() << " PEBSubDetList = [" << idsToString(m_pebSubDetList) << "]");
161  }
162 
163  return StatusCode::SUCCESS;
164 }

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

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

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

Gaudi::Property<double> MTCalibPebHypoTool::m_acceptRate
private
Initial value:
{
this, "RandomAcceptRate", -1,
"Rate of random accepts, <=0 is never, >=1 is always"
}

Definition at line 67 of file MTCalibPebHypoTool.h.

◆ m_burnTimePerCycleMillisec

Gaudi::Property<unsigned int> MTCalibPebHypoTool::m_burnTimePerCycleMillisec
private
Initial value:
{
this, "BurnTimePerCycleMillisec", 0,
"Burn time per cycle in milliseconds"
}

Definition at line 71 of file MTCalibPebHypoTool.h.

◆ m_burnTimeRandomly

Gaudi::Property<bool> MTCalibPebHypoTool::m_burnTimeRandomly
private
Initial value:
{
this, "BurnTimeRandomly", true,
"If true, burn time per cycle is a random value from uniform distribution between 0 and the given value"
}

Definition at line 79 of file MTCalibPebHypoTool.h.

◆ m_checkDataConsistency

Gaudi::Property<bool> MTCalibPebHypoTool::m_checkDataConsistency
private
Initial value:
{
this, "CheckDataConsistency", false,
"Perform consistency checks for all retrieved ROB data"
}

Definition at line 87 of file MTCalibPebHypoTool.h.

◆ m_cpuCrunchSvc

ServiceHandle<ICPUCrunchSvc> MTCalibPebHypoTool::m_cpuCrunchSvc {this, "CPUCrunchSvc", "CPUCrunchSvc", "Name of the CPU cruncher"}
private

Definition at line 121 of file MTCalibPebHypoTool.h.

◆ m_createRandomData

Gaudi::Property<std::map<std::string,unsigned int> > MTCalibPebHypoTool::m_createRandomData
private
Initial value:
{
this, "CreateRandomData", {},
"Create random data which can be serialised and saved to output. The property value should be a dictionary in the "
"form {name: number} where name is the collection name and number is the maximum number of elements and "
"their decorations"
}

Definition at line 112 of file MTCalibPebHypoTool.h.

◆ m_decisionId

HLT::Identifier MTCalibPebHypoTool::m_decisionId
private

The decision id of the tool instance.

Definition at line 125 of file MTCalibPebHypoTool.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_doCrunch

Gaudi::Property<bool> MTCalibPebHypoTool::m_doCrunch
private
Initial value:
{
this, "Crunch", false,
"Crunch CPU instead of sleeping"
}

Definition at line 83 of file MTCalibPebHypoTool.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_numBurnCycles

Gaudi::Property<unsigned int> MTCalibPebHypoTool::m_numBurnCycles
private
Initial value:
{
this, "NumBurnCycles", 0,
"Number of time burning cycles"
}

Definition at line 75 of file MTCalibPebHypoTool.h.

◆ m_pebRobList

Gaudi::Property<std::set<uint32_t> > MTCalibPebHypoTool::m_pebRobList
private
Initial value:
{
this, "PEBROBList", {},
"The list of ROBs to add for partial event building in each passed event"
}

Definition at line 104 of file MTCalibPebHypoTool.h.

◆ m_pebSubDetList

Gaudi::Property<std::set<uint32_t> > MTCalibPebHypoTool::m_pebSubDetList
private
Initial value:
{
this, "PEBSubDetList", {},
"The list of SubDets to add for partial event building in each passed event"
}

Definition at line 108 of file MTCalibPebHypoTool.h.

◆ m_randomDataWHK

SG::WriteHandleKeyArray<xAOD::TrigCompositeContainer> MTCalibPebHypoTool::m_randomDataWHK
private

WriteHandleKey array for collections specified in the CreateRandomData property.

Definition at line 127 of file MTCalibPebHypoTool.h.

◆ m_robAccessDict

std::vector<std::pair<ROBRequestInstruction,std::vector<uint32_t> > > MTCalibPebHypoTool::m_robAccessDict
private

Ordered map of ROB request instructions filled from ROBAccessDict property at initialisation.

Definition at line 129 of file MTCalibPebHypoTool.h.

◆ m_robAccessDictProp

Gaudi::Property<std::map<std::string,std::vector<uint32_t> > > MTCalibPebHypoTool::m_robAccessDictProp
private
Initial value:
{
this, "ROBAccessDict", {},
"Dictionary of prefetch/retrieve operations with given ROB IDs. The value is a vector of ROB IDs. "
"The string key has to contain :ADD: (prefetch), :GET: (retrieve), :ADDGET: (prefetch+retrieve) or :COL: (full "
"event building). :ADD:, :GET: and :ADDGET: may be also appended with :RNDX: where X is an integer. In this case, "
"random X ROBs will be prefetched/retrieved from the provided list, e.g. :GET:RND10: retrieves 10 random ROBs from "
"the list. Otherwise the full list is used. Note std::map is sorted by std::less<std::string>, so starting the key "
"with a number may be needed to enforce ordering, e.g. '01 :ADD:RND10:'."
}

Definition at line 91 of file MTCalibPebHypoTool.h.

◆ m_robDataProviderSvc

ServiceHandle<IROBDataProviderSvc> MTCalibPebHypoTool::m_robDataProviderSvc {this, "ROBDataProviderSvc", "ROBDataProviderSvc", "Name of the ROB data provider"}
private

Definition at line 120 of file MTCalibPebHypoTool.h.

◆ m_timeBetweenRobReqMillisec

Gaudi::Property<unsigned int> MTCalibPebHypoTool::m_timeBetweenRobReqMillisec
private
Initial value:
{
this, "TimeBetweenROBReqMillisec", 0,
"Delay in milliseconds between subsequent ROB request operations from ROBAccessDict"
}

Definition at line 100 of file MTCalibPebHypoTool.h.

◆ m_useRandomSeed

Gaudi::Property<bool> MTCalibPebHypoTool::m_useRandomSeed
private
Initial value:
{
this, "UseRandomSeed", false,
"If true, use random seed for the internal RNG. If false, use a seed based on run/event number and tool name."
}

Definition at line 63 of file MTCalibPebHypoTool.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.


The documentation for this class was generated from the following files:
MTCalibPebHypoTool::m_pebSubDetList
Gaudi::Property< std::set< uint32_t > > m_pebSubDetList
Definition: MTCalibPebHypoTool.h:108
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MTCalibPebHypoTool::m_acceptRate
Gaudi::Property< double > m_acceptRate
Definition: MTCalibPebHypoTool.h:67
MTCalibPebHypoTool::m_decisionId
HLT::Identifier m_decisionId
The decision id of the tool instance.
Definition: MTCalibPebHypoTool.h:125
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition: TrigCompositeUtilsRoot.cxx:61
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
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
athena.value
value
Definition: athena.py:124
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::TrigCompositeAuxContainer
TrigCompositeAuxContainer_v2 TrigCompositeAuxContainer
Declare the latest version of the container.
Definition: TrigCompositeAuxContainer.h:16
MTCalibPebHypoTool::m_useRandomSeed
Gaudi::Property< bool > m_useRandomSeed
Definition: MTCalibPebHypoTool.h:63
MTCalibPebHypoTool::m_doCrunch
Gaudi::Property< bool > m_doCrunch
Definition: MTCalibPebHypoTool.h:83
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CxxUtils::INVALID
@ INVALID
Definition: CachedValue.h:28
MTCalibPebHypoTool::m_checkDataConsistency
Gaudi::Property< bool > m_checkDataConsistency
Definition: MTCalibPebHypoTool.h:87
MTCalibPebHypoTool::m_randomDataWHK
SG::WriteHandleKeyArray< xAOD::TrigCompositeContainer > m_randomDataWHK
WriteHandleKey array for collections specified in the CreateRandomData property.
Definition: MTCalibPebHypoTool.h:127
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MTCalibPebHypoTool::m_burnTimePerCycleMillisec
Gaudi::Property< unsigned int > m_burnTimePerCycleMillisec
Definition: MTCalibPebHypoTool.h:71
HLT::Identifier::fromToolName
static HLT::Identifier fromToolName(const std::string &tname)
Definition: HLTIdentifier.cxx:31
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
MTCalibPebHypoTool::m_robDataProviderSvc
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
Definition: MTCalibPebHypoTool.h:120
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
GET
#define GET(n)
Definition: MD5.cxx:153
python.HLT.CommonSequences.EventBuildingSequences.robs
robs
Definition: EventBuildingSequences.py:401
MTCalibPebHypoTool::m_timeBetweenRobReqMillisec
Gaudi::Property< unsigned int > m_timeBetweenRobReqMillisec
Definition: MTCalibPebHypoTool.h:100
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
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
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
MTCalibPebHypoTool::m_pebRobList
Gaudi::Property< std::set< uint32_t > > m_pebRobList
Definition: MTCalibPebHypoTool.h:104
Athena::Timeout::instance
static Timeout & instance()
Get reference to Timeout singleton.
Definition: Timeout.h:64
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Athena::Timeout::reached
bool reached() const
Check if the timeout was reached.
Definition: Timeout.h:45
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
MTCalibPebHypoTool::m_burnTimeRandomly
Gaudi::Property< bool > m_burnTimeRandomly
Definition: MTCalibPebHypoTool.h:79
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
MTCalibPebHypoTool::m_robAccessDictProp
Gaudi::Property< std::map< std::string, std::vector< uint32_t > > > m_robAccessDictProp
Definition: MTCalibPebHypoTool.h:91
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::TrigCompositeContainer
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigCompositeContainer.h:17
Athena::Status::TIMEOUT
@ TIMEOUT
Timeout during event processing.
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
MTCalibPebHypoTool::ROBRequestInstruction::Type
Type
Type of instruction.
Definition: MTCalibPebHypoTool.h:55
MTCalibPebHypoTool::m_numBurnCycles
Gaudi::Property< unsigned int > m_numBurnCycles
Definition: MTCalibPebHypoTool.h:75
a
TList * a
Definition: liststreamerinfos.cxx:10
h
MTCalibPebHypoTool::m_createRandomData
Gaudi::Property< std::map< std::string, unsigned int > > m_createRandomData
Definition: MTCalibPebHypoTool.h:112
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MTCalibPebHypoTool::m_robAccessDict
std::vector< std::pair< ROBRequestInstruction, std::vector< uint32_t > > > m_robAccessDict
Ordered map of ROB request instructions filled from ROBAccessDict property at initialisation.
Definition: MTCalibPebHypoTool.h:129
DEBUG
#define DEBUG
Definition: page_access.h:11
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
MTCalibPebHypoTool::m_cpuCrunchSvc
ServiceHandle< ICPUCrunchSvc > m_cpuCrunchSvc
Definition: MTCalibPebHypoTool.h:121
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
ADD
#define ADD(NAME)
fitman.k
k
Definition: fitman.py:528