Back to home page

EIC code displayed by LXR

 
 

    


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_DIGICONTAINERDROP_H
0014 #define DDDIGI_DIGICONTAINERDROP_H
0015 
0016 /// Framework include files
0017 #include <DDDigi/DigiEventAction.h>
0018 #include <DDDigi/DigiParallelWorker.h>
0019 
0020 /// Namespace for the AIDA detector description toolkit
0021 namespace dd4hep {
0022 
0023   /// Namespace for the Digitization part of the AIDA detector description toolkit
0024   namespace digi {
0025 
0026     /// Default base class for all Digitizer actions and derivates thereof.
0027     /**
0028      *  This is a utility class supporting properties, output and access to
0029      *  event and run objects through the context.
0030      *
0031      *  \author  M.Frank
0032      *  \version 1.0
0033      *  \ingroup DD4HEP_DIGITIZATION
0034      */
0035     class DigiContainerDrop : public DigiEventAction   {
0036     public:
0037       class work_definition_t;
0038       using self_t    = DigiContainerDrop;
0039       using worker_t  = DigiParallelWorker<self_t,work_definition_t>;
0040       using workers_t = DigiParallelWorkers<worker_t>;
0041 
0042     protected:
0043       /// Property: Container names to be loaded
0044       std::vector<std::string>    m_containers   { };
0045       /// Property: Input data segment name
0046       std::string                 m_input_segment;
0047       /// Property: event masks to be handled
0048       std::vector<int>            m_input_masks  { };
0049       /// Fully qualified keys of all containers to be manipulated
0050       std::set<Key::key_type>     m_keys  { };
0051       /// Container keys of all containers to be manipulated
0052       std::set<Key::itemkey_type> m_cont_keys  { };
0053 
0054       /// Worker objects to be submitted to TBB each performing part of the job
0055       workers_t m_workers;
0056 
0057     protected:
0058       /// Define standard assignments and constructors
0059       DDDIGI_DEFINE_ACTION_CONSTRUCTORS(DigiContainerDrop);
0060 
0061       /// Default destructor
0062       virtual ~DigiContainerDrop();
0063 
0064       /// Initializing function: compute values which depend on properties
0065       void initialize();
0066 
0067       /// Decide if a continer is to merged based on the properties
0068       virtual bool use_key(Key key)  const;
0069 
0070     public:
0071       /// Standard constructor
0072       DigiContainerDrop(const kernel_t& kernel, const std::string& name);
0073 
0074       /// Main functional callback
0075       virtual void execute(context_t& context)  const;
0076     };
0077   }    // End namespace digi
0078 }      // End namespace dd4hep
0079 #endif // DDDIGI_DIGICONTAINERDROP_H