Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:59

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 // G4BorisDriver inline methods implementation
0027 
0028 // Author: Divyansh Tiwari, Google Summer of Code 2022
0029 // Supervision: John Apostolakis,Renee Fatemi, Soon Yung Jun
0030 // --------------------------------------------------------------------
0031 
0032 void G4BorisDriver::SetVerboseLevel(G4int level)
0033 {
0034     fVerbosity = (level != 0);
0035 }
0036 
0037 G4int G4BorisDriver::GetVerboseLevel() const
0038 {
0039     return static_cast<G4int>(fVerbosity);
0040 }
0041 
0042 G4double G4BorisDriver::ComputeNewStepSize( G4double /* errMaxNorm*/, G4double  hstepCurrent)
0043 {
0044    return hstepCurrent;
0045 }
0046 
0047 const G4EquationOfMotion* G4BorisDriver::GetEquationOfMotion() const
0048 {
0049    auto eq = boris->GetEquationOfMotion();
0050    return eq;
0051 }
0052 
0053 G4EquationOfMotion* G4BorisDriver::GetEquationOfMotion()
0054 {
0055    auto eq = boris->GetEquationOfMotion();
0056    return eq;
0057 }
0058 
0059 #if 0
0060 // #ifdef G4USE_SET_EQUATION_OF_MOTION
0061 void G4BorisDriver::
0062 SetEquationOfMotion( G4EquationOfMotion* equation )
0063 {
0064     boris->SetEquationOfMotion(equation);
0065 }
0066 #endif
0067 
0068 G4int G4BorisDriver::GetNumberOfVariables() const
0069 {
0070     return boris->GetNumberOfVariables();
0071 }
0072 
0073 const G4MagIntegratorStepper*
0074 G4BorisDriver::GetStepper() const
0075 {
0076     return nullptr;
0077 }
0078 
0079 G4MagIntegratorStepper*
0080 G4BorisDriver::GetStepper()
0081 {
0082     return nullptr;
0083 }
0084 
0085 void G4BorisDriver::CheckStep(const G4ThreeVector& posIn,
0086                               const G4ThreeVector& posOut,
0087                               G4double hdid) const
0088 {
0089    const G4double endPointDist = (posOut - posIn).mag();
0090    if (endPointDist >= hdid * (1. + CLHEP::perMillion))
0091    {
0092       // ++fNoAccurateAdvanceBadSteps;
0093 // #ifdef G4DEBUG_FIELD
0094       // Issue a warning only for gross differences -
0095       // we understand how small difference occur.
0096       if (endPointDist >= hdid * (1. + CLHEP::perThousand))
0097       {
0098          G4Exception("G4BorisDriver::CheckStep()",
0099                      "GeomField1002", JustWarning,
0100                      "endPointDist >= hdid!");
0101       }
0102       else
0103       {
0104          G4cerr << "G4BorisDriver::CheckStep: moved further than curve distance! "
0105                 << "  curve hdid= " << hdid << " endpoint dist= " << endPointDist
0106                 << "  ratio - 1 = " << (endPointDist - hdid) / hdid
0107                 << " ( > 1.0e-6 threshold to report ) "
0108                 << G4endl; 
0109       }
0110 // #endif
0111    }
0112    else
0113    {
0114       // ++fNoAccurateAdvanceGoodSteps;
0115    }
0116 }
0117