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

Topological cluster maker algorithm to be run on GPUs. More...

#include <TopoAutomatonClustering.h>

Inheritance diagram for TopoAutomatonClustering:
Collaboration diagram for TopoAutomatonClustering:

Public Member Functions

 TopoAutomatonClustering (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode initialize_non_CUDA () override
 Initialization that does not invoke CUDA functions. More...
 
virtual StatusCode initialize_CUDA () override
 Initialization that invokes CUDA functions. More...
 
virtual StatusCode execute (const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, CaloRecGPU::EventDataHolder &event_data, void *temporary_buffer) const override
 Process the clusters on GPU. More...
 
virtual StatusCode finalize () override
 
virtual ~TopoAutomatonClustering ()=default
 
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
 
virtual size_t size_of_temporaries () const
 The size (in bytes) of the temporary object(s) that the algorithm will use. More...
 
 DeclareInterfaceID (CaloClusterGPUProcessor, 1, 0)
 
void handle (const Incident &incident) override
 

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...
 
void record_times (const size_t event_num, const std::vector< size_t > &times) const
 
template<class ... Args>
void record_times (const size_t event_num, const size_t &value) const
 
template<class ... Args>
void record_times (const size_t event_num, const size_t &value, Args &&... args) const
 
void print_times (const std::string &header, const size_t time_size) const
 

Protected Attributes

std::shared_mutex m_timeMutex
 Mutex that is locked when recording times. More...
 
std::vector< size_t > m_times ATLAS_THREAD_SAFE
 Vector to hold execution times to be recorded if necessary. More...
 
std::vector< size_t > m_eventNumbers ATLAS_THREAD_SAFE
 Vector to hold the event numbers to be recorded if necessary. More...
 
Gaudi::Property< bool > m_measureTimes
 If true, times are recorded to the file given by m_timeFileName. More...
 
Gaudi::Property< std::string > m_timeFileName
 File to which times should be saved. 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...
 
void record_times_helper (const size_t) const
 
template<class Arg >
void record_times_helper (const size_t index, Arg &&arg) const
 
template<class ... Args>
void record_times_helper (size_t index, Args &&... args) const
 

Private Attributes

Gaudi::Property< std::vector< std::string > > m_caloNames {this, "CalorimeterNames", {}, "Name(s) of Calorimeters to use for clustering"}
 vector of names of the calorimeters to consider. More...
 
Gaudi::Property< std::vector< std::string > > m_samplingNames {this, "SeedSamplingNames", {}, "Name(s) of Calorimeter Samplings to consider for seeds"}
 vector of names of the calorimeter samplings to consider for seeds. More...
 
Gaudi::Property< float > m_cellThresholdOnEorAbsEinSigma {this, "CellThresholdOnEorAbsEinSigma", 0., "Cell (terminal) threshold (in units of noise Sigma)"}
 all cells have to satisfy \(|E| > N_{\rm cell}\,\sigma\) More...
 
Gaudi::Property< float > m_neighborThresholdOnEorAbsEinSigma {this, "NeighborThresholdOnEorAbsEinSigma", 2., "Neighbor (grow) threshold (in units of noise Sigma)"}
 cells with \(|E| > N_{\rm neighbor}\,\sigma\) extend the cluster More...
 
Gaudi::Property< float > m_seedThresholdOnEorAbsEinSigma {this, "SeedThresholdOnEorAbsEinSigma", 4., "Seed threshold (in units of noise Sigma)"}
 cells with \(|E| > N_{\rm seed}\,\sigma\) start a cluster More...
 
Gaudi::Property< bool > m_seedCutsInAbsE {this, "SeedCutsInAbsE", true, "Seed cuts in Abs E instead of E"}
 if set to true seed cuts are on \(|E|\) and \(|E|_\perp\). More...
 
Gaudi::Property< bool > m_neighborCutsInAbsE {this, "NeighborCutsInAbsE", true, "Neighbor (grow) cuts in Abs E instead of E"}
 if set to true neighbor cuts are on \(|E|\) and \(|E|_\perp\). More...
 
Gaudi::Property< bool > m_cellCutsInAbsE {this, "CellCutsInAbsE", true, "Cell (terminal) cuts in Abs E instead of E"}
 if set to true cell cuts are on \(|E|\) and \(|E|_\perp\). More...
 
Gaudi::Property< bool > m_cutCellsInTime {this, "SeedCutsInT", false, "Do seed cuts in time"}
 if set to true, time cut is applied to seed cells, no cut otherwise More...
 
Gaudi::Property< float > m_timeThreshold {this, "SeedThresholdOnTAbs", 12.5 * CLHEP::ns, "Time thresholds (in abs. val.)"}
 threshold used for timing cut on seed cells. More...
 
Gaudi::Property< float > m_thresholdForKeeping {this, "TimeCutUpperLimit", 20., "Significance upper limit for applying time cut"}
 upper limit on the energy significance, for applying the cell time cut More...
 
Gaudi::Property< bool > m_treatL1PredictedCellsAsGood {this, "TreatL1PredictedCellsAsGood", true, "Treat bad cells with dead OTX if predicted from L1 as good"}
 if set to true treat cells with a dead OTX which can be predicted by L1 trigger info as good instead of bad cells More...
 
Gaudi::Property< bool > m_excludeCutSeedsFromClustering {this, "CutOOTseed", true, "Exclude out-of-time seeds from neighbouring and cell stage"}
 if set to true, seed cells failing the time cut are also excluded from cluster at all More...
 
Gaudi::Property< bool > m_keepSignificantCells {this, "UseTimeCutUpperLimit", false, "Do not apply time cut on cells of large significance"}
 if set to true, the time cut is not applied on cell of large significance More...
 
Gaudi::Property< bool > m_twoGaussianNoise {this, "TwoGaussianNoise", false, "Use 2-gaussian noise description for TileCal"}
 if set to true use 2-gaussian noise description for TileCal More...
 
Gaudi::Property< std::string > m_neighborOptionString
 type of neighbor relations to use. More...
 
Gaudi::Property< bool > m_restrictHECIWandFCalNeighbors
 if set to true limit the neighbors in HEC IW and FCal2&3. More...
 
Gaudi::Property< bool > m_restrictPSNeighbors
 if set to true limit the neighbors in presampler Barrel and Endcap. More...
 
Gaudi::Property< bool > m_xtalkEM2
 If set to true, the time window is softened in the EMB2 and EME2_OW due to crosstalk from direct neighbour cells in phi. More...
 
Gaudi::Property< float > m_xtalkDeltaT
 Additional maximum delta t added to the upper limit time window in case crosstalk in EM2 should be accounted for. More...
 
TAGrowing::TACOptionsHolder m_options
 Options for the algorithm, held in a GPU-friendly way. More...
 
ServiceHandle< IGPUKernelSizeOptimizerSvcm_kernelSizeOptimizer { this, "KernelSizeOptimizer", "GPUKernelSizeOptimizerSvc", "CUDA kernel size optimization service." }
 Handle to the CUDA kernel block and grid size optimization service. 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

Topological cluster maker algorithm to be run on GPUs.

Author
Nuno Fernandes nuno..nosp@m.dos..nosp@m.santo.nosp@m.s.fe.nosp@m.rnand.nosp@m.es@c.nosp@m.ern.c.nosp@m.h
Date
31 May 2022

Definition at line 36 of file TopoAutomatonClustering.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

◆ TopoAutomatonClustering()

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

Definition at line 24 of file TopoAutomatonClustering.cxx.

24  :
26  CaloGPUTimed(this)
27 {
28  declareInterface<CaloClusterGPUProcessor> (this);
29 }

◆ ~TopoAutomatonClustering()

virtual TopoAutomatonClustering::~TopoAutomatonClustering ( )
virtualdefault

Member Function Documentation

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

◆ DeclareInterfaceID()

CaloClusterGPUProcessor::DeclareInterfaceID ( CaloClusterGPUProcessor  ,
,
 
)
inherited

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

◆ execute()

StatusCode TopoAutomatonClustering::execute ( const EventContext &  ctx,
const CaloRecGPU::ConstantDataHolder constant_data,
CaloRecGPU::EventDataHolder event_data,
void *  temporary_buffer 
) const
overridevirtual

Process the clusters on GPU.

Parameters
ctxThe event context.
constant_dataData held in GPU memory that is common to all events (cell noise and geometry).
event_dataData held in GPU memory that is specific to this event (including the description of the clusters themselves).
temporary_bufferA pointer to an \array in GPU memory that is at least as large as size_of_temporaries(), to hold temporary information for the algorithms. Given the way CUDA memory allocations work, casting this to a pointer (or a CaloRecGPU::Helpers::CUDA_kernel_object) to the intended type and then using it will be perfectly valid.

Implements CaloClusterGPUProcessor.

Definition at line 255 of file TopoAutomatonClustering.cxx.

257 {
258 
259  using clock_type = boost::chrono::thread_clock;
260  auto time_cast = [](const auto & before, const auto & after)
261  {
262  return boost::chrono::duration_cast<boost::chrono::microseconds>(after - before).count();
263  };
264 
265  static_assert(sizeof(TopoAutomatonGrowingTemporaries) <= sizeof(ClusterMomentsArr), "We store the temporaries in the cluster moments, so the sizes must be compatible!");
266 
267  const auto start = clock_type::now();
268 
269  const auto before_snr = clock_type::now();
270 
271  signalToNoise(event_data, constant_data, m_options, *(m_kernelSizeOptimizer.get()), m_measureTimes);
272 
273  const auto before_pairs = clock_type::now();
274 
275  cellPairs(event_data, constant_data, m_options, *(m_kernelSizeOptimizer.get()), m_measureTimes);
276 
277  const auto before_growing = clock_type::now();
278 
279  clusterGrowing(event_data, constant_data, m_options, *(m_kernelSizeOptimizer.get()), m_measureTimes);
280 
281  const auto end = clock_type::now();
282 
283 
284  if (m_measureTimes)
285  {
286  record_times(ctx.evt(),
287  time_cast(start, before_snr),
288  time_cast(before_snr, before_pairs),
289  time_cast(before_pairs, before_growing),
290  time_cast(before_growing, end)
291  );
292  }
293 
294  return StatusCode::SUCCESS;
295 
296 
297 }

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

Definition at line 300 of file TopoAutomatonClustering.cxx.

301 {
302  if (m_measureTimes)
303  {
304  print_times("Preprocessing Signal-to-Noise_Ratio Cell_Pair_Creation Cluster_Growing", 4);
305  }
306  return StatusCode::SUCCESS;
307 }

◆ handle()

void CaloGPUCUDAInitialization::handle ( const Incident &  incident)
inlineoverrideinherited

Definition at line 66 of file CaloGPUCUDAInitialization.h.

67  {
68  const bool is_multiprocess = (Gaudi::Concurrency::ConcurrencyFlags::numProcs() > 0);
69  if (is_multiprocess && incident.type() == AthenaInterprocess::UpdateAfterFork::type())
70  {
71  if (!this->initialize_CUDA().isSuccess())
72  {
73  throw GaudiException("Failed to perform the CUDA initialization!",
74  "CaloGPUCUDAInitialization::handle",
75  StatusCode::FAILURE);
76  }
77  }
78  }

◆ initialize()

virtual StatusCode TopoAutomatonClustering::initialize ( )
inlineoverridevirtual

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 43 of file TopoAutomatonClustering.h.

44  {
46  }

◆ initialize_CUDA()

StatusCode TopoAutomatonClustering::initialize_CUDA ( )
overridevirtual

Initialization that invokes CUDA functions.

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 245 of file TopoAutomatonClustering.cxx.

246 {
249 
250  return StatusCode::SUCCESS;
251 }

◆ initialize_non_CUDA()

StatusCode TopoAutomatonClustering::initialize_non_CUDA ( )
overridevirtual

Initialization that does not invoke CUDA functions.

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 31 of file TopoAutomatonClustering.cxx.

32 {
33 
35 
36 
37  using PackType = decltype(m_options.m_options->valid_sampling_seed);
38 
39  static_assert(CaloCell_ID::getNumberOfSamplings() <= sizeof(PackType) * CHAR_BIT, "We are assuming that we have fewer samplings that bits per int!");
40 
41  //Possibly more elegant alternative: compile-time packed bool vector (std::bitset?) with CUDA compat.
42  //Been there, done that, overkill since number of samplings shouldn't change unexpectedly overnight
43  //and it doesn't seem that likely to me that it'll reach anything that a 64-bit int wouldn't cover
44  //(at least without implying such a major overhaul that the code will need a deeper redesign anyway...)
45 
46  auto get_sampling_from_string = [](const std::string & str, bool & failed)
47  {
48  failed = false;
50  CRGPU_CHEAP_STRING_TO_ENUM( str, CaloCell_ID,
52  EMB1,
53  EMB2,
54  EMB3,
56  EME1,
57  EME2,
58  EME3,
59  HEC0,
60  HEC1,
61  HEC2,
62  HEC3,
63  TileBar0,
64  TileBar1,
65  TileBar2,
66  TileGap1,
67  TileGap2,
68  TileGap3,
69  TileExt0,
70  TileExt1,
71  TileExt2,
72  FCAL0,
73  FCAL1,
74  FCAL2
75  )
76  )
77  else
78  {
79  failed = true;
80  return CaloCell_ID::Unknown;
81  }
82  };
83 
84 
85  PackType & seed_samplings = m_options.m_options->valid_sampling_seed;
86 
87  seed_samplings = 0;
88 
89  for (const std::string & samp_name : m_samplingNames)
90  {
91  bool failed = false;
92  const PackType sampling = (PackType) get_sampling_from_string(samp_name, failed);
93 
94  if (failed)
95  {
96  ATH_MSG_ERROR( "Calorimeter sampling" << samp_name
97  << " is not a valid Calorimeter sampling name and will be ignored! "
98  << "Valid names are: "
99  << "PreSamplerB, EMB1, EMB2, EMB3, "
100  << "PreSamplerE, EME1, EME2, EME3, "
101  << "HEC0, HEC1, HEC2, HEC3, "
102  << "TileBar0, TileBar1, TileBar2, "
103  << "TileGap1, TileGap2, TileGap3, "
104  << "TileExt0, TileExt1, TileExt2, "
105  << "FCAL0, FCAL1, FCAL2." );
106  }
107  else
108  {
109  seed_samplings |= ((PackType) 1) << sampling;
110  }
111  }
112 
113  auto get_calo_from_string = [](const std::string & str, bool & failed)
114  {
115  failed = false;
117  CRGPU_CHEAP_STRING_TO_ENUM( str, CaloCell_ID,
118  LAREM, LARHEC,
119  LARFCAL, TILE,
121  )
122  )
123  else
124  {
125  failed = true;
126  return CaloCell_ID::NOT_VALID;
127  }
128  };
129 
130 
131  auto calo_to_sampling_mask = [](const CaloCell_ID::SUBCALO sc) -> PackType
132  {
133  switch (sc)
134  {
135  case CaloCell_ID::LAREM:
136  return 0xFFU;
137  //PreSamplerB=0, EMB1, EMB2, EMB3,
138  //PreSamplerE, EME1, EME2, EME3=7,
139  case CaloCell_ID::LARHEC:
140  return 0xF00U;
141  //HEC0=8, HEC1, HEC2, HEC3=11,
142  case CaloCell_ID::TILE:
143  return 0x1FF000U;
144  //TileBar0=12, TileBar1, TileBar2,
145  //TileGap1, TileGap2, TileGap3,
146  //TileExt0, TileExt1, TileExt2=20,
148  return 0xE00000U;
149  //FCAL0=21, FCAL1, FCAL2=23
151  return 0xF000000U;
152  //MINIFCAL0=24, MINIFCAL1, MINIFCAL2, MINIFCAL3=27,
153  default:
154  return 0;
155  }
156  };
157 
158  PackType & calo_samplings = m_options.m_options->valid_calorimeter_by_sampling;
159 
160  calo_samplings = 0;
161 
162  for (const std::string & calo_name : m_caloNames)
163  {
164  bool failed = false;
165  const PackType sample_mask = calo_to_sampling_mask(get_calo_from_string(calo_name, failed));
166 
167  if (failed)
168  {
169  ATH_MSG_ERROR( "Calorimeter " << calo_name
170  << " is not a valid Calorimeter name and will be ignored! "
171  << "Valid names are: LAREM, LARHEC, LARFCAL, and TILE." );
172  }
173  else
174  {
175  calo_samplings |= sample_mask;
176  }
177  }
178 
179  auto get_neighbour_option_from_string = [](const std::string & str, bool & failed)
180  {
181  failed = false;
184  prevInPhi,
185  nextInPhi,
186  prevInEta,
187  nextInEta,
188  faces2D,
189  corners2D,
190  all2D,
191  prevInSamp,
192  nextInSamp,
193  upAndDown,
194  prevSubDet,
195  nextSubDet,
196  all3D,
197  corners3D,
201  super3D
202  )
203  )
204  else
205  {
206  failed = true;
207  return LArNeighbours::super3D;
208  }
209  };
210 
211  bool neigh_failed = false;
212  m_options.m_options->neighbour_options = (unsigned int) get_neighbour_option_from_string(m_neighborOptionString, neigh_failed);
213 
214  if (neigh_failed)
215  {
216  ATH_MSG_ERROR("Invalid Neighbour Option: " << m_neighborOptionString);
217  }
218 
224  m_options.m_options->abs_terminal = m_cellCutsInAbsE;
225  m_options.m_options->use_two_gaussian = m_twoGaussianNoise;
226 
227  m_options.m_options->treat_L1_predicted_as_good = m_treatL1PredictedCellsAsGood;
228  m_options.m_options->use_time_cut = m_cutCellsInTime;
229  m_options.m_options->keep_significant_cells = m_keepSignificantCells;
230  m_options.m_options->completely_exclude_cut_seeds = m_excludeCutSeedsFromClustering;
231  m_options.m_options->time_threshold = m_timeThreshold;
232  m_options.m_options->snr_threshold_for_keeping_cells = m_thresholdForKeeping;
233 
234  m_options.m_options->limit_HECIW_and_FCal_neighs = m_restrictHECIWandFCalNeighbors;
235  m_options.m_options->limit_PS_neighs = m_restrictPSNeighbors;
236 
237  m_options.m_options->use_crosstalk = m_xtalkEM2;
238  m_options.m_options->crosstalk_delta = m_xtalkDeltaT;
239 
240  ATH_CHECK( m_kernelSizeOptimizer.retrieve() );
241 
242  return StatusCode::SUCCESS;
243 }

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

◆ print_times()

void CaloGPUTimed::print_times ( const std::string &  header,
const size_t  time_size 
) const
inlineprotectedinherited

Definition at line 143 of file CaloGPUTimed.h.

144  {
145  std::shared_lock<std::shared_mutex> lock(m_timeMutex);
146 
147  if (m_timeFileName.size() == 0)
148  {
149  return;
150  }
151 
152  std::vector<size_t> indices(m_eventNumbers.size());
153 
154  std::iota(indices.begin(), indices.end(), 0);
155  std::sort(indices.begin(), indices.end(), [&](size_t a, size_t b)
156  {
157  return m_eventNumbers[a] < m_eventNumbers[b];
158  }
159  );
160  std::ofstream out(m_timeFileName);
161 
162  out << "Event_Number Total " << header << "\n";
163 
164  for (const size_t idx : indices)
165  {
166  out << m_eventNumbers[idx] << " ";
167 
168  size_t total = 0;
169 
170  for (size_t i = 0; i < time_size; ++i)
171  {
172  total += m_times[idx * time_size + i];
173  }
174 
175  out << total << " ";
176 
177  for (size_t i = 0; i < time_size; ++i)
178  {
179  out << m_times[idx * time_size + i] << " ";
180  }
181  out << "\n";
182  }
183 
184  out << std::endl;
185 
186  out.close();
187  }

◆ record_times() [1/3]

template<class ... Args>
void CaloGPUTimed::record_times ( const size_t  event_num,
const size_t &  value 
) const
inlineprotectedinherited

Definition at line 105 of file CaloGPUTimed.h.

106  {
107  const size_t time_size = 1;
108 
109  size_t old_size;
110 
111  {
112  std::unique_lock<std::shared_mutex> lock(m_timeMutex);
113  old_size = m_times.size();
114  m_times.resize(old_size + time_size);
115  m_eventNumbers.push_back(event_num);
116  }
117  {
118  std::shared_lock<std::shared_mutex> lock(m_timeMutex);
119  record_times_helper(old_size, value);
120  }
121  }

◆ record_times() [2/3]

template<class ... Args>
void CaloGPUTimed::record_times ( const size_t  event_num,
const size_t &  value,
Args &&...  args 
) const
inlineprotectedinherited

Definition at line 124 of file CaloGPUTimed.h.

125  {
126  const size_t time_size = sizeof...(args) + 1;
127 
128  size_t old_size;
129 
130  {
131  std::unique_lock<std::shared_mutex> lock(m_timeMutex);
132  old_size = m_times.size();
133  m_times.resize(old_size + time_size);
134  m_eventNumbers.push_back(event_num);
135  }
136  {
137  std::shared_lock<std::shared_mutex> lock(m_timeMutex);
138  record_times_helper(old_size, value, std::forward<Args>(args)...);
139  }
140 
141  }

◆ record_times() [3/3]

void CaloGPUTimed::record_times ( const size_t  event_num,
const std::vector< size_t > &  times 
) const
inlineprotectedinherited

Definition at line 86 of file CaloGPUTimed.h.

87  {
88  size_t old_size;
89  {
90  std::unique_lock<std::shared_mutex> lock(m_timeMutex);
91  old_size = m_times.size();
92  m_times.resize(old_size + times.size());
93  m_eventNumbers.push_back(event_num);
94  }
95  {
96  std::shared_lock<std::shared_mutex> lock(m_timeMutex);
97  for (size_t i = 0; i < times.size(); ++i)
98  {
99  m_times[old_size + i] = times[i];
100  }
101  }
102  }

◆ record_times_helper() [1/3]

template<class Arg >
void CaloGPUTimed::record_times_helper ( const size_t  index,
Arg &&  arg 
) const
inlineprivateinherited

Definition at line 70 of file CaloGPUTimed.h.

71  {
72  // coverity[missing_lock]
73  m_times[index] = std::forward<Arg>(arg);
74 
75  //This is called within a function that holds the lock itself.
76  }

◆ record_times_helper() [2/3]

void CaloGPUTimed::record_times_helper ( const  size_t) const
inlineprivateinherited

Definition at line 64 of file CaloGPUTimed.h.

65  {
66  //Do nothing
67  }

◆ record_times_helper() [3/3]

template<class ... Args>
void CaloGPUTimed::record_times_helper ( size_t  index,
Args &&...  args 
) const
inlineprivateinherited

Definition at line 79 of file CaloGPUTimed.h.

80  {
81  (record_times_helper(index++, std::forward<Args>(args)), ...);
82  }

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

◆ size_of_temporaries()

virtual size_t CaloClusterGPUProcessor::size_of_temporaries ( ) const
inlinevirtualinherited

The size (in bytes) of the temporary object(s) that the algorithm will use.

Reimplemented in BasicGPUClusterInfoCalculator.

Definition at line 48 of file CaloClusterGPUProcessor.h.

49  {
50  return 0;
51  };

◆ 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

◆ ATLAS_THREAD_SAFE [1/2]

std::vector<size_t> m_times CaloGPUTimed::ATLAS_THREAD_SAFE
mutableprotectedinherited

Vector to hold execution times to be recorded if necessary.

Definition at line 35 of file CaloGPUTimed.h.

◆ ATLAS_THREAD_SAFE [2/2]

std::vector<size_t> m_eventNumbers CaloGPUTimed::ATLAS_THREAD_SAFE
mutableprotectedinherited

Vector to hold the event numbers to be recorded if necessary.

Definition at line 40 of file CaloGPUTimed.h.

◆ m_caloNames

Gaudi::Property<std::vector<std::string> > TopoAutomatonClustering::m_caloNames {this, "CalorimeterNames", {}, "Name(s) of Calorimeters to use for clustering"}
private

vector of names of the calorimeters to consider.

The default is to use all calorimeters (i.e. LAREM, LARHEC, LARFCAL, TILE). Cells which belong to one of the input cell containers and to one of the calorimeters in this vector are used as input for the cluster maker. This property is used in order to ignore a certain subsystem (e.g. for LAREM only clusters specify only LAREM in the jobOptions).

Definition at line 72 of file TopoAutomatonClustering.h.

◆ m_cellCutsInAbsE

Gaudi::Property<bool> TopoAutomatonClustering::m_cellCutsInAbsE {this, "CellCutsInAbsE", true, "Cell (terminal) cuts in Abs E instead of E"}
private

if set to true cell cuts are on \(|E|\) and \(|E|_\perp\).

The cell cuts will be on absolute energy and absolute transverse energy if this is set to true. If set to false the cuts will be on energy and transverse energy instead.

Definition at line 150 of file TopoAutomatonClustering.h.

◆ m_cellThresholdOnEorAbsEinSigma

Gaudi::Property<float> TopoAutomatonClustering::m_cellThresholdOnEorAbsEinSigma {this, "CellThresholdOnEorAbsEinSigma", 0., "Cell (terminal) threshold (in units of noise Sigma)"}
private

all cells have to satisfy \(|E| > N_{\rm cell}\,\sigma\)

This cut determines how much the cluster will extend beyond the last cell passing the neighbor threshold. The smaller this cut is the more cells will be allowed in the tail of the cluster. It should be smaller or equal to the neighbor threshold. If a cell passing this cut is neighbor of two or more cells passing the neighbor cut it will be inserted in the cluster which has the neighbor cell that was asked first for its neighbors. Since the original list of seed cells is ordered in descending order of \(E/\sigma\) (or \(|E|/\sigma\)) the distance of the cell (in number of cell generations passing the neighbor cut until this cell will be reached) usually determines in which cluster the cell will end up in. The cell cut should be lower or equal to the neighbor cut.

Definition at line 102 of file TopoAutomatonClustering.h.

◆ m_cutCellsInTime

Gaudi::Property<bool> TopoAutomatonClustering::m_cutCellsInTime {this, "SeedCutsInT", false, "Do seed cuts in time"}
private

if set to true, time cut is applied to seed cells, no cut otherwise

Definition at line 155 of file TopoAutomatonClustering.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_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_excludeCutSeedsFromClustering

Gaudi::Property<bool> TopoAutomatonClustering::m_excludeCutSeedsFromClustering {this, "CutOOTseed", true, "Exclude out-of-time seeds from neighbouring and cell stage"}
private

if set to true, seed cells failing the time cut are also excluded from cluster at all

Definition at line 174 of file TopoAutomatonClustering.h.

◆ m_keepSignificantCells

Gaudi::Property<bool> TopoAutomatonClustering::m_keepSignificantCells {this, "UseTimeCutUpperLimit", false, "Do not apply time cut on cells of large significance"}
private

if set to true, the time cut is not applied on cell of large significance

Definition at line 179 of file TopoAutomatonClustering.h.

◆ m_kernelSizeOptimizer

ServiceHandle<IGPUKernelSizeOptimizerSvc> TopoAutomatonClustering::m_kernelSizeOptimizer { this, "KernelSizeOptimizer", "GPUKernelSizeOptimizerSvc", "CUDA kernel size optimization service." }
private

Handle to the CUDA kernel block and grid size optimization service.

Definition at line 259 of file TopoAutomatonClustering.h.

◆ m_measureTimes

Gaudi::Property<bool> CaloGPUTimed::m_measureTimes
protectedinherited

If true, times are recorded to the file given by m_timeFileName.

Defaults to false.

Definition at line 46 of file CaloGPUTimed.h.

◆ m_neighborCutsInAbsE

Gaudi::Property<bool> TopoAutomatonClustering::m_neighborCutsInAbsE {this, "NeighborCutsInAbsE", true, "Neighbor (grow) cuts in Abs E instead of E"}
private

if set to true neighbor cuts are on \(|E|\) and \(|E|_\perp\).

The neighbor cuts will be on absolute energy and absolute transverse energy if this is set to true. If set to false the cuts will be on energy and transverse energy instead.

Definition at line 142 of file TopoAutomatonClustering.h.

◆ m_neighborOptionString

Gaudi::Property<std::string> TopoAutomatonClustering::m_neighborOptionString
private
Initial value:
{this, "NeighborOption", "super3D",
"Neighbor option to be used for cell neighborhood relations"}

type of neighbor relations to use.

The CaloIdentifier package defines different types of neighbors for the calorimeter cells. Currently supported neighbor relations for topological clustering are:

  • "all2D" for all cells in the same layer (sampling or module) of one calorimeter subsystem. Note that endcap and barrel will be unconnected in this case even for the LAREM.
  • "all3D" for all cells in the same calorimeter. This means all the "all2D" neighbors for each cell plus the cells in adjacent samplings overlapping at least partially in \(\eta\) and \(\phi\) with the cell. Note that endcap and barrel will be connected in this case for the LAREM.
  • "super3D" for all cells. This means all the "all3D" neighbors for each cell plus the cells in adjacent samplings from other subsystems overlapping at least partially in \(\eta\) and \(\phi\) with the cell. All calorimeters are connected in this case.

The default setting is "super3D".

Definition at line 214 of file TopoAutomatonClustering.h.

◆ m_neighborThresholdOnEorAbsEinSigma

Gaudi::Property<float> TopoAutomatonClustering::m_neighborThresholdOnEorAbsEinSigma {this, "NeighborThresholdOnEorAbsEinSigma", 2., "Neighbor (grow) threshold (in units of noise Sigma)"}
private

cells with \(|E| > N_{\rm neighbor}\,\sigma\) extend the cluster

This cut determines how many cells are asked for their neighbors to expand the cluster. The smaller this cut is the more cells will be asked for their neighbors. If a cell passing this cut is neighbor of two other cells passing this cut from different clusters, the two clusters are merged. The neighbor cut should be lower or equal to the seed cut.

Definition at line 113 of file TopoAutomatonClustering.h.

◆ m_options

TAGrowing::TACOptionsHolder TopoAutomatonClustering::m_options
private

Options for the algorithm, held in a GPU-friendly way.

Definition at line 256 of file TopoAutomatonClustering.h.

◆ m_restrictHECIWandFCalNeighbors

Gaudi::Property<bool> TopoAutomatonClustering::m_restrictHECIWandFCalNeighbors
private
Initial value:
{this, "RestrictHECIWandFCalNeighbors",
false, "Limit the neighbors in HEC IW and FCal2&3"}

if set to true limit the neighbors in HEC IW and FCal2&3.

The cells in HEC IW and FCal2&3 get very large in terms of eta and phi. Since this might pose problems on certain jet algorithms one might need to avoid expansion in eta and phi for those cells. If this property is set to true the 2d neighbors of these cells are not used - only the next sampling neighbors are probed.

Definition at line 226 of file TopoAutomatonClustering.h.

◆ m_restrictPSNeighbors

Gaudi::Property<bool> TopoAutomatonClustering::m_restrictPSNeighbors
private
Initial value:
{this, "RestrictPSNeighbors",
false, "Limit the neighbors in presampler Barrel and Endcap"}

if set to true limit the neighbors in presampler Barrel and Endcap.

The presampler cells add a lot of PileUp in the Hilum samples. With this option set to true the presampler cells do not expand the cluster in the presampler layer. Only the next sampling is used as valid neighbor source.

Definition at line 236 of file TopoAutomatonClustering.h.

◆ m_samplingNames

Gaudi::Property<std::vector<std::string> > TopoAutomatonClustering::m_samplingNames {this, "SeedSamplingNames", {}, "Name(s) of Calorimeter Samplings to consider for seeds"}
private

vector of names of the calorimeter samplings to consider for seeds.

The default is to use all calorimeter samplings. Excluding a sampling from this vector prevents the definition of a seed cell in this sampling. Cells in those samplings are still used and incorporated in the topo clusters (both on the neighbor and the cell level) they can therefore even expand a cluster but not seed one ...

Definition at line 84 of file TopoAutomatonClustering.h.

◆ m_seedCutsInAbsE

Gaudi::Property<bool> TopoAutomatonClustering::m_seedCutsInAbsE {this, "SeedCutsInAbsE", true, "Seed cuts in Abs E instead of E"}
private

if set to true seed cuts are on \(|E|\) and \(|E|_\perp\).

The seed cuts and the \(E_\perp\) cut on the final clusters before insertion to the CaloClusterContainer will be on absolute energy and absolute transverse energy if this is set to true. If set to false the cuts will be on energy and transverse energy instead.

Definition at line 134 of file TopoAutomatonClustering.h.

◆ m_seedThresholdOnEorAbsEinSigma

Gaudi::Property<float> TopoAutomatonClustering::m_seedThresholdOnEorAbsEinSigma {this, "SeedThresholdOnEorAbsEinSigma", 4., "Seed threshold (in units of noise Sigma)"}
private

cells with \(|E| > N_{\rm seed}\,\sigma\) start a cluster

This cut determines how many clusters are formed initially. The smaller this cut is the more clusters will be created. During the accumulation of cells inside the clusters it can happen that clusters are merged if a cell passing the neighbor threshold would be included in both clusters.

Definition at line 123 of file TopoAutomatonClustering.h.

◆ m_thresholdForKeeping

Gaudi::Property<float> TopoAutomatonClustering::m_thresholdForKeeping {this, "TimeCutUpperLimit", 20., "Significance upper limit for applying time cut"}
private

upper limit on the energy significance, for applying the cell time cut

Definition at line 163 of file TopoAutomatonClustering.h.

◆ m_timeFileName

Gaudi::Property<std::string> CaloGPUTimed::m_timeFileName
protectedinherited

File to which times should be saved.

Definition at line 50 of file CaloGPUTimed.h.

◆ m_timeMutex

std::shared_mutex CaloGPUTimed::m_timeMutex
mutableprotectedinherited

Mutex that is locked when recording times.

Definition at line 32 of file CaloGPUTimed.h.

◆ m_timeThreshold

Gaudi::Property<float> TopoAutomatonClustering::m_timeThreshold {this, "SeedThresholdOnTAbs", 12.5 * CLHEP::ns, "Time thresholds (in abs. val.)"}
private

threshold used for timing cut on seed cells.

Implemented as |seed_cell_time|<m_timeThreshold. No such cut on neighbouring cells.

Definition at line 159 of file TopoAutomatonClustering.h.

◆ m_treatL1PredictedCellsAsGood

Gaudi::Property<bool> TopoAutomatonClustering::m_treatL1PredictedCellsAsGood {this, "TreatL1PredictedCellsAsGood", true, "Treat bad cells with dead OTX if predicted from L1 as good"}
private

if set to true treat cells with a dead OTX which can be predicted by L1 trigger info as good instead of bad cells

Definition at line 169 of file TopoAutomatonClustering.h.

◆ m_twoGaussianNoise

Gaudi::Property<bool> TopoAutomatonClustering::m_twoGaussianNoise {this, "TwoGaussianNoise", false, "Use 2-gaussian noise description for TileCal"}
private

if set to true use 2-gaussian noise description for TileCal

Warning
Currently unsupported on the GPU side!

Definition at line 187 of file TopoAutomatonClustering.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_xtalkDeltaT

Gaudi::Property<float> TopoAutomatonClustering::m_xtalkDeltaT
private
Initial value:
{this, "XTalkDeltaT",
15 * CLHEP::ns, "Delta T to add to upper time threshold for EM2 cells affected by xtalk."}

Additional maximum delta t added to the upper limit time window in case crosstalk in EM2 should be accounted for.


Definition at line 250 of file TopoAutomatonClustering.h.

◆ m_xtalkEM2

Gaudi::Property<bool> TopoAutomatonClustering::m_xtalkEM2
private
Initial value:
{this, "XTalkEM2",
false, "Relax time window (if timing is used) in EM2 when xTalk is present"}

If set to true, the time window is softened in the EMB2 and EME2_OW due to crosstalk from direct neighbour cells in phi.

Definition at line 244 of file TopoAutomatonClustering.h.


The documentation for this class was generated from the following files:
TopoAutomatonClustering::m_cutCellsInTime
Gaudi::Property< bool > m_cutCellsInTime
if set to true, time cut is applied to seed cells, no cut otherwise
Definition: TopoAutomatonClustering.h:155
TopoAutomatonClustering::m_restrictHECIWandFCalNeighbors
Gaudi::Property< bool > m_restrictHECIWandFCalNeighbors
if set to true limit the neighbors in HEC IW and FCal2&3.
Definition: TopoAutomatonClustering.h:226
TopoAutomatonClustering::m_caloNames
Gaudi::Property< std::vector< std::string > > m_caloNames
vector of names of the calorimeters to consider.
Definition: TopoAutomatonClustering.h:72
LArNeighbours::nextSuperCalo
@ nextSuperCalo
Definition: LArNeighbours.h:28
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
LArNeighbours::corners3D
@ corners3D
Definition: LArNeighbours.h:25
TopoAutomatonClustering::m_cellCutsInAbsE
Gaudi::Property< bool > m_cellCutsInAbsE
if set to true cell cuts are on and .
Definition: TopoAutomatonClustering.h:150
LArNeighbours::upAndDown
@ upAndDown
Definition: LArNeighbours.h:21
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
header
Definition: hcg.cxx:526
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
TopoAutomatonClustering::m_xtalkDeltaT
Gaudi::Property< float > m_xtalkDeltaT
Additional maximum delta t added to the upper limit time window in case crosstalk in EM2 should be ac...
Definition: TopoAutomatonClustering.h:250
TAGrowing::cellPairs
void cellPairs(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TACOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloGPUTimed::m_timeMutex
std::shared_mutex m_timeMutex
Mutex that is locked when recording times.
Definition: CaloGPUTimed.h:32
LArNeighbours::corners2D
@ corners2D
Definition: LArNeighbours.h:17
index
Definition: index.py:1
TAGrowing::TACOptionsHolder::m_options
CaloRecGPU::Helpers::CPU_object< TopoAutomatonOptions > m_options
Definition: TopoAutomatonClusteringImpl.h:278
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
CaloCell_Base_ID::LARMINIFCAL
@ LARMINIFCAL
Definition: CaloCell_Base_ID.h:46
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
LArNeighbours::faces2D
@ faces2D
Definition: LArNeighbours.h:16
LArNeighbours::nextSubDet
@ nextSubDet
Definition: LArNeighbours.h:23
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
CaloGPUTimed::m_timeFileName
Gaudi::Property< std::string > m_timeFileName
File to which times should be saved.
Definition: CaloGPUTimed.h:50
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TAGrowing::TACOptionsHolder::allocate
void allocate()
Definition: TopoAutomatonClusteringImpl.h:282
athena.value
value
Definition: athena.py:124
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LArNeighbours::prevInPhi
@ prevInPhi
Definition: LArNeighbours.h:12
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TAGrowing::clusterGrowing
void clusterGrowing(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TACOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TopoAutomatonClustering::m_seedCutsInAbsE
Gaudi::Property< bool > m_seedCutsInAbsE
if set to true seed cuts are on and .
Definition: TopoAutomatonClustering.h:134
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
CRGPU_CHEAP_STRING_TO_ENUM
#define CRGPU_CHEAP_STRING_TO_ENUM(VAR, PREFIX, ONE,...)
Checks a string variable, VAR, for matching enum identifiers (ONE and the remaining variadic argument...
Definition: MacroHelpers.h:146
CaloGPUCUDAInitialization::initialize
virtual StatusCode initialize()
Definition: CaloGPUCUDAInitialization.h:44
LArNeighbours::nextInSamp
@ nextInSamp
Definition: LArNeighbours.h:20
TopoAutomatonClustering::m_seedThresholdOnEorAbsEinSigma
Gaudi::Property< float > m_seedThresholdOnEorAbsEinSigma
cells with start a cluster
Definition: TopoAutomatonClustering.h:123
LArNeighbours::nextInPhi
@ nextInPhi
Definition: LArNeighbours.h:13
TopoAutomatonClustering::m_restrictPSNeighbors
Gaudi::Property< bool > m_restrictPSNeighbors
if set to true limit the neighbors in presampler Barrel and Endcap.
Definition: TopoAutomatonClustering.h:236
python.handimod.now
now
Definition: handimod.py:675
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
TAGrowing::signalToNoise
void signalToNoise(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TACOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
LArNeighbours::all3DwithCorners
@ all3DwithCorners
Definition: LArNeighbours.h:26
TopoAutomatonClustering::m_excludeCutSeedsFromClustering
Gaudi::Property< bool > m_excludeCutSeedsFromClustering
if set to true, seed cells failing the time cut are also excluded from cluster at all
Definition: TopoAutomatonClustering.h:174
CRGPU_RECURSIVE_MACRO
#define CRGPU_RECURSIVE_MACRO(...)
Expands recursive macros.
Definition: MacroHelpers.h:68
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
TopoAutomatonClustering::m_samplingNames
Gaudi::Property< std::vector< std::string > > m_samplingNames
vector of names of the calorimeter samplings to consider for seeds.
Definition: TopoAutomatonClustering.h:84
TopoAutomatonClustering::m_kernelSizeOptimizer
ServiceHandle< IGPUKernelSizeOptimizerSvc > m_kernelSizeOptimizer
Handle to the CUDA kernel block and grid size optimization service.
Definition: TopoAutomatonClustering.h:259
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
CaloGPUTimed::print_times
void print_times(const std::string &header, const size_t time_size) const
Definition: CaloGPUTimed.h:143
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TopoAutomatonClustering::m_thresholdForKeeping
Gaudi::Property< float > m_thresholdForKeeping
upper limit on the energy significance, for applying the cell time cut
Definition: TopoAutomatonClustering.h:163
TopoAutomatonClustering::m_cellThresholdOnEorAbsEinSigma
Gaudi::Property< float > m_cellThresholdOnEorAbsEinSigma
all cells have to satisfy
Definition: TopoAutomatonClustering.h:102
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
TAGrowing::TopoAutomatonGrowingTemporaries
Definition: TopoAutomatonClusteringImpl.h:212
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArNeighbours::prevSuperCalo
@ prevSuperCalo
Definition: LArNeighbours.h:27
LArNeighbours::prevSubDet
@ prevSubDet
Definition: LArNeighbours.h:22
python.SUBCALO.LARMINIFCAL
int LARMINIFCAL
Definition: SUBCALO.py:12
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
TopoAutomatonClustering::m_xtalkEM2
Gaudi::Property< bool > m_xtalkEM2
If set to true, the time window is softened in the EMB2 and EME2_OW due to crosstalk from direct neig...
Definition: TopoAutomatonClustering.h:244
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
python.SUBCALO.LARHEC
int LARHEC
Definition: SUBCALO.py:9
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
LArNeighbours::prevInSamp
@ prevInSamp
Definition: LArNeighbours.h:19
LArNeighbours::super3D
@ super3D
Definition: LArNeighbours.h:29
TopoAutomatonClustering::m_options
TAGrowing::TACOptionsHolder m_options
Options for the algorithm, held in a GPU-friendly way.
Definition: TopoAutomatonClustering.h:256
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
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
TAGrowing::TACOptionsHolder::sendToGPU
void sendToGPU(const bool clear_CPU=false)
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CaloGPUTimed::CaloGPUTimed
CaloGPUTimed(T *ptr)
Definition: CaloGPUTimed.h:55
TopoAutomatonClustering::m_timeThreshold
Gaudi::Property< float > m_timeThreshold
threshold used for timing cut on seed cells.
Definition: TopoAutomatonClustering.h:159
CaloRecGPU::ClusterMomentsArr
Definition: EventInfoDefinitions.h:342
CaloSampling::getNumberOfSamplings
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:30
TILE
@ TILE
Definition: RegSelEnums.h:30
AthenaInterprocess::UpdateAfterFork::type
static const std::string & type()
Incident type.
Definition: Incidents.h:49
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
CaloGPUTimed::record_times_helper
void record_times_helper(const size_t) const
Definition: CaloGPUTimed.h:64
TopoAutomatonClustering::m_neighborOptionString
Gaudi::Property< std::string > m_neighborOptionString
type of neighbor relations to use.
Definition: TopoAutomatonClustering.h:214
CaloGPUCUDAInitialization::initialize_CUDA
virtual StatusCode initialize_CUDA()
Initialization that invokes CUDA functions.
Definition: CaloGPUCUDAInitialization.h:39
DeMoScan.index
string index
Definition: DeMoScan.py:364
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
CaloGPUTimed::record_times
void record_times(const size_t event_num, const std::vector< size_t > &times) const
Definition: CaloGPUTimed.h:86
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
CaloGPUTimed::m_measureTimes
Gaudi::Property< bool > m_measureTimes
If true, times are recorded to the file given by m_timeFileName.
Definition: CaloGPUTimed.h:46
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArNeighbours::nextInEta
@ nextInEta
Definition: LArNeighbours.h:15
BasicClusterInfoCalculator::register_kernels
void register_kernels(IGPUKernelSizeOptimizer &optimizer)
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
TopoAutomatonClustering::m_neighborCutsInAbsE
Gaudi::Property< bool > m_neighborCutsInAbsE
if set to true neighbor cuts are on and .
Definition: TopoAutomatonClustering.h:142
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
TopoAutomatonClustering::m_keepSignificantCells
Gaudi::Property< bool > m_keepSignificantCells
if set to true, the time cut is not applied on cell of large significance
Definition: TopoAutomatonClustering.h:179
LArNeighbours
Definition: LArNeighbours.h:11
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
LArNeighbours::all3D
@ all3D
Definition: LArNeighbours.h:24
LArNeighbours::prevInEta
@ prevInEta
Definition: LArNeighbours.h:14
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.SUBCALO.LARFCAL
int LARFCAL
Definition: SUBCALO.py:10
TopoAutomatonClustering::m_treatL1PredictedCellsAsGood
Gaudi::Property< bool > m_treatL1PredictedCellsAsGood
if set to true treat cells with a dead OTX which can be predicted by L1 trigger info as good instead ...
Definition: TopoAutomatonClustering.h:169
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
CaloCell_Base_ID::NOT_VALID
@ NOT_VALID
Definition: CaloCell_Base_ID.h:46
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TopoAutomatonClustering::m_twoGaussianNoise
Gaudi::Property< bool > m_twoGaussianNoise
if set to true use 2-gaussian noise description for TileCal
Definition: TopoAutomatonClustering.h:187
LArNeighbours::all2D
@ all2D
Definition: LArNeighbours.h:18
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
plot_times.times
def times(fn)
Definition: plot_times.py:11
fitman.k
k
Definition: fitman.py:528
python.SUBCALO.LAREM
int LAREM
Definition: SUBCALO.py:8
TopoAutomatonClustering::m_neighborThresholdOnEorAbsEinSigma
Gaudi::Property< float > m_neighborThresholdOnEorAbsEinSigma
cells with extend the cluster
Definition: TopoAutomatonClustering.h:113