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