Back to home page

EIC code displayed by LXR

 
 

    


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

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 // ----------------------
0029 // Class description:
0030 //
0031 // This class is a temporary representation of G3 volume.
0032 // Its methods enables successive updating of its instances
0033 // during the phase of filling the G3 tables (defining G3 geometry,
0034 // eg. by parsing the G3 input via clparse.cc).
0035 // See G3VolTable class description, too.
0036 // 
0037 // Data members:
0038 //  fVname       volume name; 
0039 //  fShape       G3 shape name;
0040 //  fRpar        array of G3 volumes parameters;
0041 //  fNpar        number of G3 volumes parameters;
0042 //  fNmed        G3 tracking medium number;
0043 //  fSolid       the G4VSolid of this volume;
0044 //  fLV          the G4LogicalVolume;
0045 //  fHasNegPars  true if G3 volume was defined with incomplete
0046 //               parameters; 
0047 //  fDaughters   vector of daughter VTEs (VTEs of volumes placed inside
0048 //               this volume); 
0049 //  fMothers     vector of mother VTEs (VTEs of volumes inside which this
0050 //               volume is placed);
0051 //  fClones      vector of clone VTEs (see explanation below);
0052 //  fG3Pos       vector of G3 positions (G3Pos objects)
0053 //  fDivision    G3Division object created in case the G4 volume
0054 //               was defined as division; 
0055 //
0056 // Clone volumes:
0057 // In case a G3 volume (e.g. XYZ) has changed its solid parameters
0058 // with its new position (placement with GSPOSP) a new G3VolTableEntry
0059 // (associated with this new solid) with a new name (XYZ_N)
0060 // is created and registered as a clone volume in the fClones vector
0061 // data member of its master G3VolTableEntry object. 
0062 
0063 // ----------------------
0064 //
0065 // by I.Hrivnacova, 13.10.99
0066 
0067 #ifndef G3VOLTABLEENTRY_HH
0068 #define G3VOLTABLEENTRY_HH 1
0069 
0070 #include "globals.hh"
0071 #include "G3Pos.hh"
0072 #include "G3Division.hh"
0073 #include <vector>
0074 
0075 class G4LogicalVolume;
0076 class G4Material;
0077 class G4VSolid;
0078 
0079 class G3VolTableEntry
0080 {
0081   public:  // with description
0082 
0083     G3VolTableEntry(G4String& vname, G4String& shape, G4double* rpar, 
0084                     G4int npar, G4int nmed, G4VSolid* solid, 
0085             G4bool hasNegPars);
0086     virtual ~G3VolTableEntry();
0087 
0088     // operators
0089     G4bool operator == ( const G3VolTableEntry& vte) const;
0090 
0091     // methods
0092     void AddG3Pos(G3Pos* aG3Pos);
0093     void AddDaughter(G3VolTableEntry* aDaughter);
0094     void AddMother(G3VolTableEntry* aDaughter);
0095     void AddClone(G3VolTableEntry* aDaughter);
0096     void AddOverlap(G3VolTableEntry* aOverlap);
0097     void ReplaceDaughter(G3VolTableEntry* vteOld, G3VolTableEntry* vteNew);
0098     void ReplaceMother(G3VolTableEntry* vteOld, G3VolTableEntry* vteNew);
0099     G3VolTableEntry* FindDaughter(const G4String& vname);
0100     G3VolTableEntry* FindMother(const G4String& vname);
0101     G3VolTableEntry* FindClone(const G4String& vname);
0102     void PrintSolidInfo();
0103 
0104     // set methods
0105     void SetName(G4String name);
0106     void SetLV(G4LogicalVolume* lv);
0107     void SetSolid(G4VSolid* solid);
0108     void SetNmed(G4int nmed);
0109     void SetNRpar(G4int npar, G4double* Rpar);
0110     void SetDivision(G3Division* division);
0111     void SetHasNegPars(G4bool hasNegPars);
0112     void SetHasMANY(G4bool hasMANY);
0113     void ClearG3PosCopy(G4int copy);
0114     void ClearDivision();
0115  
0116     // get methods
0117     G4String  GetName();
0118     G4String  GetShape();
0119     G4int GetNmed();
0120     G4int GetNpar();
0121     G4double* GetRpar();
0122     G4int NPCopies();
0123     G3Pos* GetG3PosCopy(G4int copy=0);
0124     G3Division* GetDivision();
0125     G4bool HasNegPars();
0126     G4bool HasMANY();
0127     G4VSolid* GetSolid();
0128     G4LogicalVolume* GetLV();
0129     G4int GetNoDaughters();
0130     G4int GetNoMothers();
0131     G4int GetNoClones();
0132     G4int GetNoOverlaps();
0133     G3VolTableEntry* GetDaughter(G4int i);
0134     G3VolTableEntry* GetMother(G4int i);
0135     G3VolTableEntry* GetMother();  
0136       // return the first mother - to be removed
0137     G3VolTableEntry* GetClone(G4int i);
0138     G3VolTableEntry* GetMasterClone();
0139     std::vector<G3VolTableEntry*>* GetOverlaps();
0140 
0141   private:
0142     G4String fVname;
0143     G4String fShape;
0144     G4double* fRpar;
0145     G4int fNpar;
0146     G4int fNmed;
0147     G4VSolid* fSolid;
0148     G4LogicalVolume* fLV;
0149     G4bool fHasNegPars;
0150     G4bool fHasMANY;
0151     std::vector<G3VolTableEntry*> fDaughters;
0152     std::vector<G3VolTableEntry*> fMothers;
0153     std::vector<G3VolTableEntry*> fClones;
0154     std::vector<G3VolTableEntry*> fOverlaps;
0155     std::vector<G3Pos*> fG3Pos;
0156     G3Division*  fDivision;
0157 };
0158 
0159 // inline methods
0160 
0161 inline void G3VolTableEntry::SetDivision(G3Division* division)
0162 { fDivision = division; }
0163 
0164 inline G3Division* G3VolTableEntry::GetDivision()
0165 { return fDivision; }
0166 
0167 #endif