Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-05-23 08:11:46

0001 #ifndef MACRO_FUN4ALLG4SPHENIX_C
0002 #define MACRO_FUN4ALLG4SPHENIX_C
0003 
0004 #include <sys/stat.h>
0005 #include <limits.h>     // PATH_MAX
0006 #include <unistd.h>
0007 
0008 
0009 #include <GlobalVariables.C>
0010 #include <G4_Input.C> // global variable "Input"
0011 #include <G4_ActsGeom.C> // global variable "ACTSGEOM"
0012 
0013 #include <Trkr_QA.C> // Simulation QA
0014 
0015 
0016 #include <ffamodules/FlagHandler.h>
0017 #include <ffamodules/HeadReco.h>
0018 #include <ffamodules/SyncReco.h>
0019 #include <ffamodules/CDBInterface.h>
0020 
0021 #include <fun4all/Fun4AllServer.h>
0022 #include <fun4all/Fun4AllDstInputManager.h>
0023 #include <fun4all/Fun4AllDstOutputManager.h>
0024 #include <fun4all/Fun4AllOutputManager.h>
0025 
0026 #include <phool/recoConsts.h>
0027 
0028 
0029 #include <siliconseedsana/SiliconCaloMatching.h>
0030 #include <siliconseedsana/SiliconSeedsAna.h>
0031 #pragma GCC diagnostic push
0032 
0033 #pragma GCC diagnostic ignored "-Wundefined-internal"
0034 
0035 #pragma GCC diagnostic pop
0036 
0037 R__LOAD_LIBRARY(libfun4all.so)
0038 //R__LOAD_LIBRARY(libffamodules.so)
0039 R__LOAD_LIBRARY(libsiliconseedsana.so)
0040 
0041 
0042 bool useTopologicalCluster = false;
0043 
0044 int Fun4All_DST_SiliconCaloMatch(
0045    const int nEvents = 100, //0,
0046    const string in_dst = "/sphenix/tg/tg01/commissioning/INTT/work/mahiro/SIliconCalo/MC/dst_jpsi/condor/"
0047                          "DST_SiliconOnly_single_jpsi_vtxfixed_Caloevents_reconstructedInfo_0.root",
0048    const string out_root = "ana_0.root",
0049    const string out_dst = "DST_0.root",
0050    const int startnumber = 0
0051 )
0052 {
0053 
0054   std::cout << "Input DST: " << in_dst      <<std::endl;
0055   std::cout << "out  ROOT: " << out_root    <<std::endl;
0056   std::cout << "Nevent   : " << nEvents     <<std::endl;
0057   std::cout << "#start   : " << startnumber <<std::endl;
0058 
0059 
0060   Fun4AllServer *se = Fun4AllServer::instance();
0061   //se->Verbosity(10);
0062 
0063 
0064   recoConsts *rc = recoConsts::instance();
0065   Input::VERBOSITY = 0;
0066 
0067   // Tracking setup
0068   Enable::CDB = true;
0069   rc->set_StringFlag("CDB_GLOBALTAG", CDB::global_tag);
0070   rc->set_uint64Flag("TIMESTAMP", CDB::timestamp);
0071 
0072 
0073   // this assume Geometory data is in the DST
0074   ACTSGEOM::ActsGeomInit();
0075 
0076 
0077   //--input
0078   Fun4AllInputManager *in = new Fun4AllDstInputManager("DST");
0079   in->fileopen(in_dst.c_str());
0080   in->Verbosity(2);
0081   se->registerInputManager(in);
0082 
0083   Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", out_dst.c_str());
0084   se->registerOutputManager(out);
0085 
0086 
0087   //Tracking_QA();
0088   
0089   auto sicalo = new SiliconCaloMatching("SiliconCaloMatching");
0090   se->registerSubsystem(sicalo);
0091 
0092   auto siana = new SiliconSeedsAna("SiliconSeedsAna");
0093   siana->setMC(true);
0094   siana->setVtxSkip(true);
0095   siana->setTopoCluster(useTopologicalCluster);
0096   //siana->setEMCalClusterContainerName("CLUSTERINFO_CEMC"); // for PYTHIA sim
0097   //siana->setOutputFileName("siana.root");
0098   siana->setOutputFileName(out_root.c_str());
0099 
0100   siana->setStartEventNumber(startnumber);
0101 
0102   se->registerSubsystem(siana);
0103 
0104   se->run(nEvents);
0105 
0106 
0107   //-----
0108   // Exit
0109   //-----
0110 
0111   //  CDBInterface::instance()->Print(); // print used DB files
0112   se->End();
0113   std::cout << "All done" << std::endl;
0114   delete se;
0115 
0116   gSystem->Exit(0);
0117   return 0;
0118 }
0119 #endif