Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:50

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,
0025                                                  G4double scintiGap, G4double tiltAngle)
0026   : fMinStep(0.005 * mm)
0027   , n_steel_plates(steelPlates) /*G4int*/
0028   , scinti_gap(scintiGap)       /*G4double*/
0029   , tilt_angle(tiltAngle)       /*G4double*/
0030 {
0031   G4int nvar = 8;
0032 
0033   {
0034     fEMfieldIron = new PHG4OuterHcalField(true, n_steel_plates, scinti_gap,
0035                                           tilt_angle);
0036 
0037     fEquationIron = new G4Mag_UsualEqRhs(fEMfieldIron);
0038 
0039     fStepperIron = new G4ClassicalRK4(fEquationIron, nvar);
0040 
0041     fChordFinderIron = new G4ChordFinder(
0042         new G4MagInt_Driver(fMinStep, fStepperIron,
0043                             fStepperIron->GetNumberOfVariables()));
0044 
0045     fFieldManagerIron = new G4FieldManager();
0046     fFieldManagerIron->SetDetectorField(fEMfieldIron);
0047     fFieldManagerIron->SetChordFinder(fChordFinderIron);
0048   }
0049 
0050   {
0051     fEMfieldGap = new PHG4OuterHcalField(false, n_steel_plates, scinti_gap,
0052                                          tilt_angle);
0053 
0054     fEquationGap = new G4Mag_UsualEqRhs(fEMfieldGap);
0055 
0056     fStepperGap = new G4ClassicalRK4(fEquationGap, nvar);
0057 
0058     fChordFinderGap = new G4ChordFinder(
0059         new G4MagInt_Driver(fMinStep, fStepperGap,
0060                             fStepperGap->GetNumberOfVariables()));
0061 
0062     fFieldManagerGap = new G4FieldManager();
0063     fFieldManagerGap->SetDetectorField(fEMfieldGap);
0064     fFieldManagerGap->SetChordFinder(fChordFinderGap);
0065   }
0066 }