Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:23

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 // File and Version Information:
0029 //
0030 // Description:
0031 //  Create a HepRep XML File (HepRep version 1).
0032 //
0033 // Environment:
0034 //  Software developed for the general High Energy Physics community.
0035 //
0036 // Author :
0037 //       J. Perl                    Original Author
0038 //
0039 // Copyright Information:
0040 //      Copyright (C) 2001          Stanford Linear Accelerator Center
0041 //------------------------------------------------------------------------
0042 #ifndef G4HepRepFileXMLWriter_hh
0043 #define G4HepRepFileXMLWriter_hh
0044 
0045 //#define G4HEPREPFILEDEBUG  // Comment this out to suppress debug code.
0046 
0047 #include "globals.hh"
0048 #include <fstream>
0049 
0050 class G4HepRepFileXMLWriter
0051 {
0052  public:
0053   G4HepRepFileXMLWriter();
0054 
0055   void addType(const char* name, int newTypeDepth);
0056   void addInstance();
0057   void addPrimitive();
0058   void addPoint(double x, double y, double z);
0059 
0060   void addAttDef(const char* name, const char* desc, const char* type,
0061                  const char* extra);
0062 
0063   void addAttValue(const char* name, const char* value);
0064 
0065   void addAttValue(const char* name, double value);
0066 
0067   void addAttValue(const char* name, int value);
0068 
0069   void addAttValue(const char* name, bool value);
0070 
0071   void addAttValue(const char* name, double value1, double value2,
0072                    double value3);
0073 
0074   void open(const char* filespec);
0075   void close();
0076 
0077   void endTypes();
0078 
0079   bool isOpen;
0080   int typeDepth;
0081   bool inType[50];
0082   bool inInstance[50];
0083   char* prevTypeName[50];
0084 
0085  private:
0086   std::ofstream fout;
0087 
0088   void init();
0089 
0090   bool inPrimitive;
0091   bool inPoint;
0092 
0093   void endType();
0094   void endInstance();
0095   void endPrimitive();
0096   void endPoint();
0097 
0098   void indent();
0099 };
0100 #endif