Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:26

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