BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBOptrChangeCrossSection.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSBOPTRCHANGECROSSSECTION_H
20#define BDSBOPTRCHANGECROSSSECTION_H
21
22#include "globals.hh" // geant4 types / globals
23#include "G4VBiasingOperator.hh"
24
25class G4BOptnChangeCrossSection;
26class G4ParticleDefinition;
27
28#include <map>
29
38class BDSBOptrChangeCrossSection: public G4VBiasingOperator
39{
40public:
41 BDSBOptrChangeCrossSection(const G4String& particleToBias,
42 const G4String& name = "ChangeXS");
44
45 virtual void StartRun();
46 void SetBias(const G4String& processName,
47 G4double dBias,
48 G4int iPrimary);
49
50private:
51 virtual G4VBiasingOperation* ProposeOccurenceBiasingOperation(const G4Track* track,
52 const G4BiasingProcessInterface* callingProcess);
53
54 virtual G4VBiasingOperation* ProposeFinalStateBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
55 {return 0;}
56
57 virtual G4VBiasingOperation* ProposeNonPhysicsBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
58 {return 0;}
59
60 using G4VBiasingOperator::OperationApplied;
61
62 virtual void OperationApplied(const G4BiasingProcessInterface* callingProcess,
63 G4BiasingAppliedCase biasingCase,
64 G4VBiasingOperation* occurenceOperationApplied,
65 G4double weightForOccurenceInteraction,
66 G4VBiasingOperation* finalStateOperationApplied,
67 const G4VParticleChange* particleChangeProduced );
68 std::map<const G4BiasingProcessInterface*, G4BOptnChangeCrossSection*> fChangeCrossSectionOperations;
69 std::map<const G4BiasingProcessInterface*, G4double> fXSScale;
70 std::map<const G4BiasingProcessInterface*, G4int> fPrimaryScale;
71 G4bool fSetup;
72 G4String particleName;
73 const G4ParticleDefinition* fParticleToBias;
74 G4bool particleIsIon;
75};
76
77#endif
Operator that changes cross section of a process for a particle.