Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58: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 /// \file processes/phonon/include/G4LatticeReader.hh
0027 /// \brief Definition of the G4LatticeReader class
0028 //
0029 // NOTE:  This reader class for logical lattices should be moved to
0030 //    materials/ after the 10.0 release (and this comment removed).
0031 //
0032 // 20131115  Move ctor, dtor implementations to .cc file.
0033 
0034 #ifndef G4LatticeReader_h
0035 #define G4LatticeReader_h 1
0036 
0037 #include "globals.hh"
0038 #include <iosfwd>
0039 
0040 class G4LatticeLogical;
0041 
0042 class G4LatticeReader {
0043 public:
0044   G4LatticeReader(G4int vb=0);
0045   ~G4LatticeReader();
0046 
0047   void SetVerboseLevel(G4int vb) { verboseLevel = vb; }
0048 
0049   G4LatticeLogical* MakeLattice(const G4String& filepath);
0050 
0051 protected:
0052   G4bool OpenFile(const G4String& filepath);
0053   G4bool ProcessToken();
0054   G4bool ProcessValue(const G4String& name);    // Numerical parameters
0055   G4bool ProcessConstants();            // Four dynamical constants
0056   G4bool ProcessMap();              // Velocity magnitudes file
0057   G4bool ProcessNMap();             // Direction vectors file
0058   G4bool ReadMapInfo();             // Get map file parameters
0059   G4bool SkipComments();                // Everything after '#'
0060   void CloseFile();
0061 
0062 private:
0063   G4int verboseLevel;       // For reporting progress, also use G4VERBOSE
0064 
0065   std::ifstream* psLatfile; // Configuration file being read
0066   G4LatticeLogical* pLattice;   // Lattice under construction (not owned)
0067 
0068   G4String fMapPath;        // Path to config file to find velocity maps
0069   G4String fToken;      // Reusable buffers for reading file
0070   G4double fValue;      // ... floating point data values
0071   G4String fMap, fsPol;     // ... map filename and polarization code
0072   G4int    fPol, fNX, fNY;  // ... map binning in each direction
0073 
0074   static const G4String fDataDir;   // Directory path ($G4LATTICEDATA)
0075 };
0076 
0077 #endif  /* G4LatticeReader_h */