Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
60 GB02BOptrMultiParticleForceCollision::
61 ProposeOccurenceBiasingOperation(const G4Track* track,
62  const G4BiasingProcessInterface* callingProcess)
63 {
64  if ( fCurrentOperator ) return fCurrentOperator->
65  GetProposedOccurenceBiasingOperation(track, callingProcess);
66  else return 0;
67 }
68 
70 GB02BOptrMultiParticleForceCollision::
71 ProposeNonPhysicsBiasingOperation(const G4Track* track,
72  const G4BiasingProcessInterface* callingProcess)
73 {
74  if ( fCurrentOperator ) return fCurrentOperator->
75  GetProposedNonPhysicsBiasingOperation(track, callingProcess);
76  else return 0;
77 }
78 
79 
81 {
82  const G4ParticleDefinition* definition = track->GetParticleDefinition();
83  std::map < const G4ParticleDefinition*, G4BOptrForceCollision* > :: iterator
84  it = fBOptrForParticle.find( definition );
85  fCurrentOperator = 0;
86  if ( it != fBOptrForParticle.end() ) fCurrentOperator = (*it).second;
87 }
88 
89 void
90 GB02BOptrMultiParticleForceCollision::
91 OperationApplied( const G4BiasingProcessInterface* callingProcess,
92  G4BiasingAppliedCase biasingCase,
93  G4VBiasingOperation* operationApplied,
94  const G4VParticleChange* particleChangeProduced )
95 {
96  if ( fCurrentOperator ) fCurrentOperator->ReportOperationApplied( callingProcess,
97  biasingCase,
98  operationApplied,
99  particleChangeProduced );
100 
101 }
102 
103 void
104 GB02BOptrMultiParticleForceCollision::
105 ExitBiasing( const G4Track* track,
106  const G4BiasingProcessInterface* callingProcess )
107 {
108  if ( fCurrentOperator ) fCurrentOperator->ExitingBiasing( track, callingProcess );
109 }
110 
111 
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4VBiasingOperation * GetProposedOccurenceBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess)
G4BiasingAppliedCase
const G4ParticleDefinition * GetParticleDefinition() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
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)