|
||||
File indexing completed on 2025-01-18 09:58:19
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 // 0027 //--------------------------------------------------------------------------- 0028 // 0029 // ClassName: G4FTFTunings 0030 // 0031 // Author: 2022 Alberto Ribon 0032 // 0033 // Description: Singleton to keep sets of parameters, called "tunes", 0034 // for the FTF model. 0035 // 0036 // Please NOTE that, as of now (Fall 2022) ONLY ONE tune 0037 // can be selected/applied; attempt to select multiple tunes 0038 // will not results in any error messages, however further 0039 // down the workflow only the FIRST of the activated tunes 0040 // will be used. 0041 // 0042 // To use one of the tunes of this class, there is no need to 0043 // change anything in this class, and use instead one of the 0044 // following two UI commands, before initialization: 0045 // /process/had/models/ftf/selectTuneByIndex integerIndex 0046 // or /process/had/models/ftf/selectTuneByName stringName 0047 // for instance: 0048 // /process/had/models/ftf/selectTuneByIndex 1 0049 // or 0050 // /process/had/models/ftf/selectTuneByIndex 2 0051 // or 0052 // /process/had/models/ftf/selectTuneByIndex 3 0053 // or 0054 // /process/had/models/ftf/selectTuneByName baryon-tune2022-v0 0055 // or 0056 // /process/had/models/ftf/selectTuneByName pion-tune2022-v0 0057 // or 0058 // /process/had/models/ftf/selectTuneByName combined-tune2022-v0 0059 // 0060 // If you want to create a new tune, then you need to modify 0061 // this class as follows: look for the first "dummy" tune 0062 // available; if you find it, then specify its name in the 0063 // std::array fNameOfTunes and the values of the parameters 0064 // in the methods: G4FTFParamCollection::SetTuneN() 0065 // G4FTFParamCollBaryonProj::SetTuneN() 0066 // G4FTFParamCollMesonProj::SetTuneN() 0067 // G4FTFParamCollPionProj::SetTuneN 0068 // Note that you need to set explicitly only the parameters 0069 // with non-default values - all the others inherit the 0070 // corresponding default values. 0071 // If you don't find available "dummy" tune, then you need 0072 // to increase by (at least) 1 the number of tunes, and add 0073 // the corresponding "SetTuneN()" methods in the 4 classes 0074 // G4FTFParamCollection, G4FTFParamCollBaryonProj, 0075 // G4FTFParamCollMesonProj, G4FTFParamCollPionProj 0076 // 0077 // In order to explore some variations of FTF parameters 0078 // (for instance to find out a new tune), please select 0079 // (via UI command, as explained above) the existing tune 0080 // from which you want to start with as "baseline", and 0081 // then set the values of the parameters you want to change 0082 // via the following C++ code (to used before initialization): 0083 // G4HadronicDeveloperParameters::GetInstance()->Set(...) 0084 // 0085 // Note: in its current, first version, of this class, 0086 // any FTF tune is applied "globally", i.e. for all 0087 // projectile hadrons and regardless of their kinetic 0088 // energy. 0089 // In future versions, we might try to have tunes that 0090 // are meant for specific projectile type and/or for 0091 // intervals of kinetic energy (e.g. low-energy, 0092 // medium-energy, high-energy). 0093 // 0094 // Note: a few classes (written by Julia Yarba) used only in 0095 // G4FTFParameters, related to the set of parameters of 0096 // the FTF models, have been moved from the header and 0097 // source files of the class G4FTFParameters to this 0098 // (G4FTFTunings) class, with minimal modifications. 0099 // 0100 // Modified: 0101 // 0102 //---------------------------------------------------------------------------- 0103 // 0104 #ifndef G4FTFTunings_h 0105 #define G4FTFTunings_h 1 0106 0107 #include "globals.hh" 0108 #include <CLHEP/Units/PhysicalConstants.h> 0109 #include <array> 0110 0111 class G4ParticleDefinition; 0112 class G4FTFTuningsMessenger; 0113 0114 0115 class G4FTFTunings { 0116 public: 0117 0118 static G4FTFTunings* Instance(); 0119 ~G4FTFTunings(); 0120 0121 inline G4String GetTuneName( const G4int index ) const; 0122 // Returns the name of the specified tune (via its index). 0123 // Note that the name of the tune cannot be changed 0124 // (i.e. there is no corresponding "Set" method). 0125 0126 inline G4int GetTuneApplicabilityState( const G4int index ) const; 0127 void SetTuneApplicabilityState( const G4int index, const G4int state ); 0128 // Get/Set methods for the "applicability state" of the specified tune 0129 // (via its index). For the time being, there are only two states: 0130 // 0: switched off; 1: switched on. 0131 0132 G4int GetIndexTune( const G4ParticleDefinition* particleDef, const G4double ekin ) const; 0133 // Based on the projectile type and its kinetic energy (from the input arguments), 0134 // this method returns the index of the tune which should be used. 0135 // For the time being, it returns the first alternative tune which is switched on, 0136 // else returns 0 which corresponds to the default set of parameters. 0137 // Note: this is the key method that needs to be revised if we decide to have 0138 // different tunes according to projectile type and/or projectile energy range. 0139 0140 static const G4int sNumberOfTunes = 10; 0141 // Number of tunes: must be >= 1, with the first one (i.e. with index = 0) 0142 // which corresponds to the default set of parameters. 0143 // For the time being, we set it to 10 : the second one (index = 1) is a 0144 // realistic alternative tune, whereas all the remaining 8 are "dummy" tunes, 0145 // i.e. the same as the default set of parameters. These are meant to be 0146 // replaced in the future with other, realistic alternative tunes. 0147 // Note: below, for the names and "applicability" status of tunes we use 0148 // std::array - instead of std::vector - because the number of tunes 0149 // do not change dynamically during a run, and, moreover, we expect 0150 // quite a small number of them (just a few). 0151 0152 private: 0153 0154 G4FTFTunings(); 0155 G4bool IsLocked() const; 0156 0157 static G4FTFTunings* sInstance; 0158 0159 G4FTFTuningsMessenger* fMessenger; 0160 0161 const std::array< G4String, sNumberOfTunes > fNameOfTunes = { { 0162 "default", // 0th tuning: default set 0163 "baryon-tune2022-v0", // 1st tuning: Julia Yarba's presentation on 20-Jul-2022 0164 "pion-tune2022-v0", // 2nd tuning: Julia Yarba's presentations on 26-Sept-2022 and 19-Oct-2022 0165 "combined-tune2022-v0", // 3rd tuning: combination of the 1st and 2nd tuning 0166 "energy-resolution-tune2023-v0", // 4th tuning: overcome too optimistic (i.e. narrow) pion shower 0167 // energy resolutions in ATLAS calorimeters w.r.t. test-beam data 0168 "fifth-dummy", // 5th tuning: dummy 0169 "sixth-dummy", // 6th tuning: dummy 0170 "seventh-dummy", // 7th tuning: dummy 0171 "eighth-dummy", // 8th tuning: dummy 0172 "nineth-dummy" // 9th tuning: dummy 0173 } }; 0174 // The names of tunes can be useful for debugging. 0175 0176 std::array< G4int, sNumberOfTunes > fApplicabilityOfTunes = { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; 0177 // Each tune has an integer that specifies its applicability. 0178 // For the time being, there only two values: 0179 // 0 : tune is switched off (i.e. not applicable); 0180 // 1 : tune is switched on (i.e. applicable). 0181 // Later on, it can be extended to indicate whether it is applicable to specific 0182 // projectile hadrons (e.g. protons, pions, etc.), and/or for specific energy ranges 0183 // (e.g. low-energy, medium-energy, high-energy - with energy thresholds to be 0184 // defined in this class). 0185 // The initial values can be changed (either via C++ interface or via UI command) 0186 // before initialization. 0187 0188 //const G4double fLowEnergyThreshold = 5.0*CLHEP::GeV; 0189 //const G4double fHighEnergyThreshold = 20.0*CLHEP::GeV; 0190 // These constants can be used, later on, to have different tunes 0191 // according to the energy of the projectile hadron (e.g. one set for 0192 // low energy, one set for middle energy, and one for high energy). 0193 }; 0194 0195 0196 inline G4String G4FTFTunings::GetTuneName( const G4int index ) const { 0197 if ( index < 0 || index >= sNumberOfTunes ) return G4String(); 0198 return fNameOfTunes[index]; 0199 } 0200 0201 0202 inline G4int G4FTFTunings::GetTuneApplicabilityState( const G4int index ) const { 0203 if ( index < 0 || index >= sNumberOfTunes ) return 0; // Switched off 0204 return fApplicabilityOfTunes[index]; 0205 } 0206 0207 0208 //============================================================================ 0209 0210 // Classes below have been created by Julia Yarba and were originally placed 0211 // in the G4FTFParameters.{hh,cc} files ; some minimal changes and extensions 0212 // have been included. 0213 0214 0215 class G4FTFParamCollection { 0216 // NOTE: the settings are different for: 0217 // * baryons projectile 0218 // * anti-baryons projectile 0219 // * pions (chg or pi0) projectile 0220 // * kaons projectile (pdg = +/-321, 311, 130, or 310) 0221 // * "undefined" projectile - nucleon assumed 0222 public: 0223 0224 // Set-up the tune specified in the input argument, only if that tune is switched on. 0225 virtual void SetTune( const G4int tuneIndex ); 0226 0227 virtual void SetTune1(); // Set-up the 1st tune 0228 virtual void SetTune2(); // Set-up the 2nd tune 0229 virtual void SetTune3(); // Set-up the 3rd tune 0230 virtual void SetTune4(); // Set-up the 4th tune 0231 virtual void SetTune5(); // Set-up the 5th tune 0232 virtual void SetTune6(); // Set-up the 6th tune 0233 virtual void SetTune7(); // Set-up the 7th tune 0234 virtual void SetTune8(); // Set-up the 8th tune 0235 virtual void SetTune9(); // Set-up the 9th tune 0236 //... 0237 0238 virtual ~G4FTFParamCollection() {} 0239 0240 // parameters of excitation 0241 // Proc=0 --> Qexchg w/o excitation 0242 double GetProc0A1() const { return fProc0A1; } 0243 double GetProc0B1() const { return fProc0B1; } 0244 double GetProc0A2() const { return fProc0A2; } 0245 double GetProc0B2() const { return fProc0B2; } 0246 double GetProc0A3() const { return fProc0A3; } 0247 double GetProc0Atop() const { return fProc0Atop; } 0248 double GetProc0Ymin() const { return fProc0Ymin; } 0249 // Proc=1 --> Qexchg w/excitation 0250 double GetProc1A1() const { return fProc1A1; } 0251 double GetProc1B1() const { return fProc1B1; } 0252 double GetProc1A2() const { return fProc1A2; } 0253 double GetProc1B2() const { return fProc1B2; } 0254 double GetProc1A3() const { return fProc1A3; } 0255 double GetProc1Atop() const { return fProc1Atop; } 0256 double GetProc1Ymin() const { return fProc1Ymin; } 0257 // Proc=2 & Proc=3 in case ( AbsProjectileBaryonNumber > 1 || NumberOfTargetNucleons > 1 ) 0258 // Update: Proc=2 & Proc=3 in case ( AbsProjectileBaryonNumber > 10 || NumberOfTargetNucleons > 10 ) 0259 // (diffraction dissociation) 0260 // Other parameters have a complex form for baryon projectile 0261 // although they're just numbers for e.g. pions projectile 0262 // Proc=2 --> Projectile diffraction 0263 double GetProc2A1() const { return fProc2A1; } 0264 double GetProc2B1() const { return fProc2B1; } 0265 double GetProc2A2() const { return fProc2A2; } 0266 double GetProc2B2() const { return fProc2B2; } 0267 double GetProc2A3() const { return fProc2A3; } 0268 double GetProc2Atop() const { return fProc2Atop; } 0269 double GetProc2Ymin() const { return fProc2Ymin; } 0270 // Proc=3 --> Target diffraction 0271 double GetProc3A1() const { return fProc3A1; } 0272 double GetProc3B1() const { return fProc3B1; } 0273 double GetProc3A2() const { return fProc3A2; } 0274 double GetProc3B2() const { return fProc3B2; } 0275 double GetProc3A3() const { return fProc3A3; } 0276 double GetProc3Atop() const { return fProc3Atop; } 0277 double GetProc3Ymin() const { return fProc3Ymin; } 0278 bool IsProjDiffDissociation() const { return fProjDiffDissociation; } 0279 bool IsTgtDiffDissociation() const { return fTgtDiffDissociation; } 0280 // Proc=4 --> Qexchg "w/additional multiplier" in excitation 0281 double GetProc4A1() const { return fProc4A1; } 0282 double GetProc4B1() const { return fProc4B1; } 0283 double GetProc4A2() const { return fProc4A2; } 0284 double GetProc4B2() const { return fProc4B2; } 0285 double GetProc4A3() const { return fProc4A3; } 0286 double GetProc4Atop() const { return fProc4Atop; } 0287 double GetProc4Ymin() const { return fProc4Ymin; } 0288 // 0289 double GetDeltaProbAtQuarkExchange() const { return fDeltaProbAtQuarkExchange; } 0290 double GetProbOfSameQuarkExchange() const { return fProbOfSameQuarkExchange; } 0291 double GetProjMinDiffMass() const { return fProjMinDiffMass; } 0292 double GetProjMinNonDiffMass() const { return fProjMinNonDiffMass; } 0293 double GetTgtMinDiffMass() const { return fTgtMinDiffMass; } 0294 double GetTgtMinNonDiffMass() const { return fTgtMinNonDiffMass; } 0295 double GetAveragePt2() const { return fAveragePt2; } 0296 double GetProbLogDistrPrD() const { return fProbLogDistrPrD; } 0297 double GetProbLogDistr() const { return fProbLogDistr; } 0298 // NOTE (JVY): There is also the Pt2Kind parameter but for now it's set to 0., so we'll leave it aside 0299 // --> FIXME !!! --> void Get/SetBaryonMaxNumberOfCollisions( const double, const double ); // 1st is Plab, 2nd - D=2. 0300 double GetNuclearProjDestructP1() const { return fNuclearProjDestructP1; } 0301 bool IsNuclearProjDestructP1_NBRNDEP() const { return fNuclearProjDestructP1_NBRNDEP; } 0302 double GetNuclearTgtDestructP1() const { return fNuclearTgtDestructP1; } 0303 bool IsNuclearTgtDestructP1_ADEP() const { return fNuclearTgtDestructP1_ADEP; } 0304 double GetNuclearProjDestructP2() const { return fNuclearProjDestructP2; } 0305 double GetNuclearProjDestructP3() const { return fNuclearProjDestructP3; } 0306 double GetNuclearTgtDestructP2() const { return fNuclearTgtDestructP2; } 0307 double GetNuclearTgtDestructP3() const { return fNuclearTgtDestructP3; } 0308 double GetPt2NuclearDestructP1() const { return fPt2NuclearDestructP1; } 0309 double GetPt2NuclearDestructP2() const { return fPt2NuclearDestructP2; } 0310 double GetPt2NuclearDestructP3() const { return fPt2NuclearDestructP3; } 0311 double GetPt2NuclearDestructP4() const { return fPt2NuclearDestructP4; } 0312 // separately for baryons, mesons, etc. 0313 double GetR2ofNuclearDestruct() const { return fR2ofNuclearDestruct; } 0314 double GetExciEnergyPerWoundedNucleon() const { return fExciEnergyPerWoundedNucleon; } 0315 double GetDofNuclearDestruct() const { return fDofNuclearDestruct; } 0316 double GetMaxPt2ofNuclearDestruct() const { return fMaxPt2ofNuclearDestruct; } 0317 0318 protected: 0319 0320 G4FTFParamCollection(); 0321 0322 // parameters of excitation 0323 // these are for Inelastic interactions, i.e. Xinelastic=(Xtotal-Xelastix)>0. 0324 // for elastic, all the A's & B's, Atop & Ymin are zeros 0325 // general formula: Pp = A1*exp(B1*Y) + A2*exp(B2*Y) + A3 0326 // but if Y<Ymin, then Pp=max(0.,Atop) 0327 // for details, see also G4FTFParameters::GetProcProb( ProcN, y ) 0328 // Proc=0 --> Qexchg w/o excitation 0329 double fProc0A1; 0330 double fProc0B1; 0331 double fProc0A2; 0332 double fProc0B2; 0333 double fProc0A3; 0334 double fProc0Atop; 0335 double fProc0Ymin; 0336 // Proc=1 --> Qexchg w/excitation 0337 double fProc1A1; 0338 double fProc1B1; 0339 double fProc1A2; 0340 double fProc1B2; 0341 double fProc1A3; 0342 double fProc1Atop; 0343 double fProc1Ymin; 0344 // NOTE: Proc #2 & 3 are projectile & target diffraction 0345 // they have more complex definition of A1 & A2 0346 // for *baryons* although they're just numbers for pions 0347 // (example for baryons below) 0348 // SetParams( 2, 6.0/Xinel, 0.0 ,-6.0/Xinel*16.28, 3.0 , 0.0, 0.0 , 0.93);// Projectile diffraction 0349 // SetParams( 3, 6.0/Xinel, 0.0 ,-6.0/Xinel*16.28, 3.0 , 0.0, 0.0 , 0.93);// Target diffraction 0350 // 0351 // Also, for ( AbsProjectileBaryonNumber > 1 || NumberOfTargetNucleons > 1 ) 0352 // projectile and/or target diffraction (dissociation) may be switched ON/OFF 0353 bool fProjDiffDissociation; 0354 bool fTgtDiffDissociation; 0355 // Proc=2 --> Projectile diffraction 0356 double fProc2A1; 0357 double fProc2B1; 0358 double fProc2A2; 0359 double fProc2B2; 0360 double fProc2A3; 0361 double fProc2Atop; 0362 double fProc2Ymin; 0363 // Proc=3 --> Target diffraction 0364 double fProc3A1; 0365 double fProc3B1; 0366 double fProc3A2; 0367 double fProc3B2; 0368 double fProc3A3; 0369 double fProc3Atop; 0370 double fProc3Ymin; 0371 // Proc=4 --> Qexchg w/additional multiplier in excitation 0372 double fProc4A1; 0373 double fProc4B1; 0374 double fProc4A2; 0375 double fProc4B2; 0376 double fProc4A3; 0377 double fProc4Atop; 0378 double fProc4Ymin; 0379 // parameters of participating baryon excitation 0380 // NOTE: baryon or HADRON ??? 0381 // NOTE: this parameters (as C++ class data members) are used for all types of hadrons 0382 // but the values for a specific group of particles can be are different from 0383 // another group of particles 0384 // the defaults listed under coments are for baryons, 0385 // and they may be different or the same for other hadrons (e.g. mesons) 0386 double fDeltaProbAtQuarkExchange; 0387 double fProbOfSameQuarkExchange; 0388 double fProjMinDiffMass; 0389 double fProjMinNonDiffMass; 0390 double fTgtMinDiffMass; 0391 double fTgtMinNonDiffMass; 0392 double fAveragePt2; 0393 double fProbLogDistrPrD; 0394 double fProbLogDistr; 0395 // parameters of nuclear distruction 0396 // NOTE (JVY): there're 3 cases here: 0397 // * baryon projectile 0398 // * anti-baryon projectile 0399 // * meson projectile 0400 // double fBaryonMaxNumberOfCollisions; // D=2. 0401 // void SetBaryonProbOfInteraction( const double ); // ??? this is prob. of inelastic interaction 0402 // that is set internally based on certain conditions... 0403 // general (i.e. for used for baryons,anti-baryons, and mesons) 0404 // NOTE: these parameters have stayed THE SAME for quite a while 0405 double fNuclearProjDestructP1; 0406 bool fNuclearProjDestructP1_NBRNDEP; 0407 double fNuclearTgtDestructP1; 0408 bool fNuclearTgtDestructP1_ADEP; 0409 double fNuclearProjDestructP2; 0410 double fNuclearProjDestructP3; 0411 double fNuclearTgtDestructP2; 0412 double fNuclearTgtDestructP3; 0413 // 0414 double fPt2NuclearDestructP1; 0415 double fPt2NuclearDestructP2; 0416 double fPt2NuclearDestructP3; 0417 double fPt2NuclearDestructP4; 0418 // baryons... well, in fact also mesons... 0419 double fR2ofNuclearDestruct; 0420 double fExciEnergyPerWoundedNucleon; 0421 double fDofNuclearDestruct; 0422 double fMaxPt2ofNuclearDestruct; 0423 }; 0424 0425 0426 class G4FTFParamCollBaryonProj : public G4FTFParamCollection { 0427 public: 0428 G4FTFParamCollBaryonProj(); 0429 0430 virtual void SetTune1() override; // Set-up the baryon part of the 1st tune 0431 virtual void SetTune2() override; // Set-up the baryon part of the 2nd tune 0432 virtual void SetTune3() override; // Set-up the baryon part of the 3rd tune 0433 virtual void SetTune4() override; // Set-up the baryon part of the 4th tune 0434 virtual void SetTune5() override; // Set-up the baryon part of the 5th tune 0435 virtual void SetTune6() override; // Set-up the baryon part of the 6th tune 0436 virtual void SetTune7() override; // Set-up the baryon part of the 7th tune 0437 virtual void SetTune8() override; // Set-up the baryon part of the 8th tune 0438 virtual void SetTune9() override; // Set-up the baryon part of the 9th tune 0439 //... 0440 }; 0441 0442 0443 class G4FTFParamCollMesonProj : public G4FTFParamCollection { 0444 public: 0445 G4FTFParamCollMesonProj(); 0446 0447 virtual void SetTune1() override; // Set-up the meson part of the 1st tune 0448 virtual void SetTune2() override; // Set-up the meson part of the 2nd tune 0449 virtual void SetTune3() override; // Set-up the meson part of the 3rd tune 0450 virtual void SetTune4() override; // Set-up the meson part of the 4th tune 0451 virtual void SetTune5() override; // Set-up the meson part of the 5th tune 0452 virtual void SetTune6() override; // Set-up the meson part of the 6th tune 0453 virtual void SetTune7() override; // Set-up the meson part of the 7th tune 0454 virtual void SetTune8() override; // Set-up the meson part of the 8th tune 0455 virtual void SetTune9() override; // Set-up the meson part of the 9th tune 0456 //... 0457 }; 0458 0459 0460 class G4FTFParamCollPionProj : public G4FTFParamCollMesonProj { 0461 public: 0462 G4FTFParamCollPionProj(); 0463 0464 virtual void SetTune1() override; // Set-up the pion part of the 1st tune 0465 virtual void SetTune2() override; // Set-up the pion part of the 2nd tune 0466 virtual void SetTune3() override; // Set-up the pion part of the 3rd tune 0467 virtual void SetTune4() override; // Set-up the pion part of the 4th tune 0468 virtual void SetTune5() override; // Set-up the pion part of the 5th tune 0469 virtual void SetTune6() override; // Set-up the pion part of the 6th tune 0470 virtual void SetTune7() override; // Set-up the pion part of the 7th tune 0471 virtual void SetTune8() override; // Set-up the pion part of the 8th tune 0472 virtual void SetTune9() override; // Set-up the pion part of the 9th tune 0473 //... 0474 }; 0475 0476 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |