Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:21:40

0001 // $Id: $
0002 
0003 /*!
0004  * \file PHG4OuterHcalFieldSetup.cc
0005  * \brief
0006  * \author Jin Huang <jhuang@bnl.gov>
0007  * \version $Revision:   $
0008  * \date $Date: $
0009  */
0010 
0011 #include "PHG4OuterHcalFieldSetup.h"
0012 #include "PHG4OuterHcalField.h"
0013 
0014 #include <Geant4/G4ChordFinder.hh>
0015 #include <Geant4/G4ClassicalRK4.hh>
0016 #include <Geant4/G4FieldManager.hh>
0017 #include <Geant4/G4MagIntegratorDriver.hh>
0018 #include <Geant4/G4MagIntegratorStepper.hh>
0019 #include <Geant4/G4Mag_UsualEqRhs.hh>
0020 #include <Geant4/G4MagneticField.hh>
0021 #include <Geant4/G4SystemOfUnits.hh>
0022 #include <Geant4/G4Types.hh>
0023 
0024 PHG4OuterHcalFieldSetup::PHG4OuterHcalFieldSetup(G4int steelPlates, G4double scintiGap, G4double tiltAngle)
0025   : n_steel_plates(steelPlates)
0026   , fMinStep(0.005 * mm)
0027   , scinti_gap(scintiGap)
0028   , tilt_angle(tiltAngle)
0029 {
0030   G4int nvar = 8;
0031 
0032   {
0033     fEMfieldIron = new PHG4OuterHcalField(true, n_steel_plates, scinti_gap,
0034                                           tilt_angle);
0035 
0036     fEquationIron = new G4Mag_UsualEqRhs(fEMfieldIron);
0037 
0038     fStepperIron = new G4ClassicalRK4(fEquationIron, nvar);
0039 
0040     fChordFinderIron = new G4ChordFinder(
0041         new G4MagInt_Driver(fMinStep, fStepperIron,
0042                             fStepperIron->GetNumberOfVariables()));
0043 
0044     fFieldManagerIron = new G4FieldManager();
0045     fFieldManagerIron->SetDetectorField(fEMfieldIron);
0046     fFieldManagerIron->SetChordFinder(fChordFinderIron);
0047   }
0048 
0049   {
0050     fEMfieldGap = new PHG4OuterHcalField(false, n_steel_plates, scinti_gap,
0051                                          tilt_angle);
0052 
0053     fEquationGap = new G4Mag_UsualEqRhs(fEMfieldGap);
0054 
0055     fStepperGap = new G4ClassicalRK4(fEquationGap, nvar);
0056 
0057     fChordFinderGap = new G4ChordFinder(
0058         new G4MagInt_Driver(fMinStep, fStepperGap,
0059                             fStepperGap->GetNumberOfVariables()));
0060 
0061     fFieldManagerGap = new G4FieldManager();
0062     fFieldManagerGap->SetDetectorField(fEMfieldGap);
0063     fFieldManagerGap->SetChordFinder(fChordFinderGap);
0064   }
0065 }