Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:32:43

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_DETAIL_OBJECTSINTERNA_H
0014 #define DD4HEP_DETAIL_OBJECTSINTERNA_H
0015 
0016 // Framework include files
0017 #include <DD4hep/Volumes.h>
0018 #include <DD4hep/NamedObject.h>
0019 #include <DD4hep/IDDescriptor.h>
0020 #include <DD4hep/Segmentations.h>
0021 #include <DD4hep/BitFieldCoder.h>
0022 
0023 // C/C++ include files
0024 #include <set>
0025 
0026 // Forward declarations
0027 class TColor;
0028 
0029 /// Namespace for the AIDA detector description toolkit
0030 namespace dd4hep {
0031 
0032   /// Concrete object implementation for the Header handle
0033   /**
0034    *
0035    *  \author  M.Frank
0036    *  \version 1.0
0037    *  \ingroup DD4HEP_CORE
0038    */
0039   class HeaderObject: public NamedObject {
0040   public:
0041     std::string url;
0042     std::string author;
0043     std::string status;
0044     std::string version;
0045     std::string comment;
0046     /// Standard constructor
0047     HeaderObject();
0048     /// Default destructor
0049     virtual ~HeaderObject();
0050   private:
0051     /// Private copy constructor
0052     HeaderObject(const HeaderObject&) : NamedObject() {}
0053     /// Private assignment operator
0054     HeaderObject& operator=(const HeaderObject&) { return *this; }
0055   };
0056 
0057   /// Concrete object implementation for the Constant handle
0058   /**
0059    *
0060    *  \author  M.Frank
0061    *  \version 1.0
0062    *  \ingroup DD4HEP_CORE
0063    */
0064   class ConstantObject: public NamedObject {
0065   public:
0066     /// Constant type
0067     std::string dataType;
0068     /// Default constructor for ROOT persistency
0069     ConstantObject();
0070     /// Standard constructor
0071     ConstantObject(const std::string& nam, const std::string& val, const std::string& typ);
0072     /// Default destructor
0073     virtual ~ConstantObject();
0074   private:
0075     /// Private copy constructor
0076     ConstantObject(const ConstantObject&) : NamedObject() {}
0077     /// Private assignment operator
0078     ConstantObject& operator=(const ConstantObject&) { return *this; }
0079   };
0080 
0081   /// Concrete object implementation of the VisAttr Handle
0082   /**
0083    *
0084    *  \author  M.Frank
0085    *  \version 1.0
0086    *  \ingroup DD4HEP_CORE
0087    */
0088   class VisAttrObject: public NamedObject {
0089   public:
0090     unsigned long magic;
0091     TColor*       color   = nullptr;
0092     TColor*       colortr = nullptr;
0093     float         alpha   = 0;
0094     unsigned char drawingStyle  = VisAttr::SOLID;
0095     unsigned char lineStyle     = VisAttr::SOLID;
0096     unsigned char showDaughters = true;
0097     unsigned char visible       = true;
0098     /// Standard constructor
0099     VisAttrObject();
0100     /// Default destructor
0101     virtual ~VisAttrObject();
0102   };
0103 
0104   /// Concrete object implementation of the Region Handle
0105   /**
0106    *
0107    *  \author  M.Frank
0108    *  \version 1.0
0109    *  \ingroup DD4HEP_CORE
0110    */
0111   class RegionObject: public NamedObject {
0112   public:
0113     unsigned long magic;
0114     double        threshold         = 10.0;
0115     double        cut               = 10.0;
0116     bool          store_secondaries = false;
0117     bool          use_default_cut   = true;
0118     bool          was_threshold_set = false;
0119     /// References to user limits
0120     std::vector<std::string> user_limits;
0121     /// Standard constructor
0122     RegionObject();
0123     /// Default destructor
0124     virtual ~RegionObject();
0125   };
0126 
0127   /// Concrete object implementation of the LimitSet Handle
0128   /**
0129    *
0130    *  \author  M.Frank
0131    *  \version 1.0
0132    *  \ingroup DD4HEP_CORE
0133    */
0134   class LimitSetObject: public NamedObject  {
0135   public:
0136     /// Iterator definitions
0137     typedef std::set<Limit>::iterator       iterator;
0138     typedef std::set<Limit>::const_iterator const_iterator;
0139   public:
0140     /// Particle specific limits
0141     std::set<Limit> limits;
0142     /// Particle specific production cuts
0143     std::set<Limit> cuts;
0144   public:
0145     /// Standard constructor
0146     LimitSetObject();
0147     /// Default destructor
0148     virtual ~LimitSetObject();
0149   };
0150 
0151   /// Definition of the HitCollection parameters used by the Readout
0152   /**
0153    *   \author  M.Frank
0154    *   \version 1.0
0155    *   \ingroup DD4HEP_CORE
0156    */
0157   class HitCollection   {
0158   public:
0159     /// Hit collection name
0160     std::string name;
0161     /// Discriminator key name from the <id/> string
0162     std::string key;
0163     /// Range values of the key is not empty.
0164     long key_min, key_max;
0165     /// Default constructor
0166     HitCollection() : key_min(~0x0), key_max(~0x0) {}
0167     /// Copy constructor
0168     HitCollection(const HitCollection& c);
0169     /// Initializing constructor
0170     HitCollection(const std::string& name, const std::string& key="",long k_min=~0x0, long kmax=~0x0);
0171     /// Assignment operator
0172     HitCollection& operator=(const HitCollection& c);
0173   };
0174 
0175   /// Concrete object implementation of the Readout Handle
0176   /**
0177    *
0178    * \author  M.Frank
0179    * \version 1.0
0180    * \ingroup DD4HEP_CORE
0181    */
0182   class ReadoutObject: public NamedObject {
0183   public:
0184     /// Handle to the readout segmentation
0185     Segmentation  segmentation;  //! not ROOT-persistent
0186     /// Handle to the volume
0187     Volume        readoutWorld;
0188     /// Handle to the field descriptor
0189     IDDescriptor  id;
0190     /// Hit collection container (if defined)
0191     std::vector<HitCollection> hits;
0192     /// Standard constructor
0193     ReadoutObject();
0194     /// Default destructor
0195     virtual ~ReadoutObject();
0196   };
0197 
0198   /// Concrete object implementation of the IDDescriptorObject Handle
0199   /**
0200    *
0201    *  \author  M.Frank
0202    *  \version 1.0
0203    *  \date    2012/07/31
0204    *  \ingroup DD4HEP_CORE
0205    */
0206   class IDDescriptorObject: public NamedObject {
0207   public:
0208     typedef std::vector<std::pair<std::string, const BitFieldElement*> > FieldMap;
0209     typedef std::vector<std::pair<size_t, std::string> >         FieldIDs;
0210     /// Map of id-fields in the descriptor
0211     FieldMap      fieldMap;
0212     /// String map of id descriptors
0213     FieldIDs      fieldIDs;
0214     /// Decoder object
0215     BitFieldCoder decoder;
0216     
0217     /// The description string to build the bit-field descriptors.
0218     std::string description;
0219     /// Default constructor
0220     IDDescriptorObject();
0221     /// Standard constructor
0222     IDDescriptorObject(const std::string& initString);
0223     /// Default destructor
0224     virtual ~IDDescriptorObject();
0225 #if 0
0226 #ifndef __CINT__
0227     /// Access to the field container of the BitFieldCoder
0228     const std::vector<BitFieldElement*>& fields() const {
0229       return decoder.fields();
0230     }
0231 #endif
0232 #endif
0233   };
0234 }      /* End namespace dd4hep            */
0235 #endif // DD4HEP_DETAIL_OBJECTSINTERNA_H