Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FTFTunings.hh
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//
26//
27//---------------------------------------------------------------------------
28//
29// ClassName: G4FTFTunings
30//
31// Author: 2022 Alberto Ribon
32//
33// Description: Singleton to keep sets of parameters, called "tunes",
34// for the FTF model.
35//
36// Please NOTE that, as of now (Fall 2022) ONLY ONE tune
37// can be selected/applied; attempt to select multiple tunes
38// will not results in any error messages, however further
39// down the workflow only the FIRST of the activated tunes
40// will be used.
41//
42// To use one of the tunes of this class, there is no need to
43// change anything in this class, and use instead one of the
44// following two UI commands, before initialization:
45// /process/had/models/ftf/selectTuneByIndex integerIndex
46// or /process/had/models/ftf/selectTuneByName stringName
47// for instance:
48// /process/had/models/ftf/selectTuneByIndex 1
49// or
50// /process/had/models/ftf/selectTuneByIndex 2
51// or
52// /process/had/models/ftf/selectTuneByIndex 3
53// or
54// /process/had/models/ftf/selectTuneByName baryon-tune2022-v0
55// or
56// /process/had/models/ftf/selectTuneByName pion-tune2022-v0
57// or
58// /process/had/models/ftf/selectTuneByName combined-tune2022-v0
59//
60// If you want to create a new tune, then you need to modify
61// this class as follows: look for the first "dummy" tune
62// available; if you find it, then specify its name in the
63// std::array fNameOfTunes and the values of the parameters
64// in the methods: G4FTFParamCollection::SetTuneN()
65// G4FTFParamCollBaryonProj::SetTuneN()
66// G4FTFParamCollMesonProj::SetTuneN()
67// G4FTFParamCollPionProj::SetTuneN
68// Note that you need to set explicitly only the parameters
69// with non-default values - all the others inherit the
70// corresponding default values.
71// If you don't find available "dummy" tune, then you need
72// to increase by (at least) 1 the number of tunes, and add
73// the corresponding "SetTuneN()" methods in the 4 classes
74// G4FTFParamCollection, G4FTFParamCollBaryonProj,
75// G4FTFParamCollMesonProj, G4FTFParamCollPionProj
76//
77// In order to explore some variations of FTF parameters
78// (for instance to find out a new tune), please select
79// (via UI command, as explained above) the existing tune
80// from which you want to start with as "baseline", and
81// then set the values of the parameters you want to change
82// via the following C++ code (to used before initialization):
83// G4HadronicDeveloperParameters::GetInstance()->Set(...)
84//
85// Note: in its current, first version, of this class,
86// any FTF tune is applied "globally", i.e. for all
87// projectile hadrons and regardless of their kinetic
88// energy.
89// In future versions, we might try to have tunes that
90// are meant for specific projectile type and/or for
91// intervals of kinetic energy (e.g. low-energy,
92// medium-energy, high-energy).
93//
94// Note: a few classes (written by Julia Yarba) used only in
95// G4FTFParameters, related to the set of parameters of
96// the FTF models, have been moved from the header and
97// source files of the class G4FTFParameters to this
98// (G4FTFTunings) class, with minimal modifications.
99//
100// Modified:
101//
102//----------------------------------------------------------------------------
103//
104#ifndef G4FTFTunings_h
105#define G4FTFTunings_h 1
106
107#include "globals.hh"
109#include <array>
110
113
114
116 public:
117
118 static G4FTFTunings* Instance();
120
121 inline G4String GetTuneName( const G4int index ) const;
122 // Returns the name of the specified tune (via its index).
123 // Note that the name of the tune cannot be changed
124 // (i.e. there is no corresponding "Set" method).
125
126 inline G4int GetTuneApplicabilityState( const G4int index ) const;
127 void SetTuneApplicabilityState( const G4int index, const G4int state );
128 // Get/Set methods for the "applicability state" of the specified tune
129 // (via its index). For the time being, there are only two states:
130 // 0: switched off; 1: switched on.
131
132 G4int GetIndexTune( const G4ParticleDefinition* particleDef, const G4double ekin ) const;
133 // Based on the projectile type and its kinetic energy (from the input arguments),
134 // this method returns the index of the tune which should be used.
135 // For the time being, it returns the first alternative tune which is switched on,
136 // else returns 0 which corresponds to the default set of parameters.
137 // Note: this is the key method that needs to be revised if we decide to have
138 // different tunes according to projectile type and/or projectile energy range.
139
140 static const G4int sNumberOfTunes = 10;
141 // Number of tunes: must be >= 1, with the first one (i.e. with index = 0)
142 // which corresponds to the default set of parameters.
143 // For the time being, we set it to 10 : the second one (index = 1) is a
144 // realistic alternative tune, whereas all the remaining 8 are "dummy" tunes,
145 // i.e. the same as the default set of parameters. These are meant to be
146 // replaced in the future with other, realistic alternative tunes.
147 // Note: below, for the names and "applicability" status of tunes we use
148 // std::array - instead of std::vector - because the number of tunes
149 // do not change dynamically during a run, and, moreover, we expect
150 // quite a small number of them (just a few).
151
152 private:
153
154 G4FTFTunings();
155 G4bool IsLocked() const;
156
157 static G4FTFTunings* sInstance;
158
159 G4FTFTuningsMessenger* fMessenger;
160
161 const std::array< G4String, sNumberOfTunes > fNameOfTunes = { {
162 "default", // 0th tuning: default set
163 "baryon-tune2022-v0", // 1st tuning: Julia Yarba's presentation on 20-Jul-2022
164 "pion-tune2022-v0", // 2nd tuning: Julia Yarba's presentations on 26-Sept-2022 and 19-Oct-2022
165 "combined-tune2022-v0", // 3rd tuning: combo of the 1st and 2nd tuning
166 "fourth-dummy", // 4th tuning: dummy
167 "fifth-dummy", // 5th tuning: dummy
168 "sixth-dummy", // 6th tuning: dummy
169 "seventh-dummy", // 7th tuning: dummy
170 "eighth-dummy", // 8th tuning: dummy
171 "nineth-dummy" // 9th tuning: dummy
172 } };
173 // The names of tunes can be useful for debugging.
174
175 std::array< G4int, sNumberOfTunes > fApplicabilityOfTunes = { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
176 // Each tune has an integer that specifies its applicability.
177 // For the time being, there only two values:
178 // 0 : tune is switched off (i.e. not applicable);
179 // 1 : tune is switched on (i.e. applicable).
180 // Later on, it can be extended to indicate whether it is applicable to specific
181 // projectile hadrons (e.g. protons, pions, etc.), and/or for specific energy ranges
182 // (e.g. low-energy, medium-energy, high-energy - with energy thresholds to be
183 // defined in this class).
184 // The initial values can be changed (either via C++ interface or via UI command)
185 // before initialization.
186
187 //const G4double fLowEnergyThreshold = 5.0*CLHEP::GeV;
188 //const G4double fHighEnergyThreshold = 20.0*CLHEP::GeV;
189 // These constants can be used, later on, to have different tunes
190 // according to the energy of the projectile hadron (e.g. one set for
191 // low energy, one set for middle energy, and one for high energy).
192};
193
194
195inline G4String G4FTFTunings::GetTuneName( const G4int index ) const {
196 if ( index < 0 || index >= sNumberOfTunes ) return G4String();
197 return fNameOfTunes[index];
198}
199
200
202 if ( index < 0 || index >= sNumberOfTunes ) return 0; // Switched off
203 return fApplicabilityOfTunes[index];
204}
205
206
207//============================================================================
208
209// Classes below have been created by Julia Yarba and were originally placed
210// in the G4FTFParameters.{hh,cc} files ; some minimal changes and extensions
211// have been included.
212
213
215 // NOTE: the settings are different for:
216 // * baryons projectile
217 // * anti-baryons projectile
218 // * pions (chg or pi0) projectile
219 // * kaons projectile (pdg = +/-321, 311, 130, or 310)
220 // * "undefined" projectile - nucleon assumed
221 public:
222
223 // Set-up the tune specified in the input argument, only if that tune is switched on.
224 virtual void SetTune( const G4int tuneIndex );
225
226 virtual void SetTune1(); // Set-up the 1st tune
227 virtual void SetTune2(); // Set-up the 2nd tune
228 virtual void SetTune3(); // Set-up the 3rd tune
229 virtual void SetTune4(); // Set-up the 4th tune
230 virtual void SetTune5(); // Set-up the 5th tune
231 virtual void SetTune6(); // Set-up the 6th tune
232 virtual void SetTune7(); // Set-up the 7th tune
233 virtual void SetTune8(); // Set-up the 8th tune
234 virtual void SetTune9(); // Set-up the 9th tune
235 //...
236
238
239 // parameters of excitation
240 // Proc=0 --> Qexchg w/o excitation
241 double GetProc0A1() const { return fProc0A1; }
242 double GetProc0B1() const { return fProc0B1; }
243 double GetProc0A2() const { return fProc0A2; }
244 double GetProc0B2() const { return fProc0B2; }
245 double GetProc0A3() const { return fProc0A3; }
246 double GetProc0Atop() const { return fProc0Atop; }
247 double GetProc0Ymin() const { return fProc0Ymin; }
248 // Proc=1 --> Qexchg w/excitation
249 double GetProc1A1() const { return fProc1A1; }
250 double GetProc1B1() const { return fProc1B1; }
251 double GetProc1A2() const { return fProc1A2; }
252 double GetProc1B2() const { return fProc1B2; }
253 double GetProc1A3() const { return fProc1A3; }
254 double GetProc1Atop() const { return fProc1Atop; }
255 double GetProc1Ymin() const { return fProc1Ymin; }
256 // Proc=2 & Proc=3 in case ( AbsProjectileBaryonNumber > 1 || NumberOfTargetNucleons > 1 )
257 // Update: Proc=2 & Proc=3 in case ( AbsProjectileBaryonNumber > 10 || NumberOfTargetNucleons > 10 )
258 // (diffraction dissociation)
259 // Other parameters have a complex form for baryon projectile
260 // although they're just numbers for e.g. pions projectile
261 // Proc=2 --> Projectile diffraction
262 double GetProc2A1() const { return fProc2A1; }
263 double GetProc2B1() const { return fProc2B1; }
264 double GetProc2A2() const { return fProc2A2; }
265 double GetProc2B2() const { return fProc2B2; }
266 double GetProc2A3() const { return fProc2A3; }
267 double GetProc2Atop() const { return fProc2Atop; }
268 double GetProc2Ymin() const { return fProc2Ymin; }
269 // Proc=3 --> Target diffraction
270 double GetProc3A1() const { return fProc3A1; }
271 double GetProc3B1() const { return fProc3B1; }
272 double GetProc3A2() const { return fProc3A2; }
273 double GetProc3B2() const { return fProc3B2; }
274 double GetProc3A3() const { return fProc3A3; }
275 double GetProc3Atop() const { return fProc3Atop; }
276 double GetProc3Ymin() const { return fProc3Ymin; }
279 // Proc=4 --> Qexchg "w/additional multiplier" in excitation
280 double GetProc4A1() const { return fProc4A1; }
281 double GetProc4B1() const { return fProc4B1; }
282 double GetProc4A2() const { return fProc4A2; }
283 double GetProc4B2() const { return fProc4B2; }
284 double GetProc4A3() const { return fProc4A3; }
285 double GetProc4Atop() const { return fProc4Atop; }
286 double GetProc4Ymin() const { return fProc4Ymin; }
287 //
290 double GetProjMinDiffMass() const { return fProjMinDiffMass; }
292 double GetTgtMinDiffMass() const { return fTgtMinDiffMass; }
293 double GetTgtMinNonDiffMass() const { return fTgtMinNonDiffMass; }
294 double GetAveragePt2() const { return fAveragePt2; }
295 double GetProbLogDistrPrD() const { return fProbLogDistrPrD; }
296 double GetProbLogDistr() const { return fProbLogDistr; }
297 // NOTE (JVY): There is also the Pt2Kind parameter but for now it's set to 0., so we'll leave it aside
298 // --> FIXME !!! --> void Get/SetBaryonMaxNumberOfCollisions( const double, const double ); // 1st is Plab, 2nd - D=2.
311 // separately for baryons, mesons, etc.
314 double GetDofNuclearDestruct() const { return fDofNuclearDestruct; }
316
317 protected:
318
320
321 // parameters of excitation
322 // these are for Inelastic interactions, i.e. Xinelastic=(Xtotal-Xelastix)>0.
323 // for elastic, all the A's & B's, Atop & Ymin are zeros
324 // general formula: Pp = A1*exp(B1*Y) + A2*exp(B2*Y) + A3
325 // but if Y<Ymin, then Pp=max(0.,Atop)
326 // for details, see also G4FTFParameters::GetProcProb( ProcN, y )
327 // Proc=0 --> Qexchg w/o excitation
328 double fProc0A1;
329 double fProc0B1;
330 double fProc0A2;
331 double fProc0B2;
332 double fProc0A3;
335 // Proc=1 --> Qexchg w/excitation
336 double fProc1A1;
337 double fProc1B1;
338 double fProc1A2;
339 double fProc1B2;
340 double fProc1A3;
343 // NOTE: Proc #2 & 3 are projectile & target diffraction
344 // they have more complex definition of A1 & A2
345 // for *baryons* although they're just numbers for pions
346 // (example for baryons below)
347 // SetParams( 2, 6.0/Xinel, 0.0 ,-6.0/Xinel*16.28, 3.0 , 0.0, 0.0 , 0.93);// Projectile diffraction
348 // SetParams( 3, 6.0/Xinel, 0.0 ,-6.0/Xinel*16.28, 3.0 , 0.0, 0.0 , 0.93);// Target diffraction
349 //
350 // Also, for ( AbsProjectileBaryonNumber > 1 || NumberOfTargetNucleons > 1 )
351 // projectile and/or target diffraction (dissociation) may be switched ON/OFF
354 // Proc=2 --> Projectile diffraction
355 double fProc2A1;
356 double fProc2B1;
357 double fProc2A2;
358 double fProc2B2;
359 double fProc2A3;
360 double fProc2Atop;
361 double fProc2Ymin;
362 // Proc=3 --> Target diffraction
363 double fProc3A1;
364 double fProc3B1;
365 double fProc3A2;
366 double fProc3B2;
367 double fProc3A3;
368 double fProc3Atop;
369 double fProc3Ymin;
370 // Proc=4 --> Qexchg w/additional multiplier in excitation
371 double fProc4A1;
372 double fProc4B1;
373 double fProc4A2;
374 double fProc4B2;
375 double fProc4A3;
378 // parameters of participating baryon excitation
379 // NOTE: baryon or HADRON ???
380 // NOTE: this parameters (as C++ class data members) are used for all types of hadrons
381 // but the values for a specific group of particles can be are different from
382 // another group of particles
383 // the defaults listed under coments are for baryons,
384 // and they may be different or the same for other hadrons (e.g. mesons)
394 // parameters of nuclear distruction
395 // NOTE (JVY): there're 3 cases here:
396 // * baryon projectile
397 // * anti-baryon projectile
398 // * meson projectile
399 // double fBaryonMaxNumberOfCollisions; // D=2.
400 // void SetBaryonProbOfInteraction( const double ); // ??? this is prob. of inelastic interaction
401 // that is set internally based on certain conditions...
402 // general (i.e. for used for baryons,anti-baryons, and mesons)
403 // NOTE: these parameters have stayed THE SAME for quite a while
412 //
417 // baryons... well, in fact also mesons...
422};
423
424
426 public:
428
429 virtual void SetTune1() override; // Set-up the baryon part of the 1st tune
430 virtual void SetTune2() override; // Set-up the baryon part of the 2nd tune
431 virtual void SetTune3() override; // Set-up the baryon part of the 3rd tune
432 virtual void SetTune4() override; // Set-up the baryon part of the 4th tune
433 virtual void SetTune5() override; // Set-up the baryon part of the 5th tune
434 virtual void SetTune6() override; // Set-up the baryon part of the 6th tune
435 virtual void SetTune7() override; // Set-up the baryon part of the 7th tune
436 virtual void SetTune8() override; // Set-up the baryon part of the 8th tune
437 virtual void SetTune9() override; // Set-up the baryon part of the 9th tune
438 //...
439};
440
441
443 public:
445
446 virtual void SetTune1() override; // Set-up the meson part of the 1st tune
447 virtual void SetTune2() override; // Set-up the meson part of the 2nd tune
448 virtual void SetTune3() override; // Set-up the meson part of the 3rd tune
449 virtual void SetTune4() override; // Set-up the meson part of the 4th tune
450 virtual void SetTune5() override; // Set-up the meson part of the 5th tune
451 virtual void SetTune6() override; // Set-up the meson part of the 6th tune
452 virtual void SetTune7() override; // Set-up the meson part of the 7th tune
453 virtual void SetTune8() override; // Set-up the meson part of the 8th tune
454 virtual void SetTune9() override; // Set-up the meson part of the 9th tune
455 //...
456};
457
458
460 public:
462
463 virtual void SetTune1() override; // Set-up the pion part of the 1st tune
464 virtual void SetTune2() override; // Set-up the pion part of the 2nd tune
465 virtual void SetTune3() override; // Set-up the pion part of the 3rd tune
466 virtual void SetTune4() override; // Set-up the pion part of the 4th tune
467 virtual void SetTune5() override; // Set-up the pion part of the 5th tune
468 virtual void SetTune6() override; // Set-up the pion part of the 6th tune
469 virtual void SetTune7() override; // Set-up the pion part of the 7th tune
470 virtual void SetTune8() override; // Set-up the pion part of the 8th tune
471 virtual void SetTune9() override; // Set-up the pion part of the 9th tune
472 //...
473};
474
475#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
virtual void SetTune4() override
virtual void SetTune8() override
virtual void SetTune3() override
virtual void SetTune9() override
virtual void SetTune5() override
virtual void SetTune2() override
virtual void SetTune6() override
virtual void SetTune1() override
virtual void SetTune7() override
virtual void SetTune5() override
virtual void SetTune3() override
virtual void SetTune4() override
virtual void SetTune7() override
virtual void SetTune6() override
virtual void SetTune1() override
virtual void SetTune9() override
virtual void SetTune8() override
virtual void SetTune2() override
virtual void SetTune8() override
virtual void SetTune3() override
virtual void SetTune5() override
virtual void SetTune6() override
virtual void SetTune2() override
virtual void SetTune7() override
virtual void SetTune1() override
virtual void SetTune9() override
virtual void SetTune4() override
virtual void SetTune9()
double GetProc3B2() const
double GetProc4A3() const
double GetNuclearTgtDestructP3() const
double GetProc3B1() const
virtual void SetTune3()
bool IsNuclearProjDestructP1_NBRNDEP() const
double GetProc0A2() const
double GetExciEnergyPerWoundedNucleon() const
double GetProc1Atop() const
double GetProc2A3() const
double GetNuclearProjDestructP2() const
double GetProbLogDistrPrD() const
virtual void SetTune8()
double GetPt2NuclearDestructP4() const
virtual void SetTune5()
double GetPt2NuclearDestructP3() const
double GetNuclearProjDestructP3() const
double GetProc4A2() const
double GetPt2NuclearDestructP1() const
double GetProc2Ymin() const
double GetProjMinNonDiffMass() const
virtual void SetTune(const G4int tuneIndex)
double GetProc3Ymin() const
double GetProc2A2() const
double GetProc4B1() const
double GetProc1A1() const
double GetProc0B2() const
double GetProbLogDistr() const
double GetProc1B2() const
double fDeltaProbAtQuarkExchange
double GetProc3Atop() const
double GetProc1A3() const
double GetProc1B1() const
double GetProc1Ymin() const
double GetProc2B1() const
double GetNuclearTgtDestructP2() const
double GetPt2NuclearDestructP2() const
double GetR2ofNuclearDestruct() const
virtual void SetTune1()
double GetDeltaProbAtQuarkExchange() const
double GetDofNuclearDestruct() const
virtual void SetTune4()
double fExciEnergyPerWoundedNucleon
double GetProc0A3() const
bool IsProjDiffDissociation() const
double GetProc0Atop() const
double GetProc2B2() const
double GetProc2A1() const
double GetProc2Atop() const
double GetProc1A2() const
double GetProc4Atop() const
double GetProc3A1() const
double GetAveragePt2() const
double GetProc4Ymin() const
double GetProc0B1() const
double GetTgtMinNonDiffMass() const
virtual ~G4FTFParamCollection()
bool IsTgtDiffDissociation() const
double GetProbOfSameQuarkExchange() const
virtual void SetTune2()
virtual void SetTune7()
double GetProc4B2() const
double GetProc0Ymin() const
double GetProc3A2() const
double GetProc3A3() const
bool IsNuclearTgtDestructP1_ADEP() const
virtual void SetTune6()
double GetMaxPt2ofNuclearDestruct() const
double GetProc4A1() const
double GetTgtMinDiffMass() const
double GetNuclearTgtDestructP1() const
double GetProjMinDiffMass() const
double GetProc0A1() const
double GetNuclearProjDestructP1() const
static const G4int sNumberOfTunes
void SetTuneApplicabilityState(const G4int index, const G4int state)
G4int GetTuneApplicabilityState(const G4int index) const
static G4FTFTunings * Instance()
G4String GetTuneName(const G4int index) const
G4int GetIndexTune(const G4ParticleDefinition *particleDef, const G4double ekin) const