Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:21

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_DIGIROOTINPUT_H
0014 #define DDDIGI_DIGIROOTINPUT_H
0015 
0016 /// Framework include files
0017 #include <DDDigi/DigiInputAction.h>
0018 
0019 /// C/C++ include files
0020 #include <memory>
0021 
0022 /// Forward declarations
0023 class TBranch;
0024 class TClass;
0025 
0026 /// Namespace for the AIDA detector description toolkit
0027 namespace dd4hep {
0028 
0029   /// Namespace for the Digitization part of the AIDA detector description toolkit
0030   namespace digi {
0031 
0032     // Forward declarations
0033     class DigiROOTInput;
0034 
0035     /// Base class for input actions to the digitization using ROOT
0036     /**
0037      *
0038      *  \author  M.Frank
0039      *  \version 1.0
0040      *  \ingroup DD4HEP_DIGITIZATION
0041      */
0042     class DigiROOTInput : public DigiInputAction {
0043 
0044     public:
0045       /// Helper classes
0046       class internals_t;
0047       class inputsource_t;
0048       class container_t  {
0049       public:
0050     Key          key;
0051     TBranch&     branch;
0052     TClass&      clazz;
0053         container_t(Key k, TBranch& b, TClass& c) : key(std::move(k)), branch(b), clazz(c) {}
0054       };
0055       class work_t   {
0056       public:
0057     DataSegment& segment;
0058     container_t& container;
0059       };
0060 
0061 
0062     protected:
0063       /// Connection parameters to the "current" input source
0064       mutable std::unique_ptr<internals_t> imp;
0065 
0066     protected:
0067       /// Define standard assignments and constructors
0068       DDDIGI_DEFINE_ACTION_CONSTRUCTORS(DigiROOTInput);
0069 
0070     public:
0071       /// Standard constructor
0072       DigiROOTInput(const DigiKernel& kernel, const std::string& nam);
0073       /// Default destructor
0074       virtual ~DigiROOTInput();
0075 
0076       /// Callback to read event input
0077       virtual void execute(DigiContext& context)  const override;
0078       /// Callback to handle single branch
0079       virtual void operator()(DigiContext& context, work_t& work)  const = 0;
0080     };
0081 
0082   }    // End namespace digi
0083 }      // End namespace dd4hep
0084 #endif // DDDIGI_DIGIROOTINPUT_H