Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:12:35

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 DD4HEP_READOUT_H
0014 #define DD4HEP_READOUT_H
0015 
0016 // Framework include files
0017 #include <DD4hep/Handle.h>
0018 #include <DD4hep/IDDescriptor.h>
0019 #include <DD4hep/Segmentations.h>
0020 
0021 /// Namespace for the AIDA detector description toolkit
0022 namespace dd4hep {
0023 
0024   // Forward declarations
0025   class ReadoutObject;
0026   class HitCollection;
0027 
0028   /// Handle to the implementation of the readout structure of a subdetector
0029   /**
0030    *   If there is no explicit hit collection defined, by default one single
0031    *   hit collection is defined by the name of the readout itself.
0032    *   If hit collections are defined, ALL must be defined.
0033    *
0034    *   \author  M.Frank
0035    *   \version 1.0
0036    *   \ingroup DD4HEP_CORE
0037    */
0038   class Readout: public Handle<ReadoutObject> {
0039   public:
0040     /// Default constructor
0041     Readout() = default;
0042 
0043     /// Copy Constructor from object
0044     Readout(Readout&& e) = default;
0045 
0046     /// Copy Constructor from object
0047     Readout(const Readout& e) = default;
0048 
0049 #ifndef __CINT__
0050     /// Move constructor from handle
0051     Readout(Handle<ReadoutObject>&& e) : Handle<Object>(e) { }
0052     /// Copy Constructor from handle
0053     Readout(const Handle<ReadoutObject>& e) : Handle<Object>(e) { }
0054 #endif
0055 
0056     /// Constructor to be used when reading the already parsed object
0057     template <typename Q> Readout(const Handle<Q>& e) : Handle<Object>(e) { }
0058 
0059     /// Initializing constructor
0060     Readout(const std::string& name);
0061 
0062     /// Assignment move operator
0063     Readout& operator=(Readout&& ro) = default;
0064 
0065     /// Assignment operator
0066     Readout& operator=(const Readout& ro) = default;
0067 
0068     /// Access explicit names of hit collections if present
0069     std::vector<std::string> collectionNames()  const;
0070 
0071 #ifndef __CINT__
0072     /// Access hit collections if present
0073     std::vector<const HitCollection*> collections()  const;
0074 #endif
0075     /// Access number of hit collections
0076     size_t numCollections() const;
0077     
0078     /// Assign IDDescription to readout structure
0079     void setIDDescriptor(const Ref_t& spec) const;
0080 
0081     /// Access IDDescription structure
0082     IDDescriptor idSpec() const;
0083 
0084     /// Assign segmentation structure to readout
0085     void setSegmentation(const Segmentation& segment) const;
0086 
0087     /// Access segmentation structure
0088     Segmentation segmentation() const;
0089   };
0090 }         /* End namespace dd4hep         */
0091 #endif // DD4HEP_READOUT_H