Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:56

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 // For details, see the HepRep home page at http://heprep.freehep.org
0049 //  
0050 // @author M.Frailis 
0051 // @author R.Giannitrapani
0052 // @author J.Perl
0053 // Class Description - End:
0054 
0055   
0056   class G4AttDef{
0057 
0058   public:
0059     G4AttDef(const G4String& name,
0060              const G4String& desc,
0061              const G4String& category,
0062              const G4String& extra,
0063              const G4String& valueType):
0064       m_name(name),m_desc(desc),
0065       m_category(category),
0066       m_extra(extra),m_valueType(valueType){};
0067 
0068     // G4Typekey based constructor
0069     G4AttDef(const G4String& name,
0070              const G4String& desc,
0071              const G4String& category,
0072              const G4String& extra,
0073              const G4TypeKey& typeKey):
0074       m_name(name),m_desc(desc),
0075       m_category(category),
0076       m_extra(extra),m_valueType("Null"), 
0077       m_typeKey(typeKey)
0078     {};
0079 
0080     G4AttDef()= default;
0081     virtual ~G4AttDef()= default;
0082     
0083     const G4String& GetName()const{return m_name;};
0084     const G4String& GetDesc()const{return m_desc;};
0085     const G4String& GetCategory()const{return m_category;};
0086     const G4String& GetExtra()const{return m_extra;};
0087     const G4String& GetValueType()const{return m_valueType;};
0088     const G4TypeKey& GetTypeKey()const{return m_typeKey;};
0089 
0090     void SetName(const G4String& name){m_name = name;};
0091     void SetDesc(const G4String& desc){m_desc = desc;};
0092     void SetCategory(const G4String& cat){m_category = cat;};
0093     void SetExtra(const G4String& extra){m_extra = extra;};
0094     void SetValueType(const G4String& type){m_valueType = type;};
0095 
0096   private:
0097     /// The name of the attribute
0098     G4String m_name;
0099     /// A short description of the attribute
0100     G4String m_desc;
0101     /// The category (Draw, Physics, PickAction, Association, etc.) 
0102     G4String m_category;
0103     /// Some extra property of the attribute (units, etc.)
0104     G4String m_extra;
0105     /// The type of the value of the attribute (int, double, vector, etc.)
0106     G4String m_valueType;
0107     // Type key
0108     G4TypeKey m_typeKey;
0109 
0110   };
0111 
0112 // Deprecated.  It is not a good idea to output a pointer since failure to
0113 // include this prototype will not cause a compilation error - it will merely
0114 // cause your code to use a default function that outputs the pointer as an
0115 // address.
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