| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | // Class description:
|
|---|
| 27 | //
|
|---|
| 28 | // Virtual mother class of the division testers for each solid
|
|---|
| 29 |
|
|---|
| 30 | // History:
|
|---|
| 31 | // 13.08.03 - P.Arce Initial version
|
|---|
| 32 | // ********************************************************************
|
|---|
| 33 |
|
|---|
| 34 | #ifndef ExVDivTester_H
|
|---|
| 35 | #define ExVDivTester_H 1
|
|---|
| 36 |
|
|---|
| 37 | #include <vector>
|
|---|
| 38 | #include <fstream>
|
|---|
| 39 | #include <iostream>
|
|---|
| 40 | #include "globals.hh"
|
|---|
| 41 | #include "geomdefs.hh"
|
|---|
| 42 |
|
|---|
| 43 | class G4VSolid;
|
|---|
| 44 | class G4Material;
|
|---|
| 45 |
|
|---|
| 46 | #include "G4LogicalVolume.hh"
|
|---|
| 47 | #include "G4VPhysicalVolume.hh"
|
|---|
| 48 | #include "G4VDivisionParameterisation.hh"
|
|---|
| 49 |
|
|---|
| 50 | enum SolidType{g4box, g4tube, g4tubs, g4cone, g4cons, g4trd, g4para, g4polycone, g4polyhedra };
|
|---|
| 51 | enum PVType{pvDivision, pvReplica, pvPlacement };
|
|---|
| 52 | enum PlaceType{pvNormal, pvReflected};
|
|---|
| 53 | //-enum DivType{divNDiv, divWidth, divNDivWidth };
|
|---|
| 54 |
|
|---|
| 55 | class ExVDivTester
|
|---|
| 56 | {
|
|---|
| 57 | public: // with description
|
|---|
| 58 |
|
|---|
| 59 | ExVDivTester( PVType& pvtype, PlaceType& postype,
|
|---|
| 60 | std::vector<G4String>& extraPars );
|
|---|
| 61 | virtual ~ExVDivTester();
|
|---|
| 62 |
|
|---|
| 63 | void readExtraPars();
|
|---|
| 64 | G4double getValueFromExtraPar( G4String& epar );
|
|---|
| 65 |
|
|---|
| 66 | void GenerateRandomPoints();
|
|---|
| 67 | virtual void GenerateScanPoints() = 0;
|
|---|
| 68 | void GenerateScanPointsAsBox();
|
|---|
| 69 | void GenerateScanPointsAsTubs();
|
|---|
| 70 |
|
|---|
| 71 | G4VPhysicalVolume* BuildGeometry();
|
|---|
| 72 | virtual void BuildParentSolids() = 0;
|
|---|
| 73 | virtual void BuildChildrenSolids() = 0;
|
|---|
| 74 |
|
|---|
| 75 | void PrintChildrenSolids( std::ostream& out );
|
|---|
| 76 | void PrintParentSolid( std::ostream& out );
|
|---|
| 77 |
|
|---|
| 78 | inline G4double GetWorldLengthXY() { return theWorldLengthXY; }
|
|---|
| 79 | inline G4double GetWorldLengthZ() { return theWorldLengthZ; }
|
|---|
| 80 | inline G4double GetWorldGap() { return theWorldGap; }
|
|---|
| 81 |
|
|---|
| 82 | private:
|
|---|
| 83 | void BuildParentVolumes( G4LogicalVolume* worldLog );
|
|---|
| 84 | void BuildChildrenVolumes();
|
|---|
| 85 | void SetOffsets();
|
|---|
| 86 |
|
|---|
| 87 | public:
|
|---|
| 88 | static G4bool bDivCylindrical;
|
|---|
| 89 |
|
|---|
| 90 | protected:
|
|---|
| 91 |
|
|---|
| 92 | PVType thePVType;
|
|---|
| 93 | PlaceType thePosType;
|
|---|
| 94 | DivisionType theDivType;
|
|---|
| 95 | std::vector<G4String> theExtraPars;
|
|---|
| 96 | std::vector<G4double> theWidths;
|
|---|
| 97 | std::vector<G4double> theOffsets;
|
|---|
| 98 | G4double theOffsetFactor;
|
|---|
| 99 | G4double theWidthFactor;
|
|---|
| 100 | G4int theNDiv;
|
|---|
| 101 | G4double theStartPhi;
|
|---|
| 102 | G4double theDeltaPhi;
|
|---|
| 103 |
|
|---|
| 104 | std::vector<G4VSolid*> theParentSolids;
|
|---|
| 105 | std::vector<G4LogicalVolume*> theParentLogs;
|
|---|
| 106 | std::vector<G4VPhysicalVolume*> theParentPhyss;
|
|---|
| 107 | std::vector<G4VSolid*> theChildSolids;
|
|---|
| 108 | std::vector<G4LogicalVolume*> theChildLogs;
|
|---|
| 109 | std::vector<EAxis> theAxis;
|
|---|
| 110 |
|
|---|
| 111 | G4double theWorldLengthXY;
|
|---|
| 112 | G4double theWorldLengthZ;
|
|---|
| 113 | G4double theWorldGap;
|
|---|
| 114 |
|
|---|
| 115 | G4Material* theMate;
|
|---|
| 116 |
|
|---|
| 117 | G4int numberOfPoints;
|
|---|
| 118 |
|
|---|
| 119 | G4int verbose;
|
|---|
| 120 | };
|
|---|
| 121 |
|
|---|
| 122 | #endif
|
|---|
| 123 |
|
|---|