ATLAS Offline Software
GPUClusterInfoAndMomentsCalculator.h
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 
7 #ifndef CALORECGPU_GPUCLUSTERINFOANDMOMENTSCALCULATOR_H
8 #define CALORECGPU_GPUCLUSTERINFOANDMOMENTSCALCULATOR_H
9 
11 
15 
17 
18 #include "GaudiKernel/ServiceHandle.h"
19 
21 
22 #include "CLHEP/Units/SystemOfUnits.h"
23 
33  public AthAlgTool, virtual public CaloClusterGPUProcessor, public CaloGPUCUDAInitialization
34 {
35  public:
36 
37  GPUClusterInfoAndMomentsCalculator(const std::string & type, const std::string & name, const IInterface * parent);
38 
39  virtual StatusCode initialize() override
40  {
42  }
43 
44  virtual StatusCode initialize_non_CUDA() override;
45 
46  virtual StatusCode initialize_CUDA() override;
47 
48  virtual StatusCode execute (const EventContext & ctx,
49  const CaloRecGPU::ConstantDataHolder & constant_data,
50  CaloRecGPU::EventDataHolder & event_data,
51  void * temporary_buffer) const override;
52 
53  virtual StatusCode finalize() override;
54 
56 
57  private:
58 
59 
62  Gaudi::Property<double> m_maxAxisAngle {this, "MaxAxisAngle", 20 * CLHEP::deg, "The maximal allowed deviation from the IP-to-ClusterCenter-axis"};
63 
70  Gaudi::Property<double> m_minRLateral {this, "MinRLateral", 4 * CLHEP::cm, "The minimal r in the definition of the Lateral moment"};
71 
80  Gaudi::Property<double> m_minLLongitudinal {this, "MinLLongitudinal", 10 * CLHEP::cm, "The minimal lambda in the definition of the Longitudinal moment"};
81 
88  Gaudi::Property<double> m_minBadLArQuality {this, "MinBadLArQuality", 4000, "The minimal cell quality in the LAr for declaring a cell bad"};
89 
93  Gaudi::Property<bool> m_absOpt {this, "WeightingOfNegClusters", false, "If set to true use abs E value of cells to calculate cluster moments"};
94 
97  Gaudi::Property<double> m_etaInnerWheel {this, "EMECAbsEtaWheelTransition", 2.52, "Transition from outer to inner wheel in EME2"};
98 
102  Gaudi::Property<bool> m_twoGaussianNoise {this, "TwoGaussianNoise", false, "If set to true use 2-gaussian noise description for TileCal"};
103 
107  Gaudi::Property<bool> m_skipInvalidClusters {this, "SkipInvalidClusters", true, "Check for and skip invalid clusters during moments calculation."};
108 
112 
113 
117  Gaudi::Property<bool> m_measureTimes {this, "MeasureTimes", false, "Synchronize for time measurements"};
118 
120  ServiceHandle<IGPUKernelSizeOptimizerSvc> m_kernelSizeOptimizer { this, "KernelSizeOptimizer", "GPUKernelSizeOptimizerSvc", "CUDA kernel size optimization service." };
121 };
122 
123 #endif //CALORECGPU_TOPOAUTOMATONCLUSTERING_H
GPUClusterInfoAndMomentsCalculator::m_skipInvalidClusters
Gaudi::Property< bool > m_skipInvalidClusters
If false, do the moment calculation even for invalid clusters (which may waste computation).
Definition: GPUClusterInfoAndMomentsCalculator.h:107
GPUClusterInfoAndMomentsCalculator::m_measureTimes
Gaudi::Property< bool > m_measureTimes
If true, synchronize the kernel calls to ensure accurate per-step/per-tool time measurements.
Definition: GPUClusterInfoAndMomentsCalculator.h:117
GPUClusterInfoAndMomentsCalculator::initialize_non_CUDA
virtual StatusCode initialize_non_CUDA() override
Initialization that does not invoke CUDA functions.
Definition: GPUClusterInfoAndMomentsCalculator.cxx:20
CaloClusterGPUProcessor
Base class for GPU-accelerated cluster processing tools to be called from CaloGPUHybridClusterProcess...
Definition: CaloClusterGPUProcessor.h:27
GPUClusterInfoAndMomentsCalculator::finalize
virtual StatusCode finalize() override
Definition: GPUClusterInfoAndMomentsCalculator.cxx:55
deg
#define deg
Definition: SbPolyhedron.cxx:17
GPUClusterInfoAndMomentsCalculator::m_options
ClusterMomentsCalculator::CMCOptionsHolder m_options
Options for the algorithm, held in a GPU-friendly way.
Definition: GPUClusterInfoAndMomentsCalculator.h:111
GPUClusterInfoAndMomentsCalculator::~GPUClusterInfoAndMomentsCalculator
virtual ~GPUClusterInfoAndMomentsCalculator()=default
GPUClusterInfoAndMomentsCalculator::GPUClusterInfoAndMomentsCalculator
GPUClusterInfoAndMomentsCalculator(const std::string &type, const std::string &name, const IInterface *parent)
Definition: GPUClusterInfoAndMomentsCalculator.cxx:14
CaloGPUCUDAInitialization::initialize
virtual StatusCode initialize()
Definition: CaloGPUCUDAInitialization.h:44
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
IGPUKernelSizeOptimizerSvc.h
CaloRecGPU::EventDataHolder
Definition: DataHolders.h:35
CaloClusterGPUProcessor.h
GPUClusterInfoAndMomentsCalculator::initialize_CUDA
virtual StatusCode initialize_CUDA() override
Initialization that invokes CUDA functions.
Definition: GPUClusterInfoAndMomentsCalculator.cxx:39
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GPUClusterInfoAndMomentsCalculator::m_twoGaussianNoise
Gaudi::Property< bool > m_twoGaussianNoise
if set to true use 2-gaussian noise description for TileCal
Definition: GPUClusterInfoAndMomentsCalculator.h:102
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GPUClusterInfoAndMomentsCalculatorImpl.h
CaloGPUCUDAInitialization
Base class to provide some basic common infrastructure for initializing CUDA only at the right place ...
Definition: CaloGPUCUDAInitialization.h:28
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
GPUClusterInfoAndMomentsCalculator::m_maxAxisAngle
Gaudi::Property< double > m_maxAxisAngle
the maximal allowed deviation from the IP-to-ClusterCenter-axis.
Definition: GPUClusterInfoAndMomentsCalculator.h:62
GPUClusterInfoAndMomentsCalculator::m_minBadLArQuality
Gaudi::Property< double > m_minBadLArQuality
the minimal cell quality in the LAr for declaring a cell bad
Definition: GPUClusterInfoAndMomentsCalculator.h:88
GPUClusterInfoAndMomentsCalculator::m_kernelSizeOptimizer
ServiceHandle< IGPUKernelSizeOptimizerSvc > m_kernelSizeOptimizer
Handle to the CUDA kernel block and grid size optimization service.
Definition: GPUClusterInfoAndMomentsCalculator.h:120
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GPUClusterInfoAndMomentsCalculator::initialize
virtual StatusCode initialize() override
Definition: GPUClusterInfoAndMomentsCalculator.h:39
GPUClusterInfoAndMomentsCalculator::m_absOpt
Gaudi::Property< bool > m_absOpt
if set to true use abs E value of cells to calculate cluster moments
Definition: GPUClusterInfoAndMomentsCalculator.h:93
CaloRecGPU::ConstantDataHolder
Definition: DataHolders.h:19
GPUClusterInfoAndMomentsCalculator::m_minLLongitudinal
Gaudi::Property< double > m_minLLongitudinal
the minimal in the definition of the Longitudinal moment
Definition: GPUClusterInfoAndMomentsCalculator.h:80
GPUClusterInfoAndMomentsCalculator::m_minRLateral
Gaudi::Property< double > m_minRLateral
the minimal in the definition of the Lateral moment
Definition: GPUClusterInfoAndMomentsCalculator.h:70
GPUClusterInfoAndMomentsCalculator
Standard tool to calculate cluster info (energy, transverse energy, pseudo-rapidity and azimuthal ang...
Definition: GPUClusterInfoAndMomentsCalculator.h:34
AthAlgTool
Definition: AthAlgTool.h:26
checker_macros.h
Define macros for attributes used to control the static checker.
GPUClusterInfoAndMomentsCalculator::execute
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.
Definition: GPUClusterInfoAndMomentsCalculator.cxx:47
CaloGPUCUDAInitialization.h
GPUClusterInfoAndMomentsCalculator::m_etaInnerWheel
Gaudi::Property< double > m_etaInnerWheel
Transition from outer to inner wheel in EME2.
Definition: GPUClusterInfoAndMomentsCalculator.h:97
ClusterMomentsCalculator::CMCOptionsHolder
Definition: GPUClusterInfoAndMomentsCalculatorImpl.h:318
ServiceHandle< IGPUKernelSizeOptimizerSvc >