Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:07

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 // $Id: G4TBMagneticFieldSetup.hh,v 1.10 2014/11/14 21:47:38 mccumber Exp $
0028 // GEANT4 tag $Name:  $
0029 //
0030 //    A class for control of the Electric Field of the detector.
0031 //  The field for this case is uniform.
0032 //
0033 //  It is simply a 'setup' class that creates the field and necessary other parts
0034 //
0035 
0036 #ifndef G4MAIN_G4TBELECTRICFIELDSETUP_H
0037 #define G4MAIN_G4TBELECTRICFIELDSETUP_H
0038 
0039 #include <Geant4/G4ThreeVector.hh>
0040 #include <Geant4/G4Types.hh>
0041 
0042 class G4FieldManager;
0043 class G4ChordFinder;
0044 class G4Mag_UsualEqRhs;
0045 class G4MagIntegratorStepper;
0046 class G4MagInt_Driver;
0047 class G4MagneticField;
0048 class G4TBFieldMessenger;
0049 class PHField;
0050 
0051 class G4TBMagneticFieldSetup
0052 {
0053  public:
0054   G4TBMagneticFieldSetup(PHField* phfield);
0055   //  G4TBMagneticFieldSetup(const float magfield) ;
0056   //  G4TBMagneticFieldSetup(const std::string &fieldmapfile, const int mapdim, const float magfield_rescale = 1.0) ;
0057   // G4TBMagneticFieldSetup contains pointer to memory
0058   // copy ctor and = operator need explicit implementation, do just delete it here
0059   G4TBMagneticFieldSetup(const G4TBMagneticFieldSetup&) = delete;
0060   G4TBMagneticFieldSetup& operator=(G4TBMagneticFieldSetup const&) = delete;
0061 
0062   virtual ~G4TBMagneticFieldSetup();
0063 
0064   void Verbosity(const int verb) { verbosity = verb; }
0065 
0066   void SetStepperType(const G4int i) { fStepperType = i; }
0067 
0068   void SetStepper();
0069 
0070   void SetMinStep(const G4double s) { fMinStep = s; }
0071 
0072   void UpdateField();
0073 
0074   void SetFieldValue(const G4ThreeVector& fieldVector);
0075   void SetFieldValue(const G4double fieldValue);
0076 
0077   double get_magfield_at_000(const int i) const { return magfield_at_000[i]; }
0078 
0079  protected:
0080   // Find the global Field Manager
0081   G4FieldManager* GetGlobalFieldManager();
0082 
0083  private:
0084   int verbosity = 0;
0085 
0086   G4FieldManager* fFieldManager = nullptr;
0087 
0088   G4ChordFinder* fChordFinder = nullptr;
0089 
0090   G4Mag_UsualEqRhs* fEquation = nullptr;
0091 
0092   G4MagneticField* fEMfield = nullptr;
0093 
0094   G4ThreeVector fElFieldValue;
0095 
0096   G4MagIntegratorStepper* fStepper = nullptr;
0097   G4MagInt_Driver* fIntgrDriver = nullptr;
0098 
0099   G4int fStepperType;
0100 
0101   G4double fMinStep;
0102 
0103   G4TBFieldMessenger* fFieldMessenger = nullptr;
0104 
0105   double magfield_at_000[3]{};
0106 };
0107 
0108 #endif