Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-13 08:21:03

0001 
0002 #ifndef G4HepEmConfig_h
0003 #define G4HepEmConfig_h 1
0004 
0005 #include "globals.hh"
0006 
0007 #include <vector>
0008 #include <string>
0009 
0010 
0011 struct G4HepEmParameters;
0012 
0013 /**
0014  * @file    G4HepEmConfig.hh
0015  * @class   G4HepEmConfig
0016  * @author  M. Novak
0017  * @date    2025
0018  *
0019  * Stores the configuration of the HepEm simulation.
0020  *
0021  * The `G4HepEmTrackingManager` stores an object from this class that allows its
0022  * configuration.
0023  *
0024  * Most of the configurations/parameters are those stored in the
0025  * `G4HepEmParameters` member of this configuration class. These values are red
0026  * at run time so they can be set anytime before the `beamON`. Many of these
0027  * parameters can be configured in G4HepEm per detector regions!
0028  *
0029  * Other parameters/configurations are already needed at the initialisation,
0030  * e.g. list of Woodcock tracking regions. However, the `G4HepEmTrackingManager`
0031  * is constructed only during the initialisation itself (in the physics list
0032  * `ConstructProcess` interface). Therefore, these parameters/configurations
0033  * need to be set in the code right after the `G4HepEmTrackingManager` is
0034  * constructed and assigned to the particles (i.e. in `ConstructProcess`).
0035  */
0036 
0037 
0038 // Class to hold parameters that can be set by the user.
0039 class G4HepEmConfig {
0040 public:
0041   G4HepEmConfig();
0042  ~G4HepEmConfig();
0043 
0044   void Dump();
0045 
0046   // Activate/deactivate Woodcock-tracking of photons in a given detector region
0047   // NOTE: this must be done before the initialissation of the run, i.e. right
0048   //       after the construction of the `G4HepEmTrackinManager` !!!
0049   void SetWoodcockTrackingRegion(const std::string& regionName, G4bool val=true);
0050   std::vector<std::string>& GetWoodcockTrackingRegionNames() {
0051     return fWDTRegionNames;
0052   }
0053 
0054   // Set/get the kinetic energy limit below which Woodcock tracking should be turned off.*/
0055   void     SetWDTEnergyLimit(G4double ekin) { fWDTEnergyLimit = ekin; }
0056   G4double GetWDTEnergyLimit() { return fWDTEnergyLimit; }
0057 
0058 
0059 
0060   // Set the `fDRoverRange` and `fFinalRange` parameters of the continuous energy
0061   // loss step limit function (everywhere or in a given detector region)
0062   void     SetEnergyLossStepLimitFunctionParameters(G4double drRange, G4double finRange, const G4String& nameRegion);
0063   void     SetEnergyLossStepLimitFunctionParameters(G4double drRange, G4double finRange);
0064   G4double GetEnergyLossStepLimitFunctionParameters(const G4String& nameRegion, G4bool isDRover=true);
0065   G4double GetEnergyLossStepLimitFunctionParameters(int indxRegion, G4bool isDRover=true);
0066 
0067   // Set the 'rangeFactor' parameter of the MSC step (everywhere or in a given detector region)
0068   void     SetMSCRangeFactor(G4double val, const G4String& nameRegion);
0069   void     SetMSCRangeFactor(G4double val);
0070   G4double GetMSCRangeFactor(const G4String& nameRegion);
0071   G4double GetMSCRangeFactor(int indxRegion);
0072   // Set the 'safetyFactor' parameter of the MSC step (everywhere or in a given detector region)
0073   void     SetMSCSafetyFactor(G4double val, const G4String& nameRegion);
0074   void     SetMSCSafetyFactor(G4double val);
0075   G4double GetMSCSafetyFactor(const G4String& nameRegion);
0076   G4double GetMSCSafetyFactor(int indxRegion);
0077 
0078   // Activating/deactivating energy loss fluctuation everywhere or in a given
0079   // detector region (default: true --> active)
0080   void   SetEnergyLossFluctuation(G4bool val, const G4String& nameRegion);
0081   void   SetEnergyLossFluctuation(G4bool val);
0082   G4bool GetEnergyLossFluctuation(const G4String& nameRegion);
0083   G4bool GetEnergyLossFluctuation(int indxRegion);
0084 
0085   // Activating/deactivating using the `minimal` MSC step limit everywhere or in
0086   // a given detector region (the default i.e. `fUseSafety` is used otherwise)
0087   void   SetMinimalMSCStepLimit(G4bool val, const G4String& nameRegion);
0088   void   SetMinimalMSCStepLimit(G4bool val);
0089   G4bool GetMinimalMSCStepLimit(const G4String& nameRegion);
0090   G4bool GetMinimalMSCStepLimit(int indxRegion);
0091 
0092   // Activating/deactivating using the combined MSC + Transportation e-/e+ tracking/stepping
0093   // through multiple steps (default: true --> active)
0094   void   SetMultipleStepsInMSCWithTransportation(G4bool val, const G4String& nameRegion);
0095   void   SetMultipleStepsInMSCWithTransportation(G4bool val);
0096   G4bool GetMultipleStepsInMSCWithTransportation(const G4String& nameRegion);
0097   G4bool GetMultipleStepsInMSCWithTransportation(int indxRegion);
0098 
0099   // Activating/deactivating applying cuts on other processes beyond ioni. and brem.
0100   void   SetApplyCuts(G4bool val, const G4String& nameRegion);
0101   void   SetApplyCuts(G4bool val);
0102   G4bool GetApplyCuts(const G4String& nameRegion);
0103   G4bool GetApplyCuts(int indxRegion);
0104 
0105 
0106   // NOTE: to see if we set its memebr Parameters or it will have its own
0107   void SetG4HepEmParameters(G4HepEmParameters* hepEmPars) {
0108     fG4HepEmParameters = hepEmPars;
0109   }
0110   G4HepEmParameters* GetG4HepEmParameters() { return fG4HepEmParameters; }
0111 
0112 private:
0113   G4int GetRegionIndex(const G4String& nameRegion);
0114   void  CheckRegionIndex(G4int indxRegion);
0115 
0116 private:
0117 
0118   // The G4HepEmParameters of the configuration. Default values are taken from Geant4
0119   // (mainly from G4EmParameters) but further configurations possible through this
0120   // G4HepEmConfig (even per detector regions).
0121   G4HepEmParameters*      fG4HepEmParameters;
0122 
0123   // The list of detector regions that the user requested Woodock-tracking in.
0124   std::vector<std::string> fWDTRegionNames;
0125   // Kinetic energy below which Woodcock tracking is turned off.*/
0126   G4double                 fWDTEnergyLimit;
0127 
0128 };
0129 
0130 #endif // G4HepEmConfig