G3VolTableEntry.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // ----------------------
00030 // Class description:
00031 //
00032 // This class is a temporary representation of G3 volume.
00033 // Its methods enables successive updating of its instances
00034 // during the phase of filling the G3 tables (defining G3 geometry,
00035 // eg. by parsing the G3 input via clparse.cc).
00036 // See G3VolTable class description, too.
00037 // 
00038 // Data members:
00039 //  fVname       volume name; 
00040 //  fShape       G3 shape name;
00041 //  fRpar        array of G3 volumes parameters;
00042 //  fNpar        number of G3 volumes parameters;
00043 //  fNmed        G3 tracking medium number;
00044 //  fSolid       the G4VSolid of this volume;
00045 //  fLV          the G4LogicalVolume;
00046 //  fHasNegPars  true if G3 volume was defined with incomplete
00047 //               parameters; 
00048 //  fDaughters   vector of daughter VTEs (VTEs of volumes placed inside
00049 //               this volume); 
00050 //  fMothers     vector of mother VTEs (VTEs of volumes inside which this
00051 //               volume is placed);
00052 //  fClones      vector of clone VTEs (see explanation below);
00053 //  fG3Pos       vector of G3 positions (G3Pos objects)
00054 //  fDivision    G3Division object created in case the G4 volume
00055 //               was defined as division; 
00056 //
00057 // Clone volumes:
00058 // In case a G3 volume (e.g. XYZ) has changed its solid parameters
00059 // with its new position (placement with GSPOSP) a new G3VolTableEntry
00060 // (associated with this new solid) with a new name (XYZ_N)
00061 // is created and registered as a clone volume in the fClones vector
00062 // data member of its master G3VolTableEntry object. 
00063 
00064 // ----------------------
00065 //
00066 // by I.Hrivnacova, 13.10.99
00067 
00068 #ifndef G3VOLTABLEENTRY_HH
00069 #define G3VOLTABLEENTRY_HH 1
00070 
00071 #include "globals.hh"
00072 #include "G3Pos.hh"
00073 #include "G3Division.hh"
00074 #include <vector>
00075 
00076 class G4LogicalVolume;
00077 class G4Material;
00078 class G4VSolid;
00079 
00080 class G3VolTableEntry
00081 {
00082   public:  // with description
00083 
00084     G3VolTableEntry(G4String& vname, G4String& shape, G4double* rpar, 
00085                     G4int npar, G4int nmed, G4VSolid* solid, 
00086                     G4bool hasNegPars);
00087     virtual ~G3VolTableEntry();
00088 
00089     // operators
00090     G4bool operator == ( const G3VolTableEntry& vte) const;
00091 
00092     // methods
00093     void AddG3Pos(G3Pos* aG3Pos);
00094     void AddDaughter(G3VolTableEntry* aDaughter);
00095     void AddMother(G3VolTableEntry* aDaughter);
00096     void AddClone(G3VolTableEntry* aDaughter);
00097     void AddOverlap(G3VolTableEntry* aOverlap);
00098     void ReplaceDaughter(G3VolTableEntry* vteOld, G3VolTableEntry* vteNew);
00099     void ReplaceMother(G3VolTableEntry* vteOld, G3VolTableEntry* vteNew);
00100     G3VolTableEntry* FindDaughter(const G4String& vname);
00101     G3VolTableEntry* FindMother(const G4String& vname);
00102     G3VolTableEntry* FindClone(const G4String& vname);
00103     void PrintSolidInfo();
00104 
00105     // set methods
00106     void SetName(G4String name);
00107     void SetLV(G4LogicalVolume* lv);
00108     void SetSolid(G4VSolid* solid);
00109     void SetNmed(G4int nmed);
00110     void SetNRpar(G4int npar, G4double* Rpar);
00111     void SetDivision(G3Division* division);
00112     void SetHasNegPars(G4bool hasNegPars);
00113     void SetHasMANY(G4bool hasMANY);
00114     void ClearG3PosCopy(G4int copy);
00115     void ClearDivision();
00116  
00117     // get methods
00118     G4String  GetName();
00119     G4String  GetShape();
00120     G4int GetNmed();
00121     G4int GetNpar();
00122     G4double* GetRpar();
00123     G4int NPCopies();
00124     G3Pos* GetG3PosCopy(G4int copy=0);
00125     G3Division* GetDivision();
00126     G4bool HasNegPars();
00127     G4bool HasMANY();
00128     G4VSolid* GetSolid();
00129     G4LogicalVolume* GetLV();
00130     G4int GetNoDaughters();
00131     G4int GetNoMothers();
00132     G4int GetNoClones();
00133     G4int GetNoOverlaps();
00134     G3VolTableEntry* GetDaughter(G4int i);
00135     G3VolTableEntry* GetMother(G4int i);
00136     G3VolTableEntry* GetMother();  
00137       // return the first mother - to be removed
00138     G3VolTableEntry* GetClone(G4int i);
00139     G3VolTableEntry* GetMasterClone();
00140     std::vector<G3VolTableEntry*>* GetOverlaps();
00141 
00142   private:
00143     G4String fVname;
00144     G4String fShape;
00145     G4double* fRpar;
00146     G4int fNpar;
00147     G4int fNmed;
00148     G4VSolid* fSolid;
00149     G4LogicalVolume* fLV;
00150     G4bool fHasNegPars;
00151     G4bool fHasMANY;
00152     std::vector<G3VolTableEntry*> fDaughters;
00153     std::vector<G3VolTableEntry*> fMothers;
00154     std::vector<G3VolTableEntry*> fClones;
00155     std::vector<G3VolTableEntry*> fOverlaps;
00156     std::vector<G3Pos*> fG3Pos;
00157     G3Division*  fDivision;
00158 };
00159 
00160 // inline methods
00161 
00162 inline void G3VolTableEntry::SetDivision(G3Division* division)
00163 { fDivision = division; }
00164 
00165 inline G3Division* G3VolTableEntry::GetDivision()
00166 { return fDivision; }
00167 
00168 #endif

Generated on Mon May 27 17:47:36 2013 for Geant4 by  doxygen 1.4.7