ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BiasingOperation.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BiasingOperation.cc
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 //
30 
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "BiasingOperation.hh"
36 #include "G4VParticleChange.hh"
41 #include "G4HadronicParameters.hh"
42 #include "G4FTFModel.hh"
44 #include "G4ExcitedStringDecay.hh"
46 #include "G4TheoFSGenerator.hh"
48 #include "G4VPreCompoundModel.hh"
49 #include "G4INCLXXInterface.hh"
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55 
56  // Create the inelastic processes for p , n , pi+ , pi-
61 
62  // Set the energy ranges
63  const G4double minPreco = 0.0;
64  const G4double maxPreco = 2.0 * CLHEP::MeV;
65  const G4double maxBERT = 12.0 * CLHEP::GeV;
66  const G4double minINCLXX = 1.0 * CLHEP::MeV;
67  const G4double minFTFP = 3.0 * CLHEP::GeV;
69 
70  // Create the hadronic models (to replace FTFP_BERT with "FTFP_INCLXX",
71  // keeping the same energy ranges for the transition between models).
72  // Notice that it is better to create the models here from scratch,
73  // instead of reusing the existing ones, because we might pick up the
74  // existing ones associated to the wrong particles...
75  // --- FTFP model ---
76  G4FTFModel* theStringModel = new G4FTFModel;
78  G4ExcitedStringDecay* theStringDecay = new G4ExcitedStringDecay( theLund );
79  theStringModel->SetFragmentationModel( theStringDecay );
81  G4TheoFSGenerator* theHighEnergyModel = new G4TheoFSGenerator( "FTFP" );
82  theHighEnergyModel->SetHighEnergyGenerator( theStringModel );
83  theHighEnergyModel->SetTransport( thePrecoInterface );
84  theHighEnergyModel->SetMinEnergy( minFTFP );
85  theHighEnergyModel->SetMaxEnergy( maxFTFP );
86  // Preco : create a new model to be used only for INCLXX for nucleons
87  G4VPreCompoundModel* thePreCompoundModel = new G4PreCompoundModel;
88  thePreCompoundModel->SetMinEnergy( minPreco );
89  thePreCompoundModel->SetMaxEnergy( maxPreco );
90  // --- Preco ---
91  // --- INCLXX model ---
92  // The instance for nucleons:
93  G4INCLXXInterface* theInclxxModel = new G4INCLXXInterface( thePreCompoundModel );
94  theInclxxModel->SetMinEnergy( minINCLXX );
95  theInclxxModel->SetMaxEnergy( maxBERT ); // Use the same as for Bertini
96  // The instance for pions:
97  G4INCLXXInterface* theInclxxModel_forPions = new G4INCLXXInterface;
98  theInclxxModel_forPions->SetMinEnergy( minPreco );
99  theInclxxModel_forPions->SetMaxEnergy( maxBERT ); // Use the same as for Bertini
100 
101  // Register the models
102  fProtonInelasticProcess->RegisterMe( theHighEnergyModel );
103  fProtonInelasticProcess->RegisterMe( theInclxxModel );
104  fProtonInelasticProcess->RegisterMe( thePreCompoundModel );
105  fNeutronInelasticProcess->RegisterMe( theHighEnergyModel );
106  fNeutronInelasticProcess->RegisterMe( theInclxxModel );
107  fNeutronInelasticProcess->RegisterMe( thePreCompoundModel );
108  fPionPlusInelasticProcess->RegisterMe( theHighEnergyModel );
109  fPionPlusInelasticProcess->RegisterMe( theInclxxModel_forPions );
110  fPionMinusInelasticProcess->RegisterMe( theHighEnergyModel );
111  fPionMinusInelasticProcess->RegisterMe( theInclxxModel_forPions );
112 
113  // Register the cross sections: this is mandatory starting from G4 10.6
114  // because the default Gheisha inelastic cross sections have been removed.
115  // It is convenient to use the Gheisha inelastic cross sections here
116  // because they do not require any special initialization.
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124 
126 
127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128 
131  const G4Track* track, const G4Step* step, G4bool& ) {
132  if ( track->GetParticleDefinition() == G4Proton::Definition() ) {
133  return fProtonInelasticProcess->PostStepDoIt( *track, *step );
134  } else if ( track->GetParticleDefinition() == G4Neutron::Definition() ) {
135  return fNeutronInelasticProcess->PostStepDoIt( *track, *step );
136  } else if ( track->GetParticleDefinition() == G4PionPlus::Definition() ) {
137  return fPionPlusInelasticProcess->PostStepDoIt( *track, *step );
138  } else if ( track->GetParticleDefinition() == G4PionMinus::Definition() ) {
139  return fPionMinusInelasticProcess->PostStepDoIt( *track, *step );
140  } else {
141  G4cerr << "ERROR in BiasingOperation::ApplyFinalStateBiasing : unexpected particle = "
142  << track->GetParticleDefinition()->GetParticleName() << G4endl;
143  return 0;
144  }
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......