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 for LHCb
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   Markus Frank
0011 //  \date     2018-03-08
0012 //  \version  1.0
0013 //
0014 //==============================================================================
0015 #ifndef DETECTOR_DEVP_H 
0016 #define DETECTOR_DEVP_H 1
0017 
0018 // Framework include files
0019 #include "Detector/DeVPSensor.h"
0020 #include "Detector/DeVPGeneric.h"
0021 
0022 #define DE_VP_TYPEDEFS(TYP) public:                       \
0023   DE_CONDITIONS_TYPEDEFS;                                 \
0024   typedef std::vector<DeVPSensor##TYP>  Sensors;          \
0025   typedef std::vector<DeVPGeneric##TYP> Sides;            \
0026   typedef std::vector<DeVPGeneric##TYP> ModuleSupports;   \
0027   typedef std::vector<DeVPGeneric##TYP> Modules;          \
0028   typedef std::vector<DeVPGeneric##TYP> Ladders
0029 
0030   
0031 /// Gaudi namespace declaration
0032 namespace gaudi   {
0033 
0034   /// Gaudi::detail namespace declaration
0035   namespace detail   {
0036 
0037     /// VP  detector element data
0038     /**
0039      *
0040      *  \author  Markus Frank
0041      *  \date    2018-03-08
0042      *  \version  1.0
0043      */
0044     class DeVPStaticObject : public DeVPGenericStaticObject  {
0045       DE_VP_TYPEDEFS(Static);
0046 
0047     public:
0048       enum { classID = 8200 };
0049       Sides          sides;
0050       ModuleSupports supports;
0051       Modules        modules;
0052       Ladders        ladders;
0053       
0054       double         sensitiveVolumeCut = 0e0;
0055     public:
0056       /// Standard constructors and assignment
0057       DE_CTORS_DEFAULT(DeVPStaticObject);
0058       /// Initialization of sub-classes
0059       virtual void initialize()  override;
0060       /// Printout method to stdout
0061       virtual void print(int indent, int flags)  const override;
0062     };
0063   }    // End namespace detail
0064 
0065 
0066   /// Handle defintiion to an instance of VP  detector element data
0067   /**
0068    *  This object defines the behaviour of the objects's data
0069    *
0070    *  \author  Markus Frank
0071    *  \date    2018-03-08
0072    *  \version  1.0
0073    */
0074   class DeVPStaticElement : public dd4hep::Handle<detail::DeVPStaticObject>   {
0075     DE_VP_TYPEDEFS(Static);
0076     typedef Object static_t;
0077 
0078   public:
0079     /// Standard constructors and assignment
0080     DE_CTORS_HANDLE(DeVPStaticElement,Base);
0081     /// Return the number of sensors.
0082     size_t numberSensors() const                         { return ptr()->sensors.size(); }
0083     /// Return vector of sensors.
0084     const std::vector<DeVPSensorStatic>& sensors() const { return ptr()->sensors;        }
0085   };
0086 
0087   /// For the fully enabled object, we have to combine it with the generic stuff
0088   typedef  DetectorStaticElement<DeVPStaticElement>  DeVPStatic;
0089 
0090   /// Gaudi::detail namespace declaration
0091   namespace detail   {
0092   
0093     /// VP  detector element data
0094     /**
0095      *
0096      *  \author  Markus Frank
0097      *  \date    2018-03-08
0098      *  \version  1.0
0099      */
0100     class DeVPObject : public DeVPGenericObject  {
0101       DE_VP_TYPEDEFS();
0102       typedef DeVPStatic::Object static_t;
0103 
0104     public:
0105       DeVPStatic     vp_static;
0106       Sides          sides;
0107       ModuleSupports supports;
0108       Modules        modules;
0109       Ladders        ladders;
0110       
0111     public:
0112       /// Standard constructors and assignment
0113       DE_CTORS_DEFAULT(DeVPObject);
0114       /// Initialization of sub-classes
0115       virtual void initialize()  override;
0116       /// Printout method to stdout
0117       void print(int indent, int flags)  const  override;
0118     };
0119   }    // End namespace detail
0120 
0121   /// Handle defintiion to an instance of VP  detector element data
0122   /**
0123    *  This object defines the behaviour of the objects's data
0124    *
0125    *  \author  Markus Frank
0126    *  \date    2018-03-08
0127    *  \version  1.0
0128    */
0129   class DeVPElement : public dd4hep::Handle<detail::DeVPObject>   {
0130     DE_VP_TYPEDEFS();
0131     typedef Object::static_t static_t;
0132     typedef Object           iov_t;
0133 
0134   public:
0135     /// Standard constructors and assignment
0136     DE_CTORS_HANDLE(DeVPElement,Base);
0137     /// Access to the static data
0138     static_t& staticData()  const                  { return access()->vp_static;   }
0139     /// Return the number of sensors.
0140     size_t numberSensors() const                   { return ptr()->sensors.size(); }
0141     /// Return vector of sensors.
0142     const std::vector<DeVPSensor>& sensors() const { return ptr()->sensors;        }
0143   };
0144 
0145   /// For the fully enabled object, we have to combine it with the generic stuff
0146   typedef  DetectorElement<DeVPElement>  DeVP;
0147   
0148 }      // End namespace gaudi
0149 #endif // DETECTOR_DEVP_H