Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0011 //==========================================================================
0012 #ifndef DDG4_EVENTPARAMETERS_H
0013 #define DDG4_EVENTPARAMETERS_H
0014 
0015 #include <map>
0016 #include <string>
0017 #include <vector>
0018 
0019 
0020 /// Namespace for the AIDA detector description toolkit
0021 namespace dd4hep  {
0022 
0023   /// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
0024   namespace sim  {
0025 
0026     /// Event extension to pass input event data to output event
0027     /**
0028      *  \version 1.0
0029      *  \ingroup DD4HEP_SIMULATION
0030      */
0031     class EventParameters  {
0032     protected:
0033       int                                             m_runNumber = -1;
0034       int                                             m_eventNumber = -1;
0035       std::map<std::string, std::vector<int>>         m_intValues {};
0036       std::map<std::string, std::vector<float>>       m_fltValues {};
0037       std::map<std::string, std::vector<std::string>> m_strValues {};
0038       std::map<std::string, std::vector<double>>      m_dblValues {};
0039 
0040     public:
0041       /// Initializing constructor
0042       EventParameters() = default;
0043       /// Default destructor
0044       ~EventParameters() = default;
0045 
0046       /// Set the event parameters
0047       void setRunNumber(int runNumber);
0048       void setEventNumber(int eventNumber);
0049       /// Get the run number
0050       int runNumber() const { return m_runNumber; }
0051       /// Get the event number
0052       int eventNumber() const { return m_eventNumber; }
0053 
0054       /// Copy the parameters from source
0055       template <class T> void ingestParameters(T const& source);
0056       /// Put parameters into destination
0057       template <class T> void extractParameters(T& destination);
0058 
0059       /// Get the int event parameters
0060       auto const& intParameters() const { return m_intValues; }
0061       /// Get the float event parameters
0062       auto const& fltParameters() const { return m_fltValues; }
0063       /// Get the string event parameters
0064       auto const& strParameters() const { return m_strValues; }
0065       /// Get the double event parameters
0066       auto const& dblParameters() const { return m_dblValues; }
0067 
0068     };
0069 
0070   }     /* End namespace sim   */
0071 }       /* End namespace dd4hep */
0072 #endif // DDG4_EVENTPARAMETERS_H