BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBOptrMultiParticleChangeCrossSection.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 BDSBOPTRMULTIPARTICLECHANGECROSSSECTION_H
19#define BDSBOPTRMULTIPARTICLECHANGECROSSSECTION_H
20
21#include "G4Version.hh"
22#if G4VERSION_NUMBER > 1009
23
24#include "G4VBiasingOperator.hh"
26class G4ParticleDefinition;
27
28#include <map>
29
41class BDSBOptrMultiParticleChangeCrossSection: public G4VBiasingOperator
42{
43public:
46
47 void AddParticle(const G4String& particleName);
48 void SetBias(const G4String& biasObjectName,
49 const G4String& particleName,
50 const G4String& process,
51 G4double dBias,
52 G4int iPrimary);
53 void StartTracking(const G4Track* track) override;
54
55private:
56 virtual G4VBiasingOperation* ProposeOccurenceBiasingOperation(const G4Track* track,
57 const G4BiasingProcessInterface* callingProcess) override;
58 // -- Methods not used:
59 virtual G4VBiasingOperation* ProposeFinalStateBiasingOperation(const G4Track*, const G4BiasingProcessInterface*) override
60 {return 0;}
61 virtual G4VBiasingOperation* ProposeNonPhysicsBiasingOperation(const G4Track*, const G4BiasingProcessInterface*) override
62 {return 0;}
63 virtual void OperationApplied(const G4BiasingProcessInterface* callingProcess,
64 G4BiasingAppliedCase biasingCase,
65 G4VBiasingOperation* occurenceOperationApplied,
66 G4double weightForOccurenceInteraction,
67 G4VBiasingOperation* finalStateOperationApplied,
68 const G4VParticleChange* particleChangeProduced) override;
69 // prevent compiler warning (since second G4VBiasingOperator::OperationApplied is hidden)
70 using G4VBiasingOperator::OperationApplied;
71
72 std::map<const G4ParticleDefinition*, BDSBOptrChangeCrossSection*> fBOptrForParticle;
73 std::vector<const G4ParticleDefinition*> fParticlesToBias;
74 BDSBOptrChangeCrossSection* fCurrentOperator;
75
77 G4bool debug;
78};
79
80#endif
81
82#endif
Operator that changes cross section of a process for a particle.
G4int fnInteractions
Count number of biased interations for current track.