Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:50

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 //
0014 // DDDB is a detector description convention developed by the LHCb experiment.
0015 // For further information concerning the DTD, please see:
0016 // http://lhcb-comp.web.cern.ch/lhcb-comp/Frameworks/DetDesc/Documents/lhcbDtd.pdf
0017 //
0018 //==========================================================================
0019 #ifndef DETECTOR_IDETSERVICE_H
0020 #define DETECTOR_IDETSERVICE_H
0021 
0022 // Framework includes
0023 #include "DDCond/ConditionsSlice.h"
0024 #include "DDCond/ConditionsCleanup.h"
0025 
0026 
0027 /// Gaudi namespace declaration
0028 namespace gaudi   {
0029 
0030   /// Example gaudi-like service to access dd4hep conditions
0031   /**
0032    *  \author  M.Frank
0033    *  \version 1.0
0034    *  \date    01/04/2014
0035    */
0036   class IDetService  {
0037   public:
0038     /// Short-cut to the ConditionsManager
0039     typedef dd4hep::cond::ConditionsManager           ConditionsManager;
0040     /// Other useful type definitions and type short-cuts
0041     typedef dd4hep::cond::ConditionUpdateUserContext  Context;
0042     typedef dd4hep::cond::ConditionDependency         Dependency;
0043     typedef dd4hep::cond::ConditionsCleanup           Cleanup;
0044     typedef dd4hep::DetElement                        DetElement;
0045     typedef dd4hep::Condition                         Condition;
0046     typedef dd4hep::IOV::Key_value_type               EventStamp;
0047     typedef dd4hep::IOVType                           IOVType;
0048     typedef std::shared_ptr<dd4hep::cond::ConditionsContent> Content;
0049     typedef std::shared_ptr<dd4hep::cond::ConditionsSlice>   Slice;
0050     
0051     /// Default destructor
0052     virtual ~IDetService() = default;
0053 
0054     /** General accessors to manipulate the conditions   */
0055     /// Accessor: get refernece to the conditions manager
0056     virtual ConditionsManager manager() const = 0;
0057 
0058     /// Accessor: Access IOV Type from conditions manager
0059     virtual const IOVType* iovType(const std::string& identifier)  const = 0;
0060     
0061     /** Content management interface routines            */
0062     /// Open content creation context
0063     virtual Content openContent(const std::string& name) = 0;
0064 
0065     /// Retrive existing and registered conditions content object by name
0066     virtual Content getContent(const std::string& name) = 0;
0067 
0068     /// Add a condition address to the content. Condition is identified by its global key
0069     virtual void addContent(Content& content,
0070                             Condition::key_type key,
0071                             const std::string& address) = 0;
0072 
0073     /// Add a condition address to the content. Condition is identified by the detector and item name
0074     virtual void addContent(Content& content,
0075                             DetElement det,
0076                             const std::string& item,
0077                             const std::string& address) = 0;
0078 
0079     /// Add a condition functor for a derived condition to the content
0080     virtual void addContent(Content& content,
0081                             Dependency* call) = 0;
0082 
0083     /// Open content creation context
0084     virtual void closeContent(Content& content) = 0;
0085 
0086     /// Remove content object from cache.
0087     virtual bool removeContent(Content& content) = 0;
0088 
0089     /** Slice management interface routines              */
0090     /// Project a new conditions slice. If a free cached slice is availible, it shall be re-used
0091     virtual Slice project(Content &content,
0092                           Context *ctx,
0093                           const IOVType *typ,
0094                           EventStamp stamp) = 0;
0095 
0096     /// Project a new conditions slice. If a free cached slice is availible, it shall be re-used
0097     virtual Slice project(Content &content,
0098                           Context *ctx,
0099                           const std::string &typ,
0100                           EventStamp stamp) = 0;
0101     /// Project a new conditions slice. If a free cached slice is availible, it shall be re-used
0102     virtual Slice project(const std::string &content,
0103                           Context *ctx,
0104                           const std::string &typ,
0105                           EventStamp stamp) = 0;
0106     /// Invoke slice cleanup
0107     virtual void cleanup(const Cleanup& cleaner) = 0;
0108   };
0109 }      // End namespace gaudi
0110 #endif // DETECTOR_IDETSERVICE_H