/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/include/BDSGeometrySQL.hh

00001 /* * BDSIM code.    Version 1.0
00002    * Author: Grahame A. Blair, Royal Holloway, Univ. of London.
00003    * Last modified 24.7.2002
00004    * Copyright (c) 2002 by G.A.Blair.  ALL RIGHTS RESERVED. 
00005 
00006 
00007    Author of this code: John C. Carter, Royal Holloway, Univ. of London.
00008    Last modified 13.04.2005
00009 */
00010 
00011 
00012 #ifndef BDSGeometrySQL_h
00013 #define BDSGeometrySQL_h 1
00014 
00015 #include <fstream>
00016 #include <list>
00017 #include <vector>
00018 
00019 #include "globals.hh"
00020 #include "G4LogicalVolume.hh"
00021 #include "G4VisAttributes.hh"
00022 #include "G4UserLimits.hh"
00023 #include "BDSMySQLTable.hh"
00024 #include "G4VPhysicalVolume.hh"
00025 #include "G4Region.hh"
00026 
00027 class BDSGeometrySQL
00028 {
00029 public:
00030   BDSGeometrySQL(G4String DBfile, G4double markerlength,G4LogicalVolume *marker);
00031   ~BDSGeometrySQL();
00032 
00033   // For List of uniform fields for volumes
00034   std::list<G4ThreeVector> UniformField;
00035   std::list<G4String> Fieldvol; 
00036 
00037   // For List of Quad/Sext/Oct Fields
00038   std::list<G4double> QuadBgrad;
00039   std::list<G4String> Quadvol; 
00040   std::list<G4double> SextBgrad;
00041   std::list<G4String> Sextvol;
00042   std::list<G4double> OctBgrad;
00043   std::list<G4String> Octvol;
00044 
00045   std::map<G4String, G4ThreeVector> UniformFieldVolField;
00046   std::map<G4String, G4double> QuadVolBgrad;
00047   std::map<G4String, G4double> SextVolBgrad;
00048   std::map<G4String, G4double> OctVolBgrad;
00049 
00050   G4VPhysicalVolume* align_in_volume;
00051   G4VPhysicalVolume* align_out_volume;
00052   std::vector<G4LogicalVolume*> SensitiveComponents;
00053   std::vector<G4LogicalVolume*> itsGFlashComponents;
00054   std::vector<G4VPhysicalVolume*> itsMultiplePhysicalVolumes;
00055 
00056   std::vector<G4LogicalVolume*> VOL_LIST;
00057   G4bool HasFields;
00058   G4int nPoleField;
00059   G4bool HasUniformField;
00060 
00061   std::vector<G4VPhysicalVolume*> GetMultiplePhysicalVolumes();
00062   std::vector<G4LogicalVolume*> GetGFlashComponents();
00063 
00064 private:
00065   G4int _NVariables;
00066   G4double _VisRed; 
00067   G4double _VisGreen;
00068   G4double _VisBlue;
00069   G4double _VisAlpha;
00070   G4String _VisType;
00071   G4String _Material;
00072   G4String _TableName;
00073   G4String _Name;
00074 
00075   G4double _PosX;
00076   G4double _PosY;
00077   G4double _PosZ;
00078   G4double _RotPsi;
00079   G4double _RotTheta;
00080   G4double _RotPhi;
00081   G4double _K1,_K2,_K3,_K4;
00082   G4String _PARENTNAME;
00083   G4String _InheritStyle;
00084   G4String _Parameterisation;
00085   G4String _MagType;
00086   G4int _align_in;
00087   G4int _align_out;
00088   G4int _SetSensitive;
00089   G4int _PrecisionRegion;
00090   G4int _ApproximationRegion;
00091   G4double _FieldX, _FieldY, _FieldZ;
00092 
00093   G4double _lengthUserLimit;
00094 
00095   G4Region* _precisionRegionSQL;
00096   G4Region* _approximationRegionSQL;
00097 
00098   void Construct();
00099   void BuildSQLObjects(G4String file);
00100   void SetCommonParams(BDSMySQLTable*,G4int);
00101   void SetPlacementParams(BDSMySQLTable*,G4int);
00102   G4VisAttributes* VisAtt();
00103   G4UserLimits* UserLimits(G4double);
00104   void SetLogVolAtt(G4LogicalVolume*, G4double);
00105   void SetLogVolRegion(G4LogicalVolume*);
00106   G4LogicalVolume* BuildCone(BDSMySQLTable* aSQLTable, G4int k);
00107   G4LogicalVolume* BuildEllipticalCone(BDSMySQLTable* aSQLTable, G4int k);
00108   G4LogicalVolume* BuildPolyCone(BDSMySQLTable* aSQLTable, G4int k);
00109   G4LogicalVolume* BuildBox(BDSMySQLTable* aSQLTable, G4int k);
00110   G4LogicalVolume* BuildTrap(BDSMySQLTable* aSQLTable, G4int k);
00111   G4LogicalVolume* BuildTorus(BDSMySQLTable* aSQLTable, G4int k);
00112   G4LogicalVolume* BuildSampler(BDSMySQLTable* aSQLTable, G4int k);
00113   G4LogicalVolume* BuildTube(BDSMySQLTable* aSQLTable, G4int k);
00114   G4LogicalVolume* BuildEllipticalTube(BDSMySQLTable* aSQLTable, G4int k);
00115   G4LogicalVolume* BuildPCLTube(BDSMySQLTable* aSQLTable, G4int k);
00116   G4RotationMatrix* RotateComponent(G4double psi,
00117                                     G4double phi,
00118                                     G4double theta);
00119   G4RotationMatrix* rotateComponent;
00120   void PlaceComponents(BDSMySQLTable* aSQLTable, std::vector<G4LogicalVolume*> VOL_LIST);
00121 
00122   G4double itsMarkerLength;
00123   std::ifstream ifs;
00124   G4LogicalVolume* itsMarkerVol;
00125   std::vector<BDSMySQLTable*> itsSQLTable;
00126   //  BDSMagFieldSQL* itsMagField;
00127   //  BDSSamplerSD* SensDet;
00128 
00129   void  SetMultiplePhysicalVolumes(G4VPhysicalVolume* aPhysVol);
00130 
00131 protected:
00132 };
00133 
00134 inline void BDSGeometrySQL::SetMultiplePhysicalVolumes(G4VPhysicalVolume* aPhysVol)
00135 { itsMultiplePhysicalVolumes.push_back(aPhysVol);}
00136 
00137 inline  std::vector<G4VPhysicalVolume*> BDSGeometrySQL::GetMultiplePhysicalVolumes()
00138 {return itsMultiplePhysicalVolumes;}
00139 
00140 inline  std::vector<G4LogicalVolume*> BDSGeometrySQL::GetGFlashComponents()
00141 {return itsGFlashComponents;}
00142 
00143 #endif

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7