Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:21

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 // class G4GlobalMagFieldMessenger
0027 //
0028 // Class description:
0029 //
0030 // Global uniform magnetic field messenger class. 
0031 //
0032 // It defines UI commands:
0033 // - /globalField/setValue vx vy vz unit
0034 // - /globalField/verbose level
0035 //
0036 // It creates/deletes the global uniform magnetic field and
0037 // activates/inactivates it according to the set field value.
0038 // The field value can be changed either interactively via 
0039 // the UI command or via SetFieldValue() function.
0040 
0041 // Author: Ivana Hrivnacova, 28/08/2013  (ivana@ipno.in2p3.fr)
0042 // --------------------------------------------------------------------
0043 #ifndef G4GlobalMagFieldMessenger_hh
0044 #define G4GlobalMagFieldMessenger_hh 1
0045 
0046 #include "globals.hh"
0047 #include "G4UImessenger.hh"
0048 
0049 class G4UniformMagField;
0050 class G4UIdirectory;
0051 class G4UIcmdWith3VectorAndUnit;
0052 class G4UIcmdWithAnInteger;
0053 
0054 class G4GlobalMagFieldMessenger : public G4UImessenger
0055 {
0056   public:  // with description
0057 
0058     G4GlobalMagFieldMessenger(const G4ThreeVector& value = G4ThreeVector());
0059     ~G4GlobalMagFieldMessenger() override;
0060     
0061     void SetNewValue(G4UIcommand*, G4String) override;
0062 
0063     void  SetFieldValue(const G4ThreeVector& value);
0064     G4ThreeVector GetFieldValue() const;
0065     
0066     inline void  SetVerboseLevel(G4int verboseLevel);
0067     inline G4int GetVerboseLevel() const;
0068     
0069   private:
0070 
0071     void SetField(const G4ThreeVector& value, const G4String& inFunction);
0072     
0073     G4UniformMagField* fMagField = nullptr;
0074     G4int fVerboseLevel = 0;
0075 
0076     G4UIdirectory* fDirectory = nullptr;
0077     G4UIcmdWith3VectorAndUnit* fSetValueCmd = nullptr;
0078     G4UIcmdWithAnInteger* fSetVerboseCmd = nullptr;
0079 };
0080 
0081 // inline functions
0082 
0083 inline void  G4GlobalMagFieldMessenger::SetVerboseLevel(G4int verboseLevel)
0084 { fVerboseLevel = verboseLevel; }
0085 
0086 inline G4int G4GlobalMagFieldMessenger::GetVerboseLevel() const
0087 { return fVerboseLevel; }
0088     
0089 #endif