Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef MACRO_G4TRKRVARIABLES_C
0002 #define MACRO_G4TRKRVARIABLES_C
0003 
0004 #include <g4intt/PHG4InttDefs.h>
0005 #include <g4mvtx/PHG4MvtxDefs.h>
0006 
0007 namespace Enable
0008 {
0009   bool MVTX = false;
0010   bool MVTX_OVERLAPCHECK = false;
0011 
0012   bool MVTX_CELL = false;
0013   bool MVTX_CLUSTER = false;
0014   bool MVTX_QA = false;
0015   bool MVTX_SUPPORT = false;
0016   bool MVTX_APPLYMISALIGNMENT = false;
0017 
0018   int MVTX_VERBOSITY = 0;
0019 
0020   bool INTT = false;
0021   bool INTT_ABSORBER = false;
0022   bool INTT_OVERLAPCHECK = false;
0023   bool INTT_CELL = false;
0024   bool INTT_CLUSTER = false;
0025   bool INTT_QA = false;
0026   bool INTT_SUPPORT = false;
0027   bool INTT_USEG4SURVEYGEOM = true;
0028   int INTT_VERBOSITY = 0;
0029 
0030   bool TPC = false;
0031   bool TPC_ABSORBER = false;
0032   bool TPC_OVERLAPCHECK = false;
0033   bool TPC_CELL = false;
0034   bool TPC_CLUSTER = false;
0035   bool TPC_QA = false;
0036 
0037   bool TPC_ENDCAP = true;
0038 
0039   int TPC_VERBOSITY = 0;
0040 
0041   bool MICROMEGAS_OVERLAPCHECK = false;
0042   bool MICROMEGAS_CELL = false;
0043   bool MICROMEGAS_CLUSTER = false;
0044   bool MICROMEGAS_QA = false;
0045   bool MICROMEGAS_SUPPORT = false;
0046   int MICROMEGAS_VERBOSITY = 0;
0047 
0048   bool TRACKING_TRACK = false;
0049   bool TRACKING_EVAL = false;
0050   bool TRACK_MATCHING = false;
0051   bool TRACK_MATCHING_TREE = false;
0052   bool TRACK_MATCHING_TREE_CLUSTERS = false;
0053   // 0=no output TTree file, 1=output for tracks only, 2=tracks+clusters
0054   int TRACKING_VERBOSITY = 0;
0055   bool TRACKING_QA = false;
0056   bool TRACKING_DIAGNOSTICS = false;
0057 }  // namespace Enable
0058 
0059 namespace G4MVTX
0060 {
0061   int n_maps_layer = 3;        // must be 0-3, setting it to zero removes Mvtx completely, n < 3 gives the first n layers
0062   double radius_offset = 0.7;  // clearance around radius
0063 }  // namespace G4MVTX
0064 
0065 namespace G4MVTXAlignment
0066 {
0067   std::string alignment_path = std::string(getenv("CALIBRATIONROOT")) + "/Tracking/MVTX/alignment";
0068   double z_offset[] = {0.0, 0.0, 200.0};
0069 }  // namespace G4MVTXAlignment
0070 
0071 namespace G4INTT
0072 {
0073   int n_intt_layer = 4;           // must be 4 or 0, setting to zero removes INTT completely
0074   double intt_radius_max = 140.;  // including stagger radius (mm)
0075   int laddertype[4] = {PHG4InttDefs::SEGMENTATION_PHI,
0076                        PHG4InttDefs::SEGMENTATION_PHI,
0077                        PHG4InttDefs::SEGMENTATION_PHI,
0078                        PHG4InttDefs::SEGMENTATION_PHI};
0079   int nladder[4] = {12, 12, 16, 16};
0080   //! default to survey geometry
0081   double sensor_radius[4] = {7.453, 8.046, 9.934, 10.569};
0082 
0083   enum enu_InttDeadMapType  // Dead map options for INTT
0084   {
0085     kInttNoDeadMap = 0,  // All channel in Intt is alive
0086     kInttDeadMap = 1,    // with dead channel
0087   };
0088   // enu_InttDeadMapType InttDeadMapOption = kInttNoDeadMap;  // Choose Intt deadmap here
0089   enu_InttDeadMapType InttDeadMapOption = kInttDeadMap;  // Choose Intt deadmap here
0090 
0091 }  // namespace G4INTT
0092 
0093 namespace G4TPC
0094 {
0095   int n_tpc_layer_inner = 16;
0096 
0097   int tpc_layer_rphi_count_inner = 1128;  // 94 * 12
0098 
0099   int n_tpc_layer_mid = 16;
0100   int n_tpc_layer_outer = 16;
0101   int n_gas_layer = n_tpc_layer_inner + n_tpc_layer_mid + n_tpc_layer_outer;
0102   double tpc_outer_radius = 77. + 2.;
0103 
0104   // use simple clusterizer
0105   bool USE_SIMPLE_CLUSTERIZER = false;
0106 
0107   // distortions in simulation
0108   // set how to interpret the magnitude of phi distortions in simulation
0109   bool DISTORTIONS_USE_PHI_AS_RADIANS = true;
0110 
0111   // apply static distortions in simulations
0112   bool ENABLE_STATIC_DISTORTIONS = false;
0113 
0114   std::string static_distortion_filename = "TPC_STATIC_DISTORTION";
0115 
0116   // apply time-ordered distortion fluctuations in simulation
0117   bool ENABLE_TIME_ORDERED_DISTORTIONS = false;
0118   std::string time_ordered_distortion_filename = "TPC_TIMEORDERED_DISTORTION";
0119 
0120   // allow distortions to remove electrons that
0121   bool ENABLE_REACHES_READOUT = true;
0122 
0123   // module edge distortion corrections
0124   bool ENABLE_MODULE_EDGE_CORRECTIONS = false;
0125   std::string module_edge_correction_filename = "";
0126 
0127   // static distortion corrections
0128   bool ENABLE_STATIC_CORRECTIONS = false;
0129   std::string static_correction_filename = std::string(getenv("CALIBRATIONROOT")) + "/distortion_maps/static_only_inverted_10-new.root";
0130   bool USE_PHI_AS_RAD_STATIC_CORRECTIONS = false;
0131 
0132   // average distortion corrections
0133   bool ENABLE_AVERAGE_CORRECTIONS = false;
0134   std::string average_correction_filename;
0135   bool USE_PHI_AS_RAD_AVERAGE_CORRECTIONS = false;
0136   bool average_correction_interpolate = true;
0137   
0138   // enable central membrane g4hits generation
0139   bool ENABLE_CENTRAL_MEMBRANE_HITS = false;
0140 
0141   // enable diffuse laser clustering
0142   bool ENABLE_CENTRAL_MEMBRANE_CLUSTERING = true;
0143   bool LaserClusteringSequential = false;
0144   float laser_adc_threshold = 100.0;
0145 
0146   bool REJECT_LASER_EVENTS = false;
0147   std::string laser_event_debug_filename = "";
0148   std::string LaminationOutputName = "";
0149   std::string LaminationQAName = "";
0150 
0151   // enable direct laser g4hits generation
0152   bool ENABLE_DIRECT_LASER_HITS = false;
0153 
0154   // save histograms
0155   bool DIRECT_LASER_SAVEHISTOGRAMS = false;
0156 
0157   // do cluster <-> hit association
0158   bool DO_HIT_ASSOCIATION = true;
0159 
0160   // space charge calibration output file
0161   std::string DIRECT_LASER_ROOTOUTPUT_FILENAME = "TpcSpaceChargeMatrices.root";
0162   std::string DIRECT_LASER_HISTOGRAMOUTPUT_FILENAME = "TpcDirectLaserReconstruction.root";
0163 
0164   std::string TPC_GAS_MIXTURE = "NeCF4";
0165   // drift velocity is set here for all relevant modules
0166   //  double tpc_drift_velocity_reco now set in GlobalVariables.C
0167   double tpc_drift_velocity_sim = 0.007550;  // cm/ns   // this is the ArCF4Isobutane version of the gas
0168   double tpc_added_smear_long = 0.0;
0169   double tpc_added_smear_trans = 0.0;
0170 
0171   double NeCF4_drift_velocity = 0.008;
0172   double NeCF4_diffusion_long = 0.012;
0173   double NeCF4_diffusion_trans = 0.004;
0174   double NeCF4_Ne_frac = 0.5;
0175   double NeCF4_Ar_frac = 0.0;
0176   double NeCF4_CF4_frac = 0.5;
0177   double NeCF4_N2_frac = 0.0;
0178   double NeCF4_isobutane_frac = 0.0;
0179 
0180   double ArCF4_drift_velocity = 0.008;
0181   double ArCF4_diffusion_long = 0.012;
0182   double ArCF4_diffusion_trans = 0.004;
0183   double ArCF4_Ne_frac = 0.0;
0184   double ArCF4_Ar_frac = 0.6;
0185   double ArCF4_CF4_frac = 0.4;
0186   double ArCF4_N2_frac = 0.0;
0187   double ArCF4_isobutane_frac = 0.0;
0188 
0189   double ArCF4N2_drift_velocity = 0.006965;
0190   double ArCF4N2_diffusion_long = 0.013613;
0191   double ArCF4N2_diffusion_trans = 0.005487;
0192   double ArCF4N2_Ne_frac = 0.0;
0193   double ArCF4N2_Ar_frac = 0.65;
0194   double ArCF4N2_CF4_frac = 0.25;
0195   double ArCF4N2_N2_frac = 0.10;
0196   double ArCF4N2_isobutane_frac = 0.00;
0197 
0198   double ArCF4Isobutane_drift_velocity = 0.00755;
0199   double ArCF4Isobutane_diffusion_long = 0.014596;
0200   double ArCF4Isobutane_diffusion_trans = 0.005313;
0201   double ArCF4Isobutane_Ne_frac = 0.0;
0202   double ArCF4Isobutane_Ar_frac = 0.75;
0203   double ArCF4Isobutane_CF4_frac = 0.20;
0204   double ArCF4Isobutane_N2_frac = 0.00;
0205   double ArCF4Isobutane_isobutane_frac = 0.05;
0206 
0207 }  // namespace G4TPC
0208 
0209 namespace G4TRACKING
0210 {
0211   // Space Charge calibration flag
0212   bool SC_CALIBMODE = false;  // this is anded with G4TPC::ENABLE_DISTORTIONS in TrackingInit()
0213   bool SC_USE_MICROMEGAS = true;
0214   double SC_COLLISIONRATE = 50e3;                                      // leave at 50 KHz for now, scaling of distortion map not implemented yet
0215   std::string SC_ROOTOUTPUT_FILENAME = "TpcSpaceChargeMatrices.root";  // space charge calibration output file
0216 
0217   // Vertexing
0218   bool g4eval_use_initial_vertex = true;  // if true, g4eval uses initial vertices in SvtxVertexMap, not final vertices in SvtxVertexMapRefit
0219 
0220   // Truth seeding options for diagnostics (can use any or all)
0221   bool use_truth_silicon_seeding = false;     // if true runs truth silicon seeding instead of acts silicon seeding
0222   bool use_truth_tpc_seeding = false;         // if true runs truth silicon seeding instead of reco TPC seeding
0223   bool use_truth_si_matching = false;         // if true, associates silicon clusters using best truth track match to TPC seed tracks - for diagnostics only
0224                                               // Full truth track seeding
0225   bool use_full_truth_track_seeding = false;  // makes track seeds using truth info, used for both Acts and Genfit
0226   bool use_truth_vertexing = false;           // if true runs truth vertexing, if false runs PHSimpleVertexFinder
0227 
0228   // genfit track fitter
0229   bool use_genfit_track_fitter = false;
0230 
0231   // Runs a converter from TrackSeed object to SvtxTrack object to enable
0232   // use of the various evaluation tools already available
0233   bool convert_seeds_to_svtxtracks = false;
0234 
0235   // Runs a second pass of seeding to pick up missed seeds in the first pass
0236   bool iterative_seeding = false;
0237 
0238   // Flag to run commissioning seeding workflow with tuned parameters for
0239   // misaligned + distorted tracks
0240   bool use_alignment = false;
0241   bool filter_conversion_electrons = false;
0242 
0243 }  // namespace G4TRACKING
0244 
0245 #endif