Geant4 Cross Reference |
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" 108 #include <CLHEP/Units/PhysicalConstants.h> 109 #include <array> 110 111 class G4ParticleDefinition; 112 class G4FTFTuningsMessenger; 113 114 115 class G4FTFTunings { 116 public: 117 118 static G4FTFTunings* Instance(); 119 ~G4FTFTunings(); 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: combination of the 1st and 2nd tuning 166 "energy-resolution-tune2023-v0", // 4th tuning: overcome too optimistic (i.e. narrow) pion shower 167 // energy resolutions in ATLAS calorimeters w.r.t. test-beam data 168 "fifth-dummy", // 5th tuning: dummy 169 "sixth-dummy", // 6th tuning: dummy 170 "seventh-dummy", // 7th tuning: dummy 171 "eighth-dummy", // 8th tuning: dummy 172 "nineth-dummy" // 9th tuning: dummy 173 } }; 174 // The names of tunes can be useful for debugging. 175 176 std::array< G4int, sNumberOfTunes > fApplicabilityOfTunes = { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; 177 // Each tune has an integer that specifies its applicability. 178 // For the time being, there only two values: 179 // 0 : tune is switched off (i.e. not applicable); 180 // 1 : tune is switched on (i.e. applicable). 181 // Later on, it can be extended to indicate whether it is applicable to specific 182 // projectile hadrons (e.g. protons, pions, etc.), and/or for specific energy ranges 183 // (e.g. low-energy, medium-energy, high-energy - with energy thresholds to be 184 // defined in this class). 185 // The initial values can be changed (either via C++ interface or via UI command) 186 // before initialization. 187 188 //const G4double fLowEnergyThreshold = 5.0*CLHEP::GeV; 189 //const G4double fHighEnergyThreshold = 20.0*CLHEP::GeV; 190 // These constants can be used, later on, to have different tunes 191 // according to the energy of the projectile hadron (e.g. one set for 192 // low energy, one set for middle energy, and one for high energy). 193 }; 194 195 196 inline G4String G4FTFTunings::GetTuneName( const G4int index ) const { 197 if ( index < 0 || index >= sNumberOfTunes ) return G4String(); 198 return fNameOfTunes[index]; 199 } 200 201 202 inline G4int G4FTFTunings::GetTuneApplicabilityState( const G4int index ) const { 203 if ( index < 0 || index >= sNumberOfTunes ) return 0; // Switched off 204 return fApplicabilityOfTunes[index]; 205 } 206 207 208 //============================================================================ 209 210 // Classes below have been created by Julia Yarba and were originally placed 211 // in the G4FTFParameters.{hh,cc} files ; some minimal changes and extensions 212 // have been included. 213 214 215 class G4FTFParamCollection { 216 // NOTE: the settings are different for: 217 // * baryons projectile 218 // * anti-baryons projectile 219 // * pions (chg or pi0) projectile 220 // * kaons projectile (pdg = +/-321, 311, 130, or 310) 221 // * "undefined" projectile - nucleon assumed 222 public: 223 224 // Set-up the tune specified in the input argument, only if that tune is switched on. 225 virtual void SetTune( const G4int tuneIndex ); 226 227 virtual void SetTune1(); // Set-up the 1st tune 228 virtual void SetTune2(); // Set-up the 2nd tune 229 virtual void SetTune3(); // Set-up the 3rd tune 230 virtual void SetTune4(); // Set-up the 4th tune 231 virtual void SetTune5(); // Set-up the 5th tune 232 virtual void SetTune6(); // Set-up the 6th tune 233 virtual void SetTune7(); // Set-up the 7th tune 234 virtual void SetTune8(); // Set-up the 8th tune 235 virtual void SetTune9(); // Set-up the 9th tune 236 //... 237 238 virtual ~G4FTFParamCollection() {} 239 240 // parameters of excitation 241 // Proc=0 --> Qexchg w/o excitation 242 double GetProc0A1() const { return fProc0A1; } 243 double GetProc0B1() const { return fProc0B1; } 244 double GetProc0A2() const { return fProc0A2; } 245 double GetProc0B2() const { return fProc0B2; } 246 double GetProc0A3() const { return fProc0A3; } 247 double GetProc0Atop() const { return fProc0Atop; } 248 double GetProc0Ymin() const { return fProc0Ymin; } 249 // Proc=1 --> Qexchg w/excitation 250 double GetProc1A1() const { return fProc1A1; } 251 double GetProc1B1() const { return fProc1B1; } 252 double GetProc1A2() const { return fProc1A2; } 253 double GetProc1B2() const { return fProc1B2; } 254 double GetProc1A3() const { return fProc1A3; } 255 double GetProc1Atop() const { return fProc1Atop; } 256 double GetProc1Ymin() const { return fProc1Ymin; } 257 // Proc=2 & Proc=3 in case ( AbsProjectileBaryonNumber > 1 || NumberOfTargetNucleons > 1 ) 258 // Update: Proc=2 & Proc=3 in case ( AbsProjectileBaryonNumber > 10 || NumberOfTargetNucleons > 10 ) 259 // (diffraction dissociation) 260 // Other parameters have a complex form for baryon projectile 261 // although they're just numbers for e.g. pions projectile 262 // Proc=2 --> Projectile diffraction 263 double GetProc2A1() const { return fProc2A1; } 264 double GetProc2B1() const { return fProc2B1; } 265 double GetProc2A2() const { return fProc2A2; } 266 double GetProc2B2() const { return fProc2B2; } 267 double GetProc2A3() const { return fProc2A3; } 268 double GetProc2Atop() const { return fProc2Atop; } 269 double GetProc2Ymin() const { return fProc2Ymin; } 270 // Proc=3 --> Target diffraction 271 double GetProc3A1() const { return fProc3A1; } 272 double GetProc3B1() const { return fProc3B1; } 273 double GetProc3A2() const { return fProc3A2; } 274 double GetProc3B2() const { return fProc3B2; } 275 double GetProc3A3() const { return fProc3A3; } 276 double GetProc3Atop() const { return fProc3Atop; } 277 double GetProc3Ymin() const { return fProc3Ymin; } 278 bool IsProjDiffDissociation() const { return fProjDiffDissociation; } 279 bool IsTgtDiffDissociation() const { return fTgtDiffDissociation; } 280 // Proc=4 --> Qexchg "w/additional multiplier" in excitation 281 double GetProc4A1() const { return fProc4A1; } 282 double GetProc4B1() const { return fProc4B1; } 283 double GetProc4A2() const { return fProc4A2; } 284 double GetProc4B2() const { return fProc4B2; } 285 double GetProc4A3() const { return fProc4A3; } 286 double GetProc4Atop() const { return fProc4Atop; } 287 double GetProc4Ymin() const { return fProc4Ymin; } 288 // 289 double GetDeltaProbAtQuarkExchange() const { return fDeltaProbAtQuarkExchange; } 290 double GetProbOfSameQuarkExchange() const { return fProbOfSameQuarkExchange; } 291 double GetProjMinDiffMass() const { return fProjMinDiffMass; } 292 double GetProjMinNonDiffMass() const { return fProjMinNonDiffMass; } 293 double GetTgtMinDiffMass() const { return fTgtMinDiffMass; } 294 double GetTgtMinNonDiffMass() const { return fTgtMinNonDiffMass; } 295 double GetAveragePt2() const { return fAveragePt2; } 296 double GetProbLogDistrPrD() const { return fProbLogDistrPrD; } 297 double GetProbLogDistr() const { return fProbLogDistr; } 298 // NOTE (JVY): There is also the Pt2Kind parameter but for now it's set to 0., so we'll leave it aside 299 // --> FIXME !!! --> void Get/SetBaryonMaxNumberOfCollisions( const double, const double ); // 1st is Plab, 2nd - D=2. 300 double GetNuclearProjDestructP1() const { return fNuclearProjDestructP1; } 301 bool IsNuclearProjDestructP1_NBRNDEP() const { return fNuclearProjDestructP1_NBRNDEP; } 302 double GetNuclearTgtDestructP1() const { return fNuclearTgtDestructP1; } 303 bool IsNuclearTgtDestructP1_ADEP() const { return fNuclearTgtDestructP1_ADEP; } 304 double GetNuclearProjDestructP2() const { return fNuclearProjDestructP2; } 305 double GetNuclearProjDestructP3() const { return fNuclearProjDestructP3; } 306 double GetNuclearTgtDestructP2() const { return fNuclearTgtDestructP2; } 307 double GetNuclearTgtDestructP3() const { return fNuclearTgtDestructP3; } 308 double GetPt2NuclearDestructP1() const { return fPt2NuclearDestructP1; } 309 double GetPt2NuclearDestructP2() const { return fPt2NuclearDestructP2; } 310 double GetPt2NuclearDestructP3() const { return fPt2NuclearDestructP3; } 311 double GetPt2NuclearDestructP4() const { return fPt2NuclearDestructP4; } 312 // separately for baryons, mesons, etc. 313 double GetR2ofNuclearDestruct() const { return fR2ofNuclearDestruct; } 314 double GetExciEnergyPerWoundedNucleon() const { return fExciEnergyPerWoundedNucleon; } 315 double GetDofNuclearDestruct() const { return fDofNuclearDestruct; } 316 double GetMaxPt2ofNuclearDestruct() const { return fMaxPt2ofNuclearDestruct; } 317 318 protected: 319 320 G4FTFParamCollection(); 321 322 // parameters of excitation 323 // these are for Inelastic interactions, i.e. Xinelastic=(Xtotal-Xelastix)>0. 324 // for elastic, all the A's & B's, Atop & Ymin are zeros 325 // general formula: Pp = A1*exp(B1*Y) + A2*exp(B2*Y) + A3 326 // but if Y<Ymin, then Pp=max(0.,Atop) 327 // for details, see also G4FTFParameters::GetProcProb( ProcN, y ) 328 // Proc=0 --> Qexchg w/o excitation 329 double fProc0A1; 330 double fProc0B1; 331 double fProc0A2; 332 double fProc0B2; 333 double fProc0A3; 334 double fProc0Atop; 335 double fProc0Ymin; 336 // Proc=1 --> Qexchg w/excitation 337 double fProc1A1; 338 double fProc1B1; 339 double fProc1A2; 340 double fProc1B2; 341 double fProc1A3; 342 double fProc1Atop; 343 double fProc1Ymin; 344 // NOTE: Proc #2 & 3 are projectile & target diffraction 345 // they have more complex definition of A1 & A2 346 // for *baryons* although they're just numbers for pions 347 // (example for baryons below) 348 // SetParams( 2, 6.0/Xinel, 0.0 ,-6.0/Xinel*16.28, 3.0 , 0.0, 0.0 , 0.93);// Projectile diffraction 349 // SetParams( 3, 6.0/Xinel, 0.0 ,-6.0/Xinel*16.28, 3.0 , 0.0, 0.0 , 0.93);// Target diffraction 350 // 351 // Also, for ( AbsProjectileBaryonNumber > 1 || NumberOfTargetNucleons > 1 ) 352 // projectile and/or target diffraction (dissociation) may be switched ON/OFF 353 bool fProjDiffDissociation; 354 bool fTgtDiffDissociation; 355 // Proc=2 --> Projectile diffraction 356 double fProc2A1; 357 double fProc2B1; 358 double fProc2A2; 359 double fProc2B2; 360 double fProc2A3; 361 double fProc2Atop; 362 double fProc2Ymin; 363 // Proc=3 --> Target diffraction 364 double fProc3A1; 365 double fProc3B1; 366 double fProc3A2; 367 double fProc3B2; 368 double fProc3A3; 369 double fProc3Atop; 370 double fProc3Ymin; 371 // Proc=4 --> Qexchg w/additional multiplier in excitation 372 double fProc4A1; 373 double fProc4B1; 374 double fProc4A2; 375 double fProc4B2; 376 double fProc4A3; 377 double fProc4Atop; 378 double fProc4Ymin; 379 // parameters of participating baryon excitation 380 // NOTE: baryon or HADRON ??? 381 // NOTE: this parameters (as C++ class data members) are used for all types of hadrons 382 // but the values for a specific group of particles can be are different from 383 // another group of particles 384 // the defaults listed under coments are for baryons, 385 // and they may be different or the same for other hadrons (e.g. mesons) 386 double fDeltaProbAtQuarkExchange; 387 double fProbOfSameQuarkExchange; 388 double fProjMinDiffMass; 389 double fProjMinNonDiffMass; 390 double fTgtMinDiffMass; 391 double fTgtMinNonDiffMass; 392 double fAveragePt2; 393 double fProbLogDistrPrD; 394 double fProbLogDistr; 395 // parameters of nuclear distruction 396 // NOTE (JVY): there're 3 cases here: 397 // * baryon projectile 398 // * anti-baryon projectile 399 // * meson projectile 400 // double fBaryonMaxNumberOfCollisions; // D=2. 401 // void SetBaryonProbOfInteraction( const double ); // ??? this is prob. of inelastic interaction 402 // that is set internally based on certain conditions... 403 // general (i.e. for used for baryons,anti-baryons, and mesons) 404 // NOTE: these parameters have stayed THE SAME for quite a while 405 double fNuclearProjDestructP1; 406 bool fNuclearProjDestructP1_NBRNDEP; 407 double fNuclearTgtDestructP1; 408 bool fNuclearTgtDestructP1_ADEP; 409 double fNuclearProjDestructP2; 410 double fNuclearProjDestructP3; 411 double fNuclearTgtDestructP2; 412 double fNuclearTgtDestructP3; 413 // 414 double fPt2NuclearDestructP1; 415 double fPt2NuclearDestructP2; 416 double fPt2NuclearDestructP3; 417 double fPt2NuclearDestructP4; 418 // baryons... well, in fact also mesons... 419 double fR2ofNuclearDestruct; 420 double fExciEnergyPerWoundedNucleon; 421 double fDofNuclearDestruct; 422 double fMaxPt2ofNuclearDestruct; 423 }; 424 425 426 class G4FTFParamCollBaryonProj : public G4FTFParamCollection { 427 public: 428 G4FTFParamCollBaryonProj(); 429 430 virtual void SetTune1() override; // Set-up the baryon part of the 1st tune 431 virtual void SetTune2() override; // Set-up the baryon part of the 2nd tune 432 virtual void SetTune3() override; // Set-up the baryon part of the 3rd tune 433 virtual void SetTune4() override; // Set-up the baryon part of the 4th tune 434 virtual void SetTune5() override; // Set-up the baryon part of the 5th tune 435 virtual void SetTune6() override; // Set-up the baryon part of the 6th tune 436 virtual void SetTune7() override; // Set-up the baryon part of the 7th tune 437 virtual void SetTune8() override; // Set-up the baryon part of the 8th tune 438 virtual void SetTune9() override; // Set-up the baryon part of the 9th tune 439 //... 440 }; 441 442 443 class G4FTFParamCollMesonProj : public G4FTFParamCollection { 444 public: 445 G4FTFParamCollMesonProj(); 446 447 virtual void SetTune1() override; // Set-up the meson part of the 1st tune 448 virtual void SetTune2() override; // Set-up the meson part of the 2nd tune 449 virtual void SetTune3() override; // Set-up the meson part of the 3rd tune 450 virtual void SetTune4() override; // Set-up the meson part of the 4th tune 451 virtual void SetTune5() override; // Set-up the meson part of the 5th tune 452 virtual void SetTune6() override; // Set-up the meson part of the 6th tune 453 virtual void SetTune7() override; // Set-up the meson part of the 7th tune 454 virtual void SetTune8() override; // Set-up the meson part of the 8th tune 455 virtual void SetTune9() override; // Set-up the meson part of the 9th tune 456 //... 457 }; 458 459 460 class G4FTFParamCollPionProj : public G4FTFParamCollMesonProj { 461 public: 462 G4FTFParamCollPionProj(); 463 464 virtual void SetTune1() override; // Set-up the pion part of the 1st tune 465 virtual void SetTune2() override; // Set-up the pion part of the 2nd tune 466 virtual void SetTune3() override; // Set-up the pion part of the 3rd tune 467 virtual void SetTune4() override; // Set-up the pion part of the 4th tune 468 virtual void SetTune5() override; // Set-up the pion part of the 5th tune 469 virtual void SetTune6() override; // Set-up the pion part of the 6th tune 470 virtual void SetTune7() override; // Set-up the pion part of the 7th tune 471 virtual void SetTune8() override; // Set-up the pion part of the 8th tune 472 virtual void SetTune9() override; // Set-up the pion part of the 9th tune 473 //... 474 }; 475 476 #endif 477