Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-22 09:06:34

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 
0028 #ifndef G4ATTDEF_HH
0029 #define G4ATTDEF_HH
0030 
0031 #include "globals.hh"
0032 #include "G4TypeKey.hh"
0033 #include <map>
0034 
0035 // Class Description:
0036 //
0037 // @class G4AttDef
0038 //
0039 // @brief This class represents a HepRep-style Attribute Definition.
0040 // The G4AttDef is used to define new kinds of attributes that can
0041 // then have values set for a Trajectory, Trajectory Point or Sensitive
0042 // Detector Hit.  These attributes are then made available to the end user
0043 // in an interactive visualization system (such as WIRED).
0044 // Values are set by creating G4AttValue objects and attaching them to the
0045 // relevant Trajectory, Trajectory Point or Sensitive Detector Hit.
0046 // The association between the G4AttValue and the G4AttDef object is
0047 // made through the data member "name".
0048 //
0049 // @author M.Frailis 
0050 // @author R.Giannitrapani
0051 // @author J.Perl
0052 // Class Description - End:
0053 
0054   
0055   class G4AttDef{
0056 
0057   public:
0058     G4AttDef(const G4String& name,
0059              const G4String& desc,
0060              const G4String& category,
0061              const G4String& extra,
0062              const G4String& valueType):
0063       m_name(name),m_desc(desc),
0064       m_category(category),
0065       m_extra(extra),m_valueType(valueType){};
0066 
0067     // G4Typekey based constructor
0068     G4AttDef(const G4String& name,
0069              const G4String& desc,
0070              const G4String& category,
0071              const G4String& extra,
0072              const G4TypeKey& typeKey):
0073       m_name(name),m_desc(desc),
0074       m_category(category),
0075       m_extra(extra),m_valueType("Null"), 
0076       m_typeKey(typeKey)
0077     {};
0078 
0079     G4AttDef()= default;
0080     virtual ~G4AttDef()= default;
0081     
0082     const G4String& GetName()const{return m_name;};
0083     const G4String& GetDesc()const{return m_desc;};
0084     const G4String& GetCategory()const{return m_category;};
0085     const G4String& GetExtra()const{return m_extra;};
0086     const G4String& GetValueType()const{return m_valueType;};
0087     const G4TypeKey& GetTypeKey()const{return m_typeKey;};
0088 
0089     void SetName(const G4String& name){m_name = name;};
0090     void SetDesc(const G4String& desc){m_desc = desc;};
0091     void SetCategory(const G4String& cat){m_category = cat;};
0092     void SetExtra(const G4String& extra){m_extra = extra;};
0093     void SetValueType(const G4String& type){m_valueType = type;};
0094 
0095   private:
0096     /// The name of the attribute
0097     G4String m_name;
0098     /// A short description of the attribute
0099     G4String m_desc;
0100     /// The category (Draw, Physics, PickAction, Association, etc.) 
0101     G4String m_category;
0102     /// Some extra property of the attribute (units, etc.)
0103     G4String m_extra;
0104     /// The type of the value of the attribute (int, double, vector, etc.)
0105     G4String m_valueType;
0106     // Type key
0107     G4TypeKey m_typeKey;
0108 
0109   };
0110 
0111 // Deprecated.  It is not a good idea to output a pointer since failure to
0112 // include this prototype will not cause a compilation error - it will merely
0113 // cause your code to use a default function that outputs the pointer as an
0114 // address.
0115 [[deprecated("Use pass-by-reference version instead.")]]
0116 std::ostream& operator<<
0117 (std::ostream& os, const std::map<G4String,G4AttDef>* definitions);
0118 
0119 // Use this instead.
0120 std::ostream& operator<<
0121 (std::ostream& os, const std::map<G4String,G4AttDef>& definitions);
0122 
0123 #endif //G4ATTDEF_H