|
||||
File indexing completed on 2025-01-18 09:55:20
0001 //========================================================================== 0002 // AIDA Detector description implementation 0003 //-------------------------------------------------------------------------- 0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) 0005 // All rights reserved. 0006 // 0007 // For the licensing terms see $DD4hepINSTALL/LICENSE. 0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS. 0009 // 0010 // Author : M.Frank 0011 // 0012 //========================================================================== 0013 #ifndef DDDIGI_DIGICONTAINERCOMBINE_H 0014 #define DDDIGI_DIGICONTAINERCOMBINE_H 0015 0016 /// Framework include files 0017 #include <DDDigi/DigiEventAction.h> 0018 #include <DDDigi/DigiParallelWorker.h> 0019 0020 /// C/C++ include files 0021 #include <mutex> 0022 #include <functional> 0023 0024 /// Namespace for the AIDA detector description toolkit 0025 namespace dd4hep { 0026 0027 /// Namespace for the Digitization part of the AIDA detector description toolkit 0028 namespace digi { 0029 0030 /// Default base class for all Digitizer actions and derivates thereof. 0031 /** 0032 * This is a utility class supporting properties, output and access to 0033 * event and run objects through the context. 0034 * 0035 * \author M.Frank 0036 * \version 1.0 0037 * \ingroup DD4HEP_DIGITIZATION 0038 */ 0039 class DigiContainerCombine : public DigiEventAction { 0040 public: 0041 class work_definition_t; 0042 using self_t = DigiContainerCombine; 0043 using Worker = DigiParallelWorker<self_t,work_definition_t>; 0044 using Workers = DigiParallelWorkers<Worker>; 0045 0046 protected: 0047 /// Property: Container names to be loaded 0048 std::vector<std::string> m_containers { }; 0049 /// Property: Output container dressing 0050 std::string m_output_name_flag; 0051 /// Property: Input data segment name 0052 std::string m_input; 0053 /// Property: event masks to be handled 0054 std::vector<int> m_input_masks { }; 0055 /// Property: Output data segment name 0056 std::string m_output; 0057 /// Property: mask of the deposit 0058 int m_deposit_mask { 0 }; 0059 /// Property: Flag to erase already combined containers (not thread-safe!!!) 0060 bool m_erase_combined; 0061 /// Property: Flag to indicate to merge 0062 bool m_merge_deposits; 0063 /// Property: Flag to indicate to merge 0064 bool m_merge_response; 0065 /// Property: Flag to indicate to merge 0066 bool m_merge_history; 0067 /// Property: Flag to indicate to merge 0068 bool m_merge_particles; 0069 0070 /// Fully qualified keys of all containers to be manipulated 0071 std::set<Key::key_type> m_keys { }; 0072 /// Container keys of all containers to be manipulated 0073 std::set<Key::key_type> m_cont_keys { }; 0074 0075 /// Lock to properly accumulate keys which were already used 0076 mutable std::mutex m_used_keys_lock; 0077 /// Worker objects to be submitted to TBB each performing part of the job 0078 Workers m_workers; 0079 0080 protected: 0081 /// Define standard assignments and constructors 0082 DDDIGI_DEFINE_ACTION_CONSTRUCTORS(DigiContainerCombine); 0083 0084 /// Default destructor 0085 virtual ~DigiContainerCombine(); 0086 0087 /// Initializing function: compute values which depend on properties 0088 void initialize(); 0089 0090 /// Check if we have sufficient workers 0091 void have_workers(size_t len) const; 0092 0093 /// Combine selected containers to one single deposit container 0094 std::size_t combine_containers(context_t& context, 0095 DigiEvent& event, 0096 DataSegment& inputs, 0097 DataSegment& outputs) const; 0098 0099 /// Decide if a continer is to merged based on the properties 0100 virtual bool use_key(Key key) const; 0101 0102 public: 0103 /// Standard constructor 0104 DigiContainerCombine(const kernel_t& kernel, const std::string& name); 0105 0106 /// Main functional callback 0107 virtual void execute(context_t& context) const; 0108 }; 0109 } // End namespace digi 0110 } // End namespace dd4hep 0111 #endif // DDDIGI_DIGICONTAINERCOMBINE_H
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |