Geant4  10.01.p02
GB02BOptrMultiParticleForceCollision.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 
29 #include "G4BOptrForceCollision.hh"
30 #include "G4ParticleDefinition.hh"
31 #include "G4ParticleTable.hh"
32 
34  : G4VBiasingOperator("TestManyForceCollision")
35 {
36 }
37 
39 {
40  const G4ParticleDefinition* particle =
42 
43  if ( particle == 0 )
44  {
46  ed << "Particle `" << particleName << "' not found !" << G4endl;
47  G4Exception("GB02BOptrMultiParticleForceCollision::AddParticle(...)",
48  "exGB02.01",
50  ed);
51  return;
52  }
53 
54  G4BOptrForceCollision* optr = new G4BOptrForceCollision(particleName);
55  fParticlesToBias.push_back( particle );
56  fBOptrForParticle[ particle ] = optr;
57 }
58 
62  const G4BiasingProcessInterface* callingProcess)
63 {
64  if ( fCurrentOperator ) return fCurrentOperator->
65  GetProposedOccurenceBiasingOperation(track, callingProcess);
66  else return 0;
67 }
68 
72  const G4BiasingProcessInterface* callingProcess)
73 {
74  if ( fCurrentOperator ) return fCurrentOperator->
75  GetProposedNonPhysicsBiasingOperation(track, callingProcess);
76  else return 0;
77 }
78 
82  const G4BiasingProcessInterface* callingProcess)
83 {
84  if ( fCurrentOperator ) return fCurrentOperator->
85  GetProposedFinalStateBiasingOperation(track, callingProcess);
86  else return 0;
87 }
88 
89 
91 {
92  const G4ParticleDefinition* definition = track->GetParticleDefinition();
93  std::map < const G4ParticleDefinition*, G4BOptrForceCollision* > :: iterator
94  it = fBOptrForParticle.find( definition );
95  fCurrentOperator = 0;
96  if ( it != fBOptrForParticle.end() ) fCurrentOperator = (*it).second;
97 }
98 
99 void
102  G4BiasingAppliedCase biasingCase,
103  G4VBiasingOperation* operationApplied,
104  const G4VParticleChange* particleChangeProduced )
105 {
107  biasingCase,
108  operationApplied,
109  particleChangeProduced );
110 
111 }
112 
113 void
115 ExitBiasing( const G4Track* track,
116  const G4BiasingProcessInterface* callingProcess )
117 {
118  if ( fCurrentOperator ) fCurrentOperator->ExitingBiasing( track, callingProcess );
119 }
120 
121 
G4VBiasingOperation * GetProposedFinalStateBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4VBiasingOperation * GetProposedOccurenceBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess)
std::vector< const G4ParticleDefinition * > fParticlesToBias
G4BiasingAppliedCase
virtual G4VBiasingOperation * ProposeOccurenceBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess)
virtual G4VBiasingOperation * ProposeFinalStateBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess)
const G4ParticleDefinition * GetParticleDefinition() const
std::map< const G4ParticleDefinition *, G4BOptrForceCollision * > fBOptrForParticle
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void ExitBiasing(const G4Track *, const G4BiasingProcessInterface *)
static G4ParticleTable * GetParticleTable()
#define G4endl
Definition: G4ios.hh:61
void ReportOperationApplied(const G4BiasingProcessInterface *callingProcess, G4BiasingAppliedCase biasingCase, G4VBiasingOperation *operationApplied, const G4VParticleChange *particleChangeProduced)
G4VBiasingOperation * GetProposedNonPhysicsBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess)
void ExitingBiasing(const G4Track *track, const G4BiasingProcessInterface *callingProcess)
virtual G4VBiasingOperation * ProposeNonPhysicsBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess)
virtual void OperationApplied(const G4BiasingProcessInterface *callingProcess, G4BiasingAppliedCase biasingCase, G4VBiasingOperation *operationApplied, const G4VParticleChange *particleChangeProduced)