Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-06 16:42:56

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