Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:18:01

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/SiliconSeedsAna.h>
0030 #pragma GCC diagnostic push
0031 
0032 #pragma GCC diagnostic ignored "-Wundefined-internal"
0033 
0034 #pragma GCC diagnostic pop
0035 
0036 R__LOAD_LIBRARY(libfun4all.so)
0037 //R__LOAD_LIBRARY(libffamodules.so)
0038 R__LOAD_LIBRARY(libsiliconseedsana.so)
0039 
0040 
0041 bool useTopologicalCluster = false;
0042 
0043 int Fun4All_DST_SiliconSeedAna(
0044    const int nEvents = 100, //0,
0045 //   const string in_dst = "/sphenix/tg/tg01/commissioning/INTT/work/mahiro/SIliconCalo/MC/dst_e-/condor/"
0046 //                        "DST_SiliconOnly_single_e-_vtxfixed_Caloevents_reconstructedInfo_0.root",
0047    const string in_dst = "/sphenix/tg/tg01/commissioning/INTT/work/mahiro/SIliconCalo/MC/dst/condor/"
0048                          "DST_SiliconOnly_PHYTIA_Info_1.root",
0049 //   const string out_root = "/sphenix/tg/tg01/commissioning/INTT/work/hachiya/SiCaloTrack/data/ana_em/ana_em_0.root",
0050    const string out_root = "ana_0.root",
0051    const int startnumber = 0
0052 )
0053 {
0054 
0055   std::cout << "Input DST: " << in_dst      <<std::endl;
0056   std::cout << "out  ROOT: " << out_root    <<std::endl;
0057   std::cout << "Nevent   : " << nEvents     <<std::endl;
0058   std::cout << "#start   : " << startnumber <<std::endl;
0059 
0060 
0061   Fun4AllServer *se = Fun4AllServer::instance();
0062   //se->Verbosity(10);
0063 
0064 
0065   recoConsts *rc = recoConsts::instance();
0066   Input::VERBOSITY = 0;
0067 
0068   // Tracking setup
0069   Enable::CDB = true;
0070   rc->set_StringFlag("CDB_GLOBALTAG", CDB::global_tag);
0071   rc->set_uint64Flag("TIMESTAMP", CDB::timestamp);
0072 
0073 
0074   // this assume Geometory data is in the DST
0075   ACTSGEOM::ActsGeomInit();
0076 
0077 
0078   //--input
0079   Fun4AllInputManager *in = new Fun4AllDstInputManager("DST");
0080   in->fileopen(in_dst.c_str());
0081   //in->Verbosity(2);
0082   se->registerInputManager(in);
0083 
0084 //  Tracking_QA();
0085   
0086 
0087   auto siana = new SiliconSeedsAna("SiliconSeedsAna");
0088   siana->setMC(true);
0089   siana->setVtxSkip(true);
0090   siana->setTopoCluster(useTopologicalCluster);
0091   siana->setEMCalClusterContainerName("CLUSTERINFO_CEMC"); // for PYTHIA sim
0092   //siana->setOutputFileName("siana.root");
0093   siana->setOutputFileName(out_root.c_str());
0094 
0095   siana->setStartEventNumber(startnumber);
0096 
0097   se->registerSubsystem(siana);
0098 
0099   se->run(nEvents);
0100 
0101 
0102   //-----
0103   // Exit
0104   //-----
0105 
0106   //  CDBInterface::instance()->Print(); // print used DB files
0107   se->End();
0108   std::cout << "All done" << std::endl;
0109   delete se;
0110 
0111   gSystem->Exit(0);
0112   return 0;
0113 }
0114 #endif