Belle II Software development
G4MonopoleFieldSetup.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9// modified from GEANT4 exoticphysics/monopole/*
10
11#include <simulation/monopoles/G4MonopoleFieldSetup.h>
12#include <simulation/monopoles/G4MonopoleEquation.h>
13
14#include <G4MagneticField.hh>
15#include <G4FieldManager.hh>
16#include <G4TransportationManager.hh>
17#include <G4MagIntegratorStepper.hh>
18#include <G4ChordFinder.hh>
19
20#include <G4ClassicalRK4.hh>
21
22#include <CLHEP/Units/SystemOfUnits.h>
23
24using namespace std;
25using namespace Belle2;
26using namespace Belle2::Monopoles;
27using namespace CLHEP;
28
30
32{
33 //Take existing setup from basf2
34 fFieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager();
35 fbasf2ChordFinder = fFieldManager->GetChordFinder();
36 // G4MonopoleEquation and G4ChordFinder both want a non-const field
37 fMagneticField = const_cast<G4MagneticField*>(static_cast<const G4MagneticField*>(fFieldManager->GetDetectorField()));
39 fMinStep = 0.01 * mm ; // minimal step of 1 mm is default
40 fMonopoleStepper = new G4ClassicalRK4(fMonopoleEquation, 8); // for time information..
42}
43
53
60
62{
63 switch (val) {
64 case 0:
65 fFieldManager->SetChordFinder(fbasf2ChordFinder);
66 break;
67 case 1:
68 fFieldManager->SetChordFinder(fMonopoleChordFinder);
69 break;
70 }
71}
Monopole equation of motion class.
Monopole field setup singleton class, that takes care of switching between conventional particle tran...
void SwitchChordFinder(G4int val)
Switches chord finder between 1 - basf2 FullSim chord finder 2 - monopole chord finder Since monopole...
G4FieldManager * fFieldManager
Field manager that holds current chord finder.
G4ChordFinder * fMonopoleChordFinder
Chord finder for monopoles.
G4MagneticField * fMagneticField
Magnetic field of basf2.
static G4MonopoleFieldSetup * fMonopoleFieldSetup
The instance of this class.
G4MagIntegratorStepper * fMonopoleStepper
Stepper for monopoles.
G4MonopoleEquation * fMonopoleEquation
Monopole equation of motion.
G4ChordFinder * fbasf2ChordFinder
Chord finder taken from FullSim of basf2.
static G4MonopoleFieldSetup * GetMonopoleFieldSetup()
Returns G4MonopoleFieldSetup instance.
Abstract base class for different kinds of events.
STL namespace.