  | 
  
    ATLAS Offline Software
    
   | 
 
 
 
 
Go to the documentation of this file.
   16 #include "boost/chrono/chrono.hpp" 
   17 #include "boost/chrono/thread_clock.hpp" 
   38   auto get_option_from_string = [](
const std::string & 
str, 
bool & failed)
 
   77   auto process_sampling = [&get_option_from_string](
const std::vector<std::string> & sampling_names, std::string & invalid_names, PackType & sampling_option)
 
   80     for (
const std::string & samp_name : sampling_names)
 
   83         const PackType sampling = (PackType) get_option_from_string(samp_name, failed);
 
   87             if (invalid_names.size() == 0)
 
   89                 invalid_names = 
"'" + samp_name + 
"'";
 
   93                 invalid_names += 
", '" + samp_name + 
"'";
 
   98             sampling_option |= ((PackType) 1) << sampling;
 
  103   std::string invalid_names;
 
  107   if (invalid_names.size() > 0)
 
  110                      << 
" are not a valid Calorimeter sampling name and will be ignored! " 
  111                      << 
"Valid names are: " 
  112                      << 
"PreSamplerB, EMB1, EMB2, EMB3, " 
  113                      << 
"PreSamplerE, EME1, EME2, EME3, " 
  114                      << 
"HEC0, HEC1, HEC2, HEC3, " 
  115                      << 
"TileBar0, TileBar1, TileBar2, " 
  116                      << 
"TileGap1, TileGap2, TileGap3, " 
  117                      << 
"TileExt0, TileExt1, TileExt2, " 
  118                      << 
"FCAL0, FCAL1, FCAL2."  );
 
  121   invalid_names.clear();
 
  125   if (invalid_names.size() > 0)
 
  128                      << 
" are not a valid Calorimeter sampling name and will be ignored! " 
  129                      << 
"Valid names are: " 
  130                      << 
"PreSamplerB, EMB1, EMB2, EMB3, " 
  131                      << 
"PreSamplerE, EME1, EME2, EME3, " 
  132                      << 
"HEC0, HEC1, HEC2, HEC3, " 
  133                      << 
"TileBar0, TileBar1, TileBar2, " 
  134                      << 
"TileGap1, TileGap2, TileGap3, " 
  135                      << 
"TileExt0, TileExt1, TileExt2, " 
  136                      << 
"FCAL0, FCAL1, FCAL2."  );
 
  139   auto get_neighbour_option_from_string = [](
const std::string & 
str, 
bool & failed)
 
  173   bool neigh_failed = 
false;
 
  197   return StatusCode::SUCCESS;
 
  205   return StatusCode::SUCCESS;
 
  212   using clock_type = boost::chrono::thread_clock;
 
  213   auto time_cast = [](
const auto & before, 
const auto & after)
 
  215     return boost::chrono::duration_cast<boost::chrono::microseconds>(after - before).count();
 
  246                    time_cast(
start, preprocessing_end),
 
  247                    time_cast(preprocessing_end, after_neighs),
 
  248                    time_cast(after_neighs, after_maxima),
 
  249                    time_cast(after_maxima, after_secondary_maxima),
 
  250                    time_cast(after_secondary_maxima, after_growing),
 
  251                    time_cast(after_growing, 
end)
 
  255   return StatusCode::SUCCESS;
 
  265       print_times(
"Preprocessing Fill_List_of_Intra-Cluster_Neighbours Find_Local_Maxima Find_Secondary_Maxima Splitter_Tag_Propagation Cell_Weighting_And_Finalization", 6);
 
  267   return StatusCode::SUCCESS;
 
  
virtual StatusCode finalize() override
 
void sendToGPU(const bool clear_CPU=false)
 
Gaudi::Property< std::string > m_neighborOptionString
type of neighbor relations to use.
 
virtual StatusCode initialize_non_CUDA() override
Initialization that does not invoke CUDA functions.
 
Gaudi::Property< std::vector< std::string > > m_secondarySamplingNames
vector of names of the secondary calorimeter samplings to consider.
 
void splitClusterGrowing(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
 
CaloRecGPU::Helpers::CPU_object< TopoAutomatonSplittingOptions > m_options
 
Gaudi::Property< std::vector< std::string > > m_samplingNames
vector of names of the calorimeter samplings to consider for seeds.
 
Base class to provide some basic common infrastructure for timing measurements...
 
virtual StatusCode initialize_CUDA() override
Initialization that invokes CUDA functions.
 
#define CRGPU_CHEAP_STRING_TO_ENUM(VAR, PREFIX, ONE,...)
Checks a string variable, VAR, for matching enum identifiers (ONE and the remaining variadic argument...
 
Gaudi::Property< bool > m_restrictHECIWandFCalNeighbors
if set to true limit the neighbors in HEC IW and FCal2&3.
 
TASplitting::TASOptionsHolder m_options
Options for the algorithm, held in a GPU-friendly way.
 
#define CRGPU_RECURSIVE_MACRO(...)
Expands recursive macros.
 
::StatusCode StatusCode
StatusCode definition for legacy code.
 
void print_times(const std::string &header, const size_t time_size) const
 
ServiceHandle< IGPUKernelSizeOptimizerSvc > m_kernelSizeOptimizer
Handle to the CUDA kernel block and grid size optimization service.
 
void cellWeightingAndFinalization(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
 
void excludeSecondaryMaxima(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
 
Gaudi::Property< bool > m_shareBorderCells
share cells at the border between two local maxima
 
Gaudi::Property< float > m_emShowerScale
typical EM shower scale to use for distance criteria in shared cells
 
Gaudi::Property< bool > m_restrictPSNeighbors
if set to true limit the neighbors in presampler Barrel and Endcap.
 
virtual StatusCode execute(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, CaloRecGPU::EventDataHolder &event_data, void *temporary_buffer) const override
 
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
 
void record_times(const size_t event_num, const std::vector< size_t > ×) const
 
void findLocalMaxima(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
 
Gaudi::Property< bool > m_measureTimes
If true, times are recorded to the file given by m_timeFileName.
 
Gaudi::Property< bool > m_absOpt
if set to true, splitter only looks at absolute value of Energy in order to identify potential seed c...
 
void register_kernels(IGPUKernelSizeOptimizer &optimizer)
 
Gaudi::Property< float > m_minEnergy
local maxima need at least this energy content
 
Gaudi::Property< int > m_nCells
local maxima need at least this number of neighbors to become seeds
 
void fillNeighbours(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
 
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 ...
 
TopoAutomatonSplitting(const std::string &type, const std::string &name, const IInterface *parent)