Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:17

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 /// \file field/field04/include/F04DetectorConstruction.hh
0028 /// \brief Definition of the F04DetectorConstruction class
0029 //
0030 
0031 #ifndef F04DetectorConstruction_h
0032 #define F04DetectorConstruction_h 1
0033 
0034 #include "CLHEP/Units/SystemOfUnits.h"
0035 
0036 #include "G4Cache.hh"
0037 #include "G4LogicalVolume.hh"
0038 #include "G4RotationMatrix.hh"
0039 #include "globals.hh"
0040 
0041 class G4Tubs;
0042 
0043 class G4VPhysicalVolume;
0044 
0045 class F04Materials;
0046 class G4Material;
0047 
0048 class F04GlobalField;
0049 
0050 class F04DetectorMessenger;
0051 
0052 #include "G4VUserDetectorConstruction.hh"
0053 
0054 class F04DetectorConstruction : public G4VUserDetectorConstruction
0055 {
0056   public:
0057     F04DetectorConstruction();
0058     ~F04DetectorConstruction() override;
0059 
0060     G4VPhysicalVolume* Construct() override;
0061     G4VPhysicalVolume* ConstructDetector();
0062 
0063     void ConstructSDandField() override;
0064 
0065     // StringToRotationMatrix() converts a string "X90,Y45" into a
0066     // G4RotationMatrix.
0067     // This is an active rotation, in that the object is first rotated
0068     // around the parent's X axis by 90 degrees, then the object is
0069     // further rotated around the parent's Y axis by 45 degrees.
0070     // The return value points to a G4RotationMatrix on the heap, so
0071     // it is persistent. Angles are in degrees, can have decimals,
0072     // and can be negative. Axes are X, Y, Z.
0073 
0074     static G4RotationMatrix StringToRotationMatrix(G4String rotation);
0075 
0076   public:
0077     void SetWorldMaterial(G4String);
0078     void SetWorldSizeZ(G4double);
0079     void SetWorldSizeR(G4double);
0080 
0081     void SetCaptureMgntRadius(G4double);
0082     void SetCaptureMgntLength(G4double);
0083     void SetCaptureMgntB1(G4double);
0084     void SetCaptureMgntB2(G4double);
0085 
0086     void SetTransferMgntRadius(G4double);
0087     void SetTransferMgntLength(G4double);
0088     void SetTransferMgntB(G4double);
0089     void SetTransferMgntPos(G4double);
0090 
0091     void SetTargetMaterial(G4String);
0092     void SetTargetThickness(G4double);
0093     void SetTargetRadius(G4double);
0094     void SetTargetPos(G4double);
0095     void SetTargetAngle(G4int);
0096 
0097     void SetDegraderMaterial(G4String);
0098     void SetDegraderThickness(G4double);
0099     void SetDegraderRadius(G4double);
0100     void SetDegraderPos(G4double);
0101 
0102   public:
0103     G4Material* GetWorldMaterial() { return fWorldMaterial; }
0104     G4double GetWorldSizeZ() { return fWorldSizeZ; }
0105     G4double GetWorldSizeR() { return fWorldSizeR; }
0106 
0107     G4LogicalVolume* GetCaptureMgnt() { return fLogicCaptureMgnt; }
0108     G4double GetCaptureMgntRadius() { return fCaptureMgntRadius; }
0109     G4double GetCaptureMgntLength() { return fCaptureMgntLength; }
0110     G4double GetCaptureMgntB1() { return fCaptureMgntB1; }
0111     G4double GetCaptureMgntB2() { return fCaptureMgntB2; }
0112     G4ThreeVector GetCaptureMgntCenter() { return fCaptureMgntCenter; }
0113 
0114     G4LogicalVolume* GetTransferMgnt() { return fLogicTransferMgnt; }
0115     G4double GetTransferMgntRadius() { return fTransferMgntRadius; }
0116     G4double GetTransferMgntLength() { return fTransferMgntLength; }
0117     G4double GetTransferMgntB() { return fTransferMgntB; }
0118     G4double GetTransferMgntPos() { return fTransferMgntPos; }
0119     G4ThreeVector GetTransferMgntCenter() { return fTransferMgntCenter; }
0120 
0121     G4Material* GetTargetMaterial() { return fTargetMaterial; }
0122     G4double GetTargetRadius() { return fTargetRadius; }
0123     G4double GetTargetThickness() { return fTargetThickness; }
0124     G4double GetTargetPos() { return fTargetPos; }
0125     G4int GetTargetAngle() { return fTargetAngle; }
0126 
0127     G4Material* GetDegraderMaterial() { return fDegraderMaterial; }
0128     G4double GetDegraderRadius() { return fDegraderRadius; }
0129     G4double GetDegraderThickness() { return fDegraderThickness; }
0130     G4double GetDegraderPos() { return fDegraderPos; }
0131 
0132   private:
0133     F04DetectorMessenger* fDetectorMessenger = nullptr;  // pointer to the Messenger
0134     G4Cache<F04GlobalField*> fFieldSetUp = nullptr;
0135 
0136     F04Materials* fMaterials = nullptr;
0137 
0138     G4Material* fVacuum = nullptr;
0139 
0140     G4Tubs* fSolidWorld = nullptr;
0141     G4LogicalVolume* fLogicWorld = nullptr;
0142     G4VPhysicalVolume* fPhysiWorld = nullptr;
0143 
0144     G4Tubs* fSolidTarget = nullptr;
0145     G4LogicalVolume* fLogicTarget = nullptr;
0146     G4VPhysicalVolume* fPhysiTarget = nullptr;
0147 
0148     G4Tubs* fSolidDegrader = nullptr;
0149     G4LogicalVolume* fLogicDegrader = nullptr;
0150     G4VPhysicalVolume* fPhysiDegrader = nullptr;
0151 
0152     G4Tubs* fSolidCaptureMgnt = nullptr;
0153     G4LogicalVolume* fLogicCaptureMgnt = nullptr;
0154     G4VPhysicalVolume* fPhysiCaptureMgnt = nullptr;
0155 
0156     G4Tubs* fSolidTransferMgnt = nullptr;
0157     G4LogicalVolume* fLogicTransferMgnt = nullptr;
0158     G4VPhysicalVolume* fPhysiTransferMgnt = nullptr;
0159 
0160     G4Material* fWorldMaterial = nullptr;
0161     G4double fWorldSizeR = 5. * CLHEP::m;
0162     G4double fWorldSizeZ = 50. * CLHEP::m;
0163 
0164     G4double fCaptureMgntLength = 4.0 * CLHEP::m;
0165     G4double fCaptureMgntRadius = 0.6 * CLHEP::m;
0166     G4double fCaptureMgntB1 = 0.;
0167     G4double fCaptureMgntB2 = 0.;
0168 
0169     G4double fTransferMgntLength = 15.0 * CLHEP::m;
0170     G4double fTransferMgntRadius = 0.3 * CLHEP::m;
0171     G4double fTransferMgntB = 0.;
0172     G4double fTransferMgntPos = 0.;
0173 
0174     G4Material* fTargetMaterial = nullptr;
0175     G4double fTargetThickness = 16.0 * CLHEP::cm;
0176     G4double fTargetRadius = 0.4 * CLHEP::cm;
0177     G4double fTargetPos = 0.;
0178     G4int fTargetAngle = 0.;
0179 
0180     G4Material* fDegraderMaterial = nullptr;
0181     G4double fDegraderThickness = 0.1 * CLHEP::cm;
0182     G4double fDegraderRadius = 30.0 * CLHEP::cm;
0183     G4double fDegraderPos = 0.;
0184 
0185     G4ThreeVector fCaptureMgntCenter, fTransferMgntCenter;
0186 
0187   private:
0188     void DefineMaterials();
0189 };
0190 
0191 #endif