File indexing completed on 2025-08-14 08:14:26
0001
0002
0003
0004
0005
0006
0007
0008 #include <fun4all/Fun4AllUtils.h>
0009 #include <GlobalVariables.C>
0010 #include <G4_ActsGeom.C>
0011 #include <G4_Global.C>
0012 #include <G4_Magnet.C>
0013 #include <G4_Mbd.C>
0014 #include <Trkr_Clustering.C>
0015 #include <Trkr_LaserClustering.C>
0016 #include <Trkr_RecoInit.C>
0017 #include <Trkr_TpcReadoutInit.C>
0018
0019 #include <ffamodules/CDBInterface.h>
0020 #include <fun4all/Fun4AllDstInputManager.h>
0021 #include <fun4all/Fun4AllDstOutputManager.h>
0022 #include <fun4all/Fun4AllInputManager.h>
0023 #include <fun4all/Fun4AllOutputManager.h>
0024 #include <fun4all/Fun4AllRunNodeInputManager.h>
0025 #include <fun4all/Fun4AllServer.h>
0026
0027 #include <phool/recoConsts.h>
0028
0029
0030
0031 #include <laserclusterqa/laserClusterQA.h>
0032
0033 #include <stdio.h>
0034 R__LOAD_LIBRARY(libfun4all.so)
0035 R__LOAD_LIBRARY(libffamodules.so)
0036 R__LOAD_LIBRARY(libtpc.so)
0037 R__LOAD_LIBRARY(libtpccalib.so)
0038 R__LOAD_LIBRARY(libLaserClusterQA.so)
0039 void Fun4All_laserClusterQA(
0040 const int nEvents = 10,
0041 const std::string filelist = "/sphenix/lustre01/sphnxpro/commissioning/slurp/tpcbeam/run_00041900_00042000/",
0042 const std::string outdir = "/sphenig/tg/tg01/jets/bkimelman/",
0043 const std::string prod = "ana441_2024p007",
0044 const std::string type = "run2pp")
0045
0046 {
0047
0048 auto se = Fun4AllServer::instance();
0049 se->Verbosity(2);
0050
0051 TRACKING::tpc_zero_supp = true;
0052 TRACKING::tpc_baseline_corr = true;
0053 Enable::MVTX_APPLYMISALIGNMENT = true;
0054 ACTSGEOM::mvtx_applymisalignment = Enable::MVTX_APPLYMISALIGNMENT;
0055
0056 std::ifstream ifs(filelist);
0057 std::string filepath;
0058
0059 auto rc = recoConsts::instance();
0060
0061 Enable::CDB = true;
0062 rc->set_StringFlag("CDB_GLOBALTAG", "ProdA_2024");
0063
0064 int i=0;
0065 int runnumber = 0;
0066 int segment = 0;
0067 while(std::getline(ifs,filepath))
0068 {
0069 std::cout << "Adding DST with filepath: " << filepath << std::endl;
0070 if(i==0)
0071 {
0072 std::pair<int, int> runseg = Fun4AllUtils::GetRunSegment(filepath);
0073 runnumber = runseg.first;
0074 segment = runseg.second;
0075 rc->set_IntFlag("RUNNUMBER",runnumber);
0076 rc->set_uint64Flag("TIMESTAMP",runnumber);
0077 }
0078
0079
0080
0081
0082
0083
0084 i++;
0085 }
0086
0087 auto hitsin = new Fun4AllDstInputManager("InputManager");
0088 hitsin->AddListFile(filelist);
0089 se->registerInputManager(hitsin);
0090
0091
0092 std::string geofile = CDBInterface::instance()->getUrl("Tracking_Geometry");
0093 Fun4AllRunNodeInputManager *ingeo = new Fun4AllRunNodeInputManager("GeoIn");
0094 ingeo->AddFile(geofile);
0095 se->registerInputManager(ingeo);
0096
0097
0098 G4TPC::ENABLE_MODULE_EDGE_CORRECTIONS = true;
0099
0100 G4TPC::ENABLE_STATIC_CORRECTIONS = true;
0101
0102 if(runnumber == 53098)
0103 {
0104 G4TPC::ENABLE_STATIC_CORRECTIONS = false;
0105 }
0106
0107 G4TPC::USE_PHI_AS_RAD_STATIC_CORRECTIONS=false;
0108
0109
0110 G4TPC::ENABLE_AVERAGE_CORRECTIONS = false;
0111
0112
0113
0114
0115
0116 G4TPC::ENABLE_CENTRAL_MEMBRANE_CLUSTERING = true;
0117
0118
0119 TRACKING::tpc_zero_supp = true;
0120
0121 TrackingInit();
0122
0123
0124 laserClusterQA *lcQA = new laserClusterQA("laserClusterQA");
0125 lcQA->setOutfile(Form("%s/laserHitQA_%s_%s-%08d.root",outdir.c_str(),type.c_str(),prod.c_str(),runnumber));
0126 se->registerSubsystem(lcQA);
0127
0128 se->run(nEvents);
0129
0130 se->End();
0131 se->PrintTimer();
0132
0133 delete se;
0134 std::cout << "Finished" << std::endl;
0135 gSystem->Exit(0);
0136 }