ATLAS Offline Software
CaloGPUHybridClusterProcessor.cxx
Go to the documentation of this file.
1 //
2 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 //
4 // Dear emacs, this is -*- c++ -*-
5 //
6 
8 
10 
12 
13 #include <algorithm>
14 
15 //We'll use a quick and dirty helper with placement new...
16 #include <new>
17 
20 
23 
25 
26 #include "boost/chrono/chrono.hpp"
27 #include "boost/chrono/thread_clock.hpp"
28 
29 using namespace CaloRecGPU;
30 
31 CaloGPUHybridClusterProcessor::CaloGPUHybridClusterProcessor(const std::string & name, ISvcLocator * pSvcLocator):
32  AthReentrantAlgorithm(name, pSvcLocator),
33  CaloGPUTimed(this),
34  m_temporariesSize(0),
35  m_constantDataSent(false)
36 {
37 
38 }
39 
41 {
43 
44  if (m_clusterCellLinkOutput.key().empty())
45  {
47  }
49 
50 
51  bool any_failed = false;
52 
53  auto retrieve_and_report = [&](auto & var, const auto & type, bool & falsify_if_empty)
54  {
55  if (var.empty())
56  {
57  falsify_if_empty = false;
58  ATH_MSG_DEBUG("There is nothing to retrieve for " << type << ".");
59  }
60  else if (var.retrieve().isFailure())
61  {
62  ATH_MSG_ERROR("Failed to retrieve " << type << ": " << var);
63  any_failed = true;
64  }
65  else
66  {
67  ATH_MSG_DEBUG("Successfully retrieved " << type << ": " << var);
68  }
69  };
70  //A generic lambda to prevent code repetition.
71 
72 
73  bool checker = true;
74 
75  retrieve_and_report(m_preGPUoperations, "pre-GPU operations", checker);
76  retrieve_and_report(m_GPUoperations, "GPU operations", checker);
77  retrieve_and_report(m_postGPUoperations, "post-GPU operations", checker);
78 
79  if (!m_skipConversions)
80  {
81  retrieve_and_report(m_transformConstantData, "constant data to GPU transformer", checker);
82  retrieve_and_report(m_transformForGPU, "event data to GPU transformer", checker);
83  retrieve_and_report(m_transformBackToCPU, "GPU to Athena transformer", checker);
84  }
85  else
86  {
87  m_transformConstantData.disable();
88  m_transformForGPU.disable();
89  m_transformBackToCPU.disable();
90  }
91 
92  if (m_doPlots)
93  {
94  checker = true;
95  retrieve_and_report(m_plotterTool, "plotter tool", checker);
97  }
98  else
99  {
100  m_plotterTool.disable();
101  }
102 
103  if (m_doMonitoring)
104  {
105  checker = true;
106  retrieve_and_report(m_moniTool, "monitoring tool", checker);
108  }
109  else
110  {
111  m_moniTool.disable();
112  }
113 
114  if (any_failed)
115  {
116  return StatusCode::FAILURE;
117  }
118 
119  ATH_CHECK(m_avgMuKey.initialize(m_doMonitoring));
122 
123  m_temporariesSize = 0;
124 
125  for (const auto & tool : m_GPUoperations)
126  {
127  m_temporariesSize = std::max(m_temporariesSize, tool->size_of_temporaries());
128  }
129 
131  {
133  }
134 
136 
137  return StatusCode::SUCCESS;
138 }
139 
140 
142 {
144  {
145  ATH_CHECK( m_transformConstantData->initialize() );
146  //Not sure if this is needed or the tool will get initialized by this point.
147 
148  ATH_CHECK( m_transformConstantData->convert(m_constantData, m_doPlots) );
149  m_constantDataSent = true;
150  }
151 
152  if (size_t(m_numPreAllocatedGPUData) > 0)
153  {
154  ATH_MSG_INFO("Pre-allocating event data and temporary buffer for " << size_t(m_numPreAllocatedGPUData) << " parellel events.");
155 
156  m_eventDataThreadedHolder.resize(m_numPreAllocatedGPUData);
157  m_temporariesThreadedHolder.resize(m_numPreAllocatedGPUData);
158  //This will allocate the object holders.
159 
160  m_eventDataThreadedHolder.operate_on_all( [&](EventDataHolder & edh)
161  {
162  edh.allocate(true);
163  }
164  );
165  m_temporariesThreadedHolder.operate_on_all( [&](simple_GPU_pointer_holder & ph)
166  {
168  }
169  );
170  //This will allocate all the memory at this point.
171  //Also useful to prevent/debug potential allocation issues?
172  //But the main point is really reducing the execute times...
173  }
174 
175  return StatusCode::SUCCESS;
176 }
177 
178 
179 StatusCode CaloGPUHybridClusterProcessor::execute(const EventContext & ctx) const
180 {
181  auto time_tot = Monitored::Timer("TIME_execute");
182  auto time_clusMaker = Monitored::Timer("TIME_ClustMaker");
183  auto time_clusCorr = Monitored::Timer("TIME_ClustCorr");
184  //No good way to not declare this here at the outer scope
185  //since we do need the timers to be available when we do our operations.
186  //Also: contrary to what the CPU does, we don't have a clear distinction
187  //between what is cluster making and cluster corrections;
188  //for now, ClustMaker = Pre-GPU + (CPU -> GPU) + GPU Tools + (GPU -> CPU)
189  //and ClustCorr = Post-GPU...
190 
191  if (m_doMonitoring)
192  {
193  time_tot.start();
194  }
195 
196 
198 
200  {
201  ATH_CHECK( cluster_collection.record (std::make_unique<xAOD::CaloClusterContainer>(), std::make_unique<xAOD::CaloClusterTrigAuxContainer> () ));
202  }
203  else
204  {
206  }
207 
208  //ATH_CHECK(CaloClusterStoreHelper::AddContainerWriteHandle(&(*evtStore()), cluster_collection, msg()));
209 
210  xAOD::CaloClusterContainer * cluster_collection_ptr = cluster_collection.ptr();
211 
213  {
214  std::lock_guard<std::mutex> lock_guard(m_mutex);
215  if (!m_constantDataSent.load())
216  {
217  ConstantDataHolder * cdh_ptr ATLAS_THREAD_SAFE = &m_constantData;
218  ATH_CHECK( m_transformConstantData->convert(ctx, *cdh_ptr, m_doPlots) );
219  m_constantDataSent.store(true);
220  }
221  }
222 
223  EventDataHolder * event_data_ptr = nullptr;
224 
225  Helpers::separate_thread_accessor<EventDataHolder> sep_th_acc_1(m_eventDataThreadedHolder, event_data_ptr);
226  //This is a RAII wrapper to access an object held by Helpers::separate_thread_holder,
227  //to ensure the event data is appropriately released when we are done processing.
228 
229  if (event_data_ptr == nullptr && !m_skipConversions)
230  {
231  ATH_MSG_ERROR("Could not get valid Event Data Holder! Event: " << ctx.evt() );
232  return StatusCode::FAILURE;
233  }
234 
235  if (!m_skipConversions)
236  {
237  event_data_ptr->allocate(true);
238  //No-op if already allocated.
239  }
240 
241  simple_GPU_pointer_holder * temporaries_data_ptr_holder = nullptr;
242 
243  Helpers::separate_thread_accessor<simple_GPU_pointer_holder> sep_th_acc_2(m_temporariesThreadedHolder, temporaries_data_ptr_holder);
244  if (!temporaries_data_ptr_holder)
245  {
246  ATH_MSG_ERROR("temporaries_data_ptr_holder is null in CaloGPUHybridClusterProcessor::execute" );
247  return StatusCode::FAILURE;
248  }
249  temporaries_data_ptr_holder->allocate(m_temporariesSize);
250  //This will not perform any allocations if they've already been done.
251 
252  if ( (temporaries_data_ptr_holder->get_pointer() == nullptr) && !m_skipConversions && m_temporariesSize > 0 )
253  {
254  ATH_MSG_ERROR("Could not get valid temporary buffer holder! Event: " << ctx.evt() );
255  return StatusCode::FAILURE;
256  }
257 
258  const ConstantDataHolder & constant_data_holder ATLAS_THREAD_SAFE = m_constantData;
259  //Just to shut up the checker. We know what we are doing...
260 
261  using clock_type = boost::chrono::thread_clock;
262  auto time_cast = [](const auto & before, const auto & after)
263  {
264  return boost::chrono::duration_cast<boost::chrono::microseconds>(after - before).count();
265  };
266 
267  std::vector<size_t> times;
268 
269  size_t plot_time = 0;
270 
271  if (m_measureTimes)
272  {
273  const size_t time_size = m_preGPUoperations.size() + m_GPUoperations.size() + m_postGPUoperations.size() + m_doPlots + 2 * !m_skipConversions;
274  //+2 for the conversions
275  //+1 for the plotter (only added at the end)
276  times.reserve(time_size);
277  }
278 
279  if (m_doPlots)
280  {
281  auto t1 = clock_type::now();
282  ATH_CHECK( m_plotterTool->update_plots_start(ctx, constant_data_holder, cluster_collection_ptr) );
283  auto t2 = clock_type::now();
284  if (m_measureTimes)
285  {
286  plot_time += time_cast(t1, t2);
287  }
288  }
289 
290  if (m_doMonitoring)
291  {
292  time_clusMaker.start();
293  }
294 
295  for (const auto & pre_GPU_tool : m_preGPUoperations)
296  {
297  auto t1 = clock_type::now();
298  ATH_CHECK( pre_GPU_tool->execute(ctx, cluster_collection_ptr) );
299  auto t2 = clock_type::now();
300  if (m_measureTimes)
301  {
302  times.push_back(time_cast(t1, t2));
303  }
304  if (m_doPlots)
305  {
306  auto t3 = clock_type::now();
307  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, pre_GPU_tool.get()) );
308  auto t4 = clock_type::now();
309  if (m_measureTimes)
310  {
311  plot_time += time_cast(t3, t4);
312  }
313  }
314  }
315 
316  if (!m_skipConversions)
317  {
318  auto t3 = clock_type::now();
319  ATH_CHECK( m_transformForGPU->convert(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr) );
320  auto t4 = clock_type::now();
321  if (m_measureTimes)
322  {
323  times.push_back(time_cast(t3, t4));
324  }
325  }
326 
327  if (m_doPlots)
328  {
329  auto t1 = clock_type::now();
330  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, m_transformForGPU.get()) );
331  auto t2 = clock_type::now();
332  if (m_measureTimes)
333  {
334  plot_time += time_cast(t1, t2);
335  }
336  }
337 
338  for (const auto & GPU_tool : m_GPUoperations)
339  {
340  auto t5 = clock_type::now();
341  ATH_CHECK( GPU_tool->execute(ctx, constant_data_holder, *event_data_ptr, temporaries_data_ptr_holder->get_pointer()) );
342  auto t6 = clock_type::now();
343  if (m_measureTimes)
344  {
345  times.push_back(time_cast(t5, t6));
346  }
347  if (m_doPlots)
348  {
349  auto t3 = clock_type::now();
350  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, GPU_tool.get()) );
351  auto t4 = clock_type::now();
352  if (m_measureTimes)
353  {
354  plot_time += time_cast(t3, t4);
355  }
356  }
357  }
358 
359  if (!m_skipConversions)
360  {
361  auto t7 = clock_type::now();
362  ATH_CHECK( m_transformBackToCPU->convert(ctx, constant_data_holder, *event_data_ptr, cluster_collection_ptr) );
363  auto t8 = clock_type::now();
364  if (m_measureTimes)
365  {
366  times.push_back(time_cast(t7, t8));
367  }
368  }
369 
370  if (m_doPlots)
371  {
372  auto t1 = clock_type::now();
373  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, m_transformBackToCPU.get()) );
374  auto t2 = clock_type::now();
375  if (m_measureTimes)
376  {
377  plot_time += time_cast(t1, t2);
378  }
379  }
380 
381  if (m_doMonitoring)
382  {
383  time_clusMaker.stop();
384  time_clusCorr.start();
385  }
386 
387  for (const auto & post_GPU_tool : m_postGPUoperations)
388  {
389  auto t9 = clock_type::now();
390  ATH_CHECK( post_GPU_tool->execute(ctx, cluster_collection_ptr) );
391  auto t10 = clock_type::now();
392  if (m_measureTimes)
393  {
394  times.push_back(time_cast(t9, t10));
395  }
396  if (m_doPlots)
397  {
398  auto t3 = clock_type::now();
399  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, post_GPU_tool.get()) );
400  auto t4 = clock_type::now();
401  if (m_measureTimes)
402  {
403  plot_time += time_cast(t3, t4);
404  }
405  }
406  }
407 
408  if (m_doPlots)
409  {
410  auto t1 = clock_type::now();
411  ATH_CHECK( m_plotterTool->update_plots_end(ctx, constant_data_holder, cluster_collection_ptr) );
412  auto t2 = clock_type::now();
413  if (m_measureTimes)
414  {
415  plot_time += time_cast(t1, t2);
416  }
417  }
418 
420  {
422 
423  for (const xAOD::CaloCluster * cl : *cluster_collection_ptr)
424  {
425  const CaloClusterCellLink * cell_links = cl->getCellLinks();
426  if (!cell_links)
427  {
428  decor_handle(*cl) = 0;
429  }
430  else
431  {
432  decor_handle(*cl) = cell_links->size();
433  }
434  }
435  }
436 
437  ATH_MSG_DEBUG("Created cluster container with " << cluster_collection->size() << " clusters");
438 
440 
441  ATH_CHECK( CaloClusterStoreHelper::finalizeClusters(cell_links, cluster_collection.ptr()) );
442 
443  if (m_measureTimes)
444  {
445  if (m_doPlots)
446  {
447  times.push_back(plot_time);
448  }
449  record_times(ctx.evt(), times);
450  }
451 
452  if (m_doMonitoring)
453  //For monitoring.
454  {
455  time_clusCorr.stop();
456 
457  auto mon_clusEt = Monitored::Collection("Et", *cluster_collection_ptr, &xAOD::CaloCluster::et);
458  auto mon_clusSignalState = Monitored::Collection("signalState", *cluster_collection_ptr, &xAOD::CaloCluster::signalState);
459  auto mon_clusSize = Monitored::Collection("clusterSize", *cluster_collection_ptr, &xAOD::CaloCluster::clusterSize);
460  std::vector<double> clus_phi;
461  std::vector<double> clus_eta;
462  std::vector<double> N_BAD_CELLS;
463  std::vector<double> ENG_FRAC_MAX;
464  std::vector<unsigned int> sizeVec;
465  auto mon_clusPhi = Monitored::Collection("Phi", clus_phi);
466  auto mon_clusEta = Monitored::Collection("Eta", clus_eta);
467  auto mon_badCells = Monitored::Collection("N_BAD_CELLS", N_BAD_CELLS);
468  auto mon_engFrac = Monitored::Collection("ENG_FRAC_MAX", N_BAD_CELLS);
469  auto mon_size = Monitored::Collection("size", sizeVec);
470  auto monmu = Monitored::Scalar("mu", -999.0);
471  auto mon_container_size = Monitored::Scalar("container_size", 0.);
472  auto moncount_1thrsigma = Monitored::Scalar("count_1thrsigma", -999.0);
473  auto moncount_2thrsigma = Monitored::Scalar("count_2thrsigma", -999.0);
474  auto mon_container_size_by_mu = Monitored::Scalar("container_size_by_mu", 0.);
475  auto moncount_1thrsigma_by_mu2 = Monitored::Scalar("count_1thrsigma_by_mu2", -999.0);
476  auto moncount_2thrsigma_by_mu2 = Monitored::Scalar("count_2thrsigma_by_mu2", -999.0);
477  auto monitorIt = Monitored::Group( m_moniTool, time_tot, time_clusMaker, time_clusCorr, mon_container_size,
478  mon_clusEt, mon_clusPhi, mon_clusEta, mon_clusSignalState, mon_clusSize,
479  mon_badCells, mon_engFrac, mon_size, monmu, moncount_1thrsigma, moncount_2thrsigma,
480  mon_container_size_by_mu, moncount_1thrsigma_by_mu2, moncount_2thrsigma_by_mu2 );
481  // fill monitored variables
482 
483  mon_container_size = cluster_collection_ptr->size();
484 
485  for (const xAOD::CaloCluster * cl : *cluster_collection_ptr)
486  {
487  const CaloClusterCellLink * num_cell_links = cl->getCellLinks();
488  if (! num_cell_links)
489  {
490  sizeVec.push_back(0);
491  }
492  else
493  {
494  sizeVec.push_back(num_cell_links->size());
495  }
496  clus_phi.push_back(cl->phi());
497  clus_eta.push_back(cl->eta());
498  N_BAD_CELLS.push_back(cl->getMomentValue(xAOD::CaloCluster::N_BAD_CELLS));
499  ENG_FRAC_MAX.push_back(cl->getMomentValue(xAOD::CaloCluster::ENG_FRAC_MAX));
500  }
501 
502  float read_mu = 0;
503 
505  if (eventInfoDecor.isPresent())
506  {
507  read_mu = eventInfoDecor(0);
508  monmu = read_mu;
509  }
510 
511 
512  int count_1thrsigma = 0, count_2thrsigma = 0;
513 
514  if (m_monitorCells)
515  {
516  SG::ReadHandle<CaloCellContainer> cell_collection(m_cellsKey, ctx);
517  if ( !cell_collection.isValid() )
518  {
519  ATH_MSG_ERROR( " Cannot retrieve CaloCellContainer: " << cell_collection.name() );
520  return StatusCode::FAILURE;
521  }
522 
524  const CaloNoise * noisep = *noiseHdl;
525  for (const auto & cell : *cell_collection)
526  {
527  const CaloDetDescrElement * cdde = cell->caloDDE();
528  if (cdde->is_tile())
529  {
530  continue;
531  }
532  float thr = noisep->getNoise(cdde->identifyHash(), cell->gain());
533  if (cell->energy() > m_monitoring1thr * thr)
534  {
535  count_1thrsigma += 1;
536  if (cell->energy() > m_monitoring2thr * thr)
537  {
538  count_2thrsigma += 1;
539  }
540  }
541  }
542  }
543 
544  moncount_1thrsigma = count_1thrsigma;
545  moncount_2thrsigma = count_2thrsigma;
546 
547  if (read_mu > 5)
548  {
549  const float rev_mu = 1.f / read_mu;
550  mon_container_size_by_mu = rev_mu * cluster_collection_ptr->size();
551  const float sqr_rev_mu = rev_mu * rev_mu;
552  moncount_1thrsigma_by_mu2 = sqr_rev_mu * count_1thrsigma;
553  moncount_2thrsigma_by_mu2 = sqr_rev_mu * count_2thrsigma;
554  }
555 
556  time_tot.stop();
557  }
558 
559  return StatusCode::SUCCESS;
560 }
561 
563 {
564  if (m_measureTimes)
565  {
566  std::string header_string;
567 
568  auto add_name_to_string = [&](const auto & obj)
569  {
570  std::string rep = obj->name();
571  std::replace(rep.begin(), rep.end(), ' ', '_');
572  header_string += rep + " ";
573  };
574 
575  for (const auto & pre_GPU_tool : m_preGPUoperations)
576  {
577  add_name_to_string(pre_GPU_tool);
578  }
579 
580  if (!m_skipConversions)
581  {
582  add_name_to_string(m_transformForGPU);
583  }
584 
585  for (const auto & GPU_tool : m_GPUoperations)
586  {
587  add_name_to_string(GPU_tool);
588  }
589 
590  if (!m_skipConversions)
591  {
592  add_name_to_string(m_transformBackToCPU);
593  }
594 
595  for (const auto & post_GPU_tool : m_postGPUoperations)
596  {
597  add_name_to_string(post_GPU_tool);
598  }
599 
600  if (m_doPlots)
601  {
602  add_name_to_string(m_plotterTool);
603  }
604 
605  print_times(header_string, m_preGPUoperations.size() + m_GPUoperations.size() + m_postGPUoperations.size() + 2 * !m_skipConversions + m_doPlots);
606  }
607 
608  if (m_doPlots)
609  {
610  ATH_CHECK(m_plotterTool->finalize_plots());
611  }
612 
613  return StatusCode::SUCCESS;
614 }
LUCID_EventTPCnv_Dict::t6
std::vector< LUCID_DigitContainer_p2 > t6
Definition: LUCID_EventTPCnvDict.h:32
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
CaloGPUHybridClusterProcessor::m_transformBackToCPU
ToolHandle< ICaloClusterGPUOutputTransformer > m_transformBackToCPU
The tool that will convert the data from the GPU back to the CPU.
Definition: CaloGPUHybridClusterProcessor.h:102
CaloGPUHybridClusterProcessor::m_skipConversions
Gaudi::Property< bool > m_skipConversions
If true, both constant and event data conversion is skipped.
Definition: CaloGPUHybridClusterProcessor.h:178
CaloClusterStoreHelper::finalizeClusters
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
Definition: CaloClusterStoreHelper.cxx:64
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
CaloClusterTrigAuxContainer.h
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
max
#define max(a, b)
Definition: cfImp.cxx:41
CaloGPUHybridClusterProcessor::finalize
virtual StatusCode finalize() override
Definition: CaloGPUHybridClusterProcessor.cxx:562
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloClusterStoreHelper::AddContainerWriteHandle
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
Definition: CaloClusterStoreHelper.cxx:53
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
LUCID_EventTPCnv_Dict::t8
std::vector< LUCID_SimHit_p3 > t8
Definition: LUCID_EventTPCnvDict.h:35
SG::VarHandleBase::name
const std::string & name() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:75
CaloGPUHybridClusterProcessor::simple_GPU_pointer_holder::allocate
void allocate(const size_t size)
Definition: CaloGPUHybridClusterProcessor.h:197
LUCID_EventTPCnv_Dict::t3
std::vector< LUCID_RawData_p1 > t3
Definition: LUCID_EventTPCnvDict.h:28
make_hlt_rep.rep
rep
Definition: make_hlt_rep.py:32
CaloGPUHybridClusterProcessor::m_temporariesSize
size_t m_temporariesSize
The size of the temporary buffer to allocate for the GPU tools that will be called.
Definition: CaloGPUHybridClusterProcessor.h:257
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloGPUHybridClusterProcessor::m_doMonitoring
Gaudi::Property< bool > m_doMonitoring
If true, uses the monitoring tool specified by m_monitorTool.
Definition: CaloGPUHybridClusterProcessor.h:125
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
CaloGPUHybridClusterProcessor::m_avgMuKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_avgMuKey
Event input: To get <mu> from Event Info.
Definition: CaloGPUHybridClusterProcessor.h:139
CaloGPUHybridClusterProcessor::m_writeTriggerSpecificInfo
Gaudi::Property< bool > m_writeTriggerSpecificInfo
If true, writes some trigger-specific decorations.
Definition: CaloGPUHybridClusterProcessor.h:143
CaloGPUHybridClusterProcessor.h
CaloGPUHybridClusterProcessor::m_plotterTool
ToolHandle< ICaloClusterGPUPlotter > m_plotterTool
An optional plotter, for testing and/or debugging purposes.
Definition: CaloGPUHybridClusterProcessor.h:120
SG::ReadDecorHandle::isPresent
bool isPresent() const
Is the referenced container present in SG?
LUCID_EventTPCnv_Dict::t7
std::vector< LUCID_SimHit_p2 > t7
Definition: LUCID_EventTPCnvDict.h:34
DataVector::get
const T * get(size_type n) const
Access an element, as an rvalue.
xAOD::CaloCluster_v1::et
double et() const
Definition: CaloCluster_v1.h:856
xAOD::CaloCluster_v1::signalState
State signalState() const
Get the current signal state.
Definition: CaloCluster_v1.h:633
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
xAOD::CaloCluster_v1::ENG_FRAC_MAX
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
Definition: CaloCluster_v1.h:140
CaloGPUHybridClusterProcessor::m_GPUoperations
ToolHandleArray< CaloClusterGPUProcessor > m_GPUoperations
Tools to be applied to the clusters on the GPU.
Definition: CaloGPUHybridClusterProcessor.h:96
CaloNoise::getNoise
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition: CaloNoise.h:34
CaloGPUHybridClusterProcessor::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: CaloGPUHybridClusterProcessor.cxx:179
CaloGPUHybridClusterProcessor::initialize_CUDA
virtual StatusCode initialize_CUDA() override
Initialization that invokes CUDA functions.
Definition: CaloGPUHybridClusterProcessor.cxx:141
CaloGPUTimed
Base class to provide some basic common infrastructure for timing measurements...
Definition: CaloGPUTimed.h:25
CaloGPUHybridClusterProcessor::m_monitoring1thr
Gaudi::Property< float > m_monitoring1thr
Definition: CaloGPUHybridClusterProcessor.h:127
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
CaloGPUHybridClusterProcessor::CaloGPUHybridClusterProcessor
CaloGPUHybridClusterProcessor(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CaloGPUHybridClusterProcessor.cxx:31
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
CaloGPUHybridClusterProcessor::m_doPlots
Gaudi::Property< bool > m_doPlots
If true, calls the plotter specified by m_plotterTool at every tool execution.
Definition: CaloGPUHybridClusterProcessor.h:114
CaloGPUHybridClusterProcessor::initialize_non_CUDA
virtual StatusCode initialize_non_CUDA() override
Initialization that does not invoke CUDA functions.
Definition: CaloGPUHybridClusterProcessor.cxx:40
CaloGPUHybridClusterProcessor::m_monitoring2thr
Gaudi::Property< float > m_monitoring2thr
Definition: CaloGPUHybridClusterProcessor.h:128
xAOD::CaloCluster_v1::clusterSize
ClusterSize clusterSize() const
Get cluster size.
Definition: CaloCluster_v1.cxx:364
CaloGPUHybridClusterProcessor::m_noiseCDOKey
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
Definition: CaloGPUHybridClusterProcessor.h:132
CaloGPUHybridClusterProcessor::m_moniTool
ToolHandle< GenericMonitoringTool > m_moniTool
Monitoring tool.
Definition: CaloGPUHybridClusterProcessor.h:136
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloGPUHybridClusterProcessor::ATLAS_THREAD_SAFE
CaloRecGPU::Helpers::separate_thread_holder< CaloRecGPU::EventDataHolder > m_eventDataThreadedHolder ATLAS_THREAD_SAFE
A way to reduce allocations over multiple threads by keeping a cache of previously allocated objects ...
Definition: CaloGPUHybridClusterProcessor.h:184
python.handimod.now
now
Definition: handimod.py:675
CaloGPUHybridClusterProcessor::m_mutex
std::mutex m_mutex
This mutex is locked when sending the constant data on the first event to ensure thread safety.
Definition: CaloGPUHybridClusterProcessor.h:276
CaloRecGPU::EventDataHolder
Definition: DataHolders.h:35
CaloRecGPU::EventDataHolder::allocate
void allocate(const bool also_GPU=true)
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
CaloGPUHybridClusterProcessor::simple_GPU_pointer_holder::get_pointer
void * get_pointer()
Definition: CaloGPUHybridClusterProcessor.h:238
WriteDecorHandle.h
Handle class for adding a decoration to an object.
CaloGPUTimed::print_times
void print_times(const std::string &header, const size_t time_size) const
Definition: CaloGPUTimed.h:138
CaloGPUHybridClusterProcessor::m_deferConstantDataToFirstEvent
Gaudi::Property< bool > m_deferConstantDataToFirstEvent
If true, the constant data is only converted and sent to the GPU on the first event,...
Definition: CaloGPUHybridClusterProcessor.h:173
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloGPUHybridClusterProcessor::m_monitorCells
Gaudi::Property< bool > m_monitorCells
Definition: CaloGPUHybridClusterProcessor.h:126
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
CaloGPUHybridClusterProcessor::m_constantDataSent
std::atomic< bool > m_constantDataSent
A flag to signal that the constant data has been adequately sent to the GPU.
Definition: CaloGPUHybridClusterProcessor.h:270
LUCID_EventTPCnv_Dict::t4
std::vector< LUCID_RawDataContainer_p1 > t4
Definition: LUCID_EventTPCnvDict.h:29
CaloGPUHybridClusterProcessor::m_clusterCellLinkOutput
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_clusterCellLinkOutput
The name of the key in StoreGate for the output CaloClusterCellLinkContainer.
Definition: CaloGPUHybridClusterProcessor.h:167
CaloDetDescrElement::is_tile
bool is_tile() const
cell belongs to Tile
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:442
CaloNoise
Definition: CaloNoise.h:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloGPUHybridClusterProcessor::m_cellsKey
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
vector of names of the cell containers to use as input.
Definition: CaloGPUHybridClusterProcessor.h:159
CaloDetDescrElement::identifyHash
IdentifierHash identifyHash() const override final
cell subcalo hash same as subcalo_hash(), but kept for backward compatibility
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:424
errorcheck.h
Helpers for checking error return status codes and reporting errors.
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloGPUHybridClusterProcessor::m_postGPUoperations
ToolHandleArray< CaloClusterCollectionProcessor > m_postGPUoperations
Tools to be applied to the clusters after returning from the GPU.
Definition: CaloGPUHybridClusterProcessor.h:108
CaloClusterStoreHelper.h
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
LUCID_EventTPCnv_Dict::t5
std::vector< LUCID_Digit_p2 > t5
Definition: LUCID_EventTPCnvDict.h:31
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
CaloGPUHybridClusterProcessor::m_mDecor_ncells
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_mDecor_ncells
Key to the handle for writing the number of cells as a decoration.
Definition: CaloGPUHybridClusterProcessor.h:147
CaloGPUHybridClusterProcessor::simple_GPU_pointer_holder
A simple RAII wrapper to ensure proper allocation and deallocation of GPU memory in a void * for the ...
Definition: CaloGPUHybridClusterProcessor.h:191
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
CaloGPUTimed::record_times
void record_times(const size_t event_num, const std::vector< size_t > &times) const
Definition: CaloGPUTimed.h:84
CaloGPUTimed::m_measureTimes
Gaudi::Property< bool > m_measureTimes
If true, times are recorded to the file given by m_timeFileName.
Definition: CaloGPUTimed.h:46
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloClusterContainer.h
CaloRecGPU::ConstantDataHolder
Definition: DataHolders.h:19
CaloGPUHybridClusterProcessor::m_numPreAllocatedGPUData
Gaudi::Property< size_t > m_numPreAllocatedGPUData
Number of events for which to pre-allocate space on GPU memory (should ideally be set to the expected...
Definition: CaloGPUHybridClusterProcessor.h:154
CaloGPUHybridClusterProcessor::m_preGPUoperations
ToolHandleArray< CaloClusterCollectionProcessor > m_preGPUoperations
Tools to be applied to the clusters before being sent to the GPU for processing.
Definition: CaloGPUHybridClusterProcessor.h:83
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
python.PyAthena.obj
obj
Definition: PyAthena.py:135
CaloRecGPU
Definition: BaseDefinitions.h:11
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::CaloCluster_v1::N_BAD_CELLS
@ N_BAD_CELLS
number of bad cells
Definition: CaloCluster_v1.h:149
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
CaloGPUHybridClusterProcessor::m_clusterOutput
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_clusterOutput
The name of the key in StoreGate for the output CaloClusterContainer.
Definition: CaloGPUHybridClusterProcessor.h:163
plot_times.times
def times(fn)
Definition: plot_times.py:11
CaloRecGPU::Helpers::separate_thread_accessor
!
Definition: Calorimeter/CaloRecGPU/CaloRecGPU/Helpers.h:1600
CaloGPUHybridClusterProcessor::m_transformConstantData
ToolHandle< ICaloClusterGPUConstantTransformer > m_transformConstantData
The tool that will convert the constant data from the CPU to the GPU.
Definition: CaloGPUHybridClusterProcessor.h:77
CaloGPUHybridClusterProcessor::m_transformForGPU
ToolHandle< ICaloClusterGPUInputTransformer > m_transformForGPU
The tool that will actually convert the data from the CPU to the GPU.
Definition: CaloGPUHybridClusterProcessor.h:90
dumpTriggerInfo.checker
checker
Definition: dumpTriggerInfo.py:20