Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-18 09:22:18

0001 #ifndef MACRO_GLOBALVARIABLES_C
0002 #define MACRO_GLOBALVARIABLES_C
0003 
0004 #include <g4decayer/EDecayType.hh>
0005 
0006 #include <cstdint>
0007 #include <limits>
0008 #include <set>
0009 #include <sstream>
0010 #include <string>
0011 
0012 double no_overlapp = 0.0001;
0013 
0014 // These Input settings are needed in multiple Input selections
0015 // Putting those here avoids include file ordering problems
0016 namespace Input
0017 {
0018   bool HEPMC = false;
0019   bool EMBED = false;
0020   bool READEIC = false;
0021 
0022   bool UPSILON = false;
0023   std::set<int> UPSILON_EmbedIds;
0024 
0025   //! nominal beam parameter configuration choices for BEAM_CONFIGURATION
0026   enum BeamConfiguration
0027   {
0028     AA_COLLISION = 0,
0029     pA_COLLISION = 1,
0030     pp_COLLISION = 2,
0031     pp_ZEROANGLE = 3,
0032     ppg02 = 4
0033   };
0034 
0035   BeamConfiguration BEAM_CONFIGURATION = AA_COLLISION;
0036 }  // namespace Input
0037 
0038 namespace DstOut
0039 {
0040   std::string OutputDir = ".";
0041   std::string OutputFile = "test.root";
0042 }  // namespace DstOut
0043 
0044 // Global settings affecting multiple subsystems
0045 namespace Enable
0046 {
0047   bool ABSORBER = false;
0048   bool CDB = false;
0049   bool DSTOUT = false;
0050   bool DSTOUT_COMPRESS = false;
0051   bool OVERLAPCHECK = false;
0052   bool SUPPORT = false;
0053   int VERBOSITY = 0;
0054 }  // namespace Enable
0055 
0056 // every G4 subsystem needs to implement this
0057 // rather than forcing another include file,
0058 // let's put this into the GlobalVariables.C
0059 namespace BlackHoleGeometry
0060 {
0061   double max_radius = 0.;  // this is needed for the overall dimension of the black hole
0062   double min_z = 0.;
0063   double max_z = 0.;
0064   double gap = no_overlapp;
0065   bool visible = false;
0066 };  // namespace BlackHoleGeometry
0067 
0068 namespace G4P6DECAYER
0069 {
0070   EDecayType decayType = EDecayType::kAll;
0071 }
0072 
0073 // our various tracking macro
0074 namespace TRACKING
0075 {
0076   std::string TrackNodeName = "SvtxTrackMap";
0077   bool pp_mode = false;
0078   double pp_extended_readout_time = 24900.0;  // ns
0079   bool reco_tpc_is_configured = false;
0080   int reco_tpc_maxtime_sample = 425;
0081   int reco_tpc_time_presample = 40;  // 120 - 80
0082   int reco_t0 = 0;
0083   bool tpc_zero_supp = false;
0084   bool tpc_baseline_corr = true;
0085 
0086 }  // namespace TRACKING
0087 
0088 namespace G4MAGNET
0089 {
0090   // initialize to garbage values - the override is done in the respective
0091   // MagnetInit() functions. If used standalone (without the G4_Magnet include)
0092   // like in the tracking - those need to be set in the Fun4All macro
0093   double magfield_rescale = std::numeric_limits<double>::quiet_NaN();
0094   std::string magfield;
0095   std::string magfield_OHCAL_steel;
0096   std::string magfield_tracking;
0097 }  // namespace G4MAGNET
0098 
0099 namespace Enable
0100 {
0101   bool MICROMEGAS = false;
0102 }
0103 
0104 namespace G4MICROMEGAS
0105 {
0106   // number of micromegas layers
0107   int n_micromegas_layer = 2;
0108 }  // namespace G4MICROMEGAS
0109 
0110 namespace G4TPC
0111 {
0112   double tpc_drift_velocity_reco = 7.55 / 1000.0;  // cm/ns   // this is the Ne version of the gas, it is very close to our Ar-CF4 mixture
0113   double tpc_tzero_reco = 0.0;                     // ns
0114 }  // namespace G4TPC
0115 
0116 namespace G4TRACKING
0117 {
0118   bool init_acts_magfield = true;
0119 }
0120 
0121 namespace EVTGENDECAYER
0122 {
0123   std::string DecayFile;  // The default is no need to force decay anything and use the default file DECAY.DEC from the official EvtGen software
0124                           // DECAY.DEC is located at: https://gitlab.cern.ch/evtgen/evtgen/-/blob/master/DECAY.DEC
0125 }
0126 
0127 namespace CDB
0128 {
0129   std::string global_tag = "MDC2";
0130   uint64_t timestamp = 6;
0131 }  // namespace CDB
0132 
0133 // multi purpose functions
0134 // cheap check via extension if we have a root file (pre c++17)
0135 bool isRootFile(const std::string &fname)
0136 {
0137   size_t i = fname.rfind('.', fname.length());
0138   if (i != std::string::npos)
0139   {
0140     if (fname.substr(i + 1, fname.length() - i) == "root")
0141     {
0142       return true;
0143     }
0144   }
0145   return false;
0146 }
0147 
0148 bool isConstantField(const std::string & /*name*/, double &fieldstrength)
0149 {
0150   std::istringstream stringline(G4MAGNET::magfield_tracking);
0151   stringline >> fieldstrength;
0152   if (stringline.fail())
0153   {  // conversion to double fails -> we have a string (means fieldmap)
0154     fieldstrength = std::numeric_limits<double>::quiet_NaN();
0155     return false;
0156   }
0157 
0158   return true;
0159 }
0160 
0161 #endif