Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 08:31:47

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 G4BlineTracer.hh
0027 /// \brief Definition of the G4BlineTracer class
0028 
0029 // --------------------------------------------------------------------
0030 //
0031 // G4BlineTracer
0032 //
0033 // Class description:
0034 //
0035 // Defines a tool to trace and visualise magnetic field lines
0036 // To use this tool in a Geant4 application the user should
0037 // create an instance of this class in the code as a run action.
0038 // It will only work if a G4MagneticField field object is declared.
0039 
0040 // --------------------------------------------------------------------
0041 // Author: Laurent Desorgher (desorgher@phim.unibe.ch)
0042 //         Created - 2003-10-06
0043 // --------------------------------------------------------------------
0044 #ifndef G4BlineTracer_h
0045 #define G4BlineTracer_h 1
0046 
0047 #include "CLHEP/Units/SystemOfUnits.h"
0048 
0049 #include "G4Types.hh"
0050 #include "G4UserRunAction.hh"
0051 
0052 #include <vector>
0053 
0054 class G4VUserPrimaryGeneratorAction;
0055 class G4MagneticField;
0056 class G4FieldManager;
0057 class G4ChordFinder;
0058 
0059 class G4BlineTracerMessenger;
0060 class G4BlineSteppingAction;
0061 class G4BlineEventAction;
0062 class G4BlinePrimaryGeneratorAction;
0063 class G4BlineEquation;
0064 
0065 class G4BlineTracer : public G4UserRunAction
0066 {
0067   public:  // with description
0068     G4BlineTracer();
0069     ~G4BlineTracer() override;
0070 
0071     void BeginOfRunAction(const G4Run* aRun) override;
0072     void EndOfRunAction(const G4Run* aRun) override;
0073 
0074     void ComputeBlines(G4int nlines);
0075 
0076     inline void SetMaxTrackingStep(G4double max_step) { fMaxTrackingStep = max_step; }
0077     inline G4BlineEventAction* GetEventAction() { return fEventAction; }
0078 
0079   private:
0080     void ResetChordFinders();
0081 
0082   private:
0083     G4BlineTracerMessenger* fMessenger = nullptr;
0084     G4BlineSteppingAction* fSteppingAction = nullptr;
0085     G4BlineEventAction* fEventAction = nullptr;
0086     G4BlinePrimaryGeneratorAction* fPrimaryGeneratorAction = nullptr;
0087     G4double fMaxTrackingStep = 1000. * CLHEP::m;
0088     G4bool fWas_ResetChordFinders_already_called = false;
0089 
0090     // G4VUserPrimaryGeneratorAction* fUserPrimaryAction;
0091     //  User defined primary generator action
0092 
0093     std::vector<G4ChordFinder*> fVecChordFinders;
0094     std::vector<G4FieldManager*> fVecFieldManagers;
0095     std::vector<G4MagneticField*> fVecMagneticFields;
0096     std::vector<G4BlineEquation*> fVecEquationOfMotion;
0097     // ChordFinders, detector fields, equation of motions, and field
0098     // manager for the different local and global magnetic fields.
0099 };
0100 
0101 #endif