Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef MACRO_TRKRRECOINIT_C
0002 #define MACRO_TRKRRECOINIT_C
0003 
0004 R__LOAD_LIBRARY(libtrack_reco.so)
0005 R__LOAD_LIBRARY(libtpccalib.so)
0006 
0007 #include <GlobalVariables.C>
0008 
0009 #include <G4_ActsGeom.C>
0010 #include <G4_TrkrVariables.C>
0011 
0012 #include <tpc/TpcLoadDistortionCorrection.h>
0013 
0014 #include <ffamodules/CDBInterface.h>
0015 
0016 #include <fun4all/Fun4AllServer.h>
0017 
0018 void TrackingInit()
0019 {
0020   ACTSGEOM::ActsGeomInit();
0021   G4TPC::module_edge_correction_filename = CDBInterface::instance()->getUrl("TPC_Module_Edge");
0022 
0023   // space charge correction
0024   if (G4TPC::ENABLE_MODULE_EDGE_CORRECTIONS || G4TPC::ENABLE_STATIC_CORRECTIONS || G4TPC::ENABLE_AVERAGE_CORRECTIONS)
0025   {
0026     auto se = Fun4AllServer::instance();
0027     auto tpcLoadDistortionCorrection = new TpcLoadDistortionCorrection;
0028 
0029     tpcLoadDistortionCorrection->set_read_phi_as_radians(TpcLoadDistortionCorrection::DistortionType_Static, G4TPC::USE_PHI_AS_RAD_STATIC_CORRECTIONS);
0030     tpcLoadDistortionCorrection->set_read_phi_as_radians(TpcLoadDistortionCorrection::DistortionType_Average, G4TPC::USE_PHI_AS_RAD_AVERAGE_CORRECTIONS);
0031 
0032     tpcLoadDistortionCorrection->set_interpolate_2D_to_zero(TpcLoadDistortionCorrection::DistortionType_ModuleEdge, false);
0033 
0034     if (G4TPC::ENABLE_MODULE_EDGE_CORRECTIONS)
0035     {
0036       tpcLoadDistortionCorrection->set_correction_filename(TpcLoadDistortionCorrection::DistortionType_ModuleEdge, G4TPC::module_edge_correction_filename);
0037     }
0038     if (G4TPC::ENABLE_STATIC_CORRECTIONS)
0039     {
0040       tpcLoadDistortionCorrection->set_correction_filename(TpcLoadDistortionCorrection::DistortionType_Static, G4TPC::static_correction_filename);
0041     }
0042     if (G4TPC::ENABLE_AVERAGE_CORRECTIONS)
0043     {
0044       tpcLoadDistortionCorrection->set_correction_filename(TpcLoadDistortionCorrection::DistortionType_Average, G4TPC::average_correction_filename);
0045       tpcLoadDistortionCorrection->set_interpolate_2D_to_zero(TpcLoadDistortionCorrection::DistortionType_Average, G4TPC::average_correction_interpolate);
0046     }
0047     se->registerSubsystem(tpcLoadDistortionCorrection);
0048   }
0049 }
0050 #endif